-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploy MultipleMerkleDistributor arbitrum
- Loading branch information
Showing
6 changed files
with
902 additions
and
1 deletion.
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
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 @@ | ||
42161 |
450 changes: 450 additions & 0 deletions
450
deployments/arbitrum-mainnet/MultipleMerkleDistributor.json
Large diffs are not rendered by default.
Oops, something went wrong.
383 changes: 383 additions & 0 deletions
383
deployments/arbitrum-mainnet/solcInputs/b560387ef8e523f752ce28e86fda37a4.json
Large diffs are not rendered by default.
Oops, something went wrong.
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
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); | ||
}); |