This contract implements a private agreement between two parties. The agreement is kept in secret however it may be revealed by either party at any time if they share it publicly.
Demonstrates:
- off-chain signing
- rpc interactions
- privacy and brokered agreements
- visit .env, env.example has been provided
- fill all relevant variables
- Load the project in VSCode Remote Containers Extension or in a CodeSpace
Or
- full build and test via docker command line
$ sh build.sh
Deployment scripts are provided. Deployment requires access to a private key and TestNet RPC instance as well as an ETHERSCAN_API_KEY.
$ yarn deploylibrary
Get the address of the constant library and set it inCONSTANT_LIB_ADDRESS
This has already be configured to 0x1396262031838905d3787F0A517Fa3CaCF33FA04 in package.json$ yarn deploy
This will deploy the ClosedAgreement contract
Note: If you are depending on environment variables in .env you may have to export these for yarn as well
$ export RPC_URL=https://provider...
This contract is already deployed with the following details:
Contract | Ethereum Address | Etherscan |
---|---|---|
ECDSA | 0x18F3510E1a11C502781e5E8E1FD2365fAa789Bb2 | https://sepolia.etherscan.io/address/0x18f3510e1a11c502781e5e8e1fd2365faa789bb2 |
ClosedAgreement | 0x3cb46d7079d74fb0a66e4f949a3d2b3e9be62006 | https://sepolia.etherscan.io/address/0x3cb46d7079d74fb0a66e4f949a3d2b3e9be62006 |
- setup the .env to have suitable values for message and parties
- create an agreement
$ yarn create_agreement
make a note of the agreement hash - optionall reveal the agrement
$ yarn reveal hash
Agreement for 0x6CCEF4A336990D1C3C52B7A0624D811B7EDDECB4825E3EC9CE7AE57F4FA2D9C7