ETH Price: $2,059.77 (+3.11%)

Contract Diff Checker

Contract Name:
BlastsICO

Contract Source Code:

<i class='far fa-question-circle text-muted ms-2' data-bs-trigger='hover' data-bs-toggle='tooltip' data-bs-html='true' data-bs-title='Click on the check box to select individual contract to compare. Only 1 contract can be selected from each side.'></i>

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IUniswapV2Pair {
    function getReserves() external view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast);
}
contract BlastsICO {
    uint256 public rate = 2; 
    address public admin;

    mapping(address => uint256) public buyer;

    constructor() {
        admin = address(0xE82a5F5E23Ad37d25d33ec4FD864dcA1e329d7c6);
    }

    function buy() external payable {

        uint256 amount = msg.value;
        require(amount > 0 , "Amount ether need > 0");
        uint256 chw = getETHPrice()* amount / rate;
        
        (bool sent, ) = admin.call{value: amount}("");
        require(sent, "Failed to send Ether");

        buyer[msg.sender] = buyer[msg.sender] + chw;
        
    }

    receive() external payable {}

   function getETHPrice() public view returns(uint)
   {
    IUniswapV2Pair pair = IUniswapV2Pair(address(0x0d4a11d5EEaaC28EC3F61d100daF4d40471f1852));
    (uint Res0, uint Res1,) = pair.getReserves();
    // decimals
    uint res1 = Res1*(10**12);
    return((res1)/Res0);
   }

}

Please enter a contract address above to load the contract details and source code.

Context size (optional):