Skip to content

Commit

Permalink
New sepolia and fix withdraw script
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementWalter committed Sep 26, 2024
1 parent 697100a commit fb81b8c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 31 deletions.
25 changes: 13 additions & 12 deletions deployments/starknet-sepolia/declarations.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
{
"account_contract": "0x6cb1275516c11f6c1f9d2758bd212d2c40d8136ebd353c316779b754a216d83",
"uninitialized_account_fixture": "0x2957ff0877441dddcd140e6af50a3d45712f4f7205a36a846110a70297036be",
"uninitialized_account": "0x45f7d0803659c3f58b5b6ba46f349178253dadabbfc6ab47fa1ba4bab4699f8",
"EVM": "0x1ce258b332ad964d0d0a472b7795615a84f25196b733a319e101b948f3064a8",
"OpenzeppelinAccount": "0x6153ccf69fd20f832c794df36e19135f0070d0576144f0b47f75a226e4be530",
"account_contract": "0x3c64a1702579c371fc47af9231b5537ba2bfbc82834890216dc0bc5688d1810",
"BalanceSender": "0x7e69b78afa7b96906b7a40aa7b6bb244e9146a1d151af5408498cd7831f0d6d",
"BenchmarkCairoCalls": "0x58dc8a979af32668e05579313d1d6c672d3b668f72778780e8b2e97964159c3",
"Cairo1Helpers": "0x28ece3751ecf5bdf2d791eb64a65bfb6a8816432b698870dba2f38a36101d58",
"Cairo1HelpersFixture": "0x4e7811d9bbba41193bd3c77d05c16f7aaa55dd1d601686b50f6fa0e3766a712",
"replace_class": "0xa187318c5e79b010cf45975f589f0a8d441fadde5b1e7ccad46501568437b5",
"Counter": "0x4fc47610d8c9ce0bcfc2f9e03658f0fbcd3e0a9c351a1aa59d465a33533a7c8",
"MockPragmaOracle": "0x675f00328ff84f127d71b179b3f3a3a06ce8432054770cddd5729c8d62866da",
"StarknetToken": "0x27dd8ce628866f1544202ae06ec57b3c9b1f775d5f7c2797de7aa1586ecf693",
"ERC20": "0x3c5ee4bc12f4247cd8071150c3f5d9bee71f40b0ef7aeae59f468d898f60933",
"kakarot": "0x3f9e4ac97c943181453ce74f1fd1c163c154c40d9cbbbe5c2453512ee1a86e6",
"UniversalLibraryCaller": "0x5e84816dcbfd11581d8d5160af5754a4adc71ab35a0c0aaa053773f61838627",
"BalanceSender": "0x2cc118f56b9d3ad311900db5254f3dca75fbf24de3b68ee670a0fb3691ac5b3"
}
"EVM": "0x5ace47f3aa5e8082d48b8ba8c957ba51c7fd29b457408f465d27bf1c6783e21",
"kakarot": "0x764a6eff6f91d769c066a240c29ed2fa756c71cda385188a8cb1437aaeaf79f",
"MockPragmaOracle": "0x675f00328ff84f127d71b179b3f3a3a06ce8432054770cddd5729c8d62866da",
"OpenzeppelinAccount": "0x6153ccf69fd20f832c794df36e19135f0070d0576144f0b47f75a226e4be530",
"replace_class": "0xa187318c5e79b010cf45975f589f0a8d441fadde5b1e7ccad46501568437b5",
"StarknetToken": "0x314a6a9f01e5a28beb6a7e2e8907243469d98a7e364054657e7593bea5dcee7",
"uninitialized_account_fixture": "0x84ca495a2c045060cb2a0a0abe69d089454c41ecf6627cdc36a724618910d9",
"uninitialized_account": "0x5977621f53b7d1b129446775bd7d5a573f8a87297c6287853d52219ffb90c9",
"UniversalLibraryCaller": "0x244fd35db35b48882ca2e6c2966821bd54f302b131fb22ea98e5534da390482"
}
19 changes: 12 additions & 7 deletions deployments/starknet-sepolia/deployments.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"artifact": "build/kakarot.json"
},
"EVM": {
"address": "0x41c4025537b9677034f3b58f6e722e19c40a7b77a82e3851fdc6b7adf5ad414",
"tx": "0xa0b92fd60470ac35b5a64236bacbe86d6b5aaea30997aced328123cba74024",
"artifact": "build/fixtures/EVM.json"
"address": "0x6ae512c704e2fafbc06e6a6401e9ce02d534aad4bc34400fc1d8d82e88be316",
"tx": "0x515788cd50f04984c5b5cd6c7f75014abbb0b7bdfe449b4c2d24dd6816db756",
"artifact": "None"
},
"Counter": {
"address": "0x2d6741b182475b7cfc62ec1000fbcba553ea08f2e603fa2840d0288cd2d1e3c",
Expand All @@ -20,8 +20,13 @@
"artifact": "build/ssj/contracts_MockPragmaOracle"
},
"UniversalLibraryCaller": {
"address": "0x01e12ea32baf68b1e11c1ce32595d3a61a22ccdcbc67f94c77268b6ce99fa6d4",
"tx": "0x3d6b91602c1e290bc65c6f85751f5ea156cf982d01c6bf1ea694d7398a9d5a5",
"artifact": "cairo1_contracts/utils/target/dev/library_call_UniversalLibraryCaller"
"address": "0x4e23e34042e1f0198311e2dcfc9565c214a48261574f2b37a7f12d1f65100f1",
"tx": "0x3cdee93215396193d9e08e7be3dccc7f6a650ba35f6f57b8762a540ca117816",
"artifact": "cairo1_contracts/utils/target/dev/utils_UniversalLibraryCaller.contract_class.json"
},
"BenchmarkCairoCalls": {
"address": "0x6ea732a6102b65dc04b54ec35304d5f27d1c3fbc81fd6810bd90b126f2e0d11",
"tx": "0x1c5464c82da97a4e9aeb088da8e5a932e4b14204efb192fe7b81dabe327e2d2",
"artifact": "cairo1_contracts/utils/target/dev/utils_BenchmarkCairoCalls.contract_class.json"
}
}
}
2 changes: 1 addition & 1 deletion kakarot_scripts/utils/starknet.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
# Due to some fee estimation issues, we skip it in all the calls and set instead
# this hardcoded value. This has no impact apart from enforcing the signing wallet
# to have at least 0.1 ETH
_max_fee = int(0.05e18)
_max_fee = int(0.09e18)

Artifact = namedtuple("Artifact", ["sierra", "casm"])

Expand Down
4 changes: 2 additions & 2 deletions kakarot_scripts/withdraw_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ async def main():
balance = await get_balance(contract["starknet_contract_address"])
if balance == 0:
logger.info(
f"ℹ️ No balance to withdraw from EVM contract {contract['evm_address']}"
f"ℹ️ No balance to withdraw from EVM contract {contract['evm_contract_address']}"
)
continue

logger.info(
f"ℹ️ Withdrawing {balance / 1e18} ETH from EVM contract {contract['evm_address']}"
f"ℹ️ Withdrawing {balance / 1e18} ETH from EVM contract {contract['evm_contract_address']}"
)
current_class = await RPC_CLIENT.get_class_hash_at(
contract["starknet_contract_address"]
Expand Down
11 changes: 2 additions & 9 deletions tests/fixtures/BalanceSender.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,9 @@
from openzeppelin.access.ownable.library import Ownable
from starkware.cairo.common.cairo_builtins import HashBuiltin
from starkware.starknet.common.syscalls import replace_class, get_contract_address
from kakarot.interfaces.interfaces import IERC20

@external
func set_implementation{syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_check_ptr}(
new_implementation: felt
) {
Ownable.assert_only_owner();
replace_class(new_implementation);
return ();
}
from kakarot.interfaces.interfaces import IERC20
from kakarot.accounts.account_contract import upgrade

@external
func send_balance{syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_check_ptr}(
Expand Down

0 comments on commit fb81b8c

Please sign in to comment.