generated from bgd-labs/bgd-forge-template
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
201 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
[submodule "lib/forge-std"] | ||
path = lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std | ||
[submodule "lib/aave-helpers"] | ||
path = lib/aave-helpers | ||
url = https://github.com/bgd-labs/aave-helpers |
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
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
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-helpers
updated
5 files
+1 −1 | lib/aave-address-book | |
+1 −1 | lib/forge-std | |
+1 −1 | lib/solidity-utils | |
+2 −2 | src/GovV3Helpers.sol | |
+1 −1 | src/IpfsUtils.sol |
Submodule forge-std
deleted from
f73c73
26 changes: 26 additions & 0 deletions
26
src/20231024_AaveV3Ethereum_Test/AaveV3Ethereum_Test_20231024.sol
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,26 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol'; | ||
import {AaveV3PayloadEthereum} from 'aave-helpers/v3-config-engine/AaveV3PayloadEthereum.sol'; | ||
import {IAaveV3ConfigEngine} from 'aave-helpers/v3-config-engine/IAaveV3ConfigEngine.sol'; | ||
|
||
/** | ||
* @title Test | ||
* @author BGD | ||
* - Snapshot: link | ||
* - Discussion: link | ||
*/ | ||
contract AaveV3Ethereum_Test_20231024 is AaveV3PayloadEthereum { | ||
function capsUpdates() public pure override returns (IAaveV3ConfigEngine.CapsUpdate[] memory) { | ||
IAaveV3ConfigEngine.CapsUpdate[] memory capsUpdate = new IAaveV3ConfigEngine.CapsUpdate[](1); | ||
|
||
capsUpdate[0] = IAaveV3ConfigEngine.CapsUpdate({ | ||
asset: AaveV3EthereumAssets.wstETH_UNDERLYING, | ||
supplyCap: 10_000_000, | ||
borrowCap: 100_000 | ||
}); | ||
|
||
return capsUpdate; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/20231024_AaveV3Ethereum_Test/AaveV3Ethereum_Test_20231024.t.sol
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,28 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol'; | ||
|
||
import 'forge-std/Test.sol'; | ||
import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/ProtocolV3TestBase.sol'; | ||
import {AaveV3Ethereum_Test_20231024} from './AaveV3Ethereum_Test_20231024.sol'; | ||
|
||
/** | ||
* @dev Test for AaveV3Ethereum_Test_20231024 | ||
* command: make test-contract filter=AaveV3Ethereum_Test_20231024 | ||
*/ | ||
contract AaveV3Ethereum_Test_20231024_Test is ProtocolV3TestBase { | ||
AaveV3Ethereum_Test_20231024 internal proposal; | ||
|
||
function setUp() public { | ||
vm.createSelectFork(vm.rpcUrl('mainnet'), 18420791); | ||
proposal = new AaveV3Ethereum_Test_20231024(); | ||
} | ||
|
||
/** | ||
* @dev executes the generic test suite including e2e and config snapshots | ||
*/ | ||
function test_defaultProposalExecution() public { | ||
defaultTest('AaveV3Ethereum_Test_20231024', AaveV3Ethereum.POOL, address(proposal)); | ||
} | ||
} |
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,22 @@ | ||
--- | ||
title: "Test" | ||
author: "BGD" | ||
discussions: "link" | ||
--- | ||
|
||
## Simple Summary | ||
|
||
## Motivation | ||
|
||
## Specification | ||
|
||
## References | ||
|
||
- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20231024_AaveV3Ethereum_Test/AaveV3Ethereum_Test_20231024.sol) | ||
- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20231024_AaveV3Ethereum_Test/AaveV3Ethereum_Test_20231024.t.sol) | ||
- [Snapshot](link) | ||
- [Discussion](link) | ||
|
||
## Copyright | ||
|
||
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). |
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,48 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/GovV3Helpers.sol'; | ||
import {EthereumScript} from 'aave-helpers/ScriptUtils.sol'; | ||
import {AaveV3Ethereum_Test_20231024} from './AaveV3Ethereum_Test_20231024.sol'; | ||
|
||
/** | ||
* @dev Deploy Ethereum | ||
* command: make deploy-ledger contract=src/20231024_AaveV3Ethereum_Test/Test_20231024.s.sol:DeployEthereum chain=mainnet | ||
*/ | ||
contract DeployEthereum is EthereumScript { | ||
function run() external broadcast { | ||
// deploy payloads | ||
AaveV3Ethereum_Test_20231024 payload0 = new AaveV3Ethereum_Test_20231024(); | ||
|
||
// compose action | ||
IPayloadsControllerCore.ExecutionAction[] | ||
memory actions = new IPayloadsControllerCore.ExecutionAction[](1); | ||
actions[0] = GovV3Helpers.buildAction(address(payload0)); | ||
|
||
// register action at payloadsController | ||
GovV3Helpers.createPayload(actions); | ||
} | ||
} | ||
|
||
/** | ||
* @dev Create Proposal | ||
* command: make deploy-ledger contract=src/20231024_AaveV3Ethereum_Test/Test_20231024.s.sol:CreateProposal chain=mainnet | ||
*/ | ||
contract CreateProposal is EthereumScript { | ||
function run() external broadcast { | ||
// create payloads | ||
PayloadsControllerUtils.Payload[] memory payloads = new PayloadsControllerUtils.Payload[](1); | ||
|
||
// compose actions for validation | ||
IPayloadsControllerCore.ExecutionAction[] | ||
memory actionsEthereum = new IPayloadsControllerCore.ExecutionAction[](1); | ||
actionsEthereum[0] = GovV3Helpers.buildAction(address(0)); | ||
payloads[0] = GovV3Helpers.buildMainnetPayload(vm, actionsEthereum); | ||
|
||
// create proposal | ||
GovV3Helpers.createProposal2_5( | ||
payloads, | ||
GovV3Helpers.ipfsHashFile(vm, 'src/20231024_AaveV3Ethereum_Test/Test.md') | ||
); | ||
} | ||
} |
Oops, something went wrong.