Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EasyRF strategy draft #669

Merged
merged 9 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions contracts/strategies/BaseStrategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,13 @@ abstract contract BaseStrategy is IStrategy, Transfer, Errors {

/// @notice Checks if the pool is active.
/// @dev Reverts if the pool is not active.
function _checkOnlyActivePool() internal view {
function _checkOnlyActivePool() internal view virtual {
if (!poolActive) revert POOL_INACTIVE();
}

/// @notice Checks if the pool is inactive.
/// @dev Reverts if the pool is active.
function _checkInactivePool() internal view {
function _checkInactivePool() internal view virtual {
if (poolActive) revert POOL_ACTIVE();
}

Expand Down
734 changes: 734 additions & 0 deletions contracts/strategies/_poc/easy-rf/EasyRetroFundingStrategy.sol

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions reports/deployment-logs/core/deploy.log
Original file line number Diff line number Diff line change
Expand Up @@ -669,3 +669,7 @@
20240912_141937 - Deployment finished with 0 error(s)
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
20240912_142146 - Deployment finished with 0 error(s)
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
20250107_150308 - Deployment finished with 0 error(s)
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
20250107_160738 - Deployment finished with 0 error(s)
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

////////////////////////////////////////////////////
Deploys EasyRetroFundingStrategy.sol on sepolia
////////////////////////////////////////////////////

┌─────────────────┬──────────────────────────────────────────────┐
│ (index) │ Values │
├─────────────────┼──────────────────────────────────────────────┤
│ contract │ 'EasyRetroFundingStrategy.sol' │
│ chainId │ 11155111 │
│ network │ 'sepolia' │
│ deployerAddress │ '0x8C180840fcBb90CE8464B4eCd12ab0f840c6647C' │
│ balance │ '5.654046747032034805' │
└─────────────────┴──────────────────────────────────────────────┘
Deploying EasyRetroFundingStrategy.sol
Contract EasyRetroFundingStrategy deployed at address: 0x26B583bF90adAFBf5973B03728ba9a3120D8747D

Verifying contract...
Successfully submitted source code for contract
contracts/strategies/_poc/easy-rf/EasyRetroFundingStrategy.sol:EasyRetroFundingStrategy at 0x26B583bF90adAFBf5973B03728ba9a3120D8747D
for verification on the block explorer. Waiting for verification result...

Successfully verified contract EasyRetroFundingStrategy on the block explorer.
https://sepolia.etherscan.io/address/0x26B583bF90adAFBf5973B03728ba9a3120D8747D#code

Validating getAllo() == 0x1133eA7Af70876e64665ecD07C0A0476d09465a1
 ✅ PASSED with Result: 0x1133eA7Af70876e64665ecD07C0A0476d09465a1

Validating getStrategyId() == 0x060ffd6c79f918819a622248c6823443412aedea610cc19c89d28dadcdef7fba
 ✅ PASSED with Result: 0x060ffd6c79f918819a622248c6823443412aedea610cc19c89d28dadcdef7fba
Adding EasyRetroFundingStrategy v1.0 to cloneable strategies...
4 changes: 4 additions & 0 deletions scripts/config/strategies.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ export const strategyConfig: DeployParams = {
name: "DirectAllocationStrategy",
version: "v1.1",
},
"easy-retro-funding": {
name: "EasyRetroFundingStrategy",
version: "v1.0",
},
},
// Optimism
10: {
Expand Down
1 change: 1 addition & 0 deletions scripts/core/deployAllNetworks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ scripts=(
# "strategies/deployDonationVotingMerkleDistributionDirect"
# "strategies/deployDirectGrantsLite"
# "strategies/deployDirectAllocation"
# "strategies/deployEasyRetroFunding"

# "core/transferProxyAdminOwnership"
# "strategies/deployDirectGrants"
Expand Down
9 changes: 9 additions & 0 deletions scripts/deployments/easyretrofundingstrategy.deployment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"11155111": {
"id": "0x060ffd6c79f918819a622248c6823443412aedea610cc19c89d28dadcdef7fba",
"name": "EasyRetroFundingStrategy",
"version": "v1.0",
"address": "0x26B583bF90adAFBf5973B03728ba9a3120D8747D",
"deployerAddress": "0x8C180840fcBb90CE8464B4eCd12ab0f840c6647C"
}
}
43 changes: 43 additions & 0 deletions scripts/strategies/deployEasyRetroFunding.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { ethers } from "hardhat";
import { commonConfig } from "../config/common.config";
import { strategyConfig } from "../config/strategies.config";
import { Validator } from "../utils/Validator";
import { deployStrategies, deployStrategyDirectly } from "./deployStrategies";

export const deployEasyRetroFunding = async () => {
const network = await ethers.provider.getNetwork();
const chainId = Number(network.chainId);

const strategyParams = strategyConfig[chainId]["easy-retro-funding"];

const address = await deployStrategies(
strategyParams.name,
strategyParams.version,
true
);

console.log("==> address", address);

// const validator = await new Validator(
// strategyParams.name,
// address,
// );

// await validator.validate("PERMIT2", [], commonConfig[chainId].permit2Address);

// await deployStrategyDirectly(
// strategyParams.name,
// strategyParams.version,
// [commonConfig[chainId].permit2Address],
// true,
// );

};

// Check if this script is the main module (being run directly)
if (require.main === module) {
deployEasyRetroFunding().catch((error) => {
console.error(error);
process.exitCode = 1;
});
}
Loading
Loading