|
| 1 | +// SPDX-License-Identifier: AGPL-3.0-only |
| 2 | +pragma solidity ^0.8.29; |
| 3 | + |
| 4 | +import {Script, console2} from "forge-std/Script.sol"; |
| 5 | +import {IAgreementAnchorFactory} from "dao-signer/src/interfaces/IAgreementAnchorFactory.sol"; |
| 6 | +import {AgreementAnchor} from "dao-signer/src/AgreementAnchor.sol"; |
| 7 | + |
| 8 | +contract CreateAgreementAnchors is Script { |
| 9 | + IAgreementAnchorFactory public constant AGREEMENT_ANCHOR_FACTORY = |
| 10 | + IAgreementAnchorFactory(0x5Ef3cCf9eC7E0af61E1767b2EEbB50e052b5Df47); |
| 11 | + |
| 12 | + // TODO: set content hashes and counterparty addresses for DUNI agreements |
| 13 | + bytes32 public constant AGREEMENT_ANCHOR_1_CONTENT_HASH = ""; |
| 14 | + address public constant AGREEMENT_ANCHOR_1_COUNTER_SIGNER = address(0); |
| 15 | + bytes32 public constant AGREEMENT_ANCHOR_2_CONTENT_HASH = ""; |
| 16 | + address public constant AGREEMENT_ANCHOR_2_COUNTER_SIGNER = address(0); |
| 17 | + |
| 18 | + function run() public returns (address, address) { |
| 19 | + require(block.chainid == 1, "Not mainnet"); |
| 20 | + vm.startBroadcast(); |
| 21 | + address agreementAnchor1 = address( |
| 22 | + AGREEMENT_ANCHOR_FACTORY.createAgreementAnchor( |
| 23 | + AGREEMENT_ANCHOR_1_CONTENT_HASH, AGREEMENT_ANCHOR_1_COUNTER_SIGNER |
| 24 | + ) |
| 25 | + ); |
| 26 | + |
| 27 | + address agreementAnchor2 = address( |
| 28 | + AGREEMENT_ANCHOR_FACTORY.createAgreementAnchor( |
| 29 | + AGREEMENT_ANCHOR_2_CONTENT_HASH, AGREEMENT_ANCHOR_2_COUNTER_SIGNER |
| 30 | + ) |
| 31 | + ); |
| 32 | + console2.log("Agreement Anchor 1:", agreementAnchor1); |
| 33 | + console2.log("Agreement Anchor 2:", agreementAnchor2); |
| 34 | + vm.stopBroadcast(); |
| 35 | + return (agreementAnchor1, agreementAnchor2); |
| 36 | + } |
| 37 | +} |
0 commit comments