Skip to content

Commit

Permalink
Deploying dev in goerli
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose Sosa committed Apr 14, 2023
1 parent 6487ccc commit bfa3728
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 32 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,15 @@ npx hardhat run scripts/check_status.js --network aurora_mainnet

# Deployment in Goerli

First, the contracts will be deployed in ETH Goerli, using the two `testing/` contracts for the Aurora Staking service and the Aurora token.

The branch that is deployed

First, the contracts will be deployed in ETH Goerli, using the two `testing/` contracts for the Aurora Staking service and the Aurora token.

Addresses of the deployed contracts:
- Token: 0xB0Ac0da82FF21027D1d1aB13AE67e9C7953AA66e
- AuroraStaking: 0xba63a349Fc594B2255e9541C49DA58fAf7a2A53C
- StakingManager: 0x2C5981D82Ca960602B2e829a0DAa1bDA56CA2c44
- Depositor 00: 0xBFfcc6517e372bF28909940A5Ee49b5AE4C8d466
- Depositor 01: 0x244AfCd5a0bc8A4400c6702C6a2A7717945c5e70
- StakedAuroraVault: 0x0f4967Ff6387798958fF143DAA00E0D98Fd26b46
- AuroraToken 💚: 0xAEb674aa3b8758aEdb22477F3176365CEBE8942E
- CentauriToken 🪐: 0x18D1975B2c4FcDFc121cFfCBfDe50634c69255a3
- AuroraStaking: 0x2f8fc08dd8c7fdF3e35d778E8D15bF1da42dA40B
- StakingManager: 0xbFeAAc062E72a19bEE26B9F30FDd9201de7CAdFc
- Depositor 00: 0x6fA37581EBA252C08240c85f30fA8A5e3462c09d
- Depositor 01: 0x31e0752Deb99f1fCE9701Dc5611A1652189dEdC3
- StakedAuroraVault: 0x6c41Dc70556E0C2e8Fcb105e4BfAc23B000029F7
7 changes: 4 additions & 3 deletions scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

async function main() {

const MAINNET_AURORA_PLUS = "0xccc2b1aD21666A5847A804a73a41F904C4a4A0Ec";
const MAINNET_AURORA_TOKEN = "0x8BEc47865aDe3B172A928df8f990Bc7f2A3b9f79";
const decimals = ethers.BigNumber.from(10).pow(18);
const USE_DUMMY_TOKENS = true;

const decimals = ethers.BigNumber.from(10).pow(18);
const AURORA_PLUS_CONTRACT = "0xccc2b1aD21666A5847A804a73a41F904C4a4A0Ec";
const AURORA_TOKEN_CONTRACT = "0x8BEc47865aDe3B172A928df8f990Bc7f2A3b9f79";
const AuroraToken = await ethers.getContractFactory("Token");
const AuroraStaking = await ethers.getContractFactory("AuroraStaking");
const StakingManager = await ethers.getContractFactory("StakingManager");
Expand Down
65 changes: 44 additions & 21 deletions scripts/test_deploy.js → scripts/deploy_dummy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

async function main() {

const MAX_WITHDRAW_ORDERS = 20;
const MAX_DEPOSITORS = 3;
const DECIMALS = ethers.BigNumber.from(10).pow(18);
const AuroraToken = await ethers.getContractFactory("Token");
const CentauriToken = await ethers.getContractFactory("Token");
const AuroraStaking = await ethers.getContractFactory("AuroraStaking");
const StakingManager = await ethers.getContractFactory("StakingManager");
const Depositor = await ethers.getContractFactory("Depositor");
Expand All @@ -12,10 +16,9 @@ async function main() {
bob
] = await ethers.getSigners();

// Step 1. Deploying a dummy token for testing Aurora.
// ----------------- Step 1. Deploying a dummy token for testing Aurora.
console.log("Step 1. Deploying AuroraToken...")
const decimals = ethers.BigNumber.from(10).pow(18);
const initialSupply = ethers.BigNumber.from(10_000_000).mul(decimals);
const initialSupply = ethers.BigNumber.from(10_000_000).mul(DECIMALS);
const auroraTokenContract = await AuroraToken.connect(alice).deploy(
initialSupply,
"Aurora Token",
Expand All @@ -26,25 +29,40 @@ async function main() {
console.log(" ...done!");

// Sharing total suply with Bob.
const splitSupply = ethers.BigNumber.from(3_000_000).mul(decimals);
const splitSupply = ethers.BigNumber.from(3_000_000).mul(DECIMALS);
await auroraTokenContract.connect(alice).transfer(bob.address, splitSupply);
// await auroraTokenContract.connect(alice).transfer(carl.address, splitSupply);

// Step 2. Deploying a dummy staking service.
console.log("Step 2. Deploying AuroraStaking...")
// ----------------- Step 2. Deploying a dummy token for testing rewards.
console.log("Step 2. Deploying CentauriToken...")
const centauriInitialSupply = ethers.BigNumber.from(200_000).mul(DECIMALS);
const centauriTokenContract = await CentauriToken.connect(alice).deploy(
centauriInitialSupply,
"Centauri Token",
"CENTAURI",
alice.address
);
await centauriTokenContract.deployed();
console.log(" ...done!");

// ----------------- Step 3. Deploying a dummy staking service.
console.log("Step 3. Deploying AuroraStaking...")
const auroraStakingContract = await AuroraStaking.connect(alice).deploy(
auroraTokenContract.address
auroraTokenContract.address,
centauriTokenContract.address
);
await auroraStakingContract.deployed();
console.log(" ...done!");

// Send Tokens to the Aurora Staking contract to pay for rewards.
const forRewards = ethers.BigNumber.from(1_000_000).mul(decimals);
const forRewards = ethers.BigNumber.from(1_000_000).mul(DECIMALS);
await auroraTokenContract.connect(alice).transfer(auroraStakingContract.address, forRewards);

// Send all Centauri Tokens to the Aurora Staking contract.
await centauriTokenContract.connect(alice).transfer(auroraStakingContract.address, centauriInitialSupply);

// Step 3. Deploying the IMMUTABLE Staked Aurora Vault contract.
console.log("Step 3. Deploying StakedAuroraVault...")
const minDepositAmount = ethers.BigNumber.from(1).mul(decimals);
// ----------------- Step 4. Deploying the IMMUTABLE Staked Aurora Vault contract.
console.log("Step 4. Deploying StakedAuroraVault...")
const minDepositAmount = ethers.BigNumber.from(1).mul(DECIMALS);
const stakedAuroraVaultContract = await StakedAuroraVault.connect(alice).deploy(
auroraTokenContract.address,
"Staked Aurora Token",
Expand All @@ -54,29 +72,33 @@ async function main() {
await stakedAuroraVaultContract.deployed();
console.log(" ...done!");

// Step 4. Deploying the MUTABLE Staking Manager contract.
console.log("Step 4. Deploying StakingManager...")
// ----------------- Step 5. Deploying the MUTABLE Staking Manager contract.
console.log("Step 5. Deploying StakingManager...")
const stakingManagerContract = await StakingManager.connect(alice).deploy(
stakedAuroraVaultContract.address,
auroraStakingContract.address,
bob.address,
10
bob.address,
MAX_WITHDRAW_ORDERS,
MAX_DEPOSITORS
);
await stakingManagerContract.deployed();
console.log(" ...done!");

// Insert/update the staking manager in the ERC-4626
await stakedAuroraVaultContract.updateStakingManager(stakingManagerContract.address);
await stakedAuroraVaultContract.initializeStakingManager(stakingManagerContract.address);

// Step 5. Deploying the multiple Depositor contracts.
console.log("Step 5. Deploying 2 Depositor contracts...")
// ----------------- Step 6. Deploying the multiple Depositor contracts.
console.log("Step 6. Deploying 2 Depositor contracts...")
const depositor00Contract = await Depositor.connect(bob).deploy(
stakingManagerContract.address
stakingManagerContract.address,
bob.address
);
await depositor00Contract.deployed();

const depositor01Contract = await Depositor.connect(bob).deploy(
stakingManagerContract.address
stakingManagerContract.address,
bob.address
);
await depositor01Contract.deployed();
console.log(" ...2 contracts deployed!");
Expand All @@ -85,7 +107,8 @@ async function main() {
await stakingManagerContract.connect(bob).insertDepositor(depositor01Contract.address);

console.log("Addresses of the deployed contracts:")
console.log(" - Token: %s", auroraTokenContract.address);
console.log(" - AuroraToken 💚: %s", auroraTokenContract.address);
console.log(" - CentauriToken 🪐: %s", centauriTokenContract.address);
console.log(" - AuroraStaking: %s", auroraStakingContract.address);
console.log(" - StakingManager: %s", stakingManagerContract.address);
console.log(" - Depositor 00: %s", depositor00Contract.address);
Expand Down

0 comments on commit bfa3728

Please sign in to comment.