Skip to content

Commit

Permalink
refactor : remove 'replace_class' in proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
enitrat committed Sep 25, 2024
1 parent 24d6f15 commit 9399e36
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 22 deletions.
10 changes: 0 additions & 10 deletions src/kakarot/accounts/uninitialized_account.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,6 @@ func __l1_default__{syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_check_
return ();
}

// TODO: Remove this function for mainnet
@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 ();
}

@view
func get_owner{syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_check_ptr}() -> (owner: felt) {
return Ownable.owner();
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/uninitialized_account_fixture.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ from kakarot.accounts.uninitialized_account import (
constructor,
__default__,
__l1_default__,
set_implementation,
get_owner,
)

Expand Down
2 changes: 0 additions & 2 deletions tests/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@

ZERO_ADDRESS = "0x" + 40 * "0"

ACCOUNT_CLASS_IMPLEMENTATION = 0xC0DEC1A55

BLOCK_NUMBER = 0x42
BLOCK_TIMESTAMP = int(time())

Expand Down
10 changes: 1 addition & 9 deletions tests/utils/syscall_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@
)

from kakarot_scripts.utils.uint256 import int_to_uint256, uint256_to_int
from tests.utils.constants import (
ACCOUNT_CLASS_IMPLEMENTATION,
CAIRO1_HELPERS_CLASS_HASH,
CHAIN_ID,
)
from tests.utils.constants import CAIRO1_HELPERS_CLASS_HASH, CHAIN_ID


def cairo_keccak(class_hash, calldata):
Expand Down Expand Up @@ -196,10 +192,6 @@ class SyscallHandler:
get_selector_from_name(
"verify_signature_secp256r1"
): cairo_verify_signature_secp256r1,
get_selector_from_name("get_implementation"): lambda addr, data: [
ACCOUNT_CLASS_IMPLEMENTATION
],
get_selector_from_name("set_implementation"): lambda addr, data: [],
get_selector_from_name("get_cairo1_helpers_class_hash"): lambda addr, data: [
CAIRO1_HELPERS_CLASS_HASH
],
Expand Down

0 comments on commit 9399e36

Please sign in to comment.