fix isContract

This commit is contained in:
owen05
2021-06-28 23:58:24 +08:00
parent 62794dc9cc
commit fa5faaee39
2 changed files with 4 additions and 2 deletions

View File

@@ -84,7 +84,8 @@ contract DODODropsV1 is ERC721URIStorage, InitializableOwnable {
function redeemPrize(uint256 ticketNum) external {
require(_REDEEM_ALLOWED_, "REDEEM_CLOSED");
require(!address(msg.sender).isContract(), "ONLY_ALLOW_EOA");
// require(!address(msg.sender).isContract(), "ONLY_ALLOW_EOA");
require(tx.origin == msg.sender, "ONLY_ALLOW_EOA");
require(ticketNum >= 1 && ticketNum <= _USER_TICKETS_[msg.sender], "TICKET_NUM_INVALID");
_USER_TICKETS_[msg.sender] = _USER_TICKETS_[msg.sender].sub(ticketNum);
_TOTAL_TICKETS_ = _TOTAL_TICKETS_.sub(ticketNum);

View File

@@ -132,7 +132,8 @@ contract DODODrops is InitializableMintableERC20, ReentrancyGuard {
}
function redeemTicket(uint256 ticketNum, address referer) external {
require(!address(msg.sender).isContract(), "ONLY_ALLOW_EOA");
// require(!address(msg.sender).isContract(), "ONLY_ALLOW_EOA");
require(tx.origin == msg.sender, "ONLY_ALLOW_EOA");
require(ticketNum >= 1 && ticketNum <= balanceOf(msg.sender), "TICKET_NUM_INVALID");
_burn(msg.sender,ticketNum);
for (uint256 i = 0; i < ticketNum; i++) {