Skip to content

Commit cf37467

Browse files
0xKurtthelostone-mc
andauthoredJan 9, 2025··
EasyRF strategy draft (#669)
* strategy draft * updates * add tests fmt * update strategy name * add deploy script * update bun * deploy on sepolia * add docs * remove unused var --------- Co-authored-by: Aditya Anand M C <aditya.anandmc@gmail.com>
1 parent 4eaa558 commit cf37467

File tree

11 files changed

+1572
-2
lines changed

11 files changed

+1572
-2
lines changed
 

‎bun.lockb

-110 KB
Binary file not shown.

‎contracts/strategies/BaseStrategy.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,13 @@ abstract contract BaseStrategy is IStrategy, Transfer, Errors {
254254

255255
/// @notice Checks if the pool is active.
256256
/// @dev Reverts if the pool is not active.
257-
function _checkOnlyActivePool() internal view {
257+
function _checkOnlyActivePool() internal view virtual {
258258
if (!poolActive) revert POOL_INACTIVE();
259259
}
260260

261261
/// @notice Checks if the pool is inactive.
262262
/// @dev Reverts if the pool is active.
263-
function _checkInactivePool() internal view {
263+
function _checkInactivePool() internal view virtual {
264264
if (poolActive) revert POOL_ACTIVE();
265265
}
266266

‎contracts/strategies/_poc/easy-rf/EasyRetroFundingStrategy.sol

+734
Large diffs are not rendered by default.

‎reports/deployment-logs/core/deploy.log

+4
Original file line numberDiff line numberDiff line change
@@ -669,3 +669,7 @@
669669
20240912_141937 - Deployment finished with 0 error(s)
670670
20240912_141937 - Executing: bun hardhat run scripts/strategies/deployDirectAllocation.ts --no-compile --network gnosis | tee ./reports/deployment-logs/strategies/deployDirectAllocation/gnosis/20240912_141426/deploy-20240912_141426.log
671671
20240912_142146 - Deployment finished with 0 error(s)
672+
20250107_150303 - Executing: bun hardhat run scripts/strategies/deployEasyRetrofunding.ts --no-compile --network sepolia | tee ./reports/deployment-logs/strategies/deployEasyRetrofunding/sepolia/20250107_150303/deploy-20250107_150303.log
673+
20250107_150308 - Deployment finished with 0 error(s)
674+
20250107_150313 - Executing: bun hardhat run scripts/strategies/deployEasyRetroFunding.ts --no-compile --network sepolia | tee ./reports/deployment-logs/strategies/deployEasyRetroFunding/sepolia/20250107_150313/deploy-20250107_150313.log
675+
20250107_160738 - Deployment finished with 0 error(s)

‎reports/deployment-logs/strategies/deployEasyRetrofunding/sepolia/20250107_150303/deploy-20250107_150303.log

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
////////////////////////////////////////////////////
3+
Deploys EasyRetroFundingStrategy.sol on sepolia
4+
////////////////////////////////////////////////////
5+
6+
┌─────────────────┬──────────────────────────────────────────────┐
7+
│ (index) │ Values │
8+
├─────────────────┼──────────────────────────────────────────────┤
9+
│ contract │ 'EasyRetroFundingStrategy.sol' │
10+
│ chainId │ 11155111 │
11+
│ network │ 'sepolia' │
12+
│ deployerAddress │ '0x8C180840fcBb90CE8464B4eCd12ab0f840c6647C' │
13+
│ balance │ '5.654046747032034805' │
14+
└─────────────────┴──────────────────────────────────────────────┘
15+
Deploying EasyRetroFundingStrategy.sol
16+
Contract EasyRetroFundingStrategy deployed at address: 0x26B583bF90adAFBf5973B03728ba9a3120D8747D
17+
18+
Verifying contract...
19+
Successfully submitted source code for contract
20+
contracts/strategies/_poc/easy-rf/EasyRetroFundingStrategy.sol:EasyRetroFundingStrategy at 0x26B583bF90adAFBf5973B03728ba9a3120D8747D
21+
for verification on the block explorer. Waiting for verification result...
22+
23+
Successfully verified contract EasyRetroFundingStrategy on the block explorer.
24+
https://sepolia.etherscan.io/address/0x26B583bF90adAFBf5973B03728ba9a3120D8747D#code
25+

26+
Validating getAllo() == 0x1133eA7Af70876e64665ecD07C0A0476d09465a1
27+
 ✅ PASSED with Result: 0x1133eA7Af70876e64665ecD07C0A0476d09465a1
28+

29+
Validating getStrategyId() == 0x060ffd6c79f918819a622248c6823443412aedea610cc19c89d28dadcdef7fba
30+
 ✅ PASSED with Result: 0x060ffd6c79f918819a622248c6823443412aedea610cc19c89d28dadcdef7fba
31+
Adding EasyRetroFundingStrategy v1.0 to cloneable strategies...

‎scripts/config/strategies.config.ts

+4
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ export const strategyConfig: DeployParams = {
121121
name: "DirectAllocationStrategy",
122122
version: "v1.1",
123123
},
124+
"easy-retro-funding": {
125+
name: "EasyRetroFundingStrategy",
126+
version: "v1.0",
127+
},
124128
},
125129
// Optimism
126130
10: {

‎scripts/core/deployAllNetworks.sh

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ scripts=(
6464
# "strategies/deployDonationVotingMerkleDistributionDirect"
6565
# "strategies/deployDirectGrantsLite"
6666
# "strategies/deployDirectAllocation"
67+
# "strategies/deployEasyRetroFunding"
6768

6869
# "core/transferProxyAdminOwnership"
6970
# "strategies/deployDirectGrants"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"11155111": {
3+
"id": "0x060ffd6c79f918819a622248c6823443412aedea610cc19c89d28dadcdef7fba",
4+
"name": "EasyRetroFundingStrategy",
5+
"version": "v1.0",
6+
"address": "0x26B583bF90adAFBf5973B03728ba9a3120D8747D",
7+
"deployerAddress": "0x8C180840fcBb90CE8464B4eCd12ab0f840c6647C"
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { ethers } from "hardhat";
2+
import { commonConfig } from "../config/common.config";
3+
import { strategyConfig } from "../config/strategies.config";
4+
import { Validator } from "../utils/Validator";
5+
import { deployStrategies, deployStrategyDirectly } from "./deployStrategies";
6+
7+
export const deployEasyRetroFunding = async () => {
8+
const network = await ethers.provider.getNetwork();
9+
const chainId = Number(network.chainId);
10+
11+
const strategyParams = strategyConfig[chainId]["easy-retro-funding"];
12+
13+
const address = await deployStrategies(
14+
strategyParams.name,
15+
strategyParams.version,
16+
true
17+
);
18+
19+
console.log("==> address", address);
20+
21+
// const validator = await new Validator(
22+
// strategyParams.name,
23+
// address,
24+
// );
25+
26+
// await validator.validate("PERMIT2", [], commonConfig[chainId].permit2Address);
27+
28+
// await deployStrategyDirectly(
29+
// strategyParams.name,
30+
// strategyParams.version,
31+
// [commonConfig[chainId].permit2Address],
32+
// true,
33+
// );
34+
35+
};
36+
37+
// Check if this script is the main module (being run directly)
38+
if (require.main === module) {
39+
deployEasyRetroFunding().catch((error) => {
40+
console.error(error);
41+
process.exitCode = 1;
42+
});
43+
}

‎test/foundry/strategies/EasyRFStrategy.t.sol

+744
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.