ETH Price: $2,108.96 (-10.28%)

Contract

0x2DD8A10EBd28785D964F4f475516912f28AFdAd3
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Advanced mode:
Parent Transaction Hash Block
From
To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SBTCCrowdsale

Compiler Version
v0.6.6+commit.6c089d02

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion, MIT license
/**
 *Submitted for verification at Etherscan.io on 2020-09-07
*/

// File: browser/github/OpenZeppelin/openzeppelin-contracts/contracts/utils/Address.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.2;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
        // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
        // for accounts without code, i.e. `keccak256('')`
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(account) }
        return (codehash != accountHash && codehash != 0x0);
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return _functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        return _functionCallWithValue(target, data, value, errorMessage);
    }

    function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

// File: browser/github/OpenZeppelin/openzeppelin-contracts/contracts/math/SafeMath.sol

pragma solidity ^0.6.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

// File: browser/SBTCCrowdsale.sol


pragma solidity ^0.6.0;


contract SBTCCrowdsale {
    using SafeMath for uint256;
    using Address for address;
    
    constructor() public { owner = msg.sender; }
    address payable owner;
    
    uint256 public individualMinCap = 1 ether;
    uint256 public individualMaxCap = 5 ether;
    uint256 public crowdsaleHardCap = 262.5 ether;
    uint256 private _weiRaised;

    receive() external payable {
        uint256 weiAmount = msg.value;
        require(weiAmount <= individualMaxCap, "Too much ether transferred (max = 5 ETH)");
        require(weiAmount >= individualMinCap, "Too little ether transferred (min = 1 ETH)");
        require(_weiRaised.add(weiAmount) <= crowdsaleHardCap, "Crowdsale hard cap has been hit");
        
        // update state
        _weiRaised = _weiRaised.add(weiAmount);
    }
    
    function contractOwner() public view returns (address) {
        return owner;
    }
    
    function weiRaised() public view returns (uint256) {
        return _weiRaised;
    }
    
    function withdraw(uint256 amount) public virtual {
        require(owner.send(amount));
    }
    
}

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"contractOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"crowdsaleHardCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"individualMaxCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"individualMinCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weiRaised","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

6080604052670de0b6b3a7640000600155674563918244f40000600255680e3aeb5737240a000060035534801561003557600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506104bd806100856000396000f3fe6080604052600436106100595760003560e01c80632e1a7d4d146101c85780634042b66f14610203578063744bb8d21461022e578063ce606ee014610259578063d1614df3146102b0578063f5a30cee146102db576101c3565b366101c35760003490506002548111156100be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806104366028913960400191505060405180910390fd5b600154811015610119576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a81526020018061045e602a913960400191505060405180910390fd5b6003546101318260045461030690919063ffffffff16565b11156101a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f43726f776473616c6520686172642063617020686173206265656e206869740081525060200191505060405180910390fd5b6101ba8160045461030690919063ffffffff16565b60048190555050005b600080fd5b3480156101d457600080fd5b50610201600480360360208110156101eb57600080fd5b810190808035906020019092919050505061038e565b005b34801561020f57600080fd5b506102186103f0565b6040518082815260200191505060405180910390f35b34801561023a57600080fd5b506102436103fa565b6040518082815260200191505060405180910390f35b34801561026557600080fd5b5061026e610400565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102bc57600080fd5b506102c5610429565b6040518082815260200191505060405180910390f35b3480156102e757600080fd5b506102f061042f565b6040518082815260200191505060405180910390f35b600080828401905083811015610384576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050506103ed57600080fd5b50565b6000600454905090565b60035481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60015481565b6002548156fe546f6f206d756368206574686572207472616e7366657272656420286d6178203d20352045544829546f6f206c6974746c65206574686572207472616e7366657272656420286d696e203d20312045544829a2646970667358221220c447bd16ba349c02479d016ffeec5dea99b47c20d0c1cc77f6b4b20351ad3e5164736f6c63430006060033

Deployed Bytecode

0x6080604052600436106100595760003560e01c80632e1a7d4d146101c85780634042b66f14610203578063744bb8d21461022e578063ce606ee014610259578063d1614df3146102b0578063f5a30cee146102db576101c3565b366101c35760003490506002548111156100be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806104366028913960400191505060405180910390fd5b600154811015610119576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a81526020018061045e602a913960400191505060405180910390fd5b6003546101318260045461030690919063ffffffff16565b11156101a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f43726f776473616c6520686172642063617020686173206265656e206869740081525060200191505060405180910390fd5b6101ba8160045461030690919063ffffffff16565b60048190555050005b600080fd5b3480156101d457600080fd5b50610201600480360360208110156101eb57600080fd5b810190808035906020019092919050505061038e565b005b34801561020f57600080fd5b506102186103f0565b6040518082815260200191505060405180910390f35b34801561023a57600080fd5b506102436103fa565b6040518082815260200191505060405180910390f35b34801561026557600080fd5b5061026e610400565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102bc57600080fd5b506102c5610429565b6040518082815260200191505060405180910390f35b3480156102e757600080fd5b506102f061042f565b6040518082815260200191505060405180910390f35b600080828401905083811015610384576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050506103ed57600080fd5b50565b6000600454905090565b60035481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60015481565b6002548156fe546f6f206d756368206574686572207472616e7366657272656420286d6178203d20352045544829546f6f206c6974746c65206574686572207472616e7366657272656420286d696e203d20312045544829a2646970667358221220c447bd16ba349c02479d016ffeec5dea99b47c20d0c1cc77f6b4b20351ad3e5164736f6c63430006060033

Deployed Bytecode Sourcemap

11799:1128:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12205:17;12225:9;12205:29;;12266:16;;12253:9;:29;;12245:82;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12359:16;;12346:9;:29;;12338:84;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12470:16;;12441:25;12456:9;12441:10;;:14;;:25;;;;:::i;:::-;:45;;12433:89;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12581:25;12596:9;12581:10;;:14;;:25;;;;:::i;:::-;12568:10;:38;;;;12167:447;11799:1128;;12:1:-1;9;2:12;12823:95:0;;5:9:-1;2:2;;;27:1;24;17:12;2:2;12823:95:0;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;12823:95:0;;;;;;;;;;;;;;;;;:::i;:::-;;12724:87;;5:9:-1;2:2;;;27:1;24;17:12;2:2;12724:87:0;;;:::i;:::-;;;;;;;;;;;;;;;;;;;12080:45;;5:9:-1;2:2;;;27:1;24;17:12;2:2;12080:45:0;;;:::i;:::-;;;;;;;;;;;;;;;;;;;12626:86;;5:9:-1;2:2;;;27:1;24;17:12;2:2;12626:86:0;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;11984:41;;5:9:-1;2:2;;;27:1;24;17:12;2:2;11984:41:0;;;:::i;:::-;;;;;;;;;;;;;;;;;;;12032;;5:9:-1;2:2;;;27:1;24;17:12;2:2;12032:41:0;;;:::i;:::-;;;;;;;;;;;;;;;;;;;7270:181;7328:7;7348:9;7364:1;7360;:5;7348:17;;7389:1;7384;:6;;7376:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7442:1;7435:8;;;7270:181;;;;:::o;12823:95::-;12891:5;;;;;;;;;;;:10;;:18;12902:6;12891:18;;;;;;;;;;;;;;;;;;;;;;;12883:27;;12:1:-1;9;2:12;12883:27:0;12823:95;:::o;12724:87::-;12766:7;12793:10;;12786:17;;12724:87;:::o;12080:45::-;;;;:::o;12626:86::-;12672:7;12699:5;;;;;;;;;;;12692:12;;12626:86;:::o;11984:41::-;;;;:::o;12032:::-;;;;:::o

Swarm Source

ipfs://c447bd16ba349c02479d016ffeec5dea99b47c20d0c1cc77f6b4b20351ad3e51

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.