0

I am new to Solidity. I have deployed a smart contract for a multi-sig wallet on the Rinkeby Testnet. Here I used the IERC20.sol file by Openzeppelin for deposit, withdrawal and checking balances of ERC20 tokens. But when I use it via the Etherscan website, whichever functions make use of IERC20, the gas cost is too high like it's about 0.02 to 0.2 ETH and still it doesn't get through. I am not able to understand what I did that is making the gas cost so high. I am including the gist of the code here. Please help me out.

https://gist.github.com/Shivam78288/ace74df23a3575ca8a214bd4a6e2fc2a

Contract Address on Rinkeby is 0x84B82fCE8d1e13F1944ed58855f1D89D9EE697F8 https://rinkeby.etherscan.io/address/0x84B82fCE8d1e13F1944ed58855f1D89D9EE697F8#code

1 Answer 1

0

The problem is that the contract is trying to transfer Link tokens, but the contract's balance if zero tokens.

From the transaction trace you could see the internal transaction fails

{
  "type": "CALL",
  "from": "0x84b82fce8d1e13f1944ed58855f1d89d9ee697f8",
  "to": "0x01be23585060835e02b77ef475b0cc51aa1e0709",
  "value": "0x0",
  "gas": "0x1ab139f",
  "gasUsed": "0x1ab139f",
  "input": "0xa9059cbb0000000000000000000000004c20685173e021025b2f134dd2412b2d21dc94630000000000000000000000000000000000000000000000004563918244f40000",
  "error": "invalid opcode: opcode 0xfe not defined"
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.