Skip to content

Commit

Permalink
chore(admin): add RoleXCaller for devnet account
Browse files Browse the repository at this point in the history
  • Loading branch information
kc1116 committed Nov 4, 2024
1 parent 6817341 commit d0846ca
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 35 deletions.
1 change: 1 addition & 0 deletions e2e/app/eoa/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var statics = map[netconf.ID][]Account{
wellKnown(anvil.DevPrivateKey7(), RoleTester),
wellKnown(anvil.DevPrivateKey8(), RoleHot),
wellKnown(anvil.DevPrivateKey9(), RoleCold),
wellKnown(anvil.DevPrivateKey10(), RoleXCaller),
),
netconf.Staging: flatten(
remote("0x64Bf40F5E6C4DE0dfe8fE6837F6339455657A2F5", RoleCold), // we use shared-cold
Expand Down
2 changes: 0 additions & 2 deletions e2e/app/eoa/static_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ func shouldExist(role eoa.Role, id netconf.ID) bool {
switch {
case role == eoa.RoleTester && id == netconf.Mainnet: // RoleTester not supported on mainnet
return false
case role == eoa.RoleXCaller && id == netconf.Devnet:
return false
default:
return true
}
Expand Down
21 changes: 11 additions & 10 deletions halo/genutil/evm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,17 @@ func PrefundAlloc(network netconf.ID) (types.GenesisAlloc, error) {
func ephemeralPrefundAlloc() types.GenesisAlloc {
allocs := types.GenesisAlloc{
// anvil pre-funded accounts
anvil.DevAccount0(): {Balance: eth1m},
anvil.DevAccount1(): {Balance: eth1m},
anvil.DevAccount2(): {Balance: eth1m},
anvil.DevAccount3(): {Balance: eth1m},
anvil.DevAccount4(): {Balance: eth1m},
anvil.DevAccount5(): {Balance: eth1m},
anvil.DevAccount6(): {Balance: eth1m},
anvil.DevAccount7(): {Balance: eth1m},
anvil.DevAccount8(): {Balance: eth1m},
anvil.DevAccount9(): {Balance: eth1m},
anvil.DevAccount0(): {Balance: eth1m},
anvil.DevAccount1(): {Balance: eth1m},
anvil.DevAccount2(): {Balance: eth1m},
anvil.DevAccount3(): {Balance: eth1m},
anvil.DevAccount4(): {Balance: eth1m},
anvil.DevAccount5(): {Balance: eth1m},
anvil.DevAccount6(): {Balance: eth1m},
anvil.DevAccount7(): {Balance: eth1m},
anvil.DevAccount8(): {Balance: eth1m},
anvil.DevAccount9(): {Balance: eth1m},
anvil.DevAccount10(): {Balance: eth1m},

// team ops accounts
common.HexToAddress("0xfE921e06Ed0a22c035b4aCFF0A5D3a434A330c96"): {Balance: eth1m}, // dev relayer (local)
Expand Down
6 changes: 6 additions & 0 deletions halo/genutil/evm/testdata/TestMakeEVMGenesis.golden
Original file line number Diff line number Diff line change
Expand Up @@ -11781,6 +11781,9 @@
"balance": "0x0",
"nonce": "0x1"
},
"351dd0b37c02fc8916227d06dd4867f670d7a9e1": {
"balance": "0xd3c21bcecceda1000000"
},
"355883dff46a501b280f5adcb177ff0c0a7f01ae": {
"code": "0x60806040526004361061004a5760003560e01c8063715018a61461004f5780638da5cb5b146100665780639623609d14610093578063ad3cb1cc146100a6578063f2fde38b146100e4575b600080fd5b34801561005b57600080fd5b50610064610104565b005b34801561007257600080fd5b506000546040516001600160a01b0390911681526020015b60405180910390f35b6100646100a1366004610272565b610118565b3480156100b257600080fd5b506100d7604051806040016040528060058152602001640352e302e360dc1b81525081565b60405161008a919061038e565b3480156100f057600080fd5b506100646100ff3660046103a8565b610187565b61010c6101ca565b61011660006101f7565b565b6101206101ca565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061015090869086906004016103c5565b6000604051808303818588803b15801561016957600080fd5b505af115801561017d573d6000803e3d6000fd5b5050505050505050565b61018f6101ca565b6001600160a01b0381166101be57604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6101c7816101f7565b50565b6000546001600160a01b031633146101165760405163118cdaa760e01b81523360048201526024016101b5565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146101c757600080fd5b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561028757600080fd5b833561029281610247565b925060208401356102a281610247565b9150604084013567ffffffffffffffff808211156102bf57600080fd5b818601915086601f8301126102d357600080fd5b8135818111156102e5576102e561025c565b604051601f8201601f19908116603f0116810190838211818310171561030d5761030d61025c565b8160405282815289602084870101111561032657600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b6000815180845260005b8181101561036e57602081850181015186830182015201610352565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006103a16020830184610348565b9392505050565b6000602082840312156103ba57600080fd5b81356103a181610247565b6001600160a01b03831681526040602082018190526000906103e990830184610348565b94935050505056fea26469706673582212206805e8f1728dc5f8977bb2f65489ba8d4a41dee49e47fd7efa70dd84957908a264736f6c63430008180033",
"storage": {
Expand Down Expand Up @@ -20584,6 +20587,9 @@
"balance": "0x0",
"nonce": "0x1"
},
"bc0f36a57b666922cf7c01003a01a613d44e993c": {
"balance": "0xd3c21bcecceda1000000"
},
"bc40a2c19a51c47f44eed59410e74777ae287e36": {
"code": "0x60806040526004361061004a5760003560e01c8063715018a61461004f5780638da5cb5b146100665780639623609d14610093578063ad3cb1cc146100a6578063f2fde38b146100e4575b600080fd5b34801561005b57600080fd5b50610064610104565b005b34801561007257600080fd5b506000546040516001600160a01b0390911681526020015b60405180910390f35b6100646100a1366004610272565b610118565b3480156100b257600080fd5b506100d7604051806040016040528060058152602001640352e302e360dc1b81525081565b60405161008a919061038e565b3480156100f057600080fd5b506100646100ff3660046103a8565b610187565b61010c6101ca565b61011660006101f7565b565b6101206101ca565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061015090869086906004016103c5565b6000604051808303818588803b15801561016957600080fd5b505af115801561017d573d6000803e3d6000fd5b5050505050505050565b61018f6101ca565b6001600160a01b0381166101be57604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6101c7816101f7565b50565b6000546001600160a01b031633146101165760405163118cdaa760e01b81523360048201526024016101b5565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146101c757600080fd5b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561028757600080fd5b833561029281610247565b925060208401356102a281610247565b9150604084013567ffffffffffffffff808211156102bf57600080fd5b818601915086601f8301126102d357600080fd5b8135818111156102e5576102e561025c565b604051601f8201601f19908116603f0116810190838211818310171561030d5761030d61025c565b8160405282815289602084870101111561032657600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b6000815180845260005b8181101561036e57602081850181015186830182015201610352565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006103a16020830184610348565b9392505050565b6000602082840312156103ba57600080fd5b81356103a181610247565b6001600160a01b03831681526040602082018190526000906103e990830184610348565b94935050505056fea26469706673582212206805e8f1728dc5f8977bb2f65489ba8d4a41dee49e47fd7efa70dd84957908a264736f6c63430008180033",
"storage": {
Expand Down
58 changes: 35 additions & 23 deletions lib/anvil/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,29 @@ import (

//nolint:gochecknoglobals // Static keys and addresses
var (
acc0 = addr("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266")
acc1 = addr("0x70997970C51812dc3A010C7d01b50e0d17dc79C8")
acc2 = addr("0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC")
acc3 = addr("0x90F79bf6EB2c4f870365E785982E1f101E93b906")
acc4 = addr("0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65")
acc5 = addr("0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc")
acc6 = addr("0x976EA74026E726554dB657fA54763abd0C3a0aa9")
acc7 = addr("0x14dC79964da2C08b23698B3D3cc7Ca32193d9955")
acc8 = addr("0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f")
acc9 = addr("0xa0Ee7A142d267C1f36714E4a8F75612F20a79720")

pk0 = mustHexToKey("0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80")
pk1 = mustHexToKey("0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d")
pk2 = mustHexToKey("0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a")
pk3 = mustHexToKey("0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6")
pk4 = mustHexToKey("0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a")
pk5 = mustHexToKey("0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba")
pk6 = mustHexToKey("0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e")
pk7 = mustHexToKey("0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356")
pk8 = mustHexToKey("0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97")
pk9 = mustHexToKey("0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6")
acc0 = addr("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266")
acc1 = addr("0x70997970C51812dc3A010C7d01b50e0d17dc79C8")
acc2 = addr("0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC")
acc3 = addr("0x90F79bf6EB2c4f870365E785982E1f101E93b906")
acc4 = addr("0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65")
acc5 = addr("0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc")
acc6 = addr("0x976EA74026E726554dB657fA54763abd0C3a0aa9")
acc7 = addr("0x14dC79964da2C08b23698B3D3cc7Ca32193d9955")
acc8 = addr("0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f")
acc9 = addr("0xa0Ee7A142d267C1f36714E4a8F75612F20a79720")
acc10 = addr("0x351dd0b37c02Fc8916227d06dd4867F670D7A9e1")

pk0 = mustHexToKey("0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80")
pk1 = mustHexToKey("0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d")
pk2 = mustHexToKey("0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a")
pk3 = mustHexToKey("0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6")
pk4 = mustHexToKey("0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a")
pk5 = mustHexToKey("0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba")
pk6 = mustHexToKey("0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e")
pk7 = mustHexToKey("0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356")
pk8 = mustHexToKey("0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97")
pk9 = mustHexToKey("0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6")
pk10 = mustHexToKey("0x590ba8222b28a2bb6baed4171b8541d39337e71c5d5b98f54bd688f8badde744")
)

//
Expand Down Expand Up @@ -77,9 +79,13 @@ func DevAccount9() common.Address {
return acc9
}

func DevAccount10() common.Address {
return acc10
}

func IsDevAccount(addr common.Address) bool {
switch addr {
case acc0, acc1, acc2, acc3, acc4, acc5, acc6, acc7, acc8, acc9:
case acc0, acc1, acc2, acc3, acc4, acc5, acc6, acc7, acc8, acc9, acc10:
return true
}

Expand Down Expand Up @@ -130,8 +136,12 @@ func DevPrivateKey9() *ecdsa.PrivateKey {
return pk9
}

func DevPrivateKey10() *ecdsa.PrivateKey {
return pk10
}

func DevPrivateKeys() []*ecdsa.PrivateKey {
return []*ecdsa.PrivateKey{pk0, pk1, pk2, pk3, pk4, pk5, pk6, pk7, pk8, pk9}
return []*ecdsa.PrivateKey{pk0, pk1, pk2, pk3, pk4, pk5, pk6, pk7, pk8, pk9, pk10}
}

func PrivateKey(account common.Address) (*ecdsa.PrivateKey, bool) {
Expand All @@ -156,6 +166,8 @@ func PrivateKey(account common.Address) (*ecdsa.PrivateKey, bool) {
return pk8, true
case acc9:
return pk9, true
case acc10:
return pk10, true
default:
return nil, false
}
Expand Down

0 comments on commit d0846ca

Please sign in to comment.