Skip to content
Verified contractPartial

NcovDeadPool

Address0xf2f97c5b9e3f221aedfbf80d21e1ea04464b8220
Balance

0 ETH

 

Transactions

38

 

Compiler

solc 0.4.24

 

Same code

Only this contract

 

Details

Compiler
solc 0.4.24+commit.e67f0147
Language
solidity
Optimization
No
License
Not stated
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
9,717,698
Creation transaction
0x04969ee7ec…b996e48f3c

NcovDeadPool.sol

pragma solidity ^0.4.24;

contract ERC20Token {
  function transferFrom(address from, address to, uint value);
  function transfer(address recipient, uint256 amount);
}

contract Stats {
  function getDay( uint128 day) public view returns (uint);
}


contract NcovDeadPool  {
    struct Bet {
       uint256 amount;
       uint128 day;
       uint256 infections;
    }
    Stats statsc = Stats(0x8413746B162795eFf7d3C8a90e32B8921413b802);
    function abssub(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a - b;
        return c >= 0 ? c : -c;
    }
    ERC20Token tok = ERC20Token(0x10Ef64cb79Fd4d75d4Aa7e8502d95C42124e434b);
    mapping(address => Bet) public bets;
    function bet(uint256 amount, uint128 day, uint256 infections) public {
        require(bets[msg.sender].amount == 0, "Address already made a bet");
        require(amount <= 50000000000000000000000 && amount >= 0, "Amount must be between 0 and 50k");
        require(statsc.getDay(day) == 0, "Past dates not allowed");  
        tok.transferFrom(msg.sender, address(this), amount);
        bets[msg.sender] = Bet({amount:amount, day:day, infections:infections});
}
    function reward(uint256 amount) internal {
        bets[msg.sender] = Bet({amount:0, day:0, infections:0});
        tok.transfer(msg.sender, amount);
    }
    function claim() public {
        require(bets[msg.sender].amount > 0, "No bet found");
        uint resinf = statsc.getDay(bets[msg.sender].day);  
        require(resinf > 0, "No burn happened yet");
        uint myinf = bets[msg.sender].infections;
        uint diffinf = abssub(resinf, myinf);
        uint myamount = bets[msg.sender].amount;
        if (diffinf <= 50000000000000000000) {
            reward(myamount*3);
        } else if (diffinf <= 80000000000000000000) {
            reward(myamount*2);
        } else if (diffinf <= 200000000000000000000) {
            reward(myamount*3/2);
        } else if (diffinf <= 300000000000000000000) {
            reward(myamount*13/10);
        } else if (diffinf <= 400000000000000000000) {
            reward(myamount*6/5);
        } else if (diffinf <= 500000000000000000000) {
            reward(myamount*11/10);
        } else {
            bets[msg.sender] = Bet({amount:0, day:0, infections:0});
        }
}
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 0,
    "enabled": false
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.