diff --git a/packages/contracts/README.md b/packages/contracts/README.md index 7e220b9..3a5db29 100644 --- a/packages/contracts/README.md +++ b/packages/contracts/README.md @@ -25,6 +25,10 @@ forge test ``` ## Deployment +Before deployment, you should specify the ARBITRATION_TOKEN in script/deploy.sol, in this case, we use the $NATION token +``` + address ARBITRATION_TOKEN = 0x333A4823466879eeF910A04D473505da62142069; // Mainnet +``` Run the deploy script first to verify that can be broadcasted: ``` @@ -49,3 +53,11 @@ forge build --force --optimize --optimizer-runs 20000 --build-info --build-info- jq .input build-info/*.json > inputs.json; rm -r build-info; ``` + +Alternatively, we can use the Verify.ts script to verify contracts: +``` +ts-node script/Verify.ts +``` + +You can find constructor arguments on Etherscan +![image](https://github.com/nation3/jurisdiction/assets/42999269/36b465e6-bd92-4f97-a46a-3bffcf032514) diff --git a/packages/contracts/deployments/sepolia.json b/packages/contracts/deployments/sepolia.json new file mode 100644 index 0000000..7c96229 --- /dev/null +++ b/packages/contracts/deployments/sepolia.json @@ -0,0 +1,5 @@ +{ + "ArbitrationToken": "0x23Ca3002706b71a440860E3cf8ff64679A00C9d7", + "Arbitrator": "0xBe67cEdCD1FE38aac8a5781A51250FDeFB344E6C", + "CollateralAgreementFramework": "0xD96aA6e2568f4e9632D2A5234Bb8410ca7609a27" +} diff --git a/packages/contracts/script/Verify.ts b/packages/contracts/script/Verify.ts new file mode 100644 index 0000000..d06d5b2 --- /dev/null +++ b/packages/contracts/script/Verify.ts @@ -0,0 +1,50 @@ +import { exec } from "child_process"; + +const verifyArbitrationToken = async (address: string, path: string) => { + exec( + ["forge verify-contract", address, path, "--constructor-args", "000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000b436f75727420546f6b656e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024354000000000000000000000000000000000000000000000000000000000000", "--chain-id", 11155111, "--etherscan-api-key", "6EI6Z7T8UAAVRIY8JXRXKVKM5A1WH8PURD"].join(" "), + (error, stdout, stderr) => { + console.log(error) + console.log(stdout) + console.log(stderr) + } + ); +} + + +const verifyArbitrator = async (address: string, path: string) => { + exec( + ["forge verify-contract", address, path, "--constructor-args", "000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba30000000000000000000000000c47a93ffca9bc0b116d055f2a062b625481677d", "--chain-id", 11155111, "--etherscan-api-key", "6EI6Z7T8UAAVRIY8JXRXKVKM5A1WH8PURD"].join(" "), + (error, stdout, stderr) => { + console.log(error) + console.log(stdout) + console.log(stderr) + } + ); +} +const verifyCollateralAgreementFramework = async (address: string, path: string) => { + exec( + ["forge verify-contract", address, path, "--constructor-args", "000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba30000000000000000000000000c47a93ffca9bc0b116d055f2a062b625481677d", "--chain-id", 11155111, "--etherscan-api-key", "6EI6Z7T8UAAVRIY8JXRXKVKM5A1WH8PURD"].join(" "), + (error, stdout, stderr) => { + console.log(error) + console.log(stdout) + console.log(stderr) + } + ); +} + +// Find these addresses in deployments folder +const arbitrationToken = "0x23Ca3002706b71a440860E3cf8ff64679A00C9d7" +const arbitrator = "0xBe67cEdCD1FE38aac8a5781A51250FDeFB344E6C" +const collateralAgreementFramework = "0xD96aA6e2568f4e9632D2A5234Bb8410ca7609a27" + +const main = async () => { + console.log("Contract verification...") + await verifyArbitrationToken(arbitrationToken, "lib/solmate/src/test/utils/mocks/MockERC20.sol:MockERC20") + await verifyArbitrator(arbitrator, "src/Arbitrator.sol:Arbitrator") + await verifyCollateralAgreementFramework(collateralAgreementFramework, "src/frameworks/CollateralAgreement.sol:CollateralAgreement") +} +main().catch((error) => { + console.error(error); + process.exitCode = 1; +});