Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Commit fc632e8

Browse files
committed
Deploy New Starport
This patch deploys a new Starport with the Timelock as the admin, which is the current Starport Impl now used for test-net. We add a script to make it fairly easy to deploy a new Starport implementation.
1 parent d398232 commit fc632e8

File tree

3 files changed

+48
-2
lines changed

3 files changed

+48
-2
lines changed

ethereum/networks/ropsten.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"Contracts": {
33
"Starport": "0xD905AbBA1C5Ea48c0598bE9F3f8ae31290B58613",
44
"Cash": "0xc65a4A1855d314033530A29Ab993A1717879E5BF",
5-
"StarportImpl": "0xed5DdA5976ec5F29910426d7876eBD6f307e0934",
5+
"StarportImpl": "0xaa39fd81E66Eb9DbEEf3253319516A7317829Eb0",
66
"CashImpl": "0x1ffe465b3c82499e1C637c02EFECD128B7B454CF",
77
"ProxyAdmin": "0xd418B3A7c4a2b9d60fF8dDf9E94a8b75Aa3f60A5"
88
}

ethereum/saddle.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ module.exports = {
9292
scripts: {
9393
"deploy": "scripts/deploy.js",
9494
"deploy:m3": "scripts/migrations/m3.js",
95-
"deploy:m4": "scripts/migrations/m4.js"
95+
"deploy:m4": "scripts/migrations/m4.js",
96+
"deploy:starport": "scripts/migrations/deploy_starport.js"
9697
} // Aliases for scripts
9798
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
const chalk = require('chalk');
2+
const {
3+
deployAndVerify,
4+
checkAddress,
5+
readNetwork,
6+
saveNetwork,
7+
} = require('../utils/deploy_utils');
8+
9+
const main = async (admin) => {
10+
console.log(chalk.yellow(`\n\nDeploying new Starport Admin to ${network}\n`));
11+
12+
const root = saddle.account;
13+
14+
let { Contracts } = await readNetwork(saddle, env, network);
15+
let cashAddress = Contracts['Cash'];
16+
if (!cashAddress) {
17+
throw new Error(`Missing Cash address for network ${network}`);
18+
}
19+
20+
starportImpl = await deployAndVerify('Starport', [cashAddress, admin], { from: root }, saddle, env, network);
21+
22+
if ((await starportImpl.methods.admin().call()).toLowerCase() != admin.toLowerCase()) {
23+
throw new Error(`Invalid Admin on New Starport Impl`)
24+
}
25+
26+
await saveNetwork({
27+
StarportImpl: starportImpl
28+
}, saddle, env, network);
29+
30+
console.log(chalk.yellow(`\n\nNote: you will need to manually upgrade the Starport delegator to use the new StarportImpl\n`));
31+
32+
/* E.g.
33+
await this.proxyAdmin.methods.upgradeAndCall(
34+
starport._address,
35+
"0xaa39fd81E66Eb9DbEEf3253319516A7317829Eb0",
36+
"0x"
37+
).send();
38+
*/
39+
};
40+
41+
(async () => {
42+
let [admin, initialYield_] = args;
43+
checkAddress(admin);
44+
await main(admin);
45+
})();

0 commit comments

Comments
 (0)