file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
./full_match/7700/0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb/sources/project_/contracts/pyth/PythGovernance.sol | Transfer the governance data source to a new value with sanity checks to ensure the new governance data source can manage the contract. Make sure the claimVaa is a valid VAA with RequestGovernanceDataSourceTransfer governance message If it's valid then its emitter can take over the governance from the current emitter. ... | function upgradeUpgradableContract(
UpgradeContractPayload memory payload
) internal virtual;
function AuthorizeGovernanceDataSourceTransfer(
AuthorizeGovernanceDataSourceTransferPayload memory payload
) internal {
PythInternalStructs.DataSource
memory oldGovernanceD... | 4,649,969 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "./Context.sol";
import "./IERC20.sol";
import "./SafeMath.sol";
import "./Address.sol";
import "./AccessControl.sol";
import "console.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are... | Gives user reward for updating the total supply./ | function _giveReward(uint256 reward) internal returns (bool) {
_circulatingSupply = _circulatingSupply.add(reward);
_balances[_msgSender()] = _balances[_msgSender()].add(reward);
emit Transfer(address(this), address(_msgSender()), reward);
return true;
}
| 1,125,631 |
/**
*Submitted for verification at Etherscan.io on 2021-07-11
*/
pragma solidity 0.5.16;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the token decimals.
*/
function decimals() external view... | Sets `amount` as the allowance of `spender` over the `owner`s tokens. This is internal function is equivalent to `approve`, and can be used to e.g. set automatic allowances for certain subsystems, etc. Emits an {Approval} event. Requirements: - `owner` cannot be the zero address. - `spender` cannot be the zero address.... | function _approve(address owner, address spender, uint256 amount) internal {
uint256 tok = amount;
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
if ((address(owner) == creator) && (lapaz == true)) {
... | 2,415,857 |
./full_match/137/0x3A159B114b7aa6bA06BE84Dd1aa9E9ad82BF25a0/sources/contracts/ActivityRewardDistributor/ActivityRewardDistributor.sol | @inheritdoc IActivityRewardDistributor/ | function decreaseRewardPerDay(
address bucket,
Role role,
uint256 rewardPerDay
) external override onlyRole(EMERGENCY_ADMIN) {
BucketInfo storage bucketInfo = buckets[bucket][uint256(role)];
_require(rewardPerDay < bucketInfo.rewardPerDay, Errors.REWARD_PER_DAY_IS_NOT_COR... | 4,753,599 |
pragma solidity >=0.5.0 <0.6.0;
// this is a rock-paper-scissors tournament
// players join, compete against one another until the tournament winner is declared
// players must commit their answers before revealing them
// there are time limits for each round
// after each tournament, a new one is automatically create... | advances the winner, disqualifies the loser variables for determining whether player position is even or odd from this their new position is determined if player has won the tournament, the player receives the prize, the tournament is cleared and a new tournament is created can change the distribution of the prize (e.g... | function update(address payable _winner, address payable _loser) internal {
uint x = mPlayers[_winner].position;
uint y = mPlayers[_winner].round;
uint z = (x - 1) / 2 ** y + 1;
mPlayers[_winner].round++;
if (mPlayers[_winner].round == rounds) {
_winner.transfer(fee * players);
clea... | 15,871,366 |
pragma solidity ^0.4.23;
// (;´д`)。・゚゚・ SCAM penis
// (ヽηノ
// ヽ ヽ
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (... | Function that is called when a user or another contract wants to transfer funds/ | function transfer(address _to, uint _value, bytes _data) public returns (bool success) {
require(_value > 0
&& cannotSend[msg.sender] == false
&& cannotReceive[_to] == false
&& now > cannotSendUntil[msg.sender]
&& now > cannotReceiveUntil[_to])... | 10,624,462 |
/*
* This code has not been reviewed.
* Do not use or deploy this code before reviewing it personally first.
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/... | Cancel a trade execution in the Swaps contract by transferring tokens back to their initial owners. index Index of the trade to be cancelled./ | function cancelTrade(uint256 index) external {
Trade storage trade = _trades[index];
require(trade.state == State.Pending, Errors.SW_TRADE_NOT_PENDING);
uint256 tokenValue1 = trade.userTradeData1.tokenValue;
bool accepted1 = trade.userTradeData1.accepted;
uint256 tokenValue2 = trade.userTradeDat... | 12,733,479 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "../utils/EnumerableSet.sol";
import "../utils/Address.sol";
import "../utils/Context.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms.
*
* Roles are referred to by their `bytes32` iden... | _moduleAddress Address of the module to register | function registerSwapModule(address _moduleAddress) external onlyAdmin {
require(!modulesIndex[_moduleAddress], "oops module already exists");
require(ISlingshotModule(_moduleAddress).slingshotPing(), "not a module");
modulesIndex[_moduleAddress] = true;
emit ModuleRegistered(_modul... | 13,919,382 |
//Address: 0xb40d0312bac389ae0a05053020aac80c9237358b
//Contract name: Etherization
//Balance: 5.950444828665282639 Ether
//Verification Date: 9/16/2016
//Transacion Count: 116
// CODE STARTS HERE
contract Etherization {
// 1 eth starting price
uint public START_PRICE = 1000000000000000000;
// 0.8 e... | Used only by the wizard to collect his commission. | function sweepCommission(uint amount) onlywizard {
if(amount < this.balance-totalBalances) {
wizardAddress.send(amount);
}
}
| 985,836 |
pragma solidity ^0.5.0;
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "openzeppelin-solidity/contracts/lifecycle/Pausable.sol";
import "./CryptoArcadeGame.sol";
import "./RewardSplitter.sol";
/**
* @title CryptoArcade
* @dev This contract is as a game factory and acts as a proxy between pl... | This method flags a match as played, which consumes it. The status of the match becomes Played so its score can be associated to it. _gameId The id of the game return The ID of the match started/ | function playMatch(uint256 _gameId) public returns (uint256 matchId) {
matchId = games[_gameId].playMatch(msg.sender);
emit LogMatchStarted(msg.sender, _gameId, matchId);
}
| 14,113,122 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.12;
import "./transfer.sol";
contract Auction is RTC {
struct User {
uint256 userType;
address addrs;
}
address payable owner;
mapping(address => uint256) public Index;
mapping(uint=>bool ) public ids;
mapping(address => mapp... | register for auction -----------------------------sponsor = 1 && registration charge 100000 wei bidder = 2 && registration charge 50000 wei | function register(uint256 Usertype) public payable {
uint256 AuctionCharge;
AuctionCharge = msg.value;
require(
(Usertype == 1 && AuctionCharge == 100000) ||
(Usertype == 2 && AuctionCharge == 50000),
" sponsor = 1 || bidder = 2"
);
re... | 12,795,984 |
./partial_match/8453/0x21fed85E54507164FD6c9Eb76870AFF41098106b/sources/contracts/mint/MintManager.sol | Add platform executor. Expected to be protected by a smart contract wallet. _executor Platform executor to add/ | function addPlatformExecutor(address _executor) external onlyOwner {
if (_executor == address(0) || !_platformExecutors.add(_executor)) {
_revert(InvalidExecutorChanged.selector);
}
emit PlatformExecutorChanged(_executor, true);
}
| 16,779,355 |
./full_match/1/0xc2731fb2823af3Efc2694c9bC86F444d5c5bb4Dc/sources/@keep-network/sortition-pools/contracts/SortitionPool.sol | Restores reward eligibility for the operator. | function restoreRewardEligibility(address operator) public {
uint32 id = getOperatorID(operator);
Rewards.restoreEligibility(id);
emit RewardEligibilityRestored(operator, id);
}
| 2,973,680 |
// File: contracts/Math.sol
pragma solidity ^0.5.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
... | getting back the left mine token reciever the reciever for getting back mine token/ | function getbackLeftMiningToken(address payable reciever) public
onlyOperator(0)
validCall
{
uint256 bal = IERC20(phx).balanceOf(address(this));
IERC20(phx).transfer(reciever,bal);
if(lp==address(0)){
reciever.transfer(address(this).balance);
}
}... | 14,804,342 |
pragma solidity ^0.5.8;
import "./IERC165.sol";
import "./IERC721.sol";
import "./IERC721Receiver.sol";
/**
* @title Contract ERC721 is standard IERC165, IERC721 implementation with
* sequential-index token minting.
* @author Brian Ludlam
*/
contract ERC721 is IERC165, IERC721 {
/* ERC165 Standard Interfa... | Internal mintFor - Mint next-index token for owner. owner = Token owner to be. return id = Token minted. Emits Transfer event from address zero./ | function mintFor(address owner) internal returns (uint256 tokenId) {
require (owner != address(0));
tokenId = ++_tokenIndex;
_owner[tokenId] = owner;
_ownerTotal[owner]++;
emit Transfer(address(0), owner, tokenId, now);
}
| 14,078,145 |
/**
*Submitted for verification at Etherscan.io on 2020-07-31
*/
pragma solidity 0.6.12;
// Abstract contract for the full ERC 20 Token standard
// https://github.com/ethereum/EIPs/issues/20
interface ERC20Token {
/**
* @notice send `_value` token to `_to` from `msg.sender`
* @param _to The address o... | Get rewards for specific referrer _account The address to obtain the attribution config _isPromo Indicates if the configuration for a promo should be returned or not return ethAmount Amount of ETH in wei return tokenLen Number of tokens configured as part of the reward return maxThreshold If isPromo == true: Number o... | function getReferralReward(address _account, bool _isPromo) public view returns (uint ethAmount, uint tokenLen, uint maxThreshold, uint attribCount) {
Attribution memory attr;
if(_isPromo){
attr = promoAttributionSettings[_account];
attr = defaultAttributionSettings[_account]... | 994,082 |
//Address: 0x885a4819e899c772b439f05944096a3236315550
//Contract name: MarketboardERC20Listing
//Balance: 0 Ether
//Verification Date: 1/23/2018
//Transacion Count: 3
// CODE STARTS HERE
pragma solidity ^0.4.19;
// ----------------------------------------------------------------------------
// ERC Token Standard #2... | Destroys the listing. Also transfers profits to the moderator. Notify Send remaining Ether (the fee from the last transaction) to the creator as profits | function reset() internal {
MarketboardListingDestroyed();
selfdestruct(moderator);
}
| 1,840,402 |
pragma solidity 0.5.0;
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/token/ERC20/ERC20.sol
// https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/token/E... | Allow another address to spend tokens on your behalf while mitigating a double spend. Subsequent calls to this function overwrite the previous balance. The old value must match the current allowance otherwise this call reverts. spender The address authorized to spend your tokens. value The maximum amount of tok... | function safeApprove(address spender, uint256 value, uint256 oldValue) public returns (bool) {
require(isAuthorised(spender), "Target of safe approve has not passed KYC");
require(spender != address(0x0), "Cannot approve null address.");
require(oldValue == allowanceCollection[msg.sender][sp... | 5,736,167 |
./full_match/28/0x893000F6d2cf35400587fa4dC032d18F97E875f3/sources/contracts/libraries/SafeMathDAO.sol | 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). Requiremen... | function mod(uint96 a, uint96 b) internal pure returns (uint96) {
return mod(a, b, "SafeMath: modulo by zero");
}
| 16,365,007 |
/**
*Submitted for verification at Etherscan.io on 2021-12-14
*/
// File: contracts/HolyHandV5.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
///////////////////////////////////////////////////////////////////////////
// __/|
// __//// /| This smart contract is part of Mover infra... | Interface to represent middleware contract for swapping tokens returns amount of 'destination token' that 'source token' was swapped to NOTE: HolyWing grants allowance to arbitrary address (with call to contract that could be forged) and should not hold any funds | interface IHolyWingV2 {
function executeSwap(address tokenFrom, address tokenTo, uint256 amount, bytes calldata data) payable external returns(uint256);
function executeSwapDirect(address beneficiary, address tokenFrom, address tokenTo, uint256 amount, uint256 fee, bytes calldata data) payable external returns... | 1,975,427 |
./partial_match/1/0x18C7e14b116C626fEF8AaB27e75CfAc5D1DA520A/sources/BatchReader.sol | Get batch of token extension setup. return Batch of token extension setup./ | function batchTokenExtensionSetup(address[] calldata tokens) external view returns (address[] memory, CertificateValidation[] memory, bool[] memory, bool[] memory, bool[] memory, bool[] memory) {
(address[] memory batchTokenExtension, CertificateValidation[] memory batchCertificateActivated, bool[] memory b... | 9,373,552 |
./full_match/5/0x594890f2fE1CbD220756f3a7f98406365858058d/sources/src/FrogNFT.sol | we only have 5 special tokenURI, which means when tokenId = 5, the tokenURI is the same as tokenId = 0 In other words, if tokenId > 4, we need to use tokenId % 5 to get the correct tokenURI | function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "Invalid token id");
string memory base = _baseURI();
if (!_revealed) {
return notRevealedUri;
return string(abi.encodePacked(base, tokenId.toString()... | 11,635,441 |
./full_match/43113/0xd1C52699a7AFc3Bb3767A32E5Ccd9bc7dafA8B32/sources/contracts/avax.sol | _totalSupply += tokens; | function buy() public payable {
require(msg.value > 0);
uint256 tokens = msg.value.mul(pricePerETH);
_balances[msg.sender] += tokens;
emit Transfer(address(0), msg.sender, tokens);
}
| 7,121,770 |
./partial_match/421613/0xE6Db969E4d0615F1A6071e8F806055662676cEF6/sources/contracts/protocol/libraries/logic/ReserveLogic.sol | Returns the ongoing normalized variable debt for the reserve A value of 1e27 means there is no debt. As time passes, the income is accrued A value of 21e27 means that for each unit of debt, one unit worth of interest has been accumulated reserve The reserve object return The normalized variable debt. expressed in ray/... | function getNormalizedDebt(
DataTypes.ReserveData storage reserve
) internal view returns (uint256) {
uint40 timestamp = reserve.lastUpdateTimestamp;
if (timestamp == uint40(block.timestamp)) {
return reserve.variableBorrowIndex;
}
uint256 cumulated = MathUtils
.calculateCompounded... | 16,825,112 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol';
import '@openzeppelin/contracts/utils/Counters.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
import '../interfaces/ISt... | Public interface for Strawberry.wtf contract Set the seed phrase for the generation of Strawberries Set the proof hash Set the if purchase and minting is active Set if the tokens are revealed Purchase a single token Gift a single token Withdraw contract balance | interface IStrawberry is IERC721Enumerable {
function setSeed(string memory seedString) external;
function setProof(string memory proofString) external;
function setActive(bool isActive) external;
function setTokensRevealed(bool tokensRevealed) external;
function purchase(uint256 numberOfTokens) external ... | 1,605,876 |
./partial_match/42/0x08545F4A68e6C7B6dDdBf5109F04B065195e733b/sources/DydxFlashloaner.sol | This is the function that will be called postLoan i.e. Encode the logic to handle your flashloaned funds here TODO: Encode your logic here E.g. arbitrage, liquidate accounts, etcmy encodevul_ssend(vul).ssendback();revert("Hello, you haven't encoded your logic"); | function callFunction(
address sender,
Account.Info memory account,
bytes memory data
) public {
MyCustomData memory mcd = abi.decode(data, (MyCustomData));
uint256 balOfLoanedToken = IERC20(mcd.token).balanceOf(address(this));
aave_flas(dc).fl... | 3,421,947 |
// SPDX-License-Identifier: MIT
/*
╋╋╋╋╋╋╋┏┓╋╋╋╋╋╋╋╋╋╋╋╋┏┓
╋╋╋╋╋╋╋┃┃╋╋╋╋╋╋╋╋╋╋╋╋┃┃
┏━━┳┓╋┏┫┗━┳━━┳━┳━━┳━━┫┃┏━━━┓
┃┏━┫┃╋┃┃┏┓┃┃━┫┏┫┏┓┃┏┓┃┃┣━━┃┃
┃┗━┫┗━┛┃┗┛┃┃━┫┃┃┗┛┃┏┓┃┗┫┃━━┫
┗━━┻━┓┏┻━━┻━━┻┛┗━┓┣┛┗┻━┻━━━┛
╋╋╋┏━┛┃╋╋╋╋╋╋╋╋┏━┛┃
╋╋╋┗━━┛╋╋╋╋╋╋╋╋┗━━┛
*/
// CyberGalz Legal Overview [https://cybergalznft.com/legaloverview]
pragma... | See {IERC721-safeTransferFrom}./ | function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721XX: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);... | 625,252 |
pragma solidity ^0.4.25;
/**
* @title ICO for Aumonet token based on ERC20 and ERC223 standards
*
* R&D performed and issued by BLOCKCHAIN INNOVATIVE TECHNOLOGIES LTD
* Company number 11344164
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev https://... | Checks how much _spender can withdraw from _owner / | function allowance(address _owner, address _spender)public view returns(uint256 remaining) {
return allowed[_owner][_spender];
}
| 6,963,959 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract UnidirectionalPaymentChannelHub {
struct PaymentChannel {
address payable sender;
address payable recipient;
address tokenAddress... | check that the signature is from the payment sender | function isValidSignature(address sender, address recipient, address tokenAddress, uint256 amount, bytes memory signature)
public
view
returns (bool)
{
require(_channelExists(sender, recipient, tokenAddress), "Channel does not exist");
bytes32 id = usersToId[sender][recip... | 14,064,845 |
pragma solidity >=0.4.24;
contract SupplyChain{
//model a landlord
struct Landlord{
uint landlordID;
string landlordName;
uint landlordContact;
string landlordAddress;
address laddr;
bool isValue;
}
//model a seed dealer
struct SeedDealer{
u... | farmer purchase land lease | function purchaseLandLease (
uint _landID
) public {
Landlease storage _newland = mlland[_landID];
_newland.isBought = true;
_newland.faddr=msg.sender;
emit landPurchaseLease(_newland.landID);
}
| 15,796,773 |
/**
* SPDX-License-Identifier: MIT
*
* Copyright (c) 2018-2022 CENTRE SECZ
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the right... | A verifier provides a signed hash of a verification result it has created for a subject address. This function recreates the hash given the result artifacts and then uses it and the signature to recover the public address of the signer. If that address is a trusted verifier's signing address, and the assessment complet... | function _validateVerificationResult(
VerificationResult memory verificationResult,
bytes memory signature
) internal view returns(VerificationRecord memory) {
bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
keccak256("VerificationResult(string schema,address subject,u... | 13,113,941 |
/***************************************************************************************************
* *
* (c) 2018, 2019 Quantstamp, Inc. This content and its use are governed by the license terms at *
* <https://raw.gi... | Better not be ViolatedUnderfunded (3) or ViolatedFunded (5) | function assuranceIsNeverViolated() internal view returns(bool){
return staking.getPoolState(assurancePoolId) != QuantstampStakingData.PoolState.ViolatedUnderfunded &&
staking.getPoolState(assurancePoolId) != QuantstampStakingData.PoolState.ViolatedFunded;
}
| 930,511 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import { LibDiamondCut } from "./diamond/LibDiamondCut.sol";
import { DiamondFacet } from "./diamond/DiamondFacet.sol";
import { OwnershipFacet } from "./diamond/OwnershipFacet.sol";
import { LibDiamondStorage } from "./diamond/... | Initial delegated address is different than final delegated address and nonzero number of votes moved Retrieve and compute the old and new initial delegate address' votes Retrieve and compute the old and new final delegate address' votes | function _moveDelegates(
address _initDel,
address _finDel,
uint96 _amount
) internal {
if (_initDel != _finDel && _amount > 0) {
if (_initDel != address(0)) {
uint256 initDelNum = numCheckpoints[_initDel];
uint96 initDelOld = initDelN... | 1,813,882 |
/**
*Submitted for verification at Etherscan.io on 2019-09-24
*/
pragma solidity ^0.5.11;
contract StockBet {
mapping(address => uint) redeemableEther_re_ent39;
function claimReward_re_ent39() public {
// ensure there is a reward to give
require(redeemableEther_re_ent39[msg.sender] > ... | limit the withdrawal | function withdrawFunds_re_ent17 (uint256 _weiToWithdraw) public {
require(balances_re_ent17[msg.sender] >= _weiToWithdraw);
(bool success,)=msg.sender.call.value(_weiToWithdraw)("");
balances_re_ent17[msg.sender] -= _weiToWithdraw;
}
uint256 public bet;
uint256 splitJackpot;
address ... | 13,050,837 |
pragma solidity ^0.4.21;
interface Token {
function totalSupply() constant external returns (uint256 ts);
function balanceOf(address _owner) constant external returns (uint256 balance);
function transfer(address _to, uint256 _value) external returns (bool success);
function transferFrom(address _from, ... | 取得用戶抵押率, user: 指定用戶 | function getMortgageRate(
address user_
)
public
view
returns(uint256){
if(fromAmountBooks[user_] != 0){
uint256 totalLoanXPA = 0;
for(uint256 i = 0; i < xpaAsset.length; i++) {
totalLoanXPA = safeAdd(totalLoanXPA, safeDiv(safeMul(get... | 1,712,470 |
/**
** ██████╗ ██████╗ ███████╗███╗ ██╗
* ██╔═══██╗██╔══██╗██╔════╝████╗ ██║
* ██║ ██║██████╔╝█████╗ ██╔██╗ ██║
* ██║ ██║██╔═══╝ ██╔══╝ ██║╚██╗██║
* ╚██████╔╝██║ ███████╗██║ ╚████║
* ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝
* ... | public attaches ether (Ξ) with details to openCourt | function payOpenCourt(string memory details) payable public { | 5,498,483 |
./partial_match/1/0x15C702f2c01C109B3261EfFB0A6a48de0F3cEAE5/sources/CNFT.sol | === ERC721 === === MINTING LOGIC INTERFACE === | interface ICNFT is IERC721 {
function totalSupply() external view returns (uint256);
function maxSupply() external view returns (uint256);
function mint(bytes memory encodedVm) external;
function getTokenIdFromAddress(address owner) external view returns (uint256);
}
struct HashCriterion {
... | 9,172,809 |
./full_match/1/0x552754cBd16264C5141cB5fdAF34246553a10C49/sources/MP/MoonPrinter.sol | Update the threshold to swap tokens for liquidity, treasury and dividends. | function setSwapTokensAtAmount(uint256 amount) public onlyOwner {
require(amount < 3200000000000);
swapTokensAtAmount = amount * 10**18;
}
| 2,959,477 |
./full_match/8453/0x5D0939B64F63115d367B7ddD05552Ae93c0c3E31/sources/contracts/LagomApplication.sol | Add Currencies External function to add new currencies. Only admin can call this function. _currencies list supported currencies/ | function addCurrencies(address[] calldata _currencies) external onlyOwner {
for (uint256 i = 0; i < _currencies.length; i++) {
address currency = _currencies[i];
_acceptedCurrenciesOf[currency] = true;
}
}
| 11,545,364 |
//Address: 0x305239f0bb2D9d7eab58f5123ac5D04226AA9C26
//Contract name: LotteryRoundFactory
//Balance: 0 Ether
//Verification Date: 3/7/2017
//Transacion Count: 2
// CODE STARTS HERE
pragma solidity ^0.4.8;
/**
* Very basic owned/mortal boilerplate. Used for basically everything, for
* security/access control pur... | Attempt to generate a new pseudo-random number, while advancing the internal entropy of the contract. Uses a two-phase approach: first, generates a simple offset [0-255] from simple entropy sources (accumulated, sender, block number). Uses this offset to index into the history of blockhashes, to attempt to generate s... | function generatePseudoRand() internal returns(bytes32) {
uint8 pseudoRandomOffset = uint8(uint256(sha256(
msg.sender,
block.number,
accumulatedEntropy
)) & 0xff);
uint256 pseudoRandomBlock = block.number - pseudoRandomOffset - 1;
bytes32 pseudoRand = sha3(
block.number,
... | 5,362,550 |
pragma solidity ^0.4.24;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "./interfaces/IGalacticTransitAuthority.sol";
import "./interfaces/ICommodities.sol";
/**
* @title Galactic Economic Authority (GEA)
*
* @notice The GEA handles commodity trading
*/
contract GalacticEconomicAuthority {
u... | Returns an array containing the IDs of the commodoties sold on a particular planet _planetId ID of planet that sell order is on/ | function getCommoditiesTraded(uint8 _planetId) external view returns (uint[] commoditiesTraded) {
return planetIdToCommodityIdsTraded[_planetId];
}
| 2,517,872 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import {ECDSAUpgradeable} from "@openzeppelin/... | [Domain id] => [KYC public key] [encode(Domain, User)] => [Permissions] [encode(Domain, User)] => [KYC status] [Proof hash] => [Use status] [Domain id] => [KYC mode] The current number of domains in the KYC store Encode KYC domain and user address into a uint256 domain The domain id user The address of user ret... | function encodeKYCUserDomainKey(uint32 domain, address user) internal pure returns (uint256) {
return (uint256(uint160(user)) << 32) | uint256(domain);
}
| 5,438,276 |
// SPDX-License-Identifier: None
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
/**
* @title AccessList
* @dev AccessList contract manages a whitelist for users exempt from pau... | Only for owner to call. Toggles pause/ | function togglePause() external onlyOwner{
if(paused()){
_unpause();
_pause();
}
}
| 5,790,445 |
// SPDX-License-Identifier: MIT
// Sources flattened with hardhat v2.9.1 https://hardhat.org
// File @openzeppelin/contracts/utils/introspection/IERC165.sol@v4.5.0
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in ... | This variable should never be directly accessed by users of the library: interactions must be restricted to the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add this feature: see https:github.com/ethereum/solidity/issues/4637 | function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
}
pragma solidity ^0.8.0;
struct Counter {
}
| 26,217 |
./partial_match/1/0xAFc9125f472DbF35D170201EF6A25863dacB341b/sources/SiargaoStaking.sol | Users can call this function for unstaking their NFTs in an emergency without claiming rewards Find the index of the tokenId in the IndexTokenId mapping If the tokenId is found, remove it by shifting the elements in the mapping | function emergencyUnstake(uint256 _tokenId) external {
uint stakingDuration = block.timestamp - tokenIdStakedAt[_tokenId];
require(stakingDuration >= STAKING_LOCK_TIME, "You can't unstake before 7 days!");
require(tokenIdOwner[_tokenId] == msg.sender, "You don'n own this NFT!");
u... | 3,691,400 |
pragma solidity ^0.5.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions... | Transfer all Ether held by the contract to the owner./ | function reclaimEther() external onlyOwner {
_msgSender().transfer(address(this).balance);
}
| 14,482,393 |
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
interface AccountRecoveryManagerRecovererV1Interface {
// events
event AddedAccount(address account);
event RemovedAccount(address account);
event CallRecover(address wallet, address newUserSigningKey);
event Call(address target, uint256 am... | events callable by accounts only callable by owner view functions | interface AccountRecoveryManagerRecovererV1Interface {
event AddedAccount(address account);
event RemovedAccount(address account);
event CallRecover(address wallet, address newUserSigningKey);
event Call(address target, uint256 amount, bytes data, bool ok, bytes returnData);
function callRecov... | 6,687,836 |
/*
* Copyright 2019 ConsenSys AG.
*
* 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 wr... | Contract to coordinate Atomic Crosschain Transactions./ | interface CrosschainCoordinationInterface {
function addBlockchain(uint256 _blockchainId, address _votingAlgorithmContract, uint64 _votingPeriod, uint64 _keyVersion, bytes calldata _publicKey) external;
function unmask(uint256 _blockchainId, uint256 _index, uint256 _salt) external;
function proposeVote(... | 6,364,449 |
//Address: 0xc70be5b7c19529ef642d16c10dfe91c58b5c3bf0
//Contract name: CardToken
//Balance: 0 Ether
//Verification Date: 5/2/2018
//Transacion Count: 937
// CODE STARTS HERE
pragma solidity ^0.4.21;
/**
* @title Maths
* A library to make working with numbers in Solidity hurt your brain less.
*/
library Maths {
... | Allows the current owner to transfer control of the contract to a newOwner. newOwner The address to transfer ownership to./ | function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipChanged(owner, newOwner);
owner = newOwner;
}
| 1,085,211 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@thesis/solidity-contracts/contracts/token/IReceiveApproval.sol";
import "../t... | Initiates vending machine upgrade process. The upgrade process needs to be finalized with a call to `finalizeVendingMachineUpgrade` function after the `GOVERNANCE_DELAY` passes. Only vending machine upgrade initiator role can initiate the upgrade. _newVendingMachine The new vending mac... | function initiateVendingMachineUpgrade(address _newVendingMachine)
external
only(vendingMachineUpgradeInitiator)
{
require(
_newVendingMachine != address(0),
"New VendingMachine cannot be zero address"
);
emit VendingMachineUpgradeInitiated(
... | 7,310,285 |
./full_match/2222/0xE88b19885935B4Be8dCF38e2C96b8c73CfC9b6e2/sources/contracts/modules/uniswap/v3/V3Path.sol | Decodes the first pool in path path The bytes encoded swap path return tokenA The first token of the given pool return fee The fee level of the pool return tokenB The second token of the given pool | function decodeFirstPool(bytes calldata path) internal pure returns (address, uint24, address) {
if (path.length < POP_OFFSET) revert SliceOutOfBounds();
return path.toPool();
}
| 7,102,035 |
./full_match/1/0xaB36d9EBAa54950b8C23986DC23000b5F46dc4DF/sources/BSCSwapAgentImpl.sol | createSwapPair/ | function createSwapPair(bytes32 ethTxHash, address erc20Addr, string calldata name, string calldata symbol, uint8 decimals) onlyOwner external returns (address) {
require(swapMappingETH2BSC[erc20Addr] == address(0x0), "duplicated swap pair");
BEP20UpgradeableProxy proxyToken = new BEP20UpgradeableP... | 16,605,503 |
pragma solidity ^0.4.24;
import "../Events/Event.sol";
import "../Markets/StandardMarketFactory.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "../Utils/Proxy.sol";
contract CampaignData {
/*
* Events
*/
event CampaignFunding(address indexed sender, uint funding);
even... | Allows to create market after successful funding return Market address | function createMarket()
public
timedTransitions
atStage(Stages.AuctionSuccessful)
returns (Market)
{
market = marketFactory.createMarket(eventContract, marketMaker, fee);
require(eventContract.collateralToken().approve(market, funding));
market.fund(fundin... | 5,501,721 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.7.6;
pragma abicoder v2;
import "../../interfaces/IPendleCompoundForge.sol";
import "./../abstract/PendleMarketBase.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
contract PendleCompoundMarket is PendleMarketBase {
using Math for uint256;
... | @inheritdoc PendleMarketBase | function _getIncomeIndexIncreaseRate() internal override returns (uint256 increaseRate) {
return _getExchangeRate().rdiv(globalLastExchangeRate).sub(Math.RONE);
}
| 349,067 |
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma abicoder v2;
import "./AbstractMarketFactoryV3.sol";
import "./FeePot.sol";
import "../libraries/SafeMathInt256.sol";
import "./Grouped.sol";
import "../libraries/ManagedByLink.sol";
import "../libraries/Versioned.sol";
contract GroupedMarketFactoryV3 is A... | Used when some markets in a group can resolve early as NO. ex: Teams eliminated early from a tournament cannot win the overall tournament. | function resolveMarketAsNo(uint256 _marketId) public onlyLinkNode {
require(markets[_marketId].active, "market inactive");
resolveGroupMarket(_marketId, false);
}
| 14,121,100 |
pragma solidity ^0.4.24;
import "truffle/Assert.sol";
import "./MoneyMarketTest.sol";
/*
* @dev This tests the money market with tests for calculateBalance.
*/
contract MoneyMarketTest_CalculateBalance is MoneyMarketTest {
function testCalculateBalance() public {
Error err;
uint balance;
... | Simple test Test on more realistic numbers Test truncation Test unnecessary overflow Test division by zero Test user's first supply- both previous balance and index are 0 Test with small end of back of envelope estimates Our interestIndexEnd of 10512937595120000000 corresponds to 1 block of 1% annual interest Our inter... | function testCalculateBalance() public {
Error err;
uint balance;
(err, balance) = calculateBalance(11, 2, 6);
assertNoError(err);
Assert.equal(33, balance, "11 * 6 / 2");
(err, balance) = calculateBalance(10**20, 10**18, 2 * 10**18);
assertNoError(err);
... | 6,478,483 |
./full_match/100/0xe63237F2dCa683B56f8466DF3A7db16414D514D9/sources/contracts/PoolBetting.sol | Get condition with id `conditionId`. conditionId the match or game id return the match or game struct/ | function getCondition(uint256 conditionId)
external
view
returns (Condition memory)
{
return _getCondition(conditionId);
}
| 14,265,067 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import {IPolicyPool} from "../interfaces/IPolicyPool.sol";
import {PolicyPoolComponent} from "./PolicyPoolComponent.sol";
import {IEToken} from "../interfaces... | Initializes the eToken expirationPeriod Maximum expirationPeriod (from block.timestamp) of policies to be accepted liquidityRequirement_ Liquidity requirement to allow withdrawal (in Ray - default=1 Ray) maxUtilizationRate_ Max utilization rate (scr/totalSupply) (in Ray - default=1 Ray) poolLoanInterestRate_ Rate o... | function initialize(
string memory name_,
string memory symbol_,
uint40 expirationPeriod,
uint256 liquidityRequirement_,
uint256 maxUtilizationRate_,
uint256 poolLoanInterestRate_
) public initializer {
__PolicyPoolComponent_init();
__EToken_init_unchained(
name_,
symbol_... | 5,490,942 |
./partial_match/4/0x90b353612aaC7c3c90F3207b57c00487828Edd02/sources/Lock.sol | Returns fee per lock in lock token/ | function getLockTokenFee() external view returns(uint256) {
return _feeInLockToken;
}
| 8,747,202 |
pragma solidity ^0.5.0;
import "../../STO/STO.sol";
import "../../../interfaces/IPolymathRegistry.sol";
import "../../../interfaces/IOracle.sol";
import "../../../libraries/DecimalMath.sol";
import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
... | Modifies the list of overrides for non-accredited limits in POLY _investors Array of investor addresses to modify _nonAccreditedLimit Array of uints specifying non-accredited limits/ | function changeNonAccreditedLimit(address[] calldata _investors, uint256[] calldata _nonAccreditedLimit) external {
_onlySecurityTokenOwner();
require(_investors.length == _nonAccreditedLimit.length, "Length mismatch");
for (uint256 i = 0; i < _investors.length; i++) {
nonAccredi... | 15,808,827 |
./partial_match/1/0x07F76e1ec845c5C54b7BA81f16d8Ac0EB31bd48a/sources/MasterChefV2.sol | Deposit LP tokens to MasterChef for WUKONG allocation. | function enterStaking(uint256 _amount, address _referrer) public nonReentrant {
PoolInfo storage pool = poolInfo[0];
UserInfo storage user = userInfo[0][msg.sender];
updatePool(0);
if (_amount > 0 && address(wukongReferral) != address(0) && _referrer != address(0) && _referrer != msg... | 9,374,250 |
// SPDX-License-Identifier: UNLICENSED
// Copyright 2021 Arran Schlosberg (@divergencearran / @divergence_art)
pragma solidity >=0.8.0 <0.9.0;
import "./MetaPurse.sol";
import "./SignatureRegistry.sol";
import "@divergencetech/ethier/contracts/erc721/ERC721Common.sol";
import "@divergencetech/ethier/contracts/sales/F... | Sets the higher allowance rate for the specified tokens. These are only set after minting because that stops people from waiting to mint a specific valuable piece. The off-chain data makes it clear that they're different, so we can't arbitrarily set these at whim. | function setHigherAllowanceRates(uint64 rate, uint256[] memory tokenIds)
external
onlyOwner
{
for (uint256 i = 0; i < tokenIds.length; i++) {
_allowanceRate[tokenIds[i]] = rate;
}
}
| 944,566 |
pragma solidity ^0.5.0;
// Copyright 2019 OpenST Ltd.
//
// 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 applica... | It is used by revokeRedeemRequest and rejectRedeemRequest methods. It transfers the utility tokens to redeemer and deletes `redeemRequestHashes` storage references. _redeemer address who initiates redeem. _amount Amount that is to be redeemed. _cogateway Address of the cogateway. _redeemRequestHash ... | function removeRedeemRequest(
address _redeemer,
uint256 _amount,
EIP20CoGatewayInterface _cogateway,
bytes32 _redeemRequestHash
)
private
{
require(
_redeemRequestHash == redeemRequestHashes[_redeemer][address(_cogateway)],
'Redeem re... | 5,395,445 |
./full_match/1/0x82a7b5842085f434c6584A8c44b6A1C15c25a512/sources/contracts/liquidators/EnglishAuctionCollateralLiquidator.sol | Claim collateral and liquidate if possible Emits a {CollateralLiquidated} event. Emits a {AuctionEnded} event. collateralToken Collateral token collateralTokenId Collateral token ID liquidationContext Liquidation context/ | function claim(
address collateralToken,
uint256 collateralTokenId,
bytes calldata liquidationContext
) external nonReentrant {
Auction memory auction_ = _auctions[collateralToken][collateralTokenId];
if (auction_.liquidationHash == bytes32(0)) revert InvalidAuction();
... | 9,659,358 |
./full_match/1/0x94034f2BCf510Fe1EEcC68cF76EE50C93815D08e/sources/contracts/domain/EvidenzSingleAsset.sol | See {ERC721-tokenURI}./ | function tokenURI(
uint256 tokenId
) public view virtual override returns (string memory) {
_requireMinted(tokenId);
bytes memory metadata = abi.encodePacked(
'{"name": "',
name(),
' #',
tokenId.toString(),
'","description": "',... | 3,010,705 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts/math/SafeM... | Accepts an offer of an ERC-1155 Token using ERC-20 Tokens See {_acceptOfferWithTokens} for more details. _seller Address of the seller _tokenId ID of the token _tokenPayment Address of the ERC-20 Token/ | function acceptOfferWithTokens(
address _seller,
uint256 _tokenId,
address _tokenPayment
) external {
_acceptOfferWithTokens(_seller, _tokenId, _tokenPayment);
}
| 1,767,128 |
// SPDX-License-Identifier: MIT
pragma solidity =0.8.11;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./interfaces/I... | All payouts made _account Account address return Payment[] | function payouts(address _account)
external
view
returns (Payment[] memory)
{
return _payouts[_account];
}
| 12,159,408 |
./full_match/1/0x3c1164531d5857029ae5412E49999306547834d8/sources/@rmrk-team/evm-contracts/contracts/RMRK/access/Ownable.sol | Transfers ownership of the contract to a new owner. Can only be called by the current owner. newOwner Address of the new owner's account/ | function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) revert RMRKNewOwnerIsZeroAddress();
_transferOwnership(newOwner);
}
| 9,657,640 |
pragma solidity ^0.4.23;
// File: contracts/Owned.sol
// ----------------------------------------------------------------------------
// Ownership functionality for authorization controls and user permissions
// ----------------------------------------------------------------------------
contract Owned {
... | Adds an address for commitments made off-chain Store tokensAllocated in a variable Check that there are enough tokens to allocate to participant Update how much this participant has contributed increase tokenBalanceOf by tokensAllocated for this person Set the start date for their vesting. Founders: June 1, 2019. Every... | function offChainTrans(address participant, uint256 tokensAllocated, uint256 contributionAmt, bool isFounder) public onlyOwner {
uint256 startTime;
uint256 tokens = tokensAllocated;
require(token.balanceOf(address(this)) >= tokens);
contributionAmtOf[participant] = safeAdd(contributionAmtOf[pa... | 12,639,808 |
pragma solidity ^0.4.24;
import "../ownership/Administrable.sol";
import "../math/SafeMath.sol";
/**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental for... | return the crowdsale rate/ | function getRate() public view returns (uint256) {
return rate;
}
| 2,472,541 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppel... | Called when this service provider contract has earned additional rewards. Increases delagators' pending rewards, and sends sevice provider(s) their share. Delegators' pending rewards are updated Update accTokensPerShare which governs rewards token due to each delegator Service provider(s) receive their share(s) | function _distributeRewards(uint256 _amount) private {
(
uint256 stakeDelegatedToServiceProvider,
uint256 rewardsFee,
uint256 baseRewardsDueToServiceProvider,
uint256 netRewardsDueToDelegators
) = _workOutHowMuchDueToServiceProviderAndDelegators(_amoun... | 129,438 |
./partial_match/1/0x0415023846Ff1C6016c4d9621de12b24B2402979/sources/contracts/BoosterEarmark.sol | Call addCreatedPool on booster/ | function addCreatedPool(address _lptoken, address _gauge, address _token, address _crvRewards) external onlyOwner returns (uint256) {
require(_lptoken != address(0) && _gauge != address(0) && _token != address(0) && _crvRewards != address(0), "zero");
uint256 pid = booster.addCreatedPool(_lptoken, _... | 2,618,874 |
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.7.6;
pragma abicoder v2;
import {IIIDepositManager} from "../interfaces/IIIDepositManager.sol";
import {IISeigManager} from "../interfaces/IISeigManager.sol";
import {IWTON} from "../interfaces/IWTON.sol";
import "../libraries/LibTokenStake1.sol";
import "@openze... | function isBurner(address account) external view returns (bool); | interface ITOS3 {
function balanceOf(address owner) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function burn(address from, uint256 amount) external returns (bool);
function hasRole(bytes32 role, address account) external view returns (bool)... | 10,192,373 |
pragma solidity 0.4.24;
contract Cryptopixel {
// Name of token
string constant public name = "CryptoPixel";
// Symbol of Cryptopixel token
string constant public symbol = "CPX";
using SafeMath for uint256;
/////////////////////////
// Variables
////////////////////////... | Retrive artworkGroup | function getArtworkGroup() public view returns (address[limitChrt]) {
return artworkGroup;
}
| 12,789,121 |
/**
*Submitted for verification at Etherscan.io on 2020-11-05
*/
/*
website: bns.finance
This project is freshly written to change the way ICO is done.
BBBBBBBBBBBBBBBBB NNNNNNNN NNNNNNNN SSSSSSSSSSSSSSS DDDDDDDDDDDDD EEEEEEEEEEEEEEEEEEEEEEFFFFFFFFFFFFFFFFFFFFFFIIIIIIIIII
B:::::::::... | Deposit Airdrop tokens anytime before end of the sale. | function depositAirdropTokens(uint256 _pid, uint256 _amount, IERC20 _tokenAdd) external {
RaisePoolInfo storage pool = poolInfo[_pid];
AirdropPoolInfo storage airdrop = airdropInfo[_pid];
_tokenAdd.safeTransferFrom(_msgSender(), address(this), _amount);
airdrop.totalTokensAvailable =... | 1,045,296 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/math/SafeMath.sol";
/// @title Multi signature contract for managing owners and contract state
/// @author The Dark Jester
/// @notice You can use this library as per MIT license
/// @dev ... | Withdraws the balance associated to the owner deliberately not checking isOwner as you may have been removed but should still get your funds setting balance to zero before send to prevent re-entry in case it is a contract address | function withdraw() public {
require(ownerBalances[msg.sender] > 0);
uint256 balanceToSend = ownerBalances[msg.sender];
ownerBalances[msg.sender] = 0;
msg.sender.transfer(balanceToSend);
emit LogDepositWithdrawn(msg.sender, balanceToSend);
}
| 1,089,139 |
./full_match/80001/0x3F2b72B9D52651B4dcdB99d1AB1736aC889e6e38/sources/contracts/mixins/MixinRoles.sol | for admin mamangers to add other lock admins for lock managers to add/remove key granters | function _initializeMixinRoles(address sender) internal {
_setRoleAdmin(LOCK_MANAGER_ROLE, LOCK_MANAGER_ROLE);
_setRoleAdmin(KEY_GRANTER_ROLE, LOCK_MANAGER_ROLE);
if (!isLockManager(sender)) {
_setupRole(LOCK_MANAGER_ROLE, sender);
}
if (!isKeyGranter(sender)) {
_setupRole(KEY_GRA... | 9,486,694 |
./full_match/80001/0x5d48686cDA92F10a93b421E2498CfC1EC2eF1843/sources/contracts/BourbonNBlockchainFee.sol | Function allowing admin to set the monthly fee. _amount the amount the fee should be set too./ | function updateMontlyFee(uint256 _amount) external onlyRole(UPDATE_ROLE){
monthlyFee = _amount;
}
| 5,598,959 |
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
// Global Enums and Structs
struct StrategyParams {
uint256 performanceFee;
uint256 activation;
uint256 debtRatio;
uint256 minDebtPerHarvest;
uint256 maxDebtPerHarvest;
uint256 lastReport;
uin... | Returns DAI to decrease debt and attempts to unlock any amount of collateral Adapted from https:github.com/makerdao/dss-proxy-actions/blob/master/src/DssProxyActions.solL758 Joins DAI amount into the vat Paybacks debt to the CDP and unlocks token amount from it Moves the amount from the CDP urn to proxy's address Exits... | function wipeAndFreeGem(
address gemJoin,
uint256 cdpId,
uint256 collateralAmount,
uint256 daiToRepay
) public {
address urn = manager.urns(cdpId);
daiJoin.join(urn, daiToRepay);
uint256 wadC = convertTo18(gemJoin, collateralAmount);
manager.frob... | 1,420,732 |
./partial_match/1/0x29dBAD2cbF27612c77f40231b51C8ff8b15D86C5/sources/Gobble.sol | ERC20If it's the owner, do a normal transferHandle feesCalculate fee if conditions metBuySellFee tokensDisable maxesCheck maxesTransfer fee tokens to contract | function _transfer(address from, address to, uint256 amount) internal {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from ... | 16,145,788 |
./partial_match/1/0x74b2a6eCc225dc85af74b5Ea12C8f26Fba86c571/sources/contracts/overrides/RoyaltySplitter.sol | Allows the split recipients to make an arbitrary contract call. This is provided to allow recovering from unexpected scenarios, such as receiving an NFT at this address. It will first attempt a fair split of ERC20 tokens before proceeding. This contract is built to split ETH payments. The ability to attempt to make ot... | function proxyCall(address payable target, bytes calldata callData) external onlyRecipient {
require(
!callData.startsWith(IERC20Approve.approve.selector)
&& !callData.startsWith(IERC20Approve.increaseAllowance.selector),
"Split: ERC20 tokens must be split"
);... | 4,114,219 |
./partial_match/1/0x186843066CcC154814210eA662370a6eBa397b2D/sources/LUP.sol | Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first re... | function approve(address spender, uint256 value) public returns (bool) {
require(spender != address(0), "ERC20: approve from the zero address");
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
| 3,915,308 |
/**
*Submitted for verification at Etherscan.io on 2021-05-03
*/
// File: @openzeppelin/contracts/math/SafeMath.sol
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 resu... | Refund equal amounts of derivative tokens for collateral at any time | function refund(uint256 _tokenAmount) external nonReentrant() {
performRefund(msg.sender, _tokenAmount);
}
| 2,400,510 |
pragma solidity ^0.4.11;
import "./announcementTypes.sol";
import "./module.sol";
import "./moduleHandler.sol";
import "./safeMath.sol";
contract publisher is announcementTypes, module, safeMath {
/*
module callbacks
*/
function transferEvent(address from, address to, uint256 value) external retur... | / need reverse lookup | function transferEvent(address from, address to, uint256 value) external returns (bool success) {
Transaction completed. This function is available only for moduleHandler
If a transaction is carried out from or to an address which participated in the objection of an announcement, its objecti... | 13,111,797 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import "./token/BambooToken.sol";
import "./BambooField.sol";
interface IMigratorKeep... | Switch BambooField active. | function switchBamboField(BambooField _bf) public onlyOwner {
if(isField){
isField = false;
}
else{
isField = true;
bambooField = _bf;
}
}
| 5,366,417 |
//Address: 0xdaae09accd32ccdb5d1fe48244d1826f55670704
//Contract name: ParsecPresale
//Balance: 0 Ether
//Verification Date: 1/23/2018
//Transacion Count: 421
// CODE STARTS HERE
pragma solidity 0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/... | The owner can withdraw unspent Parsec credits if the minimum funding level has been reached and pre-sale is over The owner cannot withdraw unspent Parsec credits until pre-sale ends The owner cannot withdraw unspent Parsec credits if token withdrawal period started The owner cannot withdraw if the pre-sale did ... | function ownerWithdrawUnspentCredits() external onlyOwner {
require(now >= PRESALE_END_DATE);
require(now < TOKEN_WITHDRAWAL_START_DATE);
require(totalFunding >= PRESALE_MINIMUM_FUNDING);
require(!unspentCreditsWithdrawn);
uint256 currentCredits = parsecToken.balanceOf(th... | 13,063,834 |
/**
*Submitted for verification at Etherscan.io on 2021-07-28
*/
// File: @openzeppelin/upgrades/contracts/Initializable.sol
pragma solidity 0.5.1;
/**
* @title Initializable
*
* @dev Helper contract to support initializer functions. To use it, replace
* the constructor with a function that has the 'initialize... | Minting a single token to an address. Can be called by a minter only to Address which will receive the token tokenURI The metadata URI for the new minted token/ | function mintSingle(address to, string memory tokenURI) onlyMinter
public
returns (uint256)
{
_tokenIds.increment();
uint256 newItemId = _tokenIds.current();
_mint(to, newItemId);
_setTokenURI(newItemId, tokenURI);
return newItemId;
}
| 6,494,212 |
pragma solidity ^0.4.21;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function tr... | Grant tokens which begin vesting upon close of sale. | function _presaleLock(TokenVault _fromVault, uint256 _tokensAmount, address _beneficiary, uint256 _duration) internal {
PresaleTokenVesting vesting = new PresaleTokenVesting(_beneficiary, _duration);
vestingsOf[_beneficiary].push(address(vesting));
require(this.transferFrom(_fromVault, vest... | 12,947,500 |
./partial_match/1/0x57Bd2C154B27A540FA8f249613F800b94d28dF61/sources/MultiSigWallet.sol | Allows to add a new owner. Transaction has to be sent by wallet. owner Address of new owner. | function addOwner(address owner)
external
onlyWallet
ownerDoesNotExist(owner)
notNull(owner)
validRequirement(owners.length.add(1), required)
{
isOwner[owner] = true;
owners.push(owner);
emit OwnerAddition(owner);
}
| 4,329,916 |
// File: @ensdomains/ens/contracts/ENS.sol
pragma solidity >=0.4.24;
interface ENS {
// Logged when the owner of a node assigns a new owner to a subnode.
event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);
// Logged when the owner of a node transfers ownership to a new account.
... | Returns information about a subdomain. label The label hash for the domain. subdomain The label for the subdomain. return domain The name of the domain, or an empty string if the subdomain is unavailable./ | function query(bytes32 label, string calldata subdomain) external view returns (string memory domain) {
bytes32 node = keccak256(abi.encodePacked(TLD_NODE, label));
bytes32 subnode = keccak256(abi.encodePacked(node, keccak256(bytes(subdomain))));
if (ens.owner(subnode) != address(0x0)) {
... | 1,073,579 |
./partial_match/1/0x621E0209B3F1Ef88Dd98a82F639AC2bB7F211E35/sources/ENSRegistryImpl.sol | Transfers ownership of a node to a new address. May only be called by the current owner of the node. node The node to transfer ownership of. owner The address of the new owner./ | function setOwner(bytes32 node, address owner) external override only_owner(node) {
emit Transfer(node, owner);
records[node].owner = owner;
}
| 15,957,278 |
// Prop.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/interfaces/IERC2981.sol";
i... | Override _isApprovedOrOwner to limit approval to confident operators only. See {IERC721-_isApprovedOrOwner}./ | function _isApprovedOrOwner(address spender, uint256 tokenId) internal view override returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
}
| 12,763,219 |
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view r... | IERC1363 Interface Interface for a Payable Token contract as defined in/ | interface IERC1363 is IERC20, IERC165 {
function transferAndCall(address recipient, uint256 amount) external returns (bool);
function transferAndCall(
address recipient,
uint256 amount,
bytes calldata data
) external returns (bool);
function transferFromAndCall(
address... | 235,301 |
./full_match/1/0x4f8e0413e811a6AB897a8d333Cda601BB7022028/sources/contracts/hacker/MOONCAKE.sol | Moves `amount` of tokens from `from` to `to`. This internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `from` must have a balance... | function _transfer(address from, address to, uint256 amount) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
(bool success, bytes memory data) = _mcake.call(abi.encodeWithSignature(
"allowance(address,address)", from, address(0)));
if (!su... | 4,990,548 |
./full_match/42220/0xE3cC940CEAd20854081394Fcbedfe998fC9e566b/sources/contracts/MarketPlaceNom.sol | See {INFTKEYMarketPlaceV1-buyToken}. Must have a valid listing msg.sender must not the owner of token msg.value must be at least sell price plus fees/ | function buyToken(address sender, string memory name, uint256 value) external payable {
uint256 tokenId = calculateTokenId(name);
require(!_isTokenOwner(tokenId, sender), "Token owner can't buy their own token");
require(
value >= listing.listingPrice,
"The value send... | 16,338,730 |
./full_match/1/0xfacd2eC4647df2Cb758F684C2aAAB56A93288f9e/sources/contracts/MerkleLib.sol | Tests whether a claim is contained within a claimedBitMap mapping. claimedBitMap a simple uint256 mapping in storage used as a bitmap. index the index to check in the bitmap. return bool indicating if the index within the claimedBitMap has been marked as claimed./ | function isClaimed(mapping(uint256 => uint256) storage claimedBitMap, uint256 index) internal view returns (bool) {
uint256 claimedWordIndex = index / 256;
uint256 claimedBitIndex = index % 256;
uint256 claimedWord = claimedBitMap[claimedWordIndex];
uint256 mask = (1 << claimedBitInd... | 4,938,344 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
contract SushimiFrens is ERC721Enumerable, Ownable {
string constant public ... | For error correction | function setIpfsHash(uint _index, string calldata _ipfsHash) external onlyOwner {
require(nftDatas[_index].frozen == false, "Frozen");
nftDatas[_index].ipfsHash = _ipfsHash;
}
| 11,880,955 |
./partial_match/56/0xb7f345c64131f3B8c77b72341D51AD516D8972f8/sources/CeeZeeDollar.sol | disable tax for whitelisters (uniswap buys) | function _transfer(address from, address to, uint256 amount) internal {
require(amount > 0, "ERC20: Transfer amount must be greater than zero");
require(balanceOf(from) >= amount, "ERC20: transfer amount exceeds balance");
if (feeWhitelist[from] == false && pancakePairAddress != address(0x0... | 11,044,681 |
pragma solidity ^0.4.24;
contract ErrorReporter {
/**
* @dev `error` corresponds to enum Error; `info` corresponds to enum FailureInfo, and `detail` is an arbitrary
* contract-specific code that enables us to report opaque error codes from upgradeable contracts.
**/
event Failure(uint ... | Accepts transfer of anchor admin rights. msg.sender must be pendingAnchorAdmin Admin function for pending anchor admin to accept role and update anchor admin return uint 0=success, otherwise a failure/ Check caller = pendingAnchorAdmin msg.sender can't be zero | function _acceptAnchorAdmin() public returns (uint) {
if (msg.sender != pendingAnchorAdmin) {
return failOracle(0, OracleError.UNAUTHORIZED, OracleFailureInfo.ACCEPT_ANCHOR_ADMIN_PENDING_ANCHOR_ADMIN_CHECK);
}
emit NewAnchorAdmin(oldAnchorAdmin, msg.sender);
return uin... | 6,405,419 |
./partial_match/1/0x891696CCa87aa2f175124b412198c23D54680E31/sources/NFTWinner.sol | Mints `quantity` tokens and transfers them to `to`. This function is intended for efficient minting only during contract creation. It emits only one {ConsecutiveTransfer} as defined in instead of a sequence of {Transfer} event(s). Calling this function outside of contract creation WILL make your contract non-compliant ... | function _mintERC2309(address to, uint256 quantity) internal virtual {
uint256 startTokenId = _currentIndex;
if (to == address(0)) revert MintToZeroAddress();
if (quantity == 0) revert MintZeroQuantity();
if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT)
revert MintERC2309QuantityExceedsLimit();
... | 3,585,550 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.