Skip to content

Commit

Permalink
Deploy MultipleMerkleDistributor arbitrum
Browse files Browse the repository at this point in the history
  • Loading branch information
Flocqst committed Jun 28, 2024
1 parent b738d7e commit 6daa8c9
Show file tree
Hide file tree
Showing 6 changed files with 902 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ Note: for contracts with both an implementation and proxy, when interaction with
| EscrowMigrator Proxy | [`0xC9aF789Ae606F69cF8Ed073A04eC92f2354b027d`](https://optimistic.etherscan.io/address/0xC9aF789Ae606F69cF8Ed073A04eC92f2354b027d) |
| EscrowMigrator Implementation | [`0x10B04483d762Bd4F193F35600112ad52391004A7`](https://optimistic.etherscan.io/address/0x10B04483d762Bd4F193F35600112ad52391004A7) |
| MultipleMerkleDistributor | [`0xf486A72E8c8143ACd9F65A104A16990fDb38be14`](https://optimistic.etherscan.io/address/0xf486A72E8c8143ACd9F65A104A16990fDb38be14) |
| MultipleMerkleDistributor (ARB) | [`0x5733Ef72c134E7A276029CB4ba07Bff8b1163086`](https://arbiscan.io/address/0x5733Ef72c134E7A276029CB4ba07Bff8b1163086) |
| vKWENTA | [`0x6789D8a7a7871923Fc6430432A602879eCB6520a`](https://optimistic.etherscan.io/token/0x6789d8a7a7871923fc6430432a602879ecb6520a) |
| vKWENTARedeemer | [`0x8132EE584bCD6f8Eb1bea141DB7a7AC1E72917b9`](https://optimistic.etherscan.io/address/0x8132EE584bCD6f8Eb1bea141DB7a7AC1E72917b9) |

Expand Down
1 change: 1 addition & 0 deletions deployments/arbitrum-mainnet/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
42161
450 changes: 450 additions & 0 deletions deployments/arbitrum-mainnet/MultipleMerkleDistributor.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ export default {
url: `https://opt-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}`,
accounts: process.env.DEPLOYER_PRIVATE_KEY ? [process.env.DEPLOYER_PRIVATE_KEY] : undefined,
},
"arbitrum-mainnet": {
url: `https://arb-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}`,
accounts: process.env.DEPLOYER_PRIVATE_KEY ? [process.env.DEPLOYER_PRIVATE_KEY] : undefined,
},
tenderly: {
url: process.env.TENDERLY_FORK_URL ?? ""
}
Expand All @@ -139,6 +143,6 @@ export default {
]
},
exposed: {
exclude: ["**/libraries/SafeDecimalMath.sol", "**/misc/LPRewards.sol"]
exclude: ["**/libraries/SafeDecimalMath.sol", "**/misc/LPRewards.sol", "**/TokenDistributor.sol"]
},
};
62 changes: 62 additions & 0 deletions scripts/deploy-multiple-merkle-distributor-arbitrum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
import { ethers } from "hardhat";
import { saveDeployments, verify } from "./utils";

const REWARD_DISTRIBUTOR = "0x5566B4d1767C1019F430F65C6877237bAe25D6B9";
const ARB_TOKEN_ADDRESS = "0x912CE59144191C1204E64559FE8253a0e49E6548";

async function main() {
const [deployer] = await ethers.getSigners();
console.log("Deploying contracts with the account:", deployer.address);
console.log("Account balance:", (await deployer.getBalance()).toString());

const tradingRewards = await deployMultipleMerkleDistributor(
deployer,
ARB_TOKEN_ADDRESS
);

await tradingRewards.nominateNewOwner(REWARD_DISTRIBUTOR);
console.log(
"TradingRewards nominated owner: ",
await tradingRewards.nominatedOwner()
);
}

async function deployMultipleMerkleDistributor(
owner: SignerWithAddress,
token: string
) {
const MultipleMerkleDistributor = await ethers.getContractFactory(
"MultipleMerkleDistributor"
);
const multipleMerkleDistributor = await MultipleMerkleDistributor.deploy(
owner.address,
token
);
await multipleMerkleDistributor.deployed();
await saveDeployments(
"MultipleMerkleDistributor",
multipleMerkleDistributor
);
console.log(
"MultipleMerkleDistributor deployed to: ",
multipleMerkleDistributor.address
);

await verify(
multipleMerkleDistributor.address,
[owner.address, token],
"contracts/MultipleMerkleDistributor.sol:MultipleMerkleDistributor" // to prevent bytecode clashes with contracts-exposed versions
);

return multipleMerkleDistributor;
}

// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});

0 comments on commit 6daa8c9

Please sign in to comment.