Skip to content

Commit

Permalink
feat: fix deployer for new controller
Browse files Browse the repository at this point in the history
  • Loading branch information
algys committed Feb 9, 2022
1 parent 899552d commit 2f2725f
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 41 deletions.
2 changes: 1 addition & 1 deletion contracts/Controller.sol
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ contract Controller is Initializable {
destination.parents = 1;
destination.interior = new bytes[](1);
destination.interior[0] = bytes.concat(bytes1(hex"01"), getSenderAccount(), bytes1(hex"00")); // X2, NetworkId: Any
X_TOKENS.transfer_with_fee(address(VKSM), amount, 18900000000, destination, getWeight(WEIGHT.TRANSFER_TO_RELAY_BASE));
X_TOKENS.transfer_with_fee(address(VKSM), amount, TRANSFER_FEE, destination, getWeight(WEIGHT.TRANSFER_TO_RELAY_BASE));

emit TransferToRelaychain(msg.sender, getSenderAccount(), amount);
}
Expand Down
78 changes: 39 additions & 39 deletions deployment-config.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
networks:
kusama:
deployer: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
auth_sudo: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
treasury: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
developers: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
sovereign_account: "5Ec4AhPZk8STuex8Wsi9TwDtJQxKqzPJRCH7348Xtcs9vZLJ"
deployer: "0x749C992900dcc143D85E140c3aBE271FC021D498"
auth_sudo: "0x749C992900dcc143D85E140c3aBE271FC021D498"
treasury: "0x749C992900dcc143D85E140c3aBE271FC021D498"
developers: "0x749C992900dcc143D85E140c3aBE271FC021D498"
sovereign_account: "F7fq1jSB3w59f8vMShxvP5eSu3wCJbL5Am5MQ6vP6VzYLWD"
root_derivative_index: 30
stash_indexes: [1, 2, 3]
stash_indexes: [1, 2]
oracles:
- "0x04a72797360815e33Fc6676Bf0b02F7D3E901c78"
- "0x21aeb270e48bFB111F8d1e64EACe51C3fE43E944"
quorum: 2
- "0x416291c3145237e79c6d2Eb45d3EFE0467C387bc"
quorum: 1
withdrawal_cap: 40 # max element in withdrawal queue
deposit_cap: 10_000_000_000_000_000 # 10.000 xcKSM
hex1: "0x6302010001009d1f0100010300"
Expand All @@ -28,23 +27,24 @@ networks:
min_nominator_bond: 100_000_000_000
min_active_balance: 1_000
reverse_transfer_fee: 4_000_000
transfer_fee: 18_700_000_000
max_unlocking_chunks: 32
roles:
ROLE_BEACON_MANAGER: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
ROLE_SPEC_MANAGER: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
ROLE_PAUSE_MANAGER: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
ROLE_FEE_MANAGER: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
ROLE_LEDGER_MANAGER: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
ROLE_STAKE_MANAGER: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
ROLE_ORACLE_MEMBERS_MANAGER: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
ROLE_ORACLE_QUORUM_MANAGER: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
ROLE_CONTROLLER_MANAGER: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
ROLE_SET_TREASURY: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
ROLE_SET_DEVELOPERS: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
controller_initial_balance: 15_000_000_000_000 # 15 xcKSM
xcm_max_weight: 1_835_300_000
ROLE_BEACON_MANAGER: "0x749C992900dcc143D85E140c3aBE271FC021D498"
ROLE_SPEC_MANAGER: "0x749C992900dcc143D85E140c3aBE271FC021D498"
ROLE_PAUSE_MANAGER: "0x749C992900dcc143D85E140c3aBE271FC021D498"
ROLE_FEE_MANAGER: "0x749C992900dcc143D85E140c3aBE271FC021D498"
ROLE_LEDGER_MANAGER: "0x749C992900dcc143D85E140c3aBE271FC021D498"
ROLE_STAKE_MANAGER: "0x749C992900dcc143D85E140c3aBE271FC021D498"
ROLE_ORACLE_MEMBERS_MANAGER: "0x749C992900dcc143D85E140c3aBE271FC021D498"
ROLE_ORACLE_QUORUM_MANAGER: "0x749C992900dcc143D85E140c3aBE271FC021D498"
ROLE_CONTROLLER_MANAGER: "0x749C992900dcc143D85E140c3aBE271FC021D498"
ROLE_SET_TREASURY: "0x749C992900dcc143D85E140c3aBE271FC021D498"
ROLE_SET_DEVELOPERS: "0x749C992900dcc143D85E140c3aBE271FC021D498"
controller_initial_balance: 5_000_000_000_000 # 5 xcKSM
xcm_max_weight: 1_871_796_000
xcm_weights:
- 259_272_000 #AS_DERIVATIVE
- 359_272_000 #AS_DERIVATIVE
- 585_400_000 #BOND_BASE
- 998_893_000 #BOND_EXTRA_BASE
- 1_206_618_000 #UNBOND_BASE
Expand All @@ -59,10 +59,10 @@ networks:
- 500_000_000 #TRANSFER_TO_RELAY_BASE

moonbase:
deployer: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
auth_sudo: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
treasury: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
developers: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
deployer: "0xcEF5AE54c26F6C9A9a92436966B4aa4e29671c05"
auth_sudo: "0xcEF5AE54c26F6C9A9a92436966B4aa4e29671c05"
treasury: "0xcEF5AE54c26F6C9A9a92436966B4aa4e29671c05"
developers: "0xcEF5AE54c26F6C9A9a92436966B4aa4e29671c05"
sovereign_account: "5Ec4AhPZk8STuex8Wsi9TwDtJQxKqzPJRCH7348Xtcs9vZLJ"
root_derivative_index: 30
stash_indexes: [1, 2, 3]
Expand All @@ -89,18 +89,18 @@ networks:
reverse_transfer_fee: 4_000_000
max_unlocking_chunks: 32
roles:
ROLE_BEACON_MANAGER: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
ROLE_SPEC_MANAGER: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
ROLE_PAUSE_MANAGER: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
ROLE_FEE_MANAGER: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
ROLE_LEDGER_MANAGER: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
ROLE_STAKE_MANAGER: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
ROLE_ORACLE_MEMBERS_MANAGER: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
ROLE_ORACLE_QUORUM_MANAGER: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
ROLE_CONTROLLER_MANAGER: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
ROLE_SET_TREASURY: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
ROLE_SET_DEVELOPERS: "0x499Ab66749B8eBc370CC73458D33940ae13f5D99"
controller_initial_balance: 15_000_000_000_000 # 15 xcKSM
ROLE_BEACON_MANAGER: "0xcEF5AE54c26F6C9A9a92436966B4aa4e29671c05"
ROLE_SPEC_MANAGER: "0xcEF5AE54c26F6C9A9a92436966B4aa4e29671c05"
ROLE_PAUSE_MANAGER: "0xcEF5AE54c26F6C9A9a92436966B4aa4e29671c05"
ROLE_FEE_MANAGER: "0xcEF5AE54c26F6C9A9a92436966B4aa4e29671c05"
ROLE_LEDGER_MANAGER: "0xcEF5AE54c26F6C9A9a92436966B4aa4e29671c05"
ROLE_STAKE_MANAGER: "0xcEF5AE54c26F6C9A9a92436966B4aa4e29671c05"
ROLE_ORACLE_MEMBERS_MANAGER: "0xcEF5AE54c26F6C9A9a92436966B4aa4e29671c05"
ROLE_ORACLE_QUORUM_MANAGER: "0xcEF5AE54c26F6C9A9a92436966B4aa4e29671c05"
ROLE_CONTROLLER_MANAGER: "0xcEF5AE54c26F6C9A9a92436966B4aa4e29671c05"
ROLE_SET_TREASURY: "0xcEF5AE54c26F6C9A9a92436966B4aa4e29671c05"
ROLE_SET_DEVELOPERS: "0xcEF5AE54c26F6C9A9a92436966B4aa4e29671c05"
controller_initial_balance: 5_000_000_000_000 # 5 xcKSM
xcm_max_weight: 1_835_300_000
xcm_weights:
- 259_084_000 #AS_DERIVATIVE
Expand Down
5 changes: 4 additions & 1 deletion scripts/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
import yaml
from pathlib import Path
from colorama import Fore, Back, Style, init
import os

init(autoreset=True)


NETWORK="moonbase"
NETWORK=os.getenv("NETWORK", "moonbase")


def get_derivative_account(root_account, index):
Expand Down Expand Up @@ -224,6 +225,7 @@ def main():
min_nominator_bond = CONFIG['relay_spec']['min_nominator_bond']
min_active_balance = CONFIG['relay_spec']['min_active_balance']
reverse_transfer_fee = CONFIG['relay_spec']['reverse_transfer_fee']
transfer_fee = CONFIG['relay_spec']['transfer_fee']
max_unlocking_chunks = CONFIG['relay_spec']['max_unlocking_chunks']
withdrawal_cap = CONFIG['withdrawal_cap']
deposit_cap = CONFIG['deposit_cap']
Expand Down Expand Up @@ -272,6 +274,7 @@ def main():
controller.setMaxWeight(xcm_max_weight, get_opts(roles['ROLE_CONTROLLER_MANAGER']))
controller.setWeights([w | (1<<65) for w in xcm_weights], get_opts(roles['ROLE_CONTROLLER_MANAGER']))
controller.setReverseTransferFee(reverse_transfer_fee, get_opts(roles['ROLE_CONTROLLER_MANAGER']))
controller.setTransferFee(transfer_fee, get_opts(roles['ROLE_CONTROLLER_MANAGER']))

ledger_clone = deploy_ledger_clone(deployer)

Expand Down
8 changes: 8 additions & 0 deletions scripts/gen_account.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from eth_account import Account
import secrets

priv = secrets.token_hex(32)
private_key = "0x" + priv
print ("Private key:", private_key)
acct = Account.from_key(private_key)
print("Address:", acct.address)

0 comments on commit 2f2725f

Please sign in to comment.