file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
pragma solidity ^0.4.24;
//==============================================================================
// _ _ _ _|_ _ .
// (/_\/(/_| | | _\ .
//==============================================================================
contract F3Devents {
// fired whenever a player registers a name
event o... | returns the amount of keys you would get given an amount of eth. -functionhash- 0xce89c80c _rID round ID you want price for _eth amount of eth sent in return keys received/ grab time are we in a round? | function calcKeysReceived(uint256 _rID, uint256 _eth)
public
view
returns(uint256)
{
uint256 _now = now;
if (_now > round_[_rID].strt + rndGap_ && (_now <= round_[_rID].end || (_now > round_[_rID].end && round_[_rID].plyr == 0)))
return ( (round_[_rID].eth).k... | 1,374,361 |
pragma solidity ^0.4.18;
/**
* @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 transfer(ad... | vault finalization task, called when owner calls finalize() | function finalization() internal {
if (goalReached()) {
vault.close();
}
else {
vault.enableRefunds();
}
super.finalization();
}
| 1,225,865 |
./full_match/42220/0x2E9f8C5b7d7bC46cB350A3FdCe33538418D114fA/sources/contracts/token/VotingPower.sol | Delegates votes from signatory to `delegatee` delegatee The address to delegate votes to nonce The contract state required to match the signature expiry The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA signature pair s Half of the ECDSA signature pair/ XXX_CHANGED... | function delegateBySig(
address delegatee,
uint256 nonce,
uint256 expiry,
uint8 v,
bytes32 r,
bytes32 s
) public override {
bytes32 domainSeparator = keccak256(
abi.encode(
DOMAIN_TYPEHASH,
keccak256(bytes(_name)),
getChainId(),
address(this)
)... | 16,360,005 |
./full_match/80001/0xbbfb3a8948216dc467A0Da0CE599375Bc70d023D/sources/contracts/V2.sol | Public function returns the current version of the contract/ | function version() external virtual returns (uint256) {
return 2;
}
| 9,444,604 |
./full_match/137/0x088AcC3e5733c12096B64Ac48C04bbe05957Ab30/sources/ERC1155.sol | See {IERC1155-balanceOf}. Requirements: - `account` cannot be the zero address./ | function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
require(_exists(id), "ERC1155URIStorage: URI set of nonexistent token");
require(account != address(0), "ERC1155: balance query for the zero address");
return _balances[id][account];
}
| 4,751,225 |
./full_match/1/0xDda46bF18eeb3E06E2F12975A3A184e40581A72f/sources/_prb/math/src/ud2x18/Casting.sol | Casts an UD2x18 number into SD1x18. - x must be less than or equal to `uMAX_SD1x18`. | function intoSD1x18(UD2x18 x) pure returns (SD1x18 result) {
uint64 xUint = UD2x18.unwrap(x);
pragma solidity >=0.8.13;
import { MAX_UINT40 } from "../Common.sol";
import { uMAX_SD1x18 } from "../sd1x18/Constants.sol";
import { SD1x18 } from "../sd1x18/ValueType.sol";
import { SD59x18 } from "../sd59x18/ValueType.s... | 3,094,333 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.6;
contract Ownable {
address public owner;
address private nextOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
// modifiers
modifier onlyOwner() {
require(i... | Logged when the owner of a node assigns a new owner to a subnode. Logged when the owner of a node transfers ownership to a new account. Logged when the resolver for a node changes. Logged when the TTL of a node changes Logged when an operator is added or removed. | interface IENS {
event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);
event Transfer(bytes32 indexed node, address owner);
event NewResolver(bytes32 indexed node, address resolver);
event NewTTL(bytes32 indexed node, uint64 ttl);
event ApprovalForAll(
address index... | 14,560,969 |
pragma solidity ^0.4.24;
/**
* @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 OwnershipRenounced(address indexed pre... | Set other operator ( 0 allowed )/ | function changeOperator(address _operator) external onlyOwner {
require(_operator != operator);
operator = _operator;
emit OperatorChanged(_operator);
}
| 2,535,793 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.1;
/**
* @title Linked to SYN Marker Interface
*
* @notice Marks smart contracts which are linked to SyndicateERC20 token instance upon construction,
* all these smart contracts share a common syn() address getter
*
* @notice Implementing smart contracts M... | Linked to SYN Marker Interface Marks smart contracts which are linked to SyndicateERC20 token instance upon construction, all these smart contracts share a common syn() address getter Implementing smart contracts MUST verify that they get linked to real SyndicateERC20 instance and that syn() getter returns ... | interface ILinkedToSYN {
function syn() external view returns (address);
pragma solidity 0.8.1;
}
| 12,827,228 |
./full_match/69/0xa46d600e30D9C718F44F675d85f550eb843601e9/sources/contracts/rubiconPools/BathPair.sol | this throws on a zero value ofliquidity if the asset/quote is overweighted: underlyingBalance / (Proportion of quote allocated to pair) underlyingQuote balance bid at maxSize return dynamic order size return dynamic order size | function getMaxOrderSize(address asset, address bathTokenAddress)
public
view
returns (uint256 maxOrderSize)
{
require(asset == underlyingAsset || asset == underlyingQuote);
int128 shapeCoef = ABDKMath64x64.div(shapeCoefNum, 1000);
uint256 underlyingBalance = IER... | 13,239,144 |
./partial_match/42/0x9b96b64Abf39A56f80c12821Ee7bCdE0a98d7cD4/sources/ChainAssigner.sol | todo: make _sysMap a generic _metadata bytes array | function assignStarSystem(uint _sysId, address _recipient, uint _sysMap) external {
require(msg.sender == address(assigner), "sender should be chain assigner");
bytes4 methodSelector = SidechainAMBMediator(0).assignStarSystem.selector;
bytes memory data = abi.encodeWithSelector(methodSelecto... | 9,042,068 |
pragma solidity 0.4.15;
/// @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 {
// EVENTS
event OwnershipTransferred(address indexed previousOwner, address ... | Get list of all registered dspreturn Returns array of addresses registered as DSP with register times | function getAllDSP() constant returns(address[] addresses, DSPType[] dspTypes, bytes32[5][] urls, uint256[2][] karmas, address[] recordOwners) {
addresses = new address[](numRecords);
dspTypes = new DSPType[](numRecords);
urls = new bytes32[5][](numRecords);
karmas = new uint256[2][]... | 12,750,983 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.8;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "./base/Sweepable.sol";
import "./assets/erc1155/interfaces/ISup... | / Verify that the pool is respecting per-address pool purchase limits. | function mintFromPool(uint256 _id, uint256 _groupId, uint256 _assetIndex,
uint256 _amount, uint256 _itemIndex, DFStorage.WhiteListInput calldata _whiteList) external nonReentrant payable {
require(_amount > 0,
"0x0B");
require(_id < nextPoolId && pools[_id].config.singlePurchaseLimit >= _amount,
... | 15,800,865 |
./partial_match/4/0x1B8f7C42531b5a5D2B89B83E7A23920075040f47/sources/OptionFactory.sol | set member variables to avoid stack too deep error TODO: cleaner way to do this? | function createMarket(
address _baseToken,
address _quoteToken,
address _oracle,
uint256[] memory _strikePrices,
uint256 _expiryTime,
uint256 _alpha,
bool _isPut,
uint256 _tradingFee,
uint256 _balanceCap,
uint256 _totalSupplyCap
) e... | 16,961,212 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.4;
import "./VolmexProtocol.sol";
import "../library/VolmexSafeERC20.sol";
/**
* @title Protocol Contract with Precision
* @author volmex.finance [[email protected]]
*
* This protocol is used for decimal values less than 18.
*/
contract VolmexProtocolWit... | Add collateral to the protocol and mint the position tokens _collateralQty Quantity of the collateral being deposited Added precision ratio to calculate the effective collateral qty NOTE: Collateral quantity should be at least required minimum collateral quantity Calculation: Get the quantity for position token Mint ... | function collateralize(uint256 _collateralQty)
external
virtual
override
onlyActive
onlyNotSettled
{
require(
_collateralQty >= minimumCollateralQty,
"Volmex: CollateralQty > minimum qty required"
);
uint256 initialProtocol... | 9,919,638 |
./full_match/80001/0x950b1756c44c95a4469e915484b6AEdFA134F434/sources/project_/contracts/Traductores.sol | Función para minar los tokens de 1 address en concretoemit ValorTraductoresModificado(valorTraductores); | function MintONETraductores(uint _nuevoValorTraductores, address _traductoraddress) external onlyOwner {
valorTraductores = _nuevoValorTraductores;
GovernanceToken(GovernanceTokenContract).mint(_traductoraddress, _nuevoValorTraductores);
}
Datos... | 9,538,194 |
pragma solidity ^0.6.0;
import "../Initializable.sol";
/*
* @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 dea... | / Interface of the ERC20 standard as defined in the EIP./ | interface IERC20withDec is IERC20 {
function decimals() external view returns (uint8);
}
| 470,010 |
./partial_match/97/0x737189D306111F2F336F9aCF6C5ba86eBd1bc734/sources/BatchExchange.sol | a solver facing function called for auction settlement batchId index of auction solution is referring to owners array of addresses corresponding to touched orders orderIds array of order indices used in parallel with owners to identify touched order buyVolumes executed buy amounts for each order identified by index... | function submitSolution(
uint32 batchId,
uint256 claimedObjectiveValue,
address[] memory owners,
uint16[] memory orderIds,
uint128[] memory buyVolumes,
uint128[] memory prices,
uint16[] memory tokenIdsForPrice
) public returns (uint256) {
require(a... | 11,464,699 |
./partial_match/1/0x8BB4aEf8dBdBfCBB31bc1a8A176d8ccb82513035/sources/ERC20Store.sol | PRIVATE FUNCTIONS reject ‘null’ results from the map lookup this can only be the case if an unknown `_lockId` is received | function getCustodianChangeReq(bytes32 _lockId) private view returns (address _proposedNew) {
CustodianChangeRequest storage changeRequest = custodianChangeReqs[_lockId];
require(changeRequest.proposedNew != 0);
return changeRequest.proposedNew;
}
event CustodianChangeRequested(
... | 4,328,643 |
pragma solidity 0.4.26;
import "../../ETO/ETOCommitment.sol";
contract MockETOCommitment is
ETOCommitment
{
////////////////////////
// Constructor
////////////////////////
/// anyone may be a deployer, the platform acknowledges the contract by adding it to Universe Commitment collection
con... | moves all timestamps towards the past | function _mockShiftBackTime(uint256 delta) public {
for(uint256 ii = 0; ii<_pastStateTransitionTimes.length; ii += 1) {
if(_pastStateTransitionTimes[ii] > 0) {
assert(_pastStateTransitionTimes[ii] >= delta);
_pastStateTransitionTimes[ii] -= uint32(delta);
... | 895,507 |
./full_match/80001/0xc2d5075203a878f4bb571ab1d0D44B10Ef89CB7c/sources/Token.sol | Pays out all Factory ERC20 token balance to owners address _tokenAddress is an address of the ERC20 token to payout | function payoutToken(address _tokenAddress) external {
IERC20Lib token = IERC20Lib(_tokenAddress);
uint256 amount = token.balanceOf(address(this));
require(amount > 0, "Nothing to payout");
token.transfer(owner, amount);
}
| 5,619,485 |
./full_match/80001/0xc04e87bCd09B1821db562fc2f5748DD193713a67/sources/contracts/TradeableCashflow.sol | If a new stream is opened, or an existing one is opened This will give me the new flowRate, as it is called in after callbacks If inFlowRate === 0, then delete existing flow. if inFlowRate is zero, delete outflow. If there is no existing outflow, then create new flow to equal inflow | function _updateOutflow(bytes calldata ctx)
private
returns (bytes memory newCtx)
{
newCtx = ctx;
int96 netFlowRate = _cfa.getNetFlow(_acceptedToken, address(this));
(,int96 outFlowRate,,) = _cfa.getFlow(_acceptedToken, address(this), _receiver);
int96 inFlowRate = netFlo... | 9,464,072 |
./full_match/1/0x6aB144f647ED05E6f7c0b76C5cD7F1D90D64A950/sources/contracts/Contract.sol | To launch $FKS 24 hours after presale ends | function launch() external onlyOwner {
launchTime = block.timestamp;
}
| 9,707,703 |
./full_match/3/0xED4717a7C5c363Af896F64fA4B67C3E2816111fC/sources/contracts/Web3_payment/ETH/Merchant.sol | Include a token in receiving whitelist Only callable by owner/ | function includeInRecTokenWhitelist(address _token) public onlyOwner {
require(_token != address(0), "Invalid token");
recTokenWhitelist[_token] = true;
}
| 8,194,752 |
/**
*Submitted for verification at Etherscan.io on 2022-02-17
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
library SafeMath {
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
... | 5% 0x86fc9DbcE9e909c7AB4D5D94F07e70742E2d144A95% to owner | function withdraw() public onlyOwner {
uint balance = address(this).balance;
uint256 split = balance / 100;
split = split * 5;
payable(0x86fc9DbcE9e909c7AB4D5D94F07e70742E2d144A).transfer(split);
balance = balance - split;
payable(msg.sender).transfer(balance);
... | 14,472,758 |
/// #require z > 1;
/// #try msg.sender == address(0x0);
contract Foo {
uint z;
/// #require x > 2;
/// #try x < 10;
function bar(uint x) public {
/// #require x > 10;
/// #try x == 9;
uint z = x + 1;
}
function boo() public {}
function baz() internal {}
} | require x > 2; try x < 10; | function bar(uint x) public {
uint z = x + 1;
| 5,386,363 |
pragma solidity ^0.5.10;
pragma experimental ABIEncoderV2;
import "@airswap/types/contracts/Types.sol";
import "openzeppelin-solidity/contracts/introspection/ERC165Checker.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "openzeppelin-solidity/contracts/token/ERC721/IERC721.sol";
import "@... | Takes in an order and outputs any errors that Swap would revert on order Types.Order Order to settle return uint256 errorCount if any return bytes32[] memory array of error messages/ Check valid token registry handler for sender Check the order sender The sender was specified Check if sender kind interface can correct... | function checkSwap(Types.Order memory order)
public
view
returns (uint256, bytes32[] memory)
{
address swap = order.signature.validator;
(uint256 errorCount, bytes32[] memory errors) = coreSwapChecks(order);
if (hasValidKind(order.sender.kind, swap)) {
if (order.sender.wallet != addre... | 944,040 |
./full_match/1/0x025030BdAa159f281cAe63873E68313a703725A5/sources/contracts/user_proxies/gelato_user_proxy/interfaces/IGelatoUserProxyFactory.sol | ==================== CREATE ======================================= Gelato Task Cycle consists of 1 or more Tasks that automatically submit Gelato Task Cycle consists of 1 or more Tasks that automatically submit that should have occured once the cycle is complete: ==================== CREATE 2 ==================... | interface IGelatoUserProxyFactory {
event LogCreation(
address indexed user,
GelatoUserProxy indexed userProxy,
uint256 funding
);
function create()
external
payable
returns (GelatoUserProxy userProxy);
function createExecActions(Action[] calldata _actio... | 9,651,298 |
./partial_match/1/0xc231EA5C3F934b3a9C502e50fDf66fAb5B179CD4/sources/Aptozeum.sol | Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {APZ-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have all... | function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "APZ: decreased allowance below zero"));
return true;
}
| 2,603,772 |
// ICO Platform Demo smart contract.
// Developed by Phenom.Team <info@phenom.team>
pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint a, uint b) internal constant returns (uint) {
if (a == 0) {... | Function to enable token transfers/ | function unfreeze() external managerOnly {
PHN.defrost();
}
| 15,813,719 |
// SPDX-License-Identifier: MIT
// Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier)
pragma solidity >=0.8.0 <0.9.0;
import "../thirdparty/opensea/OpenSeaGasFreeListing.sol";
import "../utils/OwnerPausable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol";
import ... | Mints new tokens for the recipient. | function _processMint(address to, uint16 num) private {
if (num + totalSupply > MAX_NUM_TOKENS)
revert InsufficientTokensRemanining();
uint256 tokenId = totalSupply;
totalSupply += num;
for (uint256 i = 0; i < num; i++) {
tokenData[tokenId] = TokenData({
... | 1,449,871 |
// 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,... | Helper to check if an account is the owner of a given list | function __isListOwner(address _who, uint256 _id) private view returns (bool isListOwner_) {
address owner = getListOwner(_id);
return
_who == owner ||
(owner == getDispatcher() && _who == IDispatcher(getDispatcher()).getOwner());
}
| 6,867,469 |
./partial_match/42/0x7Dab59e2Ca3a043316C2039453989d8519756d92/sources/DisposableGovernance.sol | Gets ID return by the oraclize query of a given index. index Index. return myid ID return by the oraclize query./ | function getApiCallIndex(uint index) external view returns (bytes32 myid) {
myid = allAPIcall[index];
}
| 3,299,901 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns... | Changes rewards rate of ICE token | function setRewardRate(uint256 _rewardRate) external onlyOwner {
rewardRate = _rewardRate;
}
| 1,681,735 |
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.9;
import { IERC20Metadata } from '@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol';
import { ProxyAdmin } from '@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol';
import { IUniswapV3Pool } from '@uniswap/v3-core-0.8-support/... | Sets up a new Rage Trade Pool by deploying necessary contracts An already deployed oracle contract address (implementing IOracle) is needed prior to using this initializePoolParams parameters for initializing the pool as an argument to vtoken constructer and make wrapper variable as immutable. this will save sload on... | function initializePool(InitializePoolParams calldata initializePoolParams) external onlyGovernance {
IVToken vToken = _deployVToken(initializePoolParams.deployVTokenParams);
IUniswapV3Pool vPool = _createUniswapV3Pool(vToken);
vPool.initialize(
initializePoolParams
... | 2,557,739 |
pragma solidity ^0.5.0;
import "@openzeppelin/contracts/token/ERC721/ERC721Full.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/ownership/Ownable.sol";
/// @title Kudos
/// @author Jason Haas
/// @notice Kudos ERC721 interface for minting, cloning, and transferring Kudos toke... | getLatestId(): Returns the newest Kudos Id in the kudos array. return the latest kudos id. | function getLatestId() public view returns (uint256 tokenId)
{
if (kudos.length == 0) {
tokenId = 0;
tokenId = kudos.length - 1;
}
}
| 6,376,170 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// Contracts
import { RolesMods } from "../../contexts2/access-control/roles/RolesMods.sol";
import { ADMIN, AUTHORIZED } from "../../shared/roles.sol";
// Interfaces
import { ICErc20 } from "../../shared/interfaces/ICErc20.sol";
import { IAToken } from "../../s... | it returns the asset's PoolTogether PrizePool contract asset the address of the asset return the PoolTogether PrizePool contract of an asset/ | function getAssetPPool(address asset)
external
view
returns (PrizePoolInterface)
{
return AssetPPoolLib.get(asset);
}
| 1,004,200 |
./partial_match/1/0xd4260e4Bfb354259F5e30279cb0D7F784Ea5f37A/sources/VokenPublicSale2.sol | USD => voken, by `usdAmount`./ | function _usd2voken(uint256 usdAmount) private view returns (uint256) {
return usdAmount.mul(1000000).div(_vokenUsdPrice);
}
| 2,613,643 |
pragma solidity >=0.8.0 <0.9.0;
//SPDX-License-Identifier: MIT
import "hardhat/console.sol";
import { ERC721 } from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import { ERC721Enumerable } from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
// import "@openzeppelin/contracts/access/Owna... | Both revealed! game on! rollRound(......); alternatively, let one side compute results and wait for other side to accept or dispute but then we need to save state to allow a confirm/dispute step so we must validate here in the contract TODO loop a few times, note that armies get modified in place | function finishRound(uint256 matchId) public {
if (matches[matchId].defenderRevealed && matches[matchId].invaderRevealed) {
evalRound(matchId);
_roundUp(matchId);
}
}
| 5,445,508 |
// SPDX-License-Identifier: MIT
pragma solidity 0.5.0;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address accou... | if 0 => block.timestamp | function pauseGlobally(uint256 startTime) external returns (bool); | 929,836 |
./partial_match/1/0x6B0B234fB2f380309D47A7E9391E29E9a179395a/sources/src/v0.8/dev/automation/2_1/KeeperRegistryLogicB2_1.sol | updates the gas limit for an upkeep/ | function setUpkeepGasLimit(uint256 id, uint32 gasLimit) external {
if (gasLimit < PERFORM_GAS_MIN || gasLimit > s_storage.maxPerformGas) revert GasLimitOutsideRange();
_requireAdminAndNotCancelled(id);
s_upkeep[id].performGas = gasLimit;
emit UpkeepGasLimitSet(id, gasLimit);
}
| 3,963,118 |
/**
*Submitted for verification at Etherscan.io on 2021-06-29
*/
// File: contracts/Whitelist.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0 <0.7.0;
contract Whitelist {
uint256 groupId;
address public whiteListManager;
struct WhitelistGroup {
mapping(address => bool) members;
... | Function to add members to a whitelist group. _groupId Group Id of the whitelist group. _memberAddress List of address to be added to the whitelist group. | function addMembersToGroup(
uint256 _groupId,
address[] memory _memberAddress
) public {
require(_isGroup(_groupId), "Group doesn't exist!");
require(
_isGroupAdmin(_groupId),
"Only goup admin is permitted for this operation"
);
for (uint2... | 15,079,424 |
pragma solidity ^0.6.5;
library Assert {
event AssertionEvent(
bool passed,
string message
);
function ok(bool a, string memory message) internal pure returns (bool result) {
result = a;
require(result, message);
}
function notOk(bool a, string memory message) internal pure returns (bool resul... | TODO: safely compare between uint and int int is negative int "b" always lesser | function lesserThan(uint a, int b, string memory message) internal pure returns (bool result) {
if(b < int(0)) {
result = false;
result = (a < uint(b));
}
ok(result, message);
}
| 13,080,243 |
./partial_match/1/0x8155F0d5714f304aBe85E05293AA7AB386987D3d/sources/MYTH.sol | Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address./ | function increaseAllowance(address spender, uint256 addedValue) public virtual returns(bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
| 2,599,900 |
pragma solidity ^0.6;
import "../../../lib/SafeMath.sol";
import {Ownable} from "../ownership/Ownable.sol";
/**
* Stores information for added training data and corresponding meta-data.
*/
interface DataHandler {
function updateClaimableAmount(bytes32 dataKey, uint rewardAmount) external;
}
/**
* Stores info... | Validate found value. usually unnecessary: require(isDataEqual(existingData.d, data), "Data is not equal."); | function getNumClaims(int64[] memory data, uint64 classification, uint addedTime, address originalAuthor)
public view returns (uint) {
bytes32 key = keccak256(abi.encodePacked(data, classification, addedTime, originalAuthor));
StoredData storage existingData = addedData[key];
req... | 12,872,850 |
./full_match/1/0x997523eF97E0b0a5625Ed2C197e61250acF4e5F1/sources/contracts/extra/ExtraRewardsMultiMerkle.sol | Udpates the Root Manager Udpates the Root Manager newManager Address of the new Root Manager/ | function updateRootManager(address newManager) external onlyOwner {
if(newManager == address(0)) revert Errors.ZeroAddress();
address oldManager = rootManager;
rootManager = newManager;
emit UpdateRootManager(oldManager, newManager);
}
| 9,761,002 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@chainlink/contracts/src/v0.8/ChainlinkClient.sol";
/**
* Request testnet LINK and ETH here: https://faucets.chain.link/
* Find information on LINK Token Contracts and get the latest ETH and LINK faucets here: https://docs.chain.link/docs/link-token-con... | Request variable bytes from the oracle/ | function requestBytes(
)
public
{
bytes32 specId = "7a97ff8493ec406d90621b2531f9251a";
uint256 payment = 100000000000000000;
Chainlink.Request memory req = buildChainlinkRequest(specId, address(this), this.fulfillBytes.selector);
req.add("path", "image");
sendChainlinkRequest(req, payment)... | 12,649,312 |
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma abicoder v2;
/**
* @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 returns (uint256);
/**
* @dev R... | Check price has not moved a lot recently. This mitigates price manipulation during rebalance and also prevents placing orders when it's too volatile. | function checkDeviation(IUniswapV3Pool pool, int24 maxTwapDeviation, uint32 twapDuration) internal view {
(, int24 currentTick, , , , , ) = pool.slot0();
int24 twap = getTwap(pool, twapDuration);
int24 deviation = currentTick > twap ? currentTick - twap : twap - currentTick;
require(... | 9,338 |
./partial_match/1/0x3198EAdB777b9b6C789bfc89491774644E95eD7e/sources/contracts/interfaces/pool/ISolidlyV3PoolActions.sol | Permissionless pool actions Contains pool methods that can be called by anyone | interface ISolidlyV3PoolActions {
function initialize(uint160 sqrtPriceX96) external;
function mint(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount
) external returns (uint256 amount0, uint256 amount1);
function mint(
address recipient,
... | 15,989,228 |
./full_match/5/0x32ff4D05236E95FF60299E9b7BaB351179138389/sources/contracts/core/Factory.sol | @inheritdoc IFactory | function disableWhitelist() external override onlyConfigMaster {
whitelistDisabled = true;
emit WhitelistDisabled();
}
| 1,940,562 |
./full_match/1/0x44C696287E1FC316CAc9C34FbD9e0F64de41A02d/sources/contracts/Farming.sol | deposit If amount is zero, it will claim pending rewards If amount is not zero, it will deposit and reset unlock time _pid {uint256} Pool Id _amount {uint256} Amount of token to deposit/ | function deposit(
uint256 _pid,
uint256 _amount
) external nonReentrant whenNotPaused validatePoolByPid(_pid) {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
updatePool(_pid);
if (user.amount > 0) {
uint256... | 8,305,556 |
./full_match/80001/0xe78D2f06d7Ad0cDC884D7DDB65e4BCEdbD212298/sources/_solidstate/contracts/token/ERC20/extended/ERC20ExtendedInternal.sol | decrease spend amount granted to spender spender address whose allowance to decrease amount quantity by which to decrease allowance return success status (always true; otherwise function will revert)/ | function _decreaseAllowance(
address spender,
uint256 amount
) internal virtual returns (bool) {
_decreaseAllowance(msg.sender, spender, amount);
return true;
}
| 9,525,842 |
pragma solidity ^0.4.25;
contract Control {
address owner;
struct userData {
address userAddress;
uint fsmVersion;
uint currentState;
}
struct fsmContractDetail {
address contractAddress;
string functionName;
}
userData[] public users;
mapping(uin... | update to the latest version | function userUpdateFSMtoNewVersion() public onlyGeneralUser{
uint i = getUserIdx(msg.sender);
users[i].fsmVersion = versionNumber;
}
| 5,440,457 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
pragma experimental ABIEncoderV2;
// File: witnet-ethereum-bridge/contracts/Request.sol
/**
* @title The serialized form of a Witnet data request
*/
contract Request {
bytes public bytecode;
/**
* @dev A `Request` is constructed around a `bytes m... | Upgrade the reward for a Data Request previously included. Call to `upgrade_dr` function in the WitnetRequestBoard contract. _id The unique identifier of a request that has been previously sent to the WitnetRequestBoard./ | function witnetUpgradeRequest(uint256 _id) internal {
}
| 997,863 |
./full_match/1/0x0F345F57ee2b395e23390f8e1F1869D7E6C0F70e/sources/contracts/p1/Deployer.sol | effects: Deploy a proxy for Main and every component of Main Call init() on Main and every component of Main, using `params` for needed parameters While doing this, init assetRegistry with this.rsrAsset and a new rTokenAsset Set up Auth so that `owner` holds all roles and no one else has any Main - Proxy Comp... | function deploy(
string memory name,
string memory symbol,
string calldata mandate,
address owner,
DeploymentParams memory params
) external returns (address) {
require(owner != address(0) && owner != address(this), "invalid owner");
MainP1 main = MainP1(... | 8,486,096 |
/**
*Submitted for verification at Etherscan.io on 2022-03-15
*/
// SPDX-License-Identifier: GPL-3.0-or-later
// Sources flattened with hardhat v2.6.1 https://hardhat.org
// File @openzeppelin/contracts/token/ERC20/[email protected]
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)
pragma so... | Calculates the minimum Hop LP to accept when depositing underlying into Curve Hop Pool. _underlyingAmount Amount of underlying that is being deposited into Curve Hop Pool. return The minimum Hop LP balance to accept./ | function _minHopLpAcceptedFromDeposit(uint256 _underlyingAmount)
internal
view
returns (uint256)
{
return
_underlyingToHopLp(_underlyingAmount).scaledMul(
ScaledMath.ONE - hopImbalanceToleranceIn
);
}
| 2,187,046 |
pragma solidity ^0.4.24;
/**
* Version: 0.1.0
* The ERC-1384 is an Equity Agreement Standard used for smart contracts on Ethereum
* blockchain for project equity allocation.
* The current ERC-1384 agreement standard version is 0.1.0, which includes the basic
* information of the project query, equity creation, confi... | Create a new vote return the new vote of ID/ Vote Agree Number Vote Disagree Number Vote Abstain Number Start Voting Time | function createVote() public payable returns (uint256){
votes_num = votes_num.add(1);
voteResult[votes_num][0] = 0;
voteResult[votes_num][1] = 0;
voteResult[votes_num][2] = 0;
voteResult[votes_num][3] = block.timestamp;
emit Vote(votes_num);
return votes_nu... | 12,981,265 |
// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is dis... | Returns the address of the Balancer Governance Token/ Returns the Balancer Vault./ SPDX-License-Identifier: GPL-3.0-or-later This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the Li... | interface IGaugeController {
function checkpoint_gauge(address gauge) external;
function gauge_relative_weight(address gauge, uint256 time) external returns (uint256);
function voting_escrow() external view returns (IVotingEscrow);
function token() external view returns (IERC20);
function add_ty... | 170,363 |
./partial_match/1/0x9490CCf93Cd750dc47f72402A163022cfB94CFC9/sources/contracts/vaults/TreasuryVault/RibbonTreasuryVaultLite.sol | Returns the asset balance held on the vault for the account account is the address to lookup balance for return the amount of `asset` custodied by the vault for the user/ | function accountVaultBalance(address account)
public
view
returns (uint256)
{
uint256 _decimals = vaultParams.decimals;
uint256 assetPerShare =
ShareMath.pricePerShare(
totalSupply(),
totalBalance(),
vaultState.t... | 3,540,712 |
pragma solidity ^0.4.24;
import "../Roles.sol";
import "./OwnerRole.sol";
/**
* @title ListerAdminRole
*
* @dev Role for providing access control to functions that administer individual lister roles.
* This contract inherits from OwnerRole so that owners can administer this role.
* The ListerRole contract should... | Internal function that asserts the given `account` is in `_listerAdmins`. account The account address being queried return True if the given `account` is in `_listerAdmins`, otherwise false/ | function _isListerAdmin(address account) internal view returns (bool) {
return _listerAdmins.has(account);
}
| 12,634,055 |
/**
*Submitted for verification at Etherscan.io on 2021-03-17
*/
/*
* @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, sin... | Releases management to the DAO. / Reentrancy guard. Burn the tokens. Update the stage. If the manager no longer is a holder we need to tell the latest DAO. | function initializeDAO() external {
require(_status == RE_NOT_ENTERED);
_status = RE_ENTERED;
require(msg.sender == _manager, "Not manager");
require(_governanceStage == STAGE_ISSUANCE_CLAIMED, "Issuance unclaimed");
uint256 startingBalance = balanceOf(_... | 2,229,996 |
./full_match/44787/0x8D38DA4eb0315582013D42a909db8076a79de277/sources/contracts/StarFarm.sol | Deposit LP tokens to MasterChef for STAR allocation. | function deposit(uint256 _pid, uint256 _amount) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_msgSender()];
updatePool(_pid,1);
(uint256 _selfGain, uint256 _parentGain) = starNode.nodeGain(_msgSender());
uint256 _amountGain = user.a... | 13,246,233 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "./interface/icustom.sol";
import "./Third.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV... | Update fee address by the previous institution. | function setFee(address _feeaddr) public {
require(msg.sender == feeaddr, "feeaddr: wut?");
require(_feeaddr != address(0), "_feeaddr is address(0)");
feeaddr = _feeaddr;
emit SetFee(_feeaddr);
}
| 15,865,820 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.4;
import 'hardhat/console.sol';
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '../base/ERC721FullUpgradeable.sol';
import '../base/SignatureVerifier.sol';
import '../erc721/Worlds.sol';
import '../erc721/Degens.sol';
import '../utility/DegenDa... | set the address of the worlds contract. because they have a circular dependency, we choose to initialize Dystopians first. | function setCraftRules(CraftRules[] calldata _rules) external onlyOwner {
for (uint256 i = 0; i < _rules.length; i++) {
craftRules[_rules[i].class] = _rules[i];
emit DystopianRegistered(_rules[i].class);
}
}
| 5,346,026 |
./full_match/1/0xBf3B3b9368262Ed9BD06B621149CA947984D1B31/sources/contracts/main/TruStakeMATICv2.sol | more gas efficient to use assembly for zero address check | function _checkNotZeroAddress(address toCheck) private pure {
assembly {
if iszero(toCheck) {
let ptr := mload(0x40)
revert(ptr, 0x4)
}
}
}
| 4,869,172 |
// optimizer: 4289999999
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.12;
// File @boringcrypto/boring-solidity/contracts/libraries/BoringMath.sol@v1.2.0
// License-Identifier: MIT
/// @notice A library for performing overflow-/underflow-safe math,
/// updated with awesomeness from of DappHub (ht... | Interface for SushiSwap. | interface ISushiSwap {
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
}
}
| 12,657,065 |
pragma solidity ^0.4.18;
interface trinityData{
function getChannelBalance(bytes32 channelId) external view returns (uint256);
function getChannelStatus(bytes32 channelId) external view returns(uint8);
function getChannelExist(bytes32 channelId) external view returns(bool);
function getChan... | verify both signature to check the behavious is valid.if channel have existed, can not create it again | function deposit(bytes32 channelId,
uint256 nonce,
address funderAddress,
uint256 funderAmount,
address partnerAddress,
uint256 partnerAmount,
bytes funderSignature,
byt... | 14,070,615 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./interfaces/IUniswapV2Router02.sol";
import "./libraries/SafeMath.sol";
import "./libraries/SafeERC20.sol";
contract Multiswap {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// WETH Address
address private immutable WETH;
... | Internal function to calculate the output from one ETH swap./ | function calcOutputEth(address _token, uint256 _value)
internal
view
returns (uint256, address[] memory)
{
address[] memory path = new address[](2);
path[0] = WETH;
path[1] = _token;
uint256[] memory expected = uniswapRouter.getAmountsOut(_value, ... | 548,216 |
pragma solidity ^0.4.24;
contract POOHMOevents {
// fired whenever a player registers a name
event onNewName
(
uint256 indexed playerID,
address indexed playerAddress,
bytes32 indexed playerName,
bool isNewPlayer,
uint256 affiliateID,
address affiliateAddress... | ============================================================================== _ _ _ _ | _ _ . _ . (_(_)| (/_ |(_)(_||(_ . (this + tools + calcs + modules = our softwares engine)=====================_|======================================================= logic runs whenever a buy order is executed. de... | function buyCore(uint256 _pID, uint256 _affID, POOHMODatasets.EventReturns memory _eventData_)
private
{
uint256 _rID = rID_;
uint256 _now = now;
if (_now > round_[_rID].strt + rndGap_ && (_now <= round_[_rID].end || (_now > round_[_rID].end && round_[_rID].plyr == 0)))
... | 9,997,509 |
// _
// (` ). _
// ( ). .:(` )`.
// ) _( '`. :( . )
// .=(`( . ) .-- `. ( ) )
// (( (..__.:'-' .+( ) ` _` ... | make sure owner owns this token | function setNightmareMode(uint256 _tokenId) public {
require(_tokenId >= 1 && _tokenId <= MAX_SUPPLY, "Not valid token range");
address ownerOfToken = ownerOf(_tokenId);
require(ownerOfToken == msg.sender, "Not the owner");
if (ownerOfToken == msg.sender) {
_nightmareMap[_tokenId-1] = true;
... | 5,801,678 |
pragma solidity 0.6.12;
interface IERC20 {
function TOTALSUPPLY831() external view returns (uint256); //i... | inject NONSTANDARD NAMING | function LENGTH659(UintSet storage set) internal view returns (uint256) { | 14,087,573 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, s... | Changing _beforeTokenTransfer to lock tokens that are in an auction so that owner cannot transfer the token as people are bidding on it./ | function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override {
require(!_validAuction(_tokenIdToAuction[tokenId]), "Cannot transfer a token in an auction");
super._beforeTokenTransfer(from, to, tokenId);
}
| 1,178,430 |
/***
* 888b d888 8888888
* 8888b d8888 888
* 88888b.d88888 ... | emit IncludeInFee(account); | function includeInFee(address account) external onlyOwner {
_isExcludedFromFee[account] = false;
}
| 230,984 |
/*
* Offer to respond to a proposal.
*/
contract Offer {
/*
* The seller who made this offer.
*/
address public owner;
/*
* Price offered at the minimum amount.
*/
uint public price;
/*
* Minimum amount of products to be bought.
*/
uint public minimumAmount;
... | Is there a best offer? | function getBestPrice() constant returns (uint price) {
uint bestOfferIndex = getBestOfferIndex();
if(bestOfferIndex == 0)
return;
price = offers[bestOfferIndex].price();
}
| 14,070,251 |
// File: @openzeppelin/contracts/GSN/Context.sol
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
* man... | Add a new lp to the pool. Can only be called by the owner./ | function addLpToken(uint256 _allocationPoint, address _lpTokenAddress, bool _withUpdate) public onlyOwner {
if (_withUpdate) {
massUpdatePools();
}
poolCounter++;
uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock;
totalAllocationPoint = totalAllocationPoint.add(... | 55,006 |
./full_match/80001/0xD4b7bd77B3a04c4000387dBF711040f23C31Ef4b/sources/contracts/ERC721A.sol | Gas spent here starts off proportional to the maximum mint batch size. It gradually moves to O(1) as tokens get transferred around in the collection over time./ unchecked { | function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) {
uint256 curr = tokenId;
TokenOwnership memory ownership = _ownerships[curr];
if (!ownership.burned) {
if (ownership.addr != address(0)) {
... | 5,568,948 |
pragma solidity ^0.5.2;
/**
* @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 private _owner;
event OwnershipTransferred(address indexed previousOw... | Release payee's proportional payment./ | function release() external nonReentrant {
address payable account = address(uint160(msg.sender));
require(_shares[account] > 0, "Account not eligible for payroll");
uint256 payment = available(account);
require(payment != 0, "No payment available for account");
_release(ac... | 14,066,571 |
./full_match/80001/0x5d48686cDA92F10a93b421E2498CfC1EC2eF1843/sources/contracts/BourbonNBlockchainRewards.sol | Function allowing super-admin to unpause reward claiming for all users/ | function unpauseRewards() public onlyRole(DEFAULT_ADMIN_ROLE) {
rewardsPaused = false;
}
| 5,598,942 |
./partial_match/1/0x1A963Df363D01EEBB2816b366d61C917F20e1EbE/sources/src/SafeMath.sol | Returns the addition of two unsigned integers, reverting on overflow. Counterpart to Solidity's `+` operator. Requirements: - Addition cannot overflow./ | function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c;
unchecked {
c = a + b;
}
require(c >= a, "SafeMath: addition overflow");
return c;
}
| 2,594,754 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.10 <0.8.0;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "../utils/SafeDecimalMath.sol";
import {Order, OrderQueue, LibOrderQueue} from "./LibOrderQueue.sol";
import {
UnsettledBuyTrade,
UnsettledSell... | Sell Token B version Current rebalance version. Revert if it is not the latest version. minPDLevel Minimal premium-discount level accepted baseAmount Amount of Token B willing to trade | function sellB(
uint256 version,
uint256 minPDLevel,
uint256 baseAmount
) external {
(, , uint256 estimatedNav) = estimateNavs(endOfEpoch(block.timestamp) - 2 * EPOCH);
_sell(version, TRANCHE_B, minPDLevel, estimatedNav, baseAmount);
}
| 2,497,717 |
import "@openzeppelin/contracts/ownership/Ownable.sol";
import "./Repayment.sol";
import { RoleManagement } from "./RoleManagement.sol";
pragma solidity ^0.5.0;
contract Mortgage is Ownable {
//Variables
uint ETHER=(10**18);
uint public MortgageCount=0;
bool public contractPaused = false;
addres... | Allows an owner to confirm a transaction. transactionId Transaction ID. addr is the address of the contract representing the land registry | function confirmTransaction(uint transactionId,address addr) public checkIfPaused() {
require(confirmations[transactionId][msg.sender] == false);
require(isParty[transactionId][msg.sender]==true);
confirmations[transactionId][msg.sender] = true;
emit Confirmation(msg.sender, transact... | 6,486,854 |
./full_match/56/0xF6C48fb39Cd9D21E5103b1F01b26C6B2cEB2c1C7/sources/GameFactory.sol | Removes the provided address to the whitelist _removedAddress address to be removed from the whitelist/ | function removeFromWhitelist(address _removedAddress)
external
onlyRole(CMO_ROLE)
{
_unWhitelist(_removedAddress);
emit RemoveFromWhitelist(_removedAddress);
}
| 3,258,983 |
./full_match/43113/0xD3068FBB4358A9B97c62f9EE3078465574b5880D/sources/WonkoIceCreamFactory_flat.sol | Get the list of all the tokens currently in sale | function tokensInSale() public view returns(uint256[] memory) {
if(inSale == 0) {
return new uint256[](0);
}
uint256[] memory result = new uint256[](inSale);
uint256 index = 0;
for(uint256 i = 0; i < totalSupply(); i++) {
if(tokensInSaleMapping[i]... | 7,149,446 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
import { Governance } from "tornado-governance/contracts/Governance.sol";
import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol";
import { ITornadoVault } from "../interfaces/ITornadoVault.sol";
/// @title Versio... | Withdraws TORN from governance if conditions permit amount the amount of TORN to withdraw | function unlock(uint256 amount) public virtual override {
require(getBlockTimestamp() > canWithdrawAfter[msg.sender], "Governance: tokens are locked");
lockedBalance[msg.sender] = lockedBalance[msg.sender].sub(amount, "Governance: insufficient balance");
userVault.withdrawTorn(msg.sender, amount);
}
| 12,640,293 |
./full_match/1/0x3Bd85DF9633eF0205206BB519E4dDee152Bb0005/sources/contracts/token/RewardsDistributor.sol | Harvest rewards of all epochs during estimation for each strategy _strategyPower Accumulated strategy power per epoch _protocolPower Accumulated protocol power per epoch _startingQuarter Starting quarter for calculations _numQuarters Total number of quarters for the calculation return th... | function _harvestStrategyRewards(
uint256[] memory _strategyPower,
uint256[] memory _protocolPower,
uint256 _startingQuarter,
uint256 _numQuarters
) internal view returns (uint256) {
uint256 strategyRewards;
uint256 percentage = 1e18;
for (uint256 i = 0; i... | 3,050,177 |
pragma solidity ^0.4.24;
/**
* Originally from https://github.com/TokenMarketNet/ico
* Modified by https://www.coinfabrik.com/
*/
pragma solidity ^0.4.24;
/**
* Originally from https://github.com/TokenMarketNet/ico
* Modified by https://www.coinfabrik.com/
*/
pragma solidity ^0.4.24;
/**
* Originally from h... | Transfer tokens from one address to another from address The address which you want to send tokens from to address The address which you want to transfer to value uint the amout of tokens to be transfered/ Check is not needed because sub(allowance, value) will already throw if this condition is not met require(value... | function transferFrom(address from, address to, uint value) public returns (bool success) {
uint allowance = allowed[from][msg.sender];
balances[from] = balances[from].sub(value);
balances[to] = balances[to].add(value);
allowed[from][msg.sender] = allowance.sub(value);
emit Transfer(from, to, va... | 1,243,489 |
pragma solidity ^0.4.17;
import "./token/ILivepeerToken.sol";
import "zeppelin-solidity/contracts/math/SafeMath.sol";
import "zeppelin-solidity/contracts/ownership/Ownable.sol";
import "zeppelin-solidity/contracts/token/TokenVesting.sol";
import "zeppelin-solidity/contracts/token/TokenTimelock.sol";
contract Genesi... | Set allocations for the initial token supply at genesis _initialSupply Initial token supply at genesis _crowdSupply Tokens allocated for the crowd at genesis _companySupply Tokens allocated for the company (for future distribution) at genesis _teamSupply Tokens allocated for the team at genesis _investorsSupply To... | function setAllocations(
uint256 _initialSupply,
uint256 _crowdSupply,
uint256 _companySupply,
uint256 _teamSupply,
uint256 _investorsSupply,
uint256 _communitySupply
)
external
onlyOwner
atStage(Stages.GenesisAllocation)
{
requ... | 6,451,114 |
/**
*Submitted for verification at Etherscan.io on 2021-11-18
*/
// SPDX-License-Identifier: MIT
/*
__/\\\______________/\\\\\\\\\\\\\_______/\\\\\\\\\___________/\\\\\\\\\_
_\/\\\_____________\/\\\/////////\\\___/\\\\\\\\\\\\\______/\\\////////__
_\/\\\_____________\/\\\_______\/\\\__/\\\/////////... | Interface of the ERC165 standard, as defined in the Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}./ | interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
__/\\\______________/\\\\\\\\\\\\\_______/\\\\\\\\\___________/\\\\\\\\\_
pragma solidity ^0.8.0;
}
| 2,085,677 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/access/Ownable.sol";
import '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';
import "@openzeppelin/contracts/utils/Counters.sol";
import './Utils.sol';
/**
* @title HappyRobotWhitelistToken
* HappyRobotWhitelistToken - ERC1... | remove an address from the minter list _account address/ find index of _from remove it | function removeFromMinters(address _account) internal {
uint256 index = 0xFFFF;
uint256 len = minters.length;
for (uint256 i = 0; i < len; i++) {
if (minters[i] == _account) {
index = i;
break;
}
}
if (index != 0xFFFF && len > 0) {
minters[index] = ... | 14,513,359 |
./full_match/97/0x1a989668cd602fefa19CC58373161C94002318BE/sources/project_/contracts/Viddly.sol | Retrieves the distribution fee percentages return The owner, level, and creator fee percentages/ | function getDistributionFeePercentage()
external
view
override
returns (uint256, uint256, uint256)
{
return (_ownerPercentage, _levelPercentage, _creatorPercentage);
}
| 3,288,985 |
pragma solidity ^0.4.24;
/**
* @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 (uint256 c) {
// Gas optimization: this is cheaper than a... | get total weighted contribution return Total sum of all weighted contribution/ | function getTotalWeightedContribution() constant public returns(uint256) {
return totalWeightedContribution;
}
| 13,884,793 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/Initializable.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
* specific functi... | Unsafe write uint into a memory location index Memory location source uint to write return End memory index/ | function unsafeWriteUint(uint256 index, uint256 source)
internal
pure
returns (uint256)
{
assembly {
mstore(index, source)
index := add(index, 0x20)
}
return index;
}
| 14,408,353 |
./full_match/11155111/0xE46FE78DBfCa5E835667Ba9dCd3F3315E7623F8a/sources/contracts/AllowanceModule.sol | Allows to add a delegate. delegate Delegate that should be added. We have a collision for the indices of delegates Delegate already exists, nothing to do | function addDelegate(address delegate) public {
uint48 index = uint48(delegate);
require(index != uint(0), "index != uint(0)");
address currentDelegate = delegates[msg.sender][index].delegate;
if (currentDelegate != address(0)) {
require(currentDelegate == delegate, "curr... | 3,835,139 |
//Address: 0x7268f9c2bc9c9e65b4a16888cb5672531ce8e945
//Contract name: DayToken
//Balance: 0 Ether
//Verification Date: 9/15/2017
//Transacion Count: 4246
// CODE STARTS HERE
pragma solidity ^0.4.13;
////////////////// >>>>> Wallet Contract <<<<< ///////////////////
/// @title Multisignature wallet - Allows mul... | Used to set mintingDec Can be called only by owner _mintingDec bounty to be set./ | function setMintingDec(uint256 _mintingDec) onlyOwner {
require(!isInitialBlockTimestampSet);
mintingDec = _mintingDec;
}
| 1,800,531 |
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {SafeDecimalMath} from "./SafeDecimalMath.sol";... | Liquidate loans at or below issuance ratio check msg.sender (liquidator's wallet) has sufficient Check loan exists and is open calculate amount to liquidate to fix ratio including accrued interest cap debt to liquidate burn funds from msg.sender for amount to liquidate Send interests paid to fee pool and record loan am... | function liquidateLoan(
address _loanCreatorsAddress,
uint256 _loanID,
uint256 _debtToCover
) external nonReentrant {
require(IERC20(address(syntharb())).balanceOf(msg.sender) >= _debtToCover, "Not enough balance");
SynthLoanStruct memory synthLoan = _getLoanFromStorag... | 6,308,976 |
pragma solidity 0.5.10;
contract Context {
constructor () internal { }
function _MSGSENDER793() internal view returns (address payable) { //inject NONSTANDARD NAMING
return msg.sender;
}
function _MSGDATA330() ... | inject NONSTANDARD NAMING | function GETSECRETHASHESFORLOAN447(address addr_) private returns (bytes32[4] memory) { | 1,784,301 |
pragma solidity 0.5.11;
/**
* @dev Interface for Aaves A Token
* Documentation: https://developers.aave.com/#atokens
*/
interface IAaveAToken {
/**
* @notice Non-standard ERC20 function to redeem an _amount of aTokens for the underlying
* asset, burning the aTokens during the process.
* @param _a... | Interface for Aaves A Token/ | interface IAaveAToken {
function redeem(uint256 _amount) external;
function balanceOf(address _user) external view returns (uint256);
}
| 6,460,625 |
// SPDX-License-Identifier: MIT
// Welcome to the Golden Gumball Machine
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/uti... | / HARD CHECK: Require the sender be the owner of the Golden Gumball Token HARD CHECK: Require no current Gumball purchase in queue HARD CHECK: Requires Gumball contract to be approved Inserts Golden Gumball Token into the machine | function insertGumballToken(uint256 _nftId)
public
override
nonReentrant
onlyNotContract
gumballMachineActive
{
Gumballers storage gumballer = gumballers[_msgSender()];
require(
IERC721(address(this)).ownerOf(_nftId) == _msgSender(),
... | 13,006,602 |
pragma solidity ^0.4.24;
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint2... | Extend parent behavior requiring purchase to respect the beneficiary&39;s funding cap. beneficiary Token purchaser weiAmount Amount of wei contributed/ | function _preValidatePurchase(
address beneficiary,
uint256 weiAmount
)
internal
{
super._preValidatePurchase(beneficiary, weiAmount);
require(
_contributions[beneficiary].add(weiAmount) <= _caps[beneficiary]);
}
| 6,710,117 |
./full_match/100/0x62D007D4c4Db781C24FF6ac19279B9A9Ec32b344/sources/contracts/recover/recover.sol | Pay the arbitration fee to raise a dispute. To be called by the finder. UNTRUSTED. Note that this function mirrors payArbitrationFeeByFinder. _claimID The index of the claim./ Require that the total pay at least the arbitration cost. The owner still has to pay. This can also happen if he has paid, but arbitrationCos... | function payArbitrationFeeByFinder(uint _claimID) public payable {
Claim storage itemClaim = claims[_claimID];
Item storage item = items[itemClaim.itemID];
uint arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData);
require(
itemClaim.status < Status.Dispute... | 14,273,936 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.