From 79fddfdad8483c416bba78fa8d953ddd84e4ef4e Mon Sep 17 00:00:00 2001 From: notV4l Date: Fri, 5 Jan 2024 17:18:09 +0100 Subject: [PATCH] add Camel impl --- .../mocks/erc20/erc20_balance_mock.cairo | 4 + .../token/erc20/test_erc20_balance.cairo | 74 ++++++++++++++----- .../token/erc20/test_erc20_metadata.cairo | 3 +- .../token/erc20/erc20_balance.cairo | 33 +++++++++ .../token/erc20/erc20_metadata.cairo | 18 +++++ token/src/presets/erc20/bridgeable.cairo | 52 ++++++++----- .../src/presets/erc20/tests_bridgeable.cairo | 40 ++++------ 7 files changed, 161 insertions(+), 63 deletions(-) diff --git a/token/src/components/tests/mocks/erc20/erc20_balance_mock.cairo b/token/src/components/tests/mocks/erc20/erc20_balance_mock.cairo index 75e0cb29..50c7ea81 100644 --- a/token/src/components/tests/mocks/erc20/erc20_balance_mock.cairo +++ b/token/src/components/tests/mocks/erc20/erc20_balance_mock.cairo @@ -46,6 +46,10 @@ mod erc20_balance_mock { impl ERC20BalanceImpl = erc20_balance_component::ERC20BalanceImpl; + #[abi(embed_v0)] + impl ERC20BalanceCamelImpl = + erc20_balance_component::ERC20BalanceCamelImpl; + impl ERC20AllowanceInternalImpl = erc20_allowance_component::InternalImpl; impl ERC20BalanceInternalImpl = erc20_balance_component::InternalImpl; diff --git a/token/src/components/tests/token/erc20/test_erc20_balance.cairo b/token/src/components/tests/token/erc20/test_erc20_balance.cairo index ddedfc5b..5742efbb 100644 --- a/token/src/components/tests/token/erc20/test_erc20_balance.cairo +++ b/token/src/components/tests/token/erc20/test_erc20_balance.cairo @@ -14,7 +14,7 @@ use token::components::token::erc20::erc20_allowance::erc20_allowance_component: }; use token::components::token::erc20::erc20_balance::{erc_20_balance_model, ERC20BalanceModel,}; use token::components::token::erc20::erc20_balance::erc20_balance_component::{ - Transfer, ERC20BalanceImpl, InternalImpl as ERC20BalanceInternalImpl + Transfer, ERC20BalanceImpl, ERC20BalanceCamelImpl, InternalImpl as ERC20BalanceInternalImpl }; use token::components::tests::mocks::erc20::erc20_balance_mock::{ erc20_balance_mock, IERC20BalanceMockDispatcher, IERC20BalanceMockDispatcherTrait @@ -30,7 +30,7 @@ use debug::PrintTrait; // events helpers // -fn assert_eventtransfer_internal( +fn assert_event_transfer( emitter: ContractAddress, from: ContractAddress, to: ContractAddress, value: u256 ) { let event = utils::pop_log::(emitter).unwrap(); @@ -39,10 +39,10 @@ fn assert_eventtransfer_internal( assert(event.value == value, 'Invalid `value`'); } -fn assert_only_eventtransfer_internal( +fn assert_only_event_transfer( emitter: ContractAddress, from: ContractAddress, to: ContractAddress, value: u256 ) { - assert_eventtransfer_internal(emitter, from, to, value); + assert_event_transfer(emitter, from, to, value); utils::assert_no_events_left(emitter); } @@ -71,6 +71,10 @@ fn test_erc20_balance_initialize() { assert(state.erc20_balance.balance_of(ADMIN()) == 0, 'Should be 0'); assert(state.erc20_balance.balance_of(OWNER()) == 0, 'Should be 0'); assert(state.erc20_balance.balance_of(OTHER()) == 0, 'Should be 0'); + + assert(state.erc20_balance.balanceOf(ADMIN()) == 0, 'Should be 0'); + assert(state.erc20_balance.balanceOf(OWNER()) == 0, 'Should be 0'); + assert(state.erc20_balance.balanceOf(OTHER()) == 0, 'Should be 0'); } // @@ -126,12 +130,12 @@ fn test_erc20_balance_transfer_internal() { state.erc20_balance.transfer_internal(ADMIN(), OTHER(), 100); assert(state.erc20_balance.balance_of(ADMIN()) == 320, 'Should be 320'); assert(state.erc20_balance.balance_of(OTHER()) == 1100, 'Should be 1100'); - assert_only_eventtransfer_internal(ZERO(), ADMIN(), OTHER(), 100); + assert_only_event_transfer(ZERO(), ADMIN(), OTHER(), 100); state.erc20_balance.transfer_internal(OTHER(), ADMIN(), 1000); assert(state.erc20_balance.balance_of(ADMIN()) == 1320, 'Should be 1320'); assert(state.erc20_balance.balance_of(OTHER()) == 100, 'Should be 100'); - assert_only_eventtransfer_internal(ZERO(), OTHER(), ADMIN(), 1000); + assert_only_event_transfer(ZERO(), OTHER(), ADMIN(), 1000); } #[test] @@ -189,7 +193,7 @@ fn setup() -> (IWorldDispatcher, IERC20BalanceMockDispatcher) { #[test] #[available_gas(40000000)] -fn test_transfer_internal_from() { +fn test_transfer_from() { let (world, mut erc20_balance_mock) = setup(); utils::impersonate(OWNER()); @@ -202,9 +206,7 @@ fn test_transfer_internal_from() { assert(erc20_balance_mock.transfer_from(OWNER(), RECIPIENT(), VALUE), 'Should return true'); assert_event_approval(erc20_balance_mock.contract_address, OWNER(), SPENDER(), 0); - assert_only_eventtransfer_internal( - erc20_balance_mock.contract_address, OWNER(), RECIPIENT(), VALUE - ); + assert_only_event_transfer(erc20_balance_mock.contract_address, OWNER(), RECIPIENT(), VALUE); // drop StoreSetRecord ERC20AllowanceModel utils::drop_event(world.contract_address); @@ -212,7 +214,7 @@ fn test_transfer_internal_from() { // drop StoreSetRecord ERC20BalanceModel x2 utils::drop_event(world.contract_address); utils::drop_event(world.contract_address); - assert_only_eventtransfer_internal(world.contract_address, OWNER(), RECIPIENT(), VALUE); + assert_only_event_transfer(world.contract_address, OWNER(), RECIPIENT(), VALUE); assert(erc20_balance_mock.balance_of(RECIPIENT()) == VALUE, 'Should eq amount'); assert(erc20_balance_mock.balance_of(OWNER()) == SUPPLY - VALUE, 'Should eq suppy - amount'); @@ -222,7 +224,7 @@ fn test_transfer_internal_from() { #[test] #[available_gas(25000000)] -fn test_transfer_internal_from_doesnt_consume_infinite_allowance() { +fn test_transfer_from_doesnt_consume_infinite_allowance() { let (world, mut erc20_balance_mock) = setup(); utils::impersonate(OWNER()); @@ -234,14 +236,12 @@ fn test_transfer_internal_from_doesnt_consume_infinite_allowance() { utils::impersonate(SPENDER()); erc20_balance_mock.transfer_from(OWNER(), RECIPIENT(), VALUE); - assert_only_eventtransfer_internal( - erc20_balance_mock.contract_address, OWNER(), RECIPIENT(), VALUE - ); + assert_only_event_transfer(erc20_balance_mock.contract_address, OWNER(), RECIPIENT(), VALUE); // drop StoreSetRecord ERC20BalanceModel x2 utils::drop_event(world.contract_address); utils::drop_event(world.contract_address); - assert_only_eventtransfer_internal(world.contract_address, OWNER(), RECIPIENT(), VALUE); + assert_only_event_transfer(world.contract_address, OWNER(), RECIPIENT(), VALUE); assert( erc20_balance_mock.allowance(OWNER(), SPENDER()) == BoundedInt::max(), @@ -253,7 +253,7 @@ fn test_transfer_internal_from_doesnt_consume_infinite_allowance() { #[test] #[available_gas(25000000)] #[should_panic(expected: ('u256_sub Overflow', 'ENTRYPOINT_FAILED'))] -fn test_transfer_internal_from_greater_than_allowance() { +fn test_transfer_from_greater_than_allowance() { let (world, mut erc20_balance_mock) = setup(); utils::impersonate(OWNER()); @@ -268,7 +268,7 @@ fn test_transfer_internal_from_greater_than_allowance() { #[test] #[available_gas(25000000)] #[should_panic(expected: ('ERC20: transfer to 0', 'ENTRYPOINT_FAILED'))] -fn test_transfer_internal_from_to_zero_address() { +fn test_transfer_from_to_zero_address() { let (world, mut erc20_balance_mock) = setup(); utils::impersonate(OWNER()); @@ -281,8 +281,44 @@ fn test_transfer_internal_from_to_zero_address() { #[test] #[available_gas(25000000)] #[should_panic(expected: ('u256_sub Overflow', 'ENTRYPOINT_FAILED'))] -fn test_transfer_internal_from_from_zero_address() { +fn test_transfer_from_from_zero_address() { let (world, mut erc20_balance_mock) = setup(); erc20_balance_mock.transfer_from(ZERO(), RECIPIENT(), VALUE); } + + +// +// transferFrom +// + +#[test] +#[available_gas(40000000)] +fn test_transferFrom() { + let (world, mut erc20_balance_mock) = setup(); + + utils::impersonate(OWNER()); + erc20_balance_mock.approve(SPENDER(), VALUE); + + utils::drop_all_events(erc20_balance_mock.contract_address); + utils::drop_all_events(world.contract_address); + + utils::impersonate(SPENDER()); + assert(erc20_balance_mock.transferFrom(OWNER(), RECIPIENT(), VALUE), 'Should return true'); + + assert_event_approval(erc20_balance_mock.contract_address, OWNER(), SPENDER(), 0); + assert_only_event_transfer(erc20_balance_mock.contract_address, OWNER(), RECIPIENT(), VALUE); + + // drop StoreSetRecord ERC20AllowanceModel + utils::drop_event(world.contract_address); + assert_event_approval(world.contract_address, OWNER(), SPENDER(), 0); + // drop StoreSetRecord ERC20BalanceModel x2 + utils::drop_event(world.contract_address); + utils::drop_event(world.contract_address); + assert_only_event_transfer(world.contract_address, OWNER(), RECIPIENT(), VALUE); + + assert(erc20_balance_mock.balance_of(RECIPIENT()) == VALUE, 'Should eq amount'); + assert(erc20_balance_mock.balance_of(OWNER()) == SUPPLY - VALUE, 'Should eq suppy - amount'); + assert(erc20_balance_mock.allowance(OWNER(), SPENDER()) == 0, 'Should eq 0'); +// assert(erc20_balance_mock.total_supply() == SUPPLY, 'Total supply should not change'); +} diff --git a/token/src/components/tests/token/erc20/test_erc20_metadata.cairo b/token/src/components/tests/token/erc20/test_erc20_metadata.cairo index fdd871fc..82f4b125 100644 --- a/token/src/components/tests/token/erc20/test_erc20_metadata.cairo +++ b/token/src/components/tests/token/erc20/test_erc20_metadata.cairo @@ -5,7 +5,7 @@ use token::tests::constants::{NAME, SYMBOL, DECIMALS}; use token::components::token::erc20::erc20_metadata::{erc_20_metadata_model, ERC20MetadataModel,}; use token::components::token::erc20::erc20_metadata::erc20_metadata_component::{ - ERC20MetadataImpl, ERC20MetadataTotalSupplyImpl, InternalImpl + ERC20MetadataImpl, ERC20MetadataTotalSupplyImpl, ERC20MetadataTotalSupplyCamelImpl, InternalImpl }; use token::components::tests::mocks::erc20::erc20_metadata_mock::erc20_metadata_mock; use token::components::tests::mocks::erc20::erc20_metadata_mock::erc20_metadata_mock::world_dispatcherContractMemberStateTrait; @@ -31,6 +31,7 @@ fn test_erc20_metadata_initialize() { assert(state.erc20_metadata.symbol() == SYMBOL, 'Should be SYMBOL'); assert(state.erc20_metadata.decimals() == DECIMALS, 'Should be 18'); assert(state.erc20_metadata.total_supply() == 0, 'Should be 0'); + assert(state.erc20_metadata.totalSupply() == 0, 'Should be 0'); } #[test] diff --git a/token/src/components/token/erc20/erc20_balance.cairo b/token/src/components/token/erc20/erc20_balance.cairo index 181cb621..adf61fb2 100644 --- a/token/src/components/token/erc20/erc20_balance.cairo +++ b/token/src/components/token/erc20/erc20_balance.cairo @@ -26,6 +26,14 @@ trait IERC20Balance { ) -> bool; } +#[starknet::interface] +trait IERC20BalanceCamel { + fn balanceOf(self: @TState, account: ContractAddress) -> u256; + fn transferFrom( + ref self: TState, sender: ContractAddress, recipient: ContractAddress, amount: u256 + ) -> bool; +} + /// /// ERC20Balance Component /// @@ -33,6 +41,8 @@ trait IERC20Balance { mod erc20_balance_component { use super::ERC20BalanceModel; use super::IERC20Balance; + use super::IERC20BalanceCamel; + use starknet::ContractAddress; use starknet::{get_contract_address, get_caller_address}; use dojo::world::{ @@ -97,6 +107,29 @@ mod erc20_balance_component { } } + #[embeddable_as(ERC20BalanceCamelImpl)] + impl ERC20BalanceCamel< + TContractState, + +HasComponent, + +IWorldProvider, + impl ERC20Allowance: erc20_allowance_comp::HasComponent, + +Drop, + > of IERC20BalanceCamel> { + fn balanceOf(self: @ComponentState, account: ContractAddress) -> u256 { + self.balance_of(account) + } + + fn transferFrom( + ref self: ComponentState, + sender: ContractAddress, + recipient: ContractAddress, + amount: u256 + ) -> bool { + self.transfer_from(sender, recipient, amount) + } + } + + #[generate_trait] impl InternalImpl< TContractState, diff --git a/token/src/components/token/erc20/erc20_metadata.cairo b/token/src/components/token/erc20/erc20_metadata.cairo index 3d6f6059..710deddd 100644 --- a/token/src/components/token/erc20/erc20_metadata.cairo +++ b/token/src/components/token/erc20/erc20_metadata.cairo @@ -30,6 +30,11 @@ trait IERC20MetadataTotalSupply { fn total_supply(self: @TState) -> u256; } +#[starknet::interface] +trait IERC20MetadataTotalSupplyCamel { + fn totalSupply(self: @TState) -> u256; +} + /// /// ERC20Metadata Component /// @@ -38,6 +43,7 @@ mod erc20_metadata_component { use super::ERC20MetadataModel; use super::IERC20Metadata; use super::IERC20MetadataTotalSupply; + use super::IERC20MetadataTotalSupplyCamel; use starknet::get_contract_address; use dojo::world::{ @@ -77,6 +83,18 @@ mod erc20_metadata_component { } } + #[embeddable_as(ERC20MetadataTotalSupplyCamelImpl)] + impl ERC20MetadataTotalSupplyCamel< + TContractState, + +HasComponent, + +IWorldProvider, + +Drop, + > of IERC20MetadataTotalSupplyCamel> { + fn totalSupply(self: @ComponentState) -> u256 { + self.total_supply() + } + } + #[generate_trait] impl InternalImpl< diff --git a/token/src/presets/erc20/bridgeable.cairo b/token/src/presets/erc20/bridgeable.cairo index 0a5525f3..cb5b4c3a 100644 --- a/token/src/presets/erc20/bridgeable.cairo +++ b/token/src/presets/erc20/bridgeable.cairo @@ -3,49 +3,56 @@ use dojo::world::IWorldDispatcher; #[starknet::interface] trait IERC20BridgeablePreset { - // IERC20 + // IWorldProvider + fn world(self: @TState,) -> IWorldDispatcher; + + // IUpgradeable + fn upgrade(ref self: TState, new_class_hash: ClassHash); + + // IERC20Metadata + fn decimals(self: @TState,) -> u8; + fn name(self: @TState,) -> felt252; + fn symbol(self: @TState,) -> felt252; + + // IERC20MetadataTotalSupply fn total_supply(self: @TState,) -> u256; + + // IERC20MetadataTotalSupplyCamel + fn totalSupply(self: @TState,) -> u256; + + // IERC20Balance fn balance_of(self: @TState, account: ContractAddress) -> u256; - fn allowance(self: @TState, owner: ContractAddress, spender: ContractAddress) -> u256; fn transfer(ref self: TState, recipient: ContractAddress, amount: u256) -> bool; fn transfer_from( ref self: TState, sender: ContractAddress, recipient: ContractAddress, amount: u256 ) -> bool; - fn approve(ref self: TState, spender: ContractAddress, amount: u256) -> bool; - // IERC20CamelOnly - fn totalSupply(self: @TState,) -> u256; + // IERC20BalanceCamel fn balanceOf(self: @TState, account: ContractAddress) -> u256; fn transferFrom( ref self: TState, sender: ContractAddress, recipient: ContractAddress, amount: u256 ) -> bool; - // IERC20Metadata - fn name(self: @TState,) -> felt252; - fn symbol(self: @TState,) -> felt252; - fn decimals(self: @TState,) -> u8; + // IERC20Allowance + fn allowance(self: @TState, owner: ContractAddress, spender: ContractAddress) -> u256; + fn approve(ref self: TState, spender: ContractAddress, amount: u256) -> bool; // IERC20SafeAllowance - fn increase_allowance(ref self: TState, spender: ContractAddress, added_value: u256) -> bool; fn decrease_allowance( ref self: TState, spender: ContractAddress, subtracted_value: u256 ) -> bool; + fn increase_allowance(ref self: TState, spender: ContractAddress, added_value: u256) -> bool; // IERC20SafeAllowanceCamel - fn increaseAllowance(ref self: TState, spender: ContractAddress, addedValue: u256) -> bool; fn decreaseAllowance(ref self: TState, spender: ContractAddress, subtractedValue: u256) -> bool; + fn increaseAllowance(ref self: TState, spender: ContractAddress, addedValue: u256) -> bool; // IERC20Bridgeable + fn burn(ref self: TState, account: ContractAddress, amount: u256); fn l2_bridge_address(self: @TState,) -> ContractAddress; fn mint(ref self: TState, recipient: ContractAddress, amount: u256); - fn burn(ref self: TState, account: ContractAddress, amount: u256); - - // IWorldProvider - fn world(self: @TState,) -> IWorldDispatcher; - - // IUpgradeable - fn upgrade(ref self: TState, new_class_hash: ClassHash); + // WITHOUT INTERFACE !!! fn initializer( ref self: TState, name: felt252, @@ -54,6 +61,7 @@ trait IERC20BridgeablePreset { recipient: ContractAddress, l2_bridge_address: ContractAddress ); + fn dojo_resource(self: @TState,) -> felt252; } @@ -132,10 +140,18 @@ mod ERC20Bridgeable { impl ERC20MetadataTotalSupplyImpl = erc20_metadata_component::ERC20MetadataTotalSupplyImpl; + #[abi(embed_v0)] + impl ERC20MetadataTotalSupplyCamelImpl = + erc20_metadata_component::ERC20MetadataTotalSupplyCamelImpl; + #[abi(embed_v0)] impl ERC20BalanceImpl = erc20_balance_component::ERC20BalanceImpl; + #[abi(embed_v0)] + impl ERC20BalanceCamelImpl = + erc20_balance_component::ERC20BalanceCamelImpl; + #[abi(embed_v0)] impl ERC20AllowanceImpl = erc20_allowance_component::ERC20AllowanceImpl; diff --git a/token/src/presets/erc20/tests_bridgeable.cairo b/token/src/presets/erc20/tests_bridgeable.cairo index b6aab763..0c3fe8a7 100644 --- a/token/src/presets/erc20/tests_bridgeable.cairo +++ b/token/src/presets/erc20/tests_bridgeable.cairo @@ -50,7 +50,7 @@ use token::components::tests::token::erc20::test_erc20_allowance::{ assert_event_approval, assert_only_event_approval }; use token::components::tests::token::erc20::test_erc20_balance::{ - assert_eventtransfer_internal, assert_only_eventtransfer_internal + assert_event_transfer, assert_only_event_transfer }; @@ -139,7 +139,7 @@ fn test_approve() { #[test] #[available_gas(30000000)] -fn test_transfer_internal() { +fn test_transfer() { let (world, mut erc20_bridgeable) = setup(); utils::impersonate(OWNER()); @@ -154,10 +154,8 @@ fn test_transfer_internal() { utils::drop_event(world.contract_address); utils::drop_event(world.contract_address); - assert_only_eventtransfer_internal( - erc20_bridgeable.contract_address, OWNER(), RECIPIENT(), VALUE - ); - assert_only_eventtransfer_internal(world.contract_address, OWNER(), RECIPIENT(), VALUE); + assert_only_event_transfer(erc20_bridgeable.contract_address, OWNER(), RECIPIENT(), VALUE); + assert_only_event_transfer(world.contract_address, OWNER(), RECIPIENT(), VALUE); } @@ -167,7 +165,7 @@ fn test_transfer_internal() { #[test] #[available_gas(40000000)] -fn test_transfer_internal_from() { +fn test_transfer_from() { let (world, mut erc20_bridgeable) = setup(); utils::impersonate(OWNER()); @@ -181,9 +179,7 @@ fn test_transfer_internal_from() { assert(erc20_bridgeable.transfer_from(OWNER(), RECIPIENT(), VALUE), 'Should return true'); assert_event_approval(erc20_bridgeable.contract_address, OWNER(), SPENDER(), 0); - assert_only_eventtransfer_internal( - erc20_bridgeable.contract_address, OWNER(), RECIPIENT(), VALUE - ); + assert_only_event_transfer(erc20_bridgeable.contract_address, OWNER(), RECIPIENT(), VALUE); // drop StoreSetRecord ERC20AllowanceModel utils::drop_event(world.contract_address); @@ -191,7 +187,7 @@ fn test_transfer_internal_from() { // drop StoreSetRecord ERC20BalanceModel x2 utils::drop_event(world.contract_address); utils::drop_event(world.contract_address); - assert_only_eventtransfer_internal(world.contract_address, OWNER(), RECIPIENT(), VALUE); + assert_only_event_transfer(world.contract_address, OWNER(), RECIPIENT(), VALUE); assert(erc20_bridgeable.balance_of(RECIPIENT()) == VALUE, 'Should eq amount'); assert(erc20_bridgeable.balance_of(OWNER()) == SUPPLY - VALUE, 'Should eq suppy - amount'); @@ -201,7 +197,7 @@ fn test_transfer_internal_from() { #[test] #[available_gas(25000000)] -fn test_transfer_internal_from_doesnt_consume_infinite_allowance() { +fn test_transfer_from_doesnt_consume_infinite_allowance() { let (world, mut erc20_bridgeable) = setup(); utils::impersonate(OWNER()); @@ -213,14 +209,12 @@ fn test_transfer_internal_from_doesnt_consume_infinite_allowance() { utils::impersonate(SPENDER()); erc20_bridgeable.transfer_from(OWNER(), RECIPIENT(), VALUE); - assert_only_eventtransfer_internal( - erc20_bridgeable.contract_address, OWNER(), RECIPIENT(), VALUE - ); + assert_only_event_transfer(erc20_bridgeable.contract_address, OWNER(), RECIPIENT(), VALUE); // drop StoreSetRecord ERC20BalanceModel x2 utils::drop_event(world.contract_address); utils::drop_event(world.contract_address); - assert_only_eventtransfer_internal(world.contract_address, OWNER(), RECIPIENT(), VALUE); + assert_only_event_transfer(world.contract_address, OWNER(), RECIPIENT(), VALUE); assert( erc20_bridgeable.allowance(OWNER(), SPENDER()) == BoundedInt::max(), @@ -293,15 +287,13 @@ fn test_bridge_can_mint() { utils::impersonate(BRIDGE()); erc20_bridgeable.mint(RECIPIENT(), VALUE); - assert_only_eventtransfer_internal( - erc20_bridgeable.contract_address, ZERO(), RECIPIENT(), VALUE - ); + assert_only_event_transfer(erc20_bridgeable.contract_address, ZERO(), RECIPIENT(), VALUE); // drop StoreSetRecord ERC20BalanceModel x2 utils::drop_event(world.contract_address); utils::drop_event(world.contract_address); - assert_only_eventtransfer_internal(world.contract_address, ZERO(), RECIPIENT(), VALUE); + assert_only_event_transfer(world.contract_address, ZERO(), RECIPIENT(), VALUE); assert(erc20_bridgeable.balance_of(RECIPIENT()) == VALUE, 'Should eq VALUE'); } @@ -323,21 +315,19 @@ fn test_bridge_can_burn() { utils::impersonate(BRIDGE()); erc20_bridgeable.mint(RECIPIENT(), VALUE); - assert_only_eventtransfer_internal( - erc20_bridgeable.contract_address, ZERO(), RECIPIENT(), VALUE - ); + assert_only_event_transfer(erc20_bridgeable.contract_address, ZERO(), RECIPIENT(), VALUE); utils::drop_all_events(erc20_bridgeable.contract_address); utils::drop_all_events(world.contract_address); erc20_bridgeable.burn(RECIPIENT(), 1); - assert_only_eventtransfer_internal(erc20_bridgeable.contract_address, RECIPIENT(), ZERO(), 1); + assert_only_event_transfer(erc20_bridgeable.contract_address, RECIPIENT(), ZERO(), 1); // drop StoreSetRecord ERC20BalanceModel x2 utils::drop_event(world.contract_address); utils::drop_event(world.contract_address); - assert_only_eventtransfer_internal(world.contract_address, RECIPIENT(), ZERO(), 1); + assert_only_event_transfer(world.contract_address, RECIPIENT(), ZERO(), 1); assert(erc20_bridgeable.balance_of(RECIPIENT()) == VALUE - 1, 'Should eq VALUE-1'); }