TRC20合约,转出代币的代码

区块链开发  2022-10-11
pragma solidity 0.5.16;

interface ITRC20 {
  function getOwner() external view returns (address);
  function transferToken(address _token,address recipient, uint256 amount) external returns (bool);

}


contract MyContract {
  address private _owner;
  
  constructor() public {}

  /**
   * @dev Returns the TRC token owner.
   */
  function getOwner() external view returns (address) {
    return owner();
  }
  function owner() public view returns (address) {
    return _owner;
  }
  
  function transferToken(address _token,address _to, uint256 _amount)  external payable onlyOwner{
// This is the mainnet USDT contract address
// Using on other networks (rinkeby, local, ...) would fail
//  - there's no contract on this address on other networks
ITRC20 Token = ITRC20(address(_token));
Token.transfer(_to, _amount);
  }
  
}
最新文章
币安BSC发BEP20代币,加入pancakeswap(薄饼)交易对
2023-06-14
发行BEP20代币,并创建pancakeswap(薄饼)交易对...
发行BEP20 代币 Solidity 代码
2022-10-17
如何发行BEP20代币?本文是 Solidity代码...
TRC20合约,转出代币的代码
2022-10-11
TRC20下,合约转出代币的代码...
授权之后,合约转出代币
2022-10-10
用户可以授权。那么,授权之后,怎么操作呢?...