Skip to content

Commit

Permalink
feat: improve proposal creation ergonomics
Browse files Browse the repository at this point in the history
  • Loading branch information
bowd committed Aug 18, 2024
1 parent f94310f commit 5649ed3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/mento-std
2 changes: 1 addition & 1 deletion script/upgrades/TemplateCelo/TemplateCelo.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ contract TemplateCelo is CeloGovernanceScript {

function buildProposal() internal override {
// TODO: Add transactions to proposal.
add({ value: 0, destination: lookup("Governance"), data: abi.encode() });
add({ destination: lookup("Governance"), data: bytes("") });
}
}
2 changes: 1 addition & 1 deletion script/upgrades/TemplateMento/TemplateMento.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ contract TemplateMento is MentoGovernanceScript {

function buildProposal() internal override {
// TODO: Add transactions to proposal.
add({ value: 0, destination: lookup("Governance"), data: abi.encode() });
add({ destination: lookup("Governance"), data: bytes("") });
}
}
8 changes: 8 additions & 0 deletions script/utils/v2/GovernanceScript.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ abstract contract GovernanceScript is Script {
transactions.push(Transaction(value, destination, data));
}

function add(address destination, bytes memory data) internal {
add(0, destination, data);
}

function add(uint256 value, address destination) internal {
add(value, destination, bytes(""));
}

function run() public virtual {
setUp();
buildProposal();
Expand Down

0 comments on commit 5649ed3

Please sign in to comment.