Hello everyone.
So I created an OpenZeppelin ERC20 Token called Balloons with 1,000,000,000, and I'm using the OpenZeppelin TokenTimelock contract to lock the tokens.
Contracts are below:
Balloons.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.0 <0.9.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Snapshot.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
/// @custom:security-contact Pavon Dunbar
contract Balloons is ERC20, ERC20Burnable, ERC20Snapshot, Ownable, Pausable {
constructor() ERC20("Balloons", "BALL") {
_mint(msg.sender, 1000000000000000000);
}
function decimals() public view virtual override returns (uint8){
return 9;
}
function snapshot() public onlyOwner {
_snapshot();
}
function pause() public onlyOwner {
_pause();
}
function unpause() public onlyOwner {
_unpause();
}
function mint(address to, uint256 amount) public onlyOwner {
_mint(to, amount);
}
function _beforeTokenTransfer(address from, address to, uint256 amount)
internal
whenNotPaused
override(ERC20, ERC20Snapshot)
{
super._beforeTokenTransfer(from, to, amount);
}
}
Lock.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.0 <0.9.0;
import "@openzeppelin/contracts/token/ERC20/utils/TokenTimelock.sol";
contract Lock is TokenTimelock {
constructor(IERC20 token, address beneficiary, uint256 releaseTime)
TokenTimelock(token, beneficiary, releaseTime)
{}
}
Both of these contracts deployed fine on Ropsten testnet. Here are the links to the deployed contracts:
I sent over 800,000,000 BALL to the Lock contract with no issues. I set the release time to 12:15AM which was within 30 minutes.
However, when I try to release the 800,000,000 BALL to the beneficiary the release fails. This is the message I am receiving:
StatusError: Transaction: 0xefe92f0565169c4b7233b5df485efe84ca014032fa58ace365a0926d8c309253 exited with an error (status 0). Please check that the transaction:
- satisfies all conditions set by Solidity require
statements.
- does not trigger a Solidity revert
statement.
The details are below:
tx: '0xefe92f0565169c4b7233b5df485efe84ca014032fa58ace365a0926d8c309253',
receipt: {
blockHash: '0x052d8f8335faa220bf960696811b540e5ee1b6c6aab58f9b6e9d9b6b800fa76d',
blockNumber: 12106439,
contractAddress: null,
cumulativeGasUsed: 79350,
effectiveGasPrice: '0x24fd3b3c5',
from: '0x73bb00ce96121d4f07bae783c0b79fa1c2801c4f',
gasUsed: 21575,
logs: [],
logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
status: false,
to: '0xee10ac0e54fb0701704277ce825c32ebd4358215',
transactionHash: '0xefe92f0565169c4b7233b5df485efe84ca014032fa58ace365a0926d8c309253',
transactionIndex: 2,
type: '0x2',
rawLogs: []
},
reason: undefined,
hijackedStack: 'StatusError: Transaction: 0xefe92f0565169c4b7233b5df485efe84ca014032fa58ace365a0926d8c309253 exited with an error (status 0). \n' +
' Please check that the transaction:\n' +
' - satisfies all conditions set by Solidity `require` statements.\n' +
' - does not trigger a Solidity `revert` statement.\n' +
'\n' +
' at Object.receipt (/usr/local/lib/node_modules/truffle/build/webpack:/packages/contract/lib/handlers.js:128:1)\n' +
' at runMicrotasks (<anonymous>)\n' +
' at processTicksAndRejections (node:internal/process/task_queues:96:5)\n' +
' at Function.start (/usr/local/lib/node_modules/truffle/build/webpack:/packages/contract/lib/override.js:49:1)'
}
How do I correct this issue so the Lock contract releases the 800,000,000 BALL tokens to the beneficiary?
Thanks in advance to all who respond. You are appreciated.
Pavon