Skip to content

Commit

Permalink
ok need to referencing existing rewards in deploy script to share the…
Browse files Browse the repository at this point in the history
… rewards'
  • Loading branch information
Hans Wang committed Jun 23, 2023
1 parent 6faabd0 commit baa5869
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 53 deletions.
4 changes: 3 additions & 1 deletion deployments/arbitrum/usdc.n/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ export default async function deploy(deploymentManager: DeploymentManager, deplo
const bulker = await deploymentManager.fromDep('bulker', 'arbitrum', 'usdc');
const localTimelock = await deploymentManager.fromDep('timelock', 'arbitrum', 'usdc');
const bridgeReceiver = await deploymentManager.fromDep('bridgeReceiver', 'arbitrum', 'usdc');
const rewards = await deploymentManager.fromDep('rewards', 'arbitrum', 'usdc');

// Deploy Comet
const deployed = await deployComet(deploymentManager, deploySpec);

return {
...deployed,
bridgeReceiver,
bulker
bulker,
rewards
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,7 @@ export default migration('1686953660_configurate_and_ens', {
COMP,
} = await govDeploymentManager.getContracts();

const COMPAmountToBridge = exp(12_500, 18);
const compGatewayAddress = await arbitrumL1GatewayRouter.getGateway(COMP.address);
const refundAddress = l2Timelock.address;

const compGasParams = await estimateTokenBridge(
{
token: COMP.address,
from: timelock.address,
to: rewards.address,
amount: COMPAmountToBridge
},
govDeploymentManager,
deploymentManager
);

const configuration = await getConfigurationStruct(deploymentManager);

const setConfigurationCalldata = await calldata(
Expand Down Expand Up @@ -124,31 +110,8 @@ export default migration('1686953660_configurate_and_ens', {
],
value: createRetryableTicketGasParams.deposit
},
// 2. Approve the COMP gateway to take Timelock's COMP for bridging
{
contract: COMP,
signature: 'approve(address,uint256)',
args: [compGatewayAddress, COMPAmountToBridge]
},
// 3. Bridge COMP from mainnet to Arbitrum rewards
{
contract: arbitrumL1GatewayRouter,
signature: 'outboundTransferCustomRefund(address,address,address,uint256,uint256,uint256,bytes)',
args: [
COMP.address, // address _token,
refundAddress, // address _refundTo,
rewards.address, // address _to,
COMPAmountToBridge, // uint256 _amount,
compGasParams.gasLimit, // uint256 _maxGas,
compGasParams.maxFeePerGas, // uint256 _gasPriceBid,
utils.defaultAbiCoder.encode(
['uint256', 'bytes'],
[compGasParams.maxSubmissionCost, '0x']
) // bytes calldata _data
],
value: compGasParams.deposit
},
// 4. Update the list of official markets

// 2. Update the list of official markets
{
target: ENSResolverAddress,
signature: 'setText(bytes32,string,string)',
Expand Down Expand Up @@ -208,18 +171,7 @@ export default migration('1686953660_configurate_and_ens', {
expect(config.rescaleFactor).to.be.equal(exp(1, 12));
expect(config.shouldUpscale).to.be.equal(true);

// 2. & 3.
// expect(await comet.getReserves()).to.be.equal(exp(10_000, 6));

// 4. & 5.
const arbitrumCOMP = new Contract(
arbitrumCOMPAddress,
['function balanceOf(address account) external view returns (uint256)'],
deploymentManager.hre.ethers.provider
);
expect(await arbitrumCOMP.balanceOf(rewards.address)).to.be.equal(exp(12_500, 18));

// 6.
// 2.
const ENSResolver = await govDeploymentManager.existing('ENSResolver', ENSResolverAddress);
const subdomainHash = ethers.utils.namehash(ENSSubdomain);
const officialMarketsJSON = await ENSResolver.text(subdomainHash, ENSTextRecordKey);
Expand Down Expand Up @@ -255,7 +207,7 @@ export default migration('1686953660_configurate_and_ens', {
],
});

// 7.
// 3.
expect(await comptrollerV2.compBorrowSpeeds(cUSDTAddress)).to.be.equal(0);
expect(await comptrollerV2.compSupplySpeeds(cUSDTAddress)).to.be.equal(0);
expect(await comet.baseTrackingSupplySpeed()).to.be.equal(exp(34.74 / 86400, 15, 18));
Expand Down

0 comments on commit baa5869

Please sign in to comment.