-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: roninscan, deploy, relayer ccip, etc
- Loading branch information
1 parent
51c2ad5
commit 0e2bcac
Showing
16 changed files
with
474 additions
and
9 deletions.
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
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
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,36 @@ | ||
{ | ||
"name": "Compound USDC", | ||
"symbol": "cUSDCv3", | ||
"baseToken": "USDC", | ||
"baseTokenAddress": "0x067fbff8990c58ab90bae3c97241c5d736053f77", | ||
"borrowMin": "100e6", | ||
"storeFrontPriceFactor": 0.6, | ||
"targetReserves": "5_000_000e6", | ||
"pauseGuardian": "", | ||
"rates": { | ||
"borrowBase": 0.015, | ||
"borrowSlopeLow": 0.0333, | ||
"borrowKink": 0.9, | ||
"borrowSlopeHigh": 4.0, | ||
"supplyBase": 0, | ||
"supplySlopeLow": 0.039, | ||
"supplyKink": 0.9, | ||
"supplySlopeHigh": 3.6 | ||
}, | ||
"tracking": { | ||
"indexScale": "1e15", | ||
"baseSupplySpeed": "46296296296e0", | ||
"baseBorrowSpeed": "46296296296e0", | ||
"baseMinForRewards": "1000e6" | ||
}, | ||
"assets": { | ||
"WRON": { | ||
"address": "0xA959726154953bAe111746E265E6d754F48570E6", | ||
"decimals": "18", | ||
"borrowCF": 0.82, | ||
"liquidateCF": 0.87, | ||
"liquidationFactor": 0.93, | ||
"supplyCap": "2800e18" | ||
} | ||
} | ||
} |
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,112 @@ | ||
import { | ||
Deployed, | ||
DeploymentManager, | ||
} from '../../../plugins/deployment_manager'; | ||
import { DeploySpec, deployComet } from '../../../src/deploy'; | ||
|
||
const HOUR = 60 * 60; | ||
const DAY = 24 * HOUR; | ||
|
||
const MAINNET_TIMELOCK = '0x6d903f6003cca6255d85cca4d3b5e5146dc33925'; | ||
|
||
export default async function deploy( | ||
deploymentManager: DeploymentManager, | ||
deploySpec: DeploySpec | ||
): Promise<Deployed | void> { | ||
const deployed = await deployContracts(deploymentManager, deploySpec); | ||
return deployed; | ||
} | ||
|
||
async function deployContracts( | ||
deploymentManager: DeploymentManager, | ||
deploySpec: DeploySpec | ||
): Promise<Deployed | void> { | ||
const trace = deploymentManager.tracer(); | ||
|
||
// Pull in existing assets | ||
const WRON = await deploymentManager.existing( | ||
'WRON', | ||
'0xA959726154953bAe111746E265E6d754F48570E6', | ||
'ronin-saigon' | ||
); | ||
|
||
console.log(WRON); | ||
|
||
console.log(await WRON.decimals()); | ||
|
||
// pre-deployed OptimismMintableERC20 | ||
const COMP = await deploymentManager.existing( | ||
'COMP', | ||
'0x52b7D8851d6CcBC6342ba0855Be65f7B82A3F17f', | ||
'ronin-saigon' | ||
); | ||
|
||
const l2CCIPMessenger = await deploymentManager.existing( | ||
'roninSaigonL2CCIPMessenger', | ||
'0x0aCAe4e51D3DA12Dd3F45A66e8b660f740e6b820', | ||
'ronin-saigon' | ||
); | ||
|
||
const l2CCIPBridge = await deploymentManager.existing( | ||
'roninSaigonL2CCIPBridge', | ||
'0x0aCAe4e51D3DA12Dd3F45A66e8b660f740e6b820', | ||
'ronin-saigon' | ||
); | ||
|
||
// Deploy OptimismBridgeReceiver | ||
const bridgeReceiver = await deploymentManager.deploy( | ||
'bridgeReceiver', | ||
'bridges/optimism/OptimismBridgeReceiver.sol', | ||
[l2CCIPMessenger.address] | ||
); | ||
|
||
// Deploy Local Timelock | ||
const localTimelock = await deploymentManager.deploy( | ||
'timelock', | ||
'vendor/Timelock.sol', | ||
[ | ||
bridgeReceiver.address, // admin | ||
1 * DAY, // delay | ||
14 * DAY, // grace period | ||
12 * HOUR, // minimum delay | ||
30 * DAY, // maxiumum delay | ||
] | ||
); | ||
|
||
// Initialize OptimismBridgeReceiver | ||
await deploymentManager.idempotent( | ||
async () => !(await bridgeReceiver.initialized()), | ||
async () => { | ||
trace(`Initializing BridgeReceiver`); | ||
await bridgeReceiver.initialize( | ||
MAINNET_TIMELOCK, // govTimelock | ||
localTimelock.address // localTimelock | ||
); | ||
trace(`BridgeReceiver initialized`); | ||
} | ||
); | ||
|
||
// Deploy Comet | ||
const deployed = await deployComet(deploymentManager, deploySpec); | ||
const { comet } = deployed; | ||
|
||
// Deploy Bulker | ||
// It won't be used, as we do not have MNT as a base and as a collateral | ||
const bulker = await deploymentManager.deploy( | ||
'bulker', | ||
'bulkers/BaseBulker.sol', | ||
[ | ||
await comet.governor(), // admin | ||
WRON.address, // wrapped native token | ||
] | ||
); | ||
|
||
return { | ||
...deployed, | ||
bridgeReceiver, | ||
l2CCIPMessenger, | ||
l2CCIPBridge, | ||
bulker, | ||
COMP, | ||
}; | ||
} |
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,36 @@ | ||
import baseRelationConfig from '../../relations'; | ||
|
||
export default { | ||
...baseRelationConfig, | ||
governor: { | ||
artifact: | ||
'contracts/bridges/optimism/OptimismBridgeReceiver.sol:OptimismBridgeReceiver', | ||
}, | ||
|
||
l2CrossDomainMessenger: { | ||
delegates: { | ||
field: { | ||
slot: | ||
'0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc', | ||
}, | ||
}, | ||
}, | ||
|
||
l2StandardBridge: { | ||
delegates: { | ||
field: { | ||
slot: | ||
'0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc', | ||
}, | ||
}, | ||
}, | ||
|
||
TransparentUpgradeableProxy: { | ||
artifact: 'contracts/ERC20.sol:ERC20', | ||
delegates: { | ||
field: { | ||
slot: '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc' | ||
} | ||
} | ||
}, | ||
}; |
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
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
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
Oops, something went wrong.