Skip to content

Commit

Permalink
feat: scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
izyak committed Apr 24, 2024
1 parent 22d90c9 commit 244cea6
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 1 deletion.
7 changes: 6 additions & 1 deletion devnet/docker/icon-bsc/scripts/bts.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const BTSCore = artifacts.require("BTSCore");
const BTSCore = artifacts.require("BTSCoreV5");
const BTSOwnerManager = artifacts.require("BTSOwnerManager");
module.exports = async function (callback) {
try {
Expand Down Expand Up @@ -27,6 +27,11 @@ module.exports = async function (callback) {
tx = await btsCore.updateCoinDb()
console.log(tx)
break;
case "moveLockedEth":
console.log("Move Locked Eth ", argv.addr)
tx = await btsCore.moveLockedEth(argv.addr)
console.log(tx)
break;
case "addOwner":
console.log("Add bts owner ", argv.addr)
tx = await btsOwnerManager.addOwner(argv.addr)
Expand Down
21 changes: 21 additions & 0 deletions devnet/docker/icon-bsc/scripts/migrate_locked_eth.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

set -e

source config.sh
source rpc.sh

export PRIVATE_KEY="[\""$(cat $BSC_KEY_STORE.priv)"\"]"

# Address to transfer the funds to
ADDR=0x69e81Cea7889608A63947814893ad1B86DcC03Aa

moveLockedEth() {
echo "transferring all locked ETH to ${ADDR}"
cd $CONTRACTS_DIR/solidity/bmc
tx=$(truffle exec --network bsc "$SCRIPTS_DIR"/bts.js \
--method addOwner --addr "${ADDR}")
echo "$tx" >$CONFIG_DIR/tx/moveLockedEth.bts.bsc
}

moveLockedEth
28 changes: 28 additions & 0 deletions devnet/docker/icon-bsc/scripts/transfer_icon_eth_ownership.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

set -e

source config.sh
source rpc.sh

# Address of new owner of ETH token on ICON
ADDR=hx80e312d8e68ee2db8fb95e6e7daae2e770d0e368

transferEthOwnership() {
cd $CONFIG_DIR

if [ ! -f icon.addr.bts ]; then
echo "BTS address file icon.addr.bts does not exist"
exit
fi

goloop rpc sendtx call --to $(cat icon.addr.bts) \
--method transferOwnership \
--param _name=btp-0x38.bsc-ETH \
--param to=${ADDR} | jq -r . >tx/transferTokenOwnership.icon
sleep 3
ensure_txresult tx/transferTokenOwnership.icon
echo "Ownership of ETH transferred to ${ADDR} "
}

transferEthOwnership

0 comments on commit 244cea6

Please sign in to comment.