-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add gov v3 helpers * fix: added helper methods * fix: patch stdStorage * fix: make it build * fix: v2 helper fix * fix: deduplicate ipfs tools * fix: stash local changes * feat: push gov v3helpers * fix: update aligned with discussion * feat: add proposal execution flow * fix: allow overwriting proposals count * feat: inject payloads * fix: update to new address book * fix: change visibility * feat: initial ready proposal * feat: implement readyProposal for govv3 * feat: add overload for single proposal * fix: update scripts * fix: update ipfs test * fix: add broken methods * feat: integrate cli into helpers * stash: stash local changes * feat: add overloads * docs: add a sentence on readme * Update src/GovV3Helpers.sol * fix: add voting script * fix: add readme * fix: some patches to storage utils * fix: add activateVoting to test * fix: remove unncessary tests * fix: last few patches * Update src/ChainIds.sol Co-authored-by: sendra <[email protected]> * fix: add sepolia rpc * fix: typo * Update src/GovV3Helpers.sol Co-authored-by: Andrey <[email protected]> * Update src/GovV3Helpers.sol Co-authored-by: Andrey <[email protected]> * fix: update address book --------- Co-authored-by: Lukas <[email protected]> Co-authored-by: Andrey <[email protected]>
- Loading branch information
1 parent
4c084bf
commit 1e1c177
Showing
13 changed files
with
1,189 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule aave-address-book
updated
97 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {IVotingMachineWithProofs} from 'aave-address-book/governance-v3/IVotingMachineWithProofs.sol'; | ||
import '../src/ScriptUtils.sol'; | ||
import {GovV3Helpers} from '../src/GovV3Helpers.sol'; | ||
|
||
contract VoteForProposal is EthereumScript { | ||
function run(uint256 proposalId, bool support) external broadcast { | ||
IVotingMachineWithProofs.VotingBalanceProof[] memory votingBalanceProofs = GovV3Helpers | ||
.getVotingProofs(vm, proposalId, msg.sender); | ||
GovV3Helpers.vote(vm, proposalId, votingBalanceProofs, support); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ pragma abicoder v2; | |
|
||
import {Vm} from 'forge-std/Vm.sol'; | ||
import {console2} from 'forge-std/console2.sol'; | ||
import {IpfsUtils} from './IpfsUtils.sol'; | ||
import {AaveGovernanceV2, IAaveGovernanceV2, IExecutorWithTimelock} from 'aave-address-book/AaveGovernanceV2.sol'; | ||
import {IPoolAddressesProvider} from 'aave-address-book/AaveV3.sol'; | ||
import {AaveV3Avalanche} from 'aave-address-book/AaveV3Avalanche.sol'; | ||
|
@@ -42,37 +43,8 @@ library GovHelpers { | |
bool withDelegatecall; | ||
} | ||
|
||
function ipfsHashFile(Vm vm, string memory filePath, bool upload) internal returns (bytes32) { | ||
string[] memory inputs = new string[](8); | ||
inputs[0] = 'npx'; | ||
inputs[1] = '--yes'; | ||
inputs[2] = '-s'; | ||
inputs[3] = '@bgd-labs/[email protected]'; | ||
inputs[4] = 'ipfs'; | ||
inputs[5] = filePath; | ||
inputs[6] = '-u'; | ||
inputs[7] = vm.toString(upload); | ||
bytes memory bs58Hash = vm.ffi(inputs); | ||
// currenty there is no better way as ffi silently fails | ||
// revisit once https://github.com/foundry-rs/foundry/pull/4908 progresses | ||
require( | ||
bs58Hash.length != 0, | ||
'CALCULATED_HASH_IS_ZERO_CHECK_IF_YARN_DEPENDENCIES_ARE_INSTALLED' | ||
); | ||
console2.logString('Info: This preview will only work when the file has been uploaded to ipfs'); | ||
console2.logString( | ||
string( | ||
abi.encodePacked( | ||
'Preview: https://app.aave.com/governance/ipfs-preview/?ipfsHash=', | ||
vm.toString(bs58Hash) | ||
) | ||
) | ||
); | ||
return bytes32(bs58Hash); | ||
} | ||
|
||
function ipfsHashFile(Vm vm, string memory filePath) internal returns (bytes32) { | ||
return ipfsHashFile(vm, filePath, false); | ||
return IpfsUtils.ipfsHashFile(vm, filePath, false); | ||
} | ||
|
||
function buildMainnet(address payloadAddress) internal pure returns (Payload memory) { | ||
|
Oops, something went wrong.
1e1c177
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Foundry report
Build log
Test success 🌈