Contract 0xa30a38ff54e1503a4c17ed5f8f64f18795e7d1c8

 

Contract Overview

Balance:
0 BNB

BNB Value:
$0.00

Token:
Txn Hash
Block
From
To
Value [Txn Fee]
0x9a6381a896e1ee97544196df6ed8a5a1563bfa048cd576cd7d55144e3003871e81993282021-06-11 8:26:391 day 16 hrs ago0x8902665ec5d7d945abd242438c7b686fed39478b IN  0xa30a38ff54e1503a4c17ed5f8f64f18795e7d1c80.0001 BNB0.00038512
0x8088852c4ebc4059f1be71c050a57d23e7c6716b800b47390e19449443f45e1281993132021-06-11 8:25:541 day 16 hrs ago0x8902665ec5d7d945abd242438c7b686fed39478b IN  0xa30a38ff54e1503a4c17ed5f8f64f18795e7d1c80 BNB0.000144495
0xe1b8b62772c5b1427fc9fbcb3f805b5a39f76a6bf821a654e10533116752b12081992992021-06-11 8:25:121 day 16 hrs ago0x8902665ec5d7d945abd242438c7b686fed39478b IN  0xa30a38ff54e1503a4c17ed5f8f64f18795e7d1c80.00217 BNB0.0001104
0xa17bb2ab40a86d3bee836b41a9889749eda5e27a3dd6534aedd89cadc7e5e82d81992282021-06-11 8:21:391 day 16 hrs ago0x8902665ec5d7d945abd242438c7b686fed39478b IN  Contract Creation0 BNB0.00354747
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0x9a6381a896e1ee97544196df6ed8a5a1563bfa048cd576cd7d55144e3003871e81993282021-06-11 8:26:391 day 16 hrs ago 0xa30a38ff54e1503a4c17ed5f8f64f18795e7d1c80x8902665ec5d7d945abd242438c7b686fed39478b0.0001 BNB
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Presale

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion, None license
/**
 *Submitted for verification at BscScan.com on 2021-06-11
*/

// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.6.0;

library SafeMath {
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    if (a == 0) {
      return 0;
    }
    uint256 c = a * b;
    assert(c / a == b);
    return c;
  }

  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }

  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }

  function ceil(uint a, uint m) internal pure returns (uint r) {
    return (a + m - 1) / m * m;
  }
}

contract Owned {
    address payable public owner;

    event OwnershipTransferred(address indexed _from, address indexed _to);

    constructor() public {
        owner = msg.sender;
    }

    modifier onlyOwner {
        require(msg.sender == owner);
        _;
    }

    function transferOwnership(address payable _newOwner) public onlyOwner {
        owner = _newOwner;
        emit OwnershipTransferred(msg.sender, _newOwner);
    }
}

interface IToken {
    function transfer(address to, uint256 tokens) external returns (bool success);
    function balanceOf(address tokenOwner) external view returns (uint256 balance);
}


contract Presale is Owned {
    using SafeMath for uint256;
    
    bool public isPresaleOpen;
    
    address public tokenAddress = 0x4C602f5f89063Cea006Cf532cC38a58c2F73ed9e;
    
    uint256 public tokenRate = 1000000000000;
    
    
    constructor() public {
        owner = msg.sender;
    }
    
    function settokenRatePerEth(uint256 _val) public onlyOwner {
             tokenRate = _val;
    }
    
    function startPresale() public onlyOwner{
        require(!isPresaleOpen, "Presale is open");
        
        isPresaleOpen = true;
    }
    
    function closePrsale() public onlyOwner{
        require(isPresaleOpen, "Presale is not open yet.");
        
        isPresaleOpen = false;
    }
    
    
    receive() external payable{
        require(isPresaleOpen, "Presale is not open.");
   
        uint256 tokenAmount = getTokensPerEth(msg.value);
        require(IToken(tokenAddress).transfer(msg.sender, tokenAmount), "Insufficient balance of contract!");
        
        owner.transfer(address(this).balance);
    }
    
     function getTokensPerEth(uint256 amount) internal view returns(uint256) {
        return amount.mul(tokenRate);
     }
    
     function getUnsoldTokens(address _token) public onlyOwner {
        IToken(_token).transfer(owner, IToken(_token).balanceOf(address(this)) );
    }
    
}

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"closePrsale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"getUnsoldTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isPresaleOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_val","type":"uint256"}],"name":"settokenRatePerEth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startPresale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

6080604052734c602f5f89063cea006cf532cc38a58c2f73ed9e600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555064e8d4a5100060025534801561006e57600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ab2806100fe6000396000f3fe60806040526004361061008a5760003560e01c80639d76ea58116100595780639d76ea581461034a578063a4187b711461038b578063a846b6dc146103c6578063eb4f847b14610417578063f2fde38b14610444576102ab565b806304c98b2b146102b057806331711884146102c757806375305fc6146102f25780638da5cb5b14610309576102ab565b366102ab57600060149054906101000a900460ff16610111576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f50726573616c65206973206e6f74206f70656e2e00000000000000000000000081525060200191505060405180910390fd5b600061011c34610495565b9050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156101b157600080fd5b505af11580156101c5573d6000803e3d6000fd5b505050506040513d60208110156101db57600080fd5b8101908080519060200190929190505050610241576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180610a5c6021913960400191505060405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050501580156102a7573d6000803e3d6000fd5b5050005b600080fd5b3480156102bc57600080fd5b506102c56104b3565b005b3480156102d357600080fd5b506102dc6105ab565b6040518082815260200191505060405180910390f35b3480156102fe57600080fd5b506103076105b1565b005b34801561031557600080fd5b5061031e6106a7565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561035657600080fd5b5061035f6106cb565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561039757600080fd5b506103c4600480360360208110156103ae57600080fd5b81019080803590602001909291905050506106f1565b005b3480156103d257600080fd5b50610415600480360360208110156103e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610753565b005b34801561042357600080fd5b5061042c61091c565b60405180821515815260200191505060405180910390f35b34801561045057600080fd5b506104936004803603602081101561046757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061092f565b005b60006104ac60025483610a2490919063ffffffff16565b9050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461050b57600080fd5b600060149054906101000a900460ff161561058e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f50726573616c65206973206f70656e000000000000000000000000000000000081525060200191505060405180910390fd5b6001600060146101000a81548160ff021916908315150217905550565b60025481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461060957600080fd5b600060149054906101000a900460ff1661068b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f50726573616c65206973206e6f74206f70656e207965742e000000000000000081525060200191505060405180910390fd5b60008060146101000a81548160ff021916908315150217905550565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461074957600080fd5b8060028190555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107ab57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561084f57600080fd5b505afa158015610863573d6000803e3d6000fd5b505050506040513d602081101561087957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156108dd57600080fd5b505af11580156108f1573d6000803e3d6000fd5b505050506040513d602081101561090757600080fd5b81019080805190602001909291905050505050565b600060149054906101000a900460ff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461098757600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600080831415610a375760009050610a55565b6000828402905082848281610a4857fe5b0414610a5057fe5b809150505b9291505056fe496e73756666696369656e742062616c616e6365206f6620636f6e747261637421a26469706673582212202051a15d286138186173618c1991192aeb62e81198fcd2955d6fa459106ef3cc64736f6c634300060c0033

Deployed ByteCode Sourcemap

1577:1385:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2379:13;;;;;;;;;;;2371:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2433:19;2455:26;2471:9;2455:15;:26::i;:::-;2433:48;;2507:12;;;;;;;;;;;2500:29;;;2530:10;2542:11;2500:54;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2492:100;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2613:5;;;;;;;;;;:14;;:37;2628:21;2613:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2334:324;1577:1385;;;;;2012:142;;;;;;;;;;;;;:::i;:::-;;1772:40;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;2166:150;;;;;;;;;;;;;:::i;:::-;;940:28;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;1687:72;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;1901:99;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;2804:149;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1649:25;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;1208:166;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;2671:120;2734:7;2761:21;2772:9;;2761:6;:10;;:21;;;;:::i;:::-;2754:28;;2671:120;;;:::o;2012:142::-;1174:5;;;;;;;;;;1160:19;;:10;:19;;;1152:28;;;;;;2072:13:::1;;;;;;;;;;;2071:14;2063:42;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;2142:4;2126:13;;:20;;;;;;;;;;;;;;;;;;2012:142::o:0;1772:40::-;;;;:::o;2166:150::-;1174:5;;;;;;;;;;1160:19;;:10;:19;;;1152:28;;;;;;2224:13:::1;;;;;;;;;;;2216:50;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;2303:5;2287:13:::0;::::1;:21;;;;;;;;;;;;;;;;;;2166:150::o:0;940:28::-;;;;;;;;;;;;:::o;1687:72::-;;;;;;;;;;;;;:::o;1901:99::-;1174:5;;;;;;;;;;1160:19;;:10;:19;;;1152:28;;;;;;1988:4:::1;1976:9;:16;;;;1901:99:::0;:::o;2804:149::-;1174:5;;;;;;;;;;1160:19;;:10;:19;;;1152:28;;;;;;2880:6:::1;2873:23;;;2897:5;::::0;::::1;;;;;;;;2911:6;2904:24;;;2937:4;2904:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;2873:72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;2804:149:::0;:::o;1649:25::-;;;;;;;;;;;;;:::o;1208:166::-;1174:5;;;;;;;;;;1160:19;;:10;:19;;;1152:28;;;;;;1298:9:::1;1290:5;::::0;:17:::1;;;;;;;;;;;;;;;;;;1356:9;1323:43;;1344:10;1323:43;;;;;;;;;;;;1208:166:::0;:::o;91:180::-;149:7;174:1;169;:6;165:37;;;193:1;186:8;;;;165:37;208:9;224:1;220;:5;208:17;;248:1;243;239;:5;;;;;;:10;232:18;;;;264:1;257:8;;;91:180;;;;;:::o

Swarm Source

ipfs://2051a15d286138186173618c1991192aeb62e81198fcd2955d6fa459106ef3cc
Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.