You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having trouble transferring ERC20 tokens. I created the below method to construct a transaction and then broadcasting the raw transaction to the blockchain. here I have a little problem with using ABI! I call the transfer method but IDK how to provide _to & _value to the call function. Also when I call this method my code panics with below information:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Api(Rpc(Error { code: MethodNotFound, message: "The method eth_sendTransaction does not exist/is not available", data: None }))'
Here is my method declaration:
pubasyncfntransfer_erc20_token(contract:Contract<Http>,private_key:SecretKey,from:Address,to:Address,value:U256) -> Result<H256, web3::contract::Error>{let c = contract.call("transfer",(to, value,),
from,ContractOptions::default()).await.unwrap();Ok(c)}
And this is a piece of abi I provided to setup Contract object:
I'm having trouble transferring
ERC20
tokens. I created the below method to construct a transaction and then broadcasting the raw transaction to the blockchain. here I have a little problem with usingABI
! I call thetransfer
method but IDK how to provide_to
&_value
to thecall
function. Also when I call this method my code panics with below information:Here is my method declaration:
And this is a piece of
abi
I provided to setupContract
object:The text was updated successfully, but these errors were encountered: