Skip to content

Commit

Permalink
Override recipient on deposit (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
karim-en authored Nov 8, 2023
1 parent 1a95a10 commit 0f809c3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion eth-connector/src/connector_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,15 @@ impl EthConnector {
},
// Deposit to Eth accounts
TokenMessageData::Eth {
receiver_id,
mut receiver_id,
message,
} => {
// The 'EthCustodian' contract produces events with the 'eth-connector'
// account as the recipient when depositing to the EVM,
// so here we override the receiver_id for backward compatibility.
if receiver_id == current_account_id {
receiver_id = self.get_account_with_access_right();
}
// Transfer to self and then transfer ETH in `ft_on_transfer`
// address - is NEAR account
let transfer_data = TransferCallCallArgs {
Expand Down

0 comments on commit 0f809c3

Please sign in to comment.