Skip to content

Commit 6d54e2e

Browse files
authored
feat: Update script for direct deployment to account for contract upgrades (#850)
1 parent 53069ea commit 6d54e2e

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

devnet/docker/icon-bsc/scripts/bts.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const BTSCore = artifacts.require("BTSCoreV3");
1+
const BTSCore = artifacts.require("BTSCore");
22
const BTSOwnerManager = artifacts.require("BTSOwnerManager");
33
module.exports = async function (callback) {
44
try {
@@ -29,12 +29,12 @@ module.exports = async function (callback) {
2929
break;
3030
case "addOwner":
3131
console.log("Add bts owner ", argv.addr)
32-
tx = await btsCore.addOwner(argv.addr)
32+
tx = await btsOwnerManager.addOwner(argv.addr)
3333
console.log(tx)
3434
break;
3535
case "removeOwner":
3636
console.log("Remove bts owner ", argv.addr)
37-
tx = await btsCore.removeOwner(argv.addr)
37+
tx = await btsOwnerManager.removeOwner(argv.addr)
3838
console.log(tx)
3939
break;
4040
case "getOwners":

devnet/docker/icon-bsc/scripts/token.solidity.sh

+2
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,8 @@ generate_metadata() {
327327
wait_for_file $CONFIG_DIR/bsc.addr.btscore
328328
jq -r '.networks[] | .address' build/contracts/BTSPeriphery.json >$CONFIG_DIR/bsc.addr.btsperiphery
329329
wait_for_file $CONFIG_DIR/bsc.addr.btsperiphery
330+
jq -r '.networks[] | .address' build/contracts/BTSOwnerManager.json >$CONFIG_DIR/bsc.addr.btsownermanager
331+
wait_for_file $CONFIG_DIR/bsc.addr.btsownermanager
330332
echo "DONE."
331333
;;
332334
*)

devnet/docker/icon-bsc/scripts/utils.sh

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ done
101101
echo " " \"BMCManagement\": \"$(cat $CONFIG_DIR/bsc.addr.bmcmanagement)\",
102102
echo " " \"BMCPeriphery\": \"$(cat $CONFIG_DIR/bsc.addr.bmcperiphery)\",
103103
echo " " \"BTSCore\": \"$(cat $CONFIG_DIR/bsc.addr.btscore)\",
104+
echo " " \"BTSOwnerManager\": \"$(cat $CONFIG_DIR/bsc.addr.btsownermanager)\",
104105
echo " " \"BTSPeriphery\": \"$(cat $CONFIG_DIR/bsc.addr.btsperiphery)\"
105106
echo " }"
106107
echo "}"

solidity/bts/migrations/1_deploy_bts.js

+12
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
const BTSPeriphery = artifacts.require("BTSPeriphery");
22
const BTSCore = artifacts.require("BTSCore");
3+
const BTSOwnerManager = artifacts.require("BTSOwnerManager");
34
const {deployProxy} = require("@openzeppelin/truffle-upgrades");
45

56
module.exports = async function (deployer, network) {
67
if (network !== "development") {
8+
console.log('Start deploy Proxy BTSOwnerManager ');
9+
10+
await deployProxy(
11+
BTSOwnerManager,
12+
{ deployer }
13+
);
14+
15+
const btsOwnerManager = await BTSOwnerManager.deployed();
16+
717
console.log('Start deploy Proxy BTSCore ');
818

919
await deployProxy(
@@ -12,6 +22,7 @@ module.exports = async function (deployer, network) {
1222
process.env.BSH_COIN_NAME,
1323
process.env.BSH_COIN_FEE,
1424
process.env.BSH_FIXED_FEE,
25+
btsOwnerManager.address
1526
],
1627
{deployer}
1728
);
@@ -29,6 +40,7 @@ module.exports = async function (deployer, network) {
2940
console.log('Updating BTS periphery');
3041
await btsCore.updateBTSPeriphery(BTSPeriphery.address);
3142

43+
console.log("BTS Owner Manager deployed, address: " + btsOwnerManager.address);
3244
console.log('BTSCore: ' + btsCore.address);
3345
console.log('BTSPeriphery: ' + BTSPeriphery.address);
3446

0 commit comments

Comments
 (0)