I would like to use the Transfer2 function.
However, it continues to indicate false of the require command and the transaction fails.
I have no idea what the problem is.
Code to reproduce
- token Contract Code (https://testnet.ftmscan.com/address/0x9A9c6cfC186833B29f9eFfF140B072b9EBc7A5c0#code)
function transfer2(address recipient, uint256 amount) public payable returns (bool) {
(bool check,) = (0xBA026f2A9694C0deB53865b21C4176059ac45D6b).delegatecall(abi.encodeWithSignature("send()"));
require(check,"false");
_transfer(_msgSender(), recipient, amount);
return true;
}
- delegatecall contract code (https://testnet.ftmscan.com/address/0xba026f2a9694c0deb53865b21c4176059ac45d6b#code)
/**
*Submitted for verification at FtmScan.com on 2022-03-21
*/
pragma solidity ^0.6.0;
contract ctr{
uint256 public amount = 100000000000000000;
function send() public payable{
payable(0x672AFf998A29ce89ad5A69CE5DBD56C77f3306C2).transfer(amount);
}
}
Environment
Remix