I'm trying to write function which will be transfer erc-20 tokens in hedera hashgraph.
pragma solidity ^0.8.7;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract Coins is ERC20 {
constructor(string memory name_, string memory symbol_) ERC20(name_, symbol_) {
_mint(msg.sender, 1000000000000000000000);
}
}
very simple solidity contract
then i deploy it in hedera
tx, err := hedera.NewContractCreateFlow().
SetBytecode(bytecode).
SetGas(1_000_000).
SetConstructorParameters(
hedera.NewContractFunctionParameters().
AddString("Coins").
AddString("coin"),
).
Execute(client)
then i've trying to transfer some erc-20 tokens to other address
ps, _ := hedera.NewContractFunctionParameters().
AddAddress(hedera.AccountID{Account: 34937758}.ToSolidityAddress())
ps.AddUint256(big.NewInt(1).Bytes())
contractExecTx, err := hedera.NewContractExecuteTransaction().
SetContractID(newContractID).
SetGas(1000000).
SetFunction("transfer", ps).
Execute(client)
and i got error StatusContractRevertExecuted (33)
is it possible to use ERC-20 tokens as a usual in Ethereum? or i have to use HTS only? is it possible to use solidity contract and register it as token in Hedera?
thank you so much