Skip to content

Commit

Permalink
Update usage of ecosystem contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
LikoIlya committed Jun 17, 2024
1 parent 8902179 commit 4030498
Show file tree
Hide file tree
Showing 22 changed files with 346 additions and 239 deletions.
55 changes: 49 additions & 6 deletions deployments/30746.json
Original file line number Diff line number Diff line change
Expand Up @@ -1054,8 +1054,51 @@
"fullyQualifiedName": "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol:ERC1967Proxy"
}
},
"BondMarketplace_Multisig": {
"address": "0x761314376Ac00758DB402b47F44104529768605b",
"MasterMultisig_ecosystem": {
"address": "0x1c65553DFCd298872ed905089677ef7Ad57eEe17",
"abi": [
"constructor(address[] _signers, bool[] isInitiatorFlags, uint256 _threshold)",
"event Confirmation(address indexed sender, uint256 indexed txId)",
"event Execution(uint256 indexed txId)",
"event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)",
"event Revocation(address indexed sender, uint256 indexed txId)",
"event SignerAddition(address indexed signer, bool isInitiator)",
"event SignerRemoval(address indexed signer)",
"event Submission(uint256 indexed txId)",
"event ThresholdChange(uint256 required)",
"function changeOwners(address[] multisigs, address newOwner)",
"function changeSigners(address[] signersToRemove, address[] signersToAdd, bool[] isInitiatorFlags)",
"function changeSignersMaster(tuple(address contract_, address[] signersToRemove, address[] signersToAdd, bool[] isInitiatorFlags)[] changes)",
"function changeThreshold(uint256 _threshold)",
"function checkBeforeSubmitTransaction(address destination, uint256 value, bytes data) payable",
"function confirmTransaction(uint256 txId)",
"function confirmations(uint256, address) view returns (bool)",
"function getAllSigners(address[] multisigs) view returns (tuple(address[] signers, bool[] isInitiatorFlags, uint256 threshold)[])",
"function getConfirmations(uint256 txId) view returns (address[])",
"function getInitiatorsCount() view returns (uint256)",
"function getRequiredSignersCount() view returns (uint256)",
"function getSigners() view returns (address[], bool[])",
"function getTransactionData(uint256 txId) view returns (tuple(address destination, uint256 value, bytes data, bool executed), address[])",
"function getTransactionIds(uint256 from, uint256 to, bool pending, bool executed) view returns (uint256[] result)",
"function isConfirmed(uint256 txId) view returns (bool)",
"function isInitiator(address) view returns (bool)",
"function isSigner(address) view returns (bool)",
"function owner() view returns (address)",
"function renounceOwnership()",
"function revokeConfirmation(uint256 txId)",
"function signers(uint256) view returns (address)",
"function submitTransaction(address destination, uint256 value, bytes data) payable returns (uint256 txId)",
"function threshold() view returns (uint256)",
"function transactionCount() view returns (uint256)",
"function transactions(uint256) view returns (address destination, uint256 value, bytes data, bool executed)",
"function transferOwnership(address newOwner)",
"function withdraw(address to, uint256 amount)"
],
"deployTx": "0x1ac616567b6a5a35f1ad037864ed941ffcde5df4cd7ecc441fb4a6c94ea2a7be",
"fullyQualifiedName": "contracts/multisig/MasterMultisig.sol:MasterMultisig"
},
"BondMarketplace_Multisig_ecosystem": {
"address": "0xFE633aB44e17309C073bDaA3004C5DF7eF78Fc0a",
"abi": [
"constructor(address[] _signers, bool[] isInitiatorFlags, uint256 _threshold, address owner)",
"event Confirmation(address indexed sender, uint256 indexed txId)",
Expand Down Expand Up @@ -1091,11 +1134,11 @@
"function transferOwnership(address newOwner)",
"function withdraw(address to, uint256 amount)"
],
"deployTx": "0xf1d39b72af293772617b7c5515d548f18a6abc55dc30c4173b72382cc313c32b",
"deployTx": "0xfac727200e0836da9e78889e77eaa15671e31d3632429b6ea560c289a06a31a2",
"fullyQualifiedName": "contracts/multisig/Multisig.sol:Multisig"
},
"BondMarketplace_RewardsBank": {
"address": "0xFFafaD16D4C174cA8E403E764704eb2784037b26",
"BondMarketplace_RewardsBank_ecosystem": {
"address": "0x2a5cffc6f81DbAf50b3e36b9173a4Fd69b8b7dF9",
"abi": [
"constructor()",
"event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)",
Expand All @@ -1111,7 +1154,7 @@
"function withdrawAmb(address addressTo, uint256 amount)",
"function withdrawErc20(address tokenAddress, address addressTo, uint256 amount)"
],
"deployTx": "0x0a9cf5c7b2bf4b772508d528839b7dcd86655ffe2149eb19240d18748b910651",
"deployTx": "0x57d94327d1204525b81ad83fd4079e224ea135d3972f81e0290692de1824f0b6",
"fullyQualifiedName": "contracts/funds/RewardsBank.sol:RewardsBank"
}
}
105 changes: 0 additions & 105 deletions deployments/30746_v2.json

This file was deleted.

3 changes: 0 additions & 3 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ task("sourcify", "verify contracts using sourcify").setAction(async (args: any,
await hre.run("compile"); // compile contract first
// @ts-ignore
let { chainId } = await hre.ethers.provider.getNetwork();
if (process.env.MULTISIGS && process.env.MULTISIGS !== "v1") {
chainId = (chainId.toString() + `_${process.env.MULTISIGS}`) as any;
}
const deployments = require(`./deployments/${chainId}.json`) as Record<string, any>;

for (const [contractName, deployment] of Object.entries(deployments))
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
"deploy_fees": "hardhat run scripts/fees/deploy_fees.ts --network dev",
"deploy_bond": "hardhat run scripts/bond-marketplace/deploy_rewards_bank.ts --network dev",
"deploy_all": "npm run deploy_multisig && npm run deploy_finance && npm run deploy_airdrop && npm run deploy_staking && npm run deploy_fees && npm run deploy_bond",
"deploy_multisig:v2": "MULTISIGS=v2 npm run deploy_multisig",
"deploy_bond:v2": "MULTISIGS=v2 npm run deploy_bond",
"deploy_all:v2": "npm run deploy_multisig:v2 && npm run deploy_bond:v2",
"deploy_multisig:eco": "MULTISIGS=ecosystem npm run deploy_multisig",
"deploy_bond:eco": "MULTISIGS=ecosystem npm run deploy_bond",
"deploy_all:eco": "npm run deploy_multisig:eco && npm run deploy_bond:eco",
"migration_to_new_staking": "hardhat run scripts/staking/migrate_to_new_staking.ts --network dev",
"test_script": "hardhat run scripts/test.ts --network test",
"integration_test_script": "hardhat run scripts/staking/new_validatorset_integration_test.ts --network local",
Expand Down
21 changes: 15 additions & 6 deletions scripts/bond-marketplace/deploy_rewards_bank.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@ import {
SharedDev,
Sophie,
} from "../addresses";
import { MultisigVersions } from "../../src/contracts/names";

export async function main() {
let { chainId } = await ethers.provider.getNetwork();
if (process.env.MULTISIGS && process.env.MULTISIGS !== "v1") {
chainId = (chainId.toString() + `_${process.env.MULTISIGS}`) as any;
}
// if (process.env.MULTISIGS && process.env.MULTISIGS !== MultisigVersions.common) {
// chainId = (chainId.toString() + `_${process.env.MULTISIGS}`) as any;
// }
const [deployer] = await ethers.getSigners();

const masterMultisig = loadDeployment(ContractNames.MasterMultisig, chainId).address;
const masterMultisig = loadDeployment(
ContractNames.MasterMultisig +
(process.env.MULTISIGS && process.env.MULTISIGS !== MultisigVersions.common ? `_${process.env.MULTISIGS}` : ""),
chainId
).address;

const multisigSettings: [string[], boolean[], number] =
network.name == "main"
Expand All @@ -35,7 +40,9 @@ export async function main() {
: [[SharedDev, DimaTest96], [true, true], 1];

const multisig = await deploy<Multisig__factory>({
contractName: ContractNames.BondMarketplaceMultisig,
contractName:
ContractNames.BondMarketplaceMultisig +
(process.env.MULTISIGS && process.env.MULTISIGS !== MultisigVersions.common ? `_${process.env.MULTISIGS}` : ""),
networkId: chainId,
artifactName: "Multisig",
deployArgs: [...multisigSettings, masterMultisig],
Expand All @@ -44,7 +51,9 @@ export async function main() {
});

const rewardsBank = await deploy<RewardsBank__factory>({
contractName: ContractNames.BondMarketplaceRewardsBank,
contractName:
ContractNames.BondMarketplaceRewardsBank +
(process.env.MULTISIGS && process.env.MULTISIGS !== MultisigVersions.common ? `_${process.env.MULTISIGS}` : ""),
networkId: chainId,
artifactName: "RewardsBank",
deployArgs: [],
Expand Down
19 changes: 12 additions & 7 deletions scripts/fees/deploy_fees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,23 @@ import {ethers} from "hardhat";
import {Fees__factory, Finance__factory, Multisig__factory} from "../../typechain-types";
import {ContractNames} from "../../src";
import {Roadmap2023MultisigSettings} from "../addresses";
import { MultisigVersions } from "../../src/contracts/names";

export async function main() {
let { chainId } = await ethers.provider.getNetwork();
if (process.env.MULTISIGS && process.env.MULTISIGS !== "v1") {
chainId = (chainId.toString() + `_${process.env.MULTISIGS}`) as any;
}
// if (process.env.MULTISIGS && process.env.MULTISIGS !== "v1") {
// chainId = (chainId.toString() + `_${process.env.MULTISIGS}`) as any;
// }

const [deployer] = await ethers.getSigners();
const masterMultisig = loadDeployment(ContractNames.MasterMultisig, chainId).address;
const masterMultisig = loadDeployment(
ContractNames.MasterMultisig +
(process.env.MULTISIGS && process.env.MULTISIGS !== MultisigVersions.common ? `_${process.env.MULTISIGS}` : ""),
chainId
).address;

const multisig = await deploy<Multisig__factory>({
contractName: ContractNames.FeesMultisig,
contractName: ContractNames.FeesMultisig+ (process.env.MULTISIGS && process.env.MULTISIGS !== MultisigVersions.common ? `_${process.env.MULTISIGS}` : ""),
networkId: chainId,
artifactName: "Multisig",
deployArgs: [...Roadmap2023MultisigSettings, masterMultisig],
Expand All @@ -23,7 +28,7 @@ export async function main() {
});

const treasure = await deploy<Finance__factory>({
contractName: ContractNames.FeesTreasure,
contractName: ContractNames.FeesTreasure + (process.env.MULTISIGS && process.env.MULTISIGS !== MultisigVersions.common ? `_${process.env.MULTISIGS}` : ""),
networkId: chainId,
artifactName: "Finance",
deployArgs: [multisig.address],
Expand All @@ -35,7 +40,7 @@ export async function main() {
const feePercent = 300000;

const fees = await deploy<Fees__factory>({
contractName: ContractNames.Fees,
contractName: ContractNames.Fees + (process.env.MULTISIGS && process.env.MULTISIGS !== MultisigVersions.common ? `_${process.env.MULTISIGS}` : ""),
networkId: chainId,
artifactName: "Fees",
deployArgs: [gasPrice, payAddress, feePercent],
Expand Down
23 changes: 16 additions & 7 deletions scripts/finance/deploy_airdrop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import { ethers, network } from "hardhat";
import { ContractNames } from "../../src";
import { deploy } from "@airdao/deployments/deploying";
import { AirBond__factory, AirDrop__factory } from "../../typechain-types";
import { MultisigVersions } from "../../src/contracts/names";

async function main() {
let { chainId } = await ethers.provider.getNetwork();
if (process.env.MULTISIGS && process.env.MULTISIGS !== "v1") {
chainId = (chainId.toString() + `_${process.env.MULTISIGS}`) as any;
}
// if (process.env.MULTISIGS && process.env.MULTISIGS !== "v1") {
// chainId = (chainId.toString() + `_${process.env.MULTISIGS}`) as any;
// }
const [deployer] = await ethers.getSigners();

if (network.name == "main") {
Expand All @@ -18,15 +19,19 @@ async function main() {

// const financeInvestorsMultisig = loadDeployment(ContractNames.FinanceInvestorsMultisig, networkName).address;
const airBond = await deploy<AirBond__factory>({
contractName: ContractNames.AirBond,
contractName:
ContractNames.AirBond +
(process.env.MULTISIGS && process.env.MULTISIGS !== MultisigVersions.common ? `_${process.env.MULTISIGS}` : ""),
networkId: chainId,
artifactName: "AirBond",
deployArgs: [deployer.address],
signer: deployer,
loadIfAlreadyDeployed: true,
});
const airDrop = await deploy<AirDrop__factory>({
contractName: ContractNames.AirDrop,
contractName:
ContractNames.AirDrop +
(process.env.MULTISIGS && process.env.MULTISIGS !== MultisigVersions.common ? `_${process.env.MULTISIGS}` : ""),
networkId: chainId,
artifactName: "AirDrop",
deployArgs: [airBond.address, BACKEND_ADDRESS, ethers.utils.parseEther("999"), []],
Expand All @@ -40,15 +45,19 @@ async function main() {
await airDrop.transferOwnership("0x7fadc4729bc1Ff8DAc313cb41e7527Dc6cAB2deb"); // valar
} else {
const airBond = await deploy<AirBond__factory>({
contractName: ContractNames.AirBond,
contractName:
ContractNames.AirBond +
(process.env.MULTISIGS && process.env.MULTISIGS !== MultisigVersions.common ? `_${process.env.MULTISIGS}` : ""),
networkId: chainId,
artifactName: "AirBond",
deployArgs: [deployer.address],
signer: deployer,
loadIfAlreadyDeployed: true,
});
const airDrop = await deploy<AirDrop__factory>({
contractName: ContractNames.AirDrop,
contractName:
ContractNames.AirDrop +
(process.env.MULTISIGS && process.env.MULTISIGS !== MultisigVersions.common ? `_${process.env.MULTISIGS}` : ""),
networkId: chainId,
artifactName: "AirDrop",
deployArgs: [airBond.address, deployer.address, ethers.utils.parseEther("999"), []],
Expand Down
Loading

0 comments on commit 4030498

Please sign in to comment.