01.RugPull @lock token
2023-09-18 11:09:04 # 13.RugPull

RugPull @lock token

an easy rug pull contract

project team is the owner, he promises he won’t transfer his asset until next year. He will show u the transfer(). In fact, he can transfer his asset by transferFrom()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract LockCoin is ERC20{
uint256 lockTime = block.timestamp + 365 days;
address owner;

constructor() ERC20("MyCoin","MC"){
owner = msg.sender;
_mint(msg.sender, 100*10**18);
}

modifier lock(){
if(msg.sender == owner) require(block.timestamp > lockTime);
_;
}

function transfer(address to, uint256 amount) public virtual override lock returns(bool){
return super.transfer(to, amount);
}

}
Prev
2023-09-18 11:09:04 # 13.RugPull
Next