Skip to content

Commit

Permalink
Revert "Change transferFrom to transfer on send ETH (#35)"
Browse files Browse the repository at this point in the history
This reverts commit 5800202.
  • Loading branch information
brunocampos-ssa authored Feb 7, 2024
1 parent 5800202 commit d52697b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packages/kos-sdk/src/chains/ethereum/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,13 @@ impl ETH {
if !is_eth_token {
// update contract data for token transfer
let contract = evm20::get_contract_evm20();
let func = contract.function("transfer").map_err(|e| {
Error::InvalidMessage(format!("failed to get transfer function: {}", e))
let func = contract.function("transferFrom").map_err(|e| {
Error::InvalidMessage(format!("failed to get transferFrom function: {}", e))
})?;

let encoded = func
.encode_input(&[
ethabi::Token::Address(addr_sender.into()),
ethabi::Token::Address(addr_receiver.into()),
ethabi::Token::Uint(
U256::from_dec_str(&amount.to_string())
Expand Down
2 changes: 1 addition & 1 deletion packages/kos-sdk/src/chains/evm20.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const EVM20_CONTRACT_ABI: &str = r#"
}
],
"payable": false,
"stateMutability": "nonpayable",
"stateMutability": "nonpayable",
"type": "function"
},
{
Expand Down

0 comments on commit d52697b

Please sign in to comment.