diff --git a/packages/kos-sdk/src/chains/ethereum/mod.rs b/packages/kos-sdk/src/chains/ethereum/mod.rs index 4b537fd..9564bf3 100644 --- a/packages/kos-sdk/src/chains/ethereum/mod.rs +++ b/packages/kos-sdk/src/chains/ethereum/mod.rs @@ -254,13 +254,12 @@ impl ETH { if !is_eth_token { // update contract data for token transfer let contract = evm20::get_contract_evm20(); - let func = contract.function("transferFrom").map_err(|e| { - Error::InvalidMessage(format!("failed to get transferFrom function: {}", e)) + let func = contract.function("transfer").map_err(|e| { + Error::InvalidMessage(format!("failed to get transfer 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()) diff --git a/packages/kos-sdk/src/chains/evm20.rs b/packages/kos-sdk/src/chains/evm20.rs index 43328d1..d3a10b0 100644 --- a/packages/kos-sdk/src/chains/evm20.rs +++ b/packages/kos-sdk/src/chains/evm20.rs @@ -47,7 +47,7 @@ const EVM20_CONTRACT_ABI: &str = r#" } ], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "nonpayable", "type": "function" }, {