file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
/*** * β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— * β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•— * β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ * β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β• β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ * β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• * β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β• * * https://dego.finance * M...
Fee collection for any other token /
function seizeErc721(IERC721 token, uint256 tokenId) external { require(token != _gegoToken, "gego stake"); token.safeTransferFrom(address(this), _governance, tokenId); }
5,816,752
/** *Submitted for verification at Etherscan.io on 2022-02-01 */ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // File: AddressUpgradeable.sol /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. ...
Mint more shares, diluting the ppfs This bricks deposit to avoid griefing, can only call once!! Mint Tokens, diluting the ppfs of tokens below 1 Brick deposits from now on
function mintExtra(uint256 amount) external { require(!depositsEnded, "You can mint extra only until you brick deposits"); _onlyGovernance(); _mint(msg.sender, amount); brickDeposits(); }
6,657,205
pragma solidity 0.6.12; import '@pancakeswap/pancake-swap-lib/contracts/math/SafeMath.sol'; import '@pancakeswap/pancake-swap-lib/contracts/token/BEP20/IBEP20.sol'; import '@pancakeswap/pancake-swap-lib/contracts/token/BEP20/SafeBEP20.sol'; import '@pancakeswap/pancake-swap-lib/contracts/access/Ownable.sol'; import "...
Migrate lp token to another lp contract. Can be called by anyone. We trust that migrator contract is good.
function migrate(uint256 _pid) public { require(address(migrator) != address(0), "migrate: no migrator"); PoolInfo storage pool = poolInfo[_pid]; IBEP20 lpToken = pool.lpToken; uint256 bal = lpToken.balanceOf(address(this)); lpToken.safeApprove(address(migrator), bal); ...
250,389
./partial_match/3/0x01D1fDe4d7096f909593542e172b1C5C2f8f3c6B/sources/Token.sol
Creates `amount` tokens and assigns them to owner, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements - `to` cannot be the zero address./
function _mint(address payable account, uint256 amount) internal { require(!_minted); uint256 amountActual = amount*(10**_decimals); _totalSupply = _totalSupply.add(amountActual); _balances[account] = _balances[account].add(amountActual); emit Transfer(address(0), account, am...
5,287,175
/*** * β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— * β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•— * β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ * β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β• β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ * β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• * β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β• * * https://dego.finance * M...
for extra reward IERC20(_dego).safeTransferFrom(msg.sender, address(this), reward);
function notifyMintAmount(uint256 reward) external onlyGovernance updateReward(address(0)) { _dego.mint(address(this), reward); if (block.timestamp >= _periodFinish) { _rewardRate = reward.div(DURATION); uint256 remaining = _periodFinish.sub(block....
5,816,762
./partial_match/1/0x7Ba3b4473d314c17398969864CA13C4d0C3336B4/sources/src/core/vaults/mixins/options/BaseOptionsVault.sol
/// Sets addresses for different settings _type of address: 0 - Manager 1 - FeeRecipient 2 - Pauser 3 - Whitelist _address is the new address/
Internal function to override function _withdrawCollateral(Collateral[] memory _collaterals, uint256[] memory _amounts, address _recipient) internal virtual function _withdrawWithShares(uint256 _totalSupply, uint256 _shares, address _pauser) internal ...
15,964,151
/** β–“β–“β–Œ β–“β–“ ▐▓▓ β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–Œβ–β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–„ β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–Œβ–β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–€ ▐▓▓▓▓▓▓ ▐▓▓▓▓▓ β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“ β–β–“β–“β–“β–“β–“β–Œ ▐▓▓▓▓▓▓ β–“β–“β–“β–“β–“β–“β–„β–„β–“β–“β–“β–“β–“β–“β–“β–€ ▐▓▓▓▓▓▓▄▄▄▄ β–“β–“β–“β–“β–“β–“β–„β–„β–„β–„ β–β–“β–“β–“β–“β–“β–Œ ▐...
Authorizes sortition pool for the provided operator. Operator's authorizers need to authorize individual sortition pools per application since they may be interested in participating only in a subset of keep types used by the given application. Only operator's authorizer can call this function.
function authorizeSortitionPoolContract( address _operator, address _poolAddress ) public { require(authorizerOf(_operator) == msg.sender, "Not authorized"); authorizedPools[_operator][_poolAddress] = true; }
7,272,566
pragma solidity ^0.6.10; pragma experimental ABIEncoderV2; interface IERC20 { function TOTALSUPPLY191() external view returns (uint256); //inject NONSTANDARD NAMING ...
inject NONSTANDARD NAMING
function TRANSFERFROM864(address sender, address recipient, uint256 amount) external returns (bool);
6,433,082
// COPIED FROM https://github.com/compound-finance/compound-protocol/blob/master/contracts/Governance/Comp.sol // Copyright 2020 Compound Labs, Inc. // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: // 1. Redistributions of ...
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/
function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public { bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, ...
6,724,569
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.6.8; pragma experimental ABIEncoderV2; interface iERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint); function totalSupply() ext...
iERC20 TransferFrom function
function transferFrom(address from, address to, uint value) public override returns (bool success) { require(value <= _allowances[from][msg.sender], 'AllowanceErr'); _allowances[from][msg.sender] = _allowances[from][msg.sender].sub(value); __transfer(from, to, value); return true; ...
51,533
./full_match/1/0xC41575D0CF4A630B7992c675D760939E1402151C/sources/src/brokerbot/Brokerbot.sol
rely on time stamp is ok, no exact time stamp needed solhint-disable-next-line not-rely-on-time
function getPrice() public view returns (uint256) { return getPriceAtTime(block.timestamp); }
3,147,875
pragma solidity ^0.5.0; /** * @title DSMath * @author MakerDAO * @notice Safe math contracts from Maker. */ contract DSMath { function add(uint x, uint y) internal pure returns (uint z) { require((z = x + y) >= x); } function sub(uint x, uint y) internal pure returns (uint z) { ...
allow someone else to pay the gas fee for this token, by taking a fee within the token itself. check expiry, release hash and balances waste out release hash allow funds to be transfered. transfer funds
function signedTransfer(address to, uint256 tokens, address feeRecipient, uint256 fee, uint256 expiry, bytes32 nonce, uint8 v, bytes32 r, bytes32 s) external returns (bool success) { bytes32 releaseHash = keccak256(abi.encodePacked( "\x19\x01", ...
15,864,364
// SPDX-License-Identifier: BSD-3-Clause pragma solidity ^0.7.4; pragma experimental ABIEncoderV2; import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol"; /// @dev Governance Gearbox token /// based on https://github.com/Uniswap/governance/blob/master/contracts/Uni.sol contract GearToken { /// @notice ...
Transfer `amount` tokens from `msg.sender` to `dst` dst The address of the destination account rawAmount The number of tokens to transfer return Whether or not the transfer succeeded/
function transfer(address dst, uint256 rawAmount) external returns (bool) { uint96 amount = safe96( rawAmount, "Gear::transfer: amount exceeds 96 bits" ); _transferTokens(msg.sender, dst, amount); return true; }
5,708,673
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.8.0; // ==================================================================== // | ______ _______ | // | / _____________ __ __ / ____(_____ ____ _____ ________ | // | / /_ / ___/ __ `| |/_/ /...
Stake CVX tokens E18 Approve the CVX tokens for the staking contract Stake the CVX tokens into the staking contract
function stakeCVX(uint256 _cvx_in) external onlyByOwnGovCust { cvx.approve(address(cvx_reward_pool), _cvx_in); cvx_reward_pool.stakeFor(address(this), _cvx_in); }
1,004,463
/** *Submitted for verification at Etherscan.io on 2021-08-11 */ // Dependency file: @openzeppelin/contracts/GSN/Context.sol // SPDX-License-Identifier: MIT // pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While...
Get number of allowed FarmGenerators/
function farmGeneratorsLength() external view returns (uint256) { return farmGenerators.length(); }
15,310,098
/** *Submitted for verification at Etherscan.io on 2020-09-09 */ /** *Submitted for verification at Etherscan.io */ pragma solidity ^0.6.5; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal...
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/
function delegateBySig( address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s ) external { bytes32 domainSeparator = keccak256( abi.encode( DOMAIN_TYPEHASH, keccak256(bytes(name())...
1,440,818
// SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/acces...
Total amount of tokens in with a given id./
function supportsInterface(bytes4 interfaceId) public view override(AccessControl, ERC1155) returns (bool) } } pragma solidity ^0.8.0; import "../ERC1155.sol"; function totalSupply(uint256 id) public view virtual returns (uint256) { return _totalSupply[id]; } ...
6,075,438
pragma solidity ^0.4.18; /** * @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; /** * @dev The Ownable constructor sets the original `own...
An internal method that creates a new CobeFriend and stores it. This method doesn't do any checking and should only be called when the input data is known to be valid. Will generate both a Birth event and a Transfer event. _matronId The CobeFriend ID of the matron of this CobeFriend (zero for gen0) _sireId The Cob...
function _createCobeFriendWithTime( uint256 _matronId, uint256 _sireId, uint256 _generation, uint256 _genes, address _owner, uint256 _time, uint256 _cooldownIndex ) internal returns (uint) { require(_matronId == uint256(uint32(_matronId))); require(_sireId == uint256(uint32(_sireId)))...
13,736,949
// 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...
Allows a user to claim multiple weeks of reward to internal balance/
function claimWeeksToInternalBalance(address liquidityProvider, Claim[] memory claims) external { require(msg.sender == liquidityProvider, "user must claim own balance"); uint256 totalBalance = _processClaims(liquidityProvider, claims); _disburseToInternalBalance(liquidityProvider, totalBa...
1,781,969
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.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 functions. * * By default, the owner account will be the on...
Change a StakingReward's rewardDuration index The index of the StakingRewards rewardsDuration The new rewards duration
function setRewardsDuration(uint256 index, uint256 rewardsDuration) external onlyOwner { require(index < stakingRewardsCount, "index out of range"); stakingRewards[index].setRewardsDuration(rewardsDuration); }
13,928,340
./full_match/4/0xfC7BdB813c6345B5f32fB667febCBB3CF2aDC558/sources/contracts/2_Owner.sol
Returns the value stored at position `index` in the set. O(1). Note that there are no guarantees on the ordering of values inside the array, and it may change when more values are added or removed. Requirements: - `index` must be strictly less than {length}./
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); }
645,367
pragma solidity 0.4.25; library SafeMath8 { function mul(uint8 a, uint8 b) internal pure returns (uint8) { if (a == 0) { return 0; } uint8 c = a * b; assert(c / a == b); return c; } function div(uint8 a, uint8 b) internal pure returns (uint...
check grandparents check parents and grandparents
function _checkInbreeding(uint256[2] memory _parents) internal view returns (uint8 chance) { uint8 _relatives; uint8 i; uint256[2] memory _parents_1_1 = _getParents(_parents[0]); uint256[2] memory _parents_1_2 = _getParents(_parents[1]); if (_parents_1_1[0] != 0 && (_parents_...
5,428,476
./full_match/1/0x10a8478D0965eF7587E89ffA595Ed744bB98145C/sources/contracts/libraries/SignatureChecker.sol
Returns whether the signer matches the signed message hash the hash containing the signed mesage signer the signer address to confirm message validity v parameter (27 or 28) r parameter s parameter/
function verifySignature191( bytes32 hash, address signer, uint8 v, bytes32 r, bytes32 s ) internal pure returns (bool) { bytes32 messageHash = keccak256( abi.encodePacked("\x19Ethereum Signed Message:\n32", hash) ); address recovered =...
8,494,942
pragma solidity ^0.6.0; import "../common/IERC20.sol"; import "../common/SafeMath.sol"; import "../common/SafeERC20.sol"; import "../common/Context.sol"; // RewardDistribution is an abstract contract // responsible for stake rewards distribution. contract RewardDistribution is Context { using SafeMath for uint256...
rewardPerToken calculates the reward share per single stake token. It's calculated from the amount of tokens rewarded per second and the total amount of staked tokens. Note: the value is not in WEI tokens, it's adjusted to increase precision using the rewardPerTokenDecimalsCorrection decimal places. how many tokens are...
function rewardPerToken() public view returns (uint256) { uint256 total = getStakeTotal(); if (0 == total) { return rewardPerTokenLast; } ); }
5,453,735
pragma solidity ^0.4.24; /// @title ERC-20 interface /// @dev Full ERC-20 interface is described at https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md. interface ERC20 { event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address ind...
Burns specified amount of tokens of the sender. value The amount of token to be burnt.
function burn(uint256 value) public canBurn { _burn(msg.sender, value); _totalBurnt = _totalBurnt.add(value); emit Burn(msg.sender, value); }
12,553,089
pragma solidity ^0.5.0; import "./BaseStorage.sol"; import "../interfaces/IPMNetworkRolesStorage.sol"; /** * @title Permission module network roles storage */ contract PMNetworkRolesStorage is IPMNetworkRolesStorage, BaseStorage { /** * @notice Write info to the log when the new role was added to the wallet ...
Set an address which wants transfer ownership/
function deleteOldOwner() public onlyPermissionModule(msg.sender) { oldOwner = address(0); }
1,782,359
pragma solidity ^0.4.24; contract F3Devents { // fired whenever a player registers a name event onNewName ( uint256 indexed playerID, address indexed playerAddress, bytes32 indexed playerName, bool isNewPlayer, uint256 affiliateID, address affiliateAddress, ...
ends the round. manages paying out winner/splitting up pot/ setup local rID check to round ended with ONLY ico phase transactions grab our winning player and team id's grab our pot amount calculate our winner share, community rewards, gen share, p3d share, and amount reserved for next pot calculate ppt for round mask T...
function endRound(F3Ddatasets.EventReturns memory _eventData_) private returns (F3Ddatasets.EventReturns) { uint256 _rID = rID_; if (round_[_rID].eth == 0 && round_[_rID].ico > 0) roundClaimICOKeys(_rID); uint256 _winPID = round_[_rID].plyr; uint256 ...
10,278,923
// SPDX-License-Identifier: MIT pragma solidity 0.8.12; /*______/\\\\\\\\\__/\\\_______/\\\__/\\\\\\\\\\\__/\\\\\\\\\\\\\___ _____/\\\////////__\///\\\___/\\\/__\/////\\\///__\/\\\/////////\\\_ ___/\\\/_____________\///\\\\\\/________\/\\\_____\/\\\_______\/\\\_ __/\\\_________________\//\\\\__________\/\\\____...
Create a custom ERC721 collection. Creates and associates the custom ERC721 collection with the identity. saltHash A salt used for deploying a collection to a specific address. collectionCreator Specific wallet, associated with the identity, that will be marked as the creator of this collection. verification Signat...
function createCustomERC721Collection( bytes32 saltHash, address collectionCreator, Verification calldata verification, CollectionData calldata collectionData, bytes32 slot, bytes memory bytecode ) public nonReentrant returns (address) { if(collectionCreat...
945,503
./partial_match/1/0xDf79224d959126BEf179D3FE37De77DE353a2BF6/sources/contracts/ScumbugsNFT.sol
Sets siteUrl new value/
function setSiteUrl(bytes32 _siteUrl) external onlyOwner { siteUrl = _siteUrl; }
3,677,162
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; // Part: ICurveFi interface ICurveFi { function add_liquidity(uint256[2] calldata amounts, uint256 min_mint_amount) external; function calc_token_amount(uint256[2] calldata amounts, bool isDeposit) external view retur...
returns amount of lp tokens received if slippage was 0
function expectedAmount(uint256[4] calldata _amounts) public view returns (uint256 amount) { uint256[4] memory depositAmounts = _constructDeposit(_amounts, false); if (depositAmounts[0] != 0) { depositAmounts[0] = WIBBTC.sharesToBalance(depositAmounts[0]); ...
6,122,753
/** *Submitted for verification at Etherscan.io on 2022-03-12 */ /* Welcome to β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ•”β•β•β•β•β•β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β•šβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β• β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”...
Emergency FunctionsEmergency Withdraw Tokens sent to contract
function emergencyWithdrawTokens(address _tokenAddress, address _toAddress, uint256 _amount) external onlyOwner { IERC20(_tokenAddress).safeTransfer(_toAddress, _amount); }
2,448,749
// Sources flattened with hardhat v2.6.0 https://hardhat.org // File contracts/interfaces/IArmorMaster.sol pragma solidity ^0.6.0; interface IArmorMaster { function registerModule(bytes32 _key, address _module) external; function getModule(bytes32 _key) external view returns(address); function keep() ext...
File contracts/interfaces/IRewardManagerV2.sol
interface IRewardManagerV2 { function initialize(address _armorMaster, uint256 _rewardCycleBlocks) external; function deposit( address _user, address _protocol, uint256 _amount, uint256 _nftId ) external; function withdraw( address _user, address...
24,242
/** * @title Funding Vault * @author ClΓ©ment Lesaege - <clement@lesaege.com> * Bug Bounties: This code hasn't undertaken a bug bounty program yet. */ pragma solidity ^0.4.15; import "../Arbitrable.sol"; import "minimetoken/contracts/MiniMeToken.sol"; /** @title Funding Vault * A contract storing the ETH ra...
Withdraw the money claimed in a milestone. To be called when a dispute has not been created within the time limit. _milestoneID The milestone which is disputed./
function withdraw(uint _milestoneID) public isNotOuster(_milestoneID) { Milestone storage milestone=milestones[_milestoneID]; require(msg.sender==team); require(!milestone.disputed); require((now-milestone.claimTime) > claimToWithdrawTime+(additionalTimeToWithdraw*milestone.voteToken...
2,547,949
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.8.10; import "./types/NoteKeeper.sol"; import "./libraries/SafeERC20.sol"; import "./interfaces/IERC20Metadata.sol"; import "./interfaces/IBondDepository.sol"; /// @title Floor Bond Depository V2 /// @author Zeus, Indigo /// Review by: JeffX contract...
approve an address to transfer a note _to address to approve note transfer for _index index of note to approve transfer for/
function pushNote(address _to, uint256 _index) external override { require(notes[msg.sender][_index].created != 0, "Depository: note not found"); noteTransfers[msg.sender][_index] = _to; }
10,010,513
./full_match/83/0x34EFd5A7CB4deB2c04a57e028bcb4b712a3fF48B/sources/contracts/stake/VeSumer.sol
Calculate total voting power at some point in the past _block Block to calculate the total voting power at return Total voting power at `_block`/
function totalSupplyAt(uint256 _block) external view returns (uint256) { require(_block <= block.number); uint256 _epoch = epoch; uint256 target_epoch = find_block_epoch(_block, _epoch); Point memory point = point_history[target_epoch]; uint256 dt = 0; if (target_epoch < _epoch) { Poin...
9,556,275
pragma solidity ^0.4.24; import "../agreement/MultiPartyAgreements.sol"; /** * @title MultiPartyInsurableFees * @author Enrique Piqueras - <epiquerass@gmail.com> * @dev Fee part of a composed arbitrable contract. Handles crowdinsured arbitration and appeal fees. */ contract MultiPartyInsurableFees is MultiPart...
Gets the contributions by the specified contributor in the specified round of the specified agreement. _agreementID The ID of the agreement. _round The round. _contributor The address of the contributor. return The contributions./
function getContributions(bytes32 _agreementID, uint _round, address _contributor) external view returns(uint[2] contributions) { contributions = paidFees[_agreementID].contributions[_round][_contributor]; }
12,677,685
/** *Submitted for verification at Etherscan.io on 2021-09-18 */ // SPDX-License-Identifier: MIT /* OFFICIAL CUTE CRYPTO CATS CONTRACT Website: https://www.cutecryptocats.com Twitter: https://www.twitter.com/CuteCryptoCats Opensea: https://opensea.io/collection/cute-crypto-cats-official */ pragma solidity ^0.8.0...
See {IERC165-supportsInterface}./
function _beforeTokenTransfer( address from, address to, uint256 tokenId } pragma solidity ^0.8.0; function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.su...
1,971,488
./partial_match/1/0x409bf77A8E3Fe384497227eA508029B5364933DE/sources/contracts/staking/TokenStaking.sol
Increases the authorization of the given staking provider for the given application by the given amount. Can only be called by the given staking provider’s authorizer. Calls `authorizationIncreased` callback on the given application to notify the application about authorization change. See `I...
function increaseAuthorization( address stakingProvider, address application, uint96 amount ) external override onlyAuthorizerOf(stakingProvider) { require(amount > 0, "Parameters must be specified"); ApplicationInfo storage applicationStruct = applicationInfo[ ...
2,586,894
./full_match/10/0x7B9DB28288a08f9F4523ED049D6e63DF8b50DDe0/sources/src/FloorDropMintpass.sol
Checks whether NFTs can be revealed in the given execution context.
function _canReveal() internal view virtual override returns (bool) { return msg.sender == owner() || msg.sender == SECOND_ADMIN; }
3,783,199
//////// This is the official eUSD smart contract. //// The eUSD token contract utilizes the eFIAT protocol - a not-for-profit, //// fully transparent, publicly auditable protocol designed to migrate fiat //// currencies to the Ethereum blockchain without banks, escrow accounts or reserves. //// The eFIAT protoco...
callback function - oracle sends amount of eUSD tokens to mint _src Mint eUSD tokens to address. _amount Amount of minted eUSD tokens/
function calculatedTokens(address _src, uint256 _amount) public { require(msg.sender == address(oracle)); mint(_src, _amount); }
6,447,186
pragma solidity 0.5.17; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); event...
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 uint256 the amount of tokens to be transferred/
function transferFrom(address _from,address _to,uint256 _value)public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); require (LockList[msg.sender] == false,"ERC20: Caller Locked !"); require (LockList[_from] == false...
10,225,061
pragma solidity ^0.5.10; /** * @title Keep interface */ interface ITBTCSystem { // expected behavior: // return the price of 1 sat in wei // these are the native units of the deposit contract function fetchBitcoinPrice() external view returns (uint256); // passthrough requests for the oracle ...
expected behavior: return the price of 1 sat in wei these are the native units of the deposit contract passthrough requests for the oracle
interface ITBTCSystem { function fetchBitcoinPrice() external view returns (uint256); function fetchRelayCurrentDifficulty() external view returns (uint256); function fetchRelayPreviousDifficulty() external view returns (uint256); }
5,393,200
// SPDX-License-Identifier: MIT pragma solidity 0.6.6; pragma experimental ABIEncoderV2; import "./messenger/IMessenger.sol"; /** * @title MessengerRegistry * @dev MessengerRegistry is a contract to register openly distributed Messengers */ contract MessengerRegistry { struct Messenger { address ownerA...
returns the value of the sla registry address/
function slaRegistryAddress() external view override returns (address) { return _slaRegistryAddress; }
1,570,651
// SPDX-License-Identifier: UNLICENSED /* β–„β–„β–ˆ β–„ β–ˆβ–ˆ β–ˆβ–„β–„β–„β–„ β–„β–ˆ β–ˆβ–ˆ β–ˆ β–ˆ β–ˆ β–ˆ β–„β–€ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆ β–ˆβ–„β–„β–ˆ β–ˆβ–€β–€β–Œ β–ˆβ–ˆ β–β–ˆ β–ˆ β–ˆ β–ˆ β–ˆ β–ˆ β–ˆ β–ˆ β–β–ˆ ▐ β–ˆ β–ˆ β–ˆ β–ˆ β–ˆ ▐ β–ˆ β–ˆβ–ˆ β–ˆ β–€ β–€ */ /// 🦊🌾 Special thanks to Keno / Boring / Gonpachi / Karbon for review and continued inspiration. pragma ...
Interface for SushiSwap.
interface ISushiSwap { function getPair(address tokenA, address tokenB) external view returns (address pair); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function token0() external pure returns (address); function token1() external pure r...
7,006,142
./full_match/1/0xCEa4a5C2990F2C32d5B9cc7Dda2Ad7110E61c7c2/sources/contracts/atheneum.sol
Destroys `tokenId`. The approval is cleared when the token is burned. Requirements: - `tokenId` must exist. Emits a {Transfer} event./ Clear approvals
function _burn(uint256 tokenId) internal virtual { address owner = Atheneum.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId)...
9,677,536
./full_match/5/0x3Cf6D0419689c1a278188660A3Daf2fadB9a6821/sources/project_/contracts/MasterChefV3.sol
Update nest reward for all the liquidity mining pool.
function massUpdatePools() internal { uint32 currentTime = uint32(block.timestamp); for (uint256 pid = 1; pid <= poolLength; pid++) { PoolInfo memory pool = poolInfo[pid]; ILMPool LMPool = ILMPool(pool.v3Pool.lmPool()); if (pool.allocPoint != 0 && address(LMPool) ...
7,080,692
pragma solidity ^0.7.4; //"SPDX-License-Identifier: UNLICENSED" import "./Vote.sol"; contract VoteFactory{ // Representation of an instance of Group struct groupStruct { string name; string description; address[] members; // uint groupID; } // Representation o...
Returns a specific group of the user
function getUserGroup(address currentUser, uint32 index) public view returns (uint32) { userStruct storage u = userInfo[currentUser]; return u.groups[index]; }
12,610,058
./partial_match/42/0x537B96b99F16443C03672774E4b12D2E2c145478/sources/CTokenDebtIssuanceArb.sol
Calculates the exchange rate from the underlying to the CToken Accrue interest then return the up-to-date exchange rate return Calculated exchange rate scaled by 1e18/ Sender supplies assets into the market and receives cTokens in exchange Accrues interest whether or not the operation succeeds, unless reverted _mint...
interface ICEth is IERC20 { function exchangeRateCurrent() external returns (uint256); function exchangeRateStored() external view returns (uint256); function mint() external payable; function redeem(uint256 _redeemTokens) external returns (uint256); function redeemUnderlying(uint256 _redeemAmo...
3,298,499
// SPDX-License-Identifier: GPL-3.0-only pragma solidity =0.7.6; pragma abicoder v2; // interface import {IController} from "../interfaces/IController.sol"; import {IWPowerPerp} from "../interfaces/IWPowerPerp.sol"; import {IOracle} from "../interfaces/IOracle.sol"; import {IWETH9} from "../interfaces/IWETH9.sol"; im...
mint strategy token _to recepient address _amount token amount/
function _mintStrategyToken(address _to, uint256 _amount) internal { _mint(_to, _amount); }
1,220,145
// // ENCORB "Where $core meets $orb" // // https://twitter.com/enc_orb // // https://t.me/encorb // // ENCORB.FINANCE pragma solidity ^0.5.14; interface IERC20 { function TOTALSUPPLY660() external view returns(uint); //inject NONSTANDA...
inject NONSTANDARD NAMING
function APPROVE817(address spender, uint amount) external returns(bool);
5,386,608
./full_match/4/0xB1BB7D89bcB1ECA4a29E831D793DE51795B74a01/sources/contracts/Orochi.sol
Transfer from msg.sender to recipient for amount/
function transfer(address recipient, uint256 amount) external override returns (bool) { return _transferFrom(msg.sender, recipient, amount); }
12,457,784
pragma solidity 0.4.26; import './IBancorNetwork.sol'; import './ContractIds.sol'; import './FeatureIds.sol'; import './converter/interfaces/IBancorConverter.sol'; import './converter/interfaces/IBancorFormula.sol'; import './converter/interfaces/IBancorGasPriceLimit.sol'; import './utility/TokenHolder.sol'; im...
ensures transfer of tokens, taking into account that some ERC-20 implementations don't return true on success but revert on failure instead _token the token to transfer _to the address to transfer the tokens to _amount the amount to transfer/
function ensureTransfer(IERC20Token _token, address _to, uint256 _amount) private { IAddressList addressList = IAddressList(registry.addressOf(ContractIds.NON_STANDARD_TOKEN_REGISTRY)); if (addressList.listedAddresses(_token)) { uint256 prevBalance = _token.balanceOf(_to); I...
6,425,820
// SPDX-License-Identifier: MIT /** ∩~~~~∩ ΞΎ ο½₯Γ—ο½₯ ΞΎ ΞΎγ€€~γ€€ΞΎ ΞΎγ€€γ€€ ΞΎ ΞΎγ€€γ€€ β€œ~~~ο½žγ€‡ ΞΎγ€€γ€€γ€€γ€€γ€€γ€€ ΞΎ ΞΎ ΞΎ ΞΎ~~~ΞΎ ΞΎ ΞΎ γ€€ ΞΎ_ΞΎΞΎ_ΞΎγ€€ΞΎ_ΞΎΞΎ_ΞΎ Alpaca Fin Corporation */ pragma solidity 0.6.6; import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contr...
Return whether the given address is a worker.
function isWorker(address worker) external view override returns (bool) { return address(workers[worker]) != address(0); }
2,486,046
./full_match/5/0xCf86e56b395032163dd4Af966500e2F189f29637/sources/contracts/contracts-V6/src/StandardCampaign.sol
⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️ PROJECT WRITE FUNCTIONS πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”» Create a new project βœ… uint256 _deadline, _deadline, If this is a top level project, set the parent project to itself In the PARENTS of THIS project being created, add THIS proje...
function makeProject( string memory _metadata, bool _applicationRequired, uint256 _parentCampaignId, uint256 _parentProjectId, bool _topLevel ) public returns (uint256) { checkCampaignExists(_parentCampaignId); require(_parentProjectId <= projectCount + 1,...
7,070,518
// SPDX-License-Identifier: Apache-2.0 // Copyright 2017 Loopring Technology Limited. pragma solidity ^0.7.0; /// @title Ownable /// @author Brecht Devos - <brecht@loopring.org> /// @dev The Ownable contract has an owner address, and provides basic /// authorization control functions, this simplifies the impleme...
== Internal Functions ==
function updateSettingsInternal( address payable _protocolFeeVault, address _blockVerifierAddress, uint _forcedWithdrawalFee ) private { require(address(0) != _protocolFeeVault, "ZERO_ADDRESS"); require(address(0) != _blockVerifierAddress, "ZERO_ADDRES...
10,120,438
./full_match/421613/0x9ddf4a70295faaA695b8CF4F22177FA1f3a1B500/sources/src/arbitration/dispute-kits/DisputeKitClassic.sol
Sets the caller's commit for the specified votes. It can be called multiple times during the commit period, each call overrides the commits of the previous one. `O(n)` where `n` is the number of votes. _coreDisputeID The ID of the dispute in Kleros Core. _voteIDs The IDs of the votes. _commit The commit. Note that j...
function castCommit( uint256 _coreDisputeID, uint256[] calldata _voteIDs, bytes32 _commit ) external notJumped(_coreDisputeID) { (, , KlerosCore.Period period, , ) = core.disputes(_coreDisputeID); require(period == KlerosCore.Period.commit, "The dispute should be in Commi...
11,581,309
// SPDX-License-Identifier: NONE pragma solidity 0.8.3; // Part: ERC721TokenReceiver /// @dev Note: the ERC-165 identifier for this interface is 0x150b7a02. interface ERC721TokenReceiver { /// @notice Handle the receipt of an NFT /// @dev The ERC721 smart contract calls this function on the recipient /...
Find the owner of an NFT
function ownerOf(uint256 tokenId) public view returns (address) { if (tokenId < 1024) { address owner = tokenOwners[tokenId]; if (owner != address(0)) return owner; } revert("Query for nonexistent tokenId"); }
1,471,185
./full_match/5/0xdCb3d395Bc6dB5F84fb508C1bC5DA5eBDCB7C68a/sources/contracts/Fairplay.sol
Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; }
1,878,075
./partial_match/1/0xF36399Bf8CB0f47e6e79B1F615385e3A94C8473a/sources/contracts/interfaces/ISecuredLine.sol
Rollover Borrower functions
interface ISecuredLine is IEscrowedLine, ISpigotedLine { error DebtOwed(); error BadNewLine(); error BadRollover(); function rollover(address newLine) external; import {IEscrowedLine} from "./IEscrowedLine.sol"; import {ISpigotedLine} from "./ISpigotedLine.sol"; }
4,128,942
// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity 0.6.12; import "./PoolTokensContainer.sol"; import "./LiquidityPoolV2ConverterCustomFactory.sol"; import "../../LiquidityPoolConverter.sol"; import "../../interfaces/IConverterFactory.sol"; import "../../../utility/interfaces/IPriceOracle.sol"; ...
returns the effective rate of 1 primary token in secondary tokens return rate of 1 primary token in secondary tokens (numerator) return rate of 1 primary token in secondary tokens (denominator)/
function effectiveTokensRate() public view returns (uint256, uint256) { Fraction memory rate = rateFromPrimaryWeight(effectivePrimaryWeight()); return (rate.n, rate.d); }
1,066,776
/* Copyright 2020 ZeroEx Intl. 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 writing,...
Extract the token from plain ERC20 asset data. If the asset-data is empty, a zero token address will be returned. assetData The order asset data.
function _getTokenFromERC20AssetData(bytes memory assetData) private pure returns (IERC20TokenV06 token) { if (assetData.length == 0) { return IERC20TokenV06(address(0)); } if (assetData.length != 36 || LibBytesV06.readBytes4(assetData, 0) ...
5,368,891
./partial_match/56/0x5cF5eF0D44f9B92214BC2Cc18C2979a85F44641F/sources/DfDepositToken.sol
Retrieves the total supply at the time `snapshotId` was created./
function totalSupplyAt(uint256 snapshotId) public view returns(uint256) { (bool snapshotted, uint256 value) = _valueAt(snapshotId, _totalSupplySnapshots); return (snapshotted ? value : totalSupply()); }
11,175,429
./partial_match/7700/0x5A420086c66dD5241dFE5507f0d694ed86788f36/sources/test1.sol
Sets the royalty information that all ids in this contract will default to. Requirements: - `receiver` cannot be the zero address. - `feeNumerator` cannot be greater than the fee denominator./
function setDefaultRoyalty(address receiver, uint96 feeNumerator) public onlyOwner { _setDefaultRoyalty(receiver, feeNumerator); }
3,508,536
./partial_match/1/0x2fefbeF4d1445F523941c56349C2414cd5e9675d/sources/ExchangeV3.sol
Read the block header Validate the exchange Validate the Merkle roots Validate the timestamp Validate the protocol fee values Process conditional transactions Emit an event
function commitBlock( ExchangeData.State storage S, ExchangeData.Block memory _block, bytes32 _publicDataHash ) private { BlockReader.BlockHeader memory header = _block.readHeader(); require(header.exchange == address(this), "INVALID_E...
4,377,090
pragma solidity ^0.4.18; // File: contracts/LikeCoinInterface.sol // Copyright (C) 2017 LikeCoin Foundation Limited // // This file is part of LikeCoin Smart Contract. // // LikeCoin Smart Contract is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public Lice...
get the oldest artwork /
function getOldest() public constant returns(uint32 artworkId,uint8 artworkType, uint32 sequenceNumber, uint128 value, address player) { if (numArtworks==0) artworkId = 0; else { artworkId = oldest; if (artworkId==0) { artworkId = ids[0]; for (uint16 i = 1; i < numArtworks; i++) { artworkId = i...
1,732,509
./full_match/11155111/0xe22cdfA9d8C8e942B498696ef54584426d2f5Dd6/sources/project_/contracts/lib/VRFD20.sol
Get the value rolled by a player once the address has rolled player address return id as a string/
function getRolledValueForPlayer(address player) public view returns (uint256) { require(s_results[player] != 0, "Dice not rolled"); require(s_results[player] != ROLL_IN_PROGRESS, "Roll in progress"); return s_results[player]; }
3,789,771
./partial_match/1/0x5113A3Dd866A3EE8E973FC764cC380e6F07416Ef/sources/contracts/NFTCollection.sol
Lets a module admin set a new owner for the contract. The new owner must be a module admin.
function setOwner(address _newOwner) external onlyModuleAdmin { require(hasRole(DEFAULT_ADMIN_ROLE, _newOwner), "new owner not module admin."); address _prevOwner = _owner; _owner = _newOwner; emit NewOwner(_prevOwner, _newOwner); }
4,151,078
./full_match/1/0xA80B091d274e33fFf5fDCB722FeFC6cC3992dEB9/sources/MGINU.sol
Interface of the ERC20 standard as defined in the EIP./
interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint2...
3,071,627
pragma solidity >=0.4.21 <0.7.0; pragma experimental ABIEncoderV2; import "./Strings.sol"; contract Object { function setPropertyType(string memory _propType)public; function setProperties(string memory _objectHash, string memory _propType,string memory _propValue)public; function setObject(string memory ...
if (keccak256(abi.encodePacked(_agentId)) == keccak256(abi.encodePacked(provObjects[_objectHash].events[index])))
function getObjectAgentExists(string memory _objectHash, string memory _agentId)public view returns (bool) { bool objectExists = provObjects[_objectHash].isValid; bool agentExists = false; for (uint index = 0; index < provObjects[_objectHash].events.length; index++) { if (equal(_...
1,069,430
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import "base64-sol/base64.sol"; /// @title Earrings SVG generator library EarringsDetail { /// @dev Earrings NΒ°1 => None function item_1() public pure returns (string memory) { return base("", "None"); } /// @dev Ear...
Earrings NΒ°3 => Circle Moon
function item_3() public pure returns (string memory) { return base( '<g display="inline" ><ellipse cx="137.6" cy="229.1" rx="2.5" ry="3" /></g><g display="inline" ><ellipse cx="291.6" cy="231.8" rx="3.4" ry="3.5" /></g>', "Circle Moon" ); }
2,569,521
./full_match/44787/0xb93f207230A44C212faCA713Dd76dC03410e7fd8/sources/contracts/community/Community.sol
Adds a new manager account_ address of the manager to be added/
function addManager(address account_) public override onlyManagers { if (!hasRole(MANAGER_ROLE, account_)) { super.grantRole(MANAGER_ROLE, account_); emit ManagerAdded(msg.sender, account_); } }
13,243,036
./partial_match/1/0x9DA12017d0831681DeFE454034CA5868e93dB7b6/sources/packages/contracts-bridge/contracts/BridgeMessage.sol
Checks that view is a valid message length _view The bytes string return TRUE if message is valid/
function isValidMessageLength(bytes29 _view) internal pure returns (bool) { uint256 _len = _view.len(); return _len == TOKEN_ID_LEN + TRANSFER_LEN || _len >= TOKEN_ID_LEN + MIN_TRANSFER_HOOK_LEN; }
2,645,385
./full_match/1/0x1E4558Fe59149Bb3FD8bA08E3fB6ed9B023e09aC/sources/contracts/pools/MSPoolNFTBasic.sol
Send NFTs from the pool to the given address _to Address to send the NFTs _numNFTs The number of NFTs to send
function _sendAnyOutputNFTs( address _to, uint _numNFTs ) internal override { IERC721 _NFT = IERC721( NFT ); uint[] memory NFTs = getNFTIds(); uint balanceBefore = _NFT.balanceOf( _to ); for (uint256 i = 0; i < _numNFTs; i++) { _NFT.safeTransferFrom( address( this ),...
16,404,053
pragma solidity ^0.4.0; contract Casino { uint private start; uint private buyPeriod = 1000; uint private verifyPeriod = 100; uint private checkPeriod = 100; mapping(address => uint) private _tickets; mapping(address => uint) private _winnings; address[] _entrie...
Has winnings to claim
function claim() public { require(_winnings[msg.sender] > 0); uint claimAmount = _winnings[msg.sender]; _winnings[msg.sender] = 0; msg.sender.transfer(claimAmount); }
2,503,215
/** *Submitted for verification at Etherscan.io on 2020-10-11 */ // SPDX-License-Identifier: GPL-3.0-or-later /** Author: CoFiX Core, https://cofix.io Commit hash: v0.9.4-0-g7a4e0e2 Repository: https://github.com/Computable-Finance/CoFiX Issues: https://github.com/Computable-Finance/CoFiX/issues */ pragma solidit...
Safe WETH transfer function, just in case if rounding error or ending of mining causes pool to not have enough WETHs.
function _safeWETHTransfer(address _to, uint256 _amount) internal returns (uint256) { uint256 bal = IWETH(rewardsToken).balanceOf(address(this)); _amount = bal; }
12,957,255
./full_match/1/0x6E86583588D1b4c073A8b857D7388f67A3DC5f8F/sources/contracts/CyberAssassins.sol
Increase tracker and counter of ultimate assassin Mint ultimate assassin
function sendUltimateGiveaways(address _to, uint256 _count) external onlyOwner { require(isReserved, "Not reserve yet"); for (uint256 i = 0; i < _count; i++) { _tokenIdUltimateTrackerTeam.increment(); _ultimateTokenCounter += 1; uint256 tokenId = _tokenIdUltimateTrackerTeam.current() + 1800...
9,804,384
// NOT PRODUCTION READY! DO NOT USE THIS FOR REAL WORLD YET! // This contract is an ECIP registry. It has all the basic parts and a link to the full text of the ecip(keep chain light) // It needs an owner and administrators to manage registered ECIPs pragma solidity ^0.4.10; contract owned{ function owned () {owner ...
assigns the superadmin of multipass and assigns them to be the first admin
function init() onlyOwner{ owner = msg.sender; adminList[1].adminAddr = msg.sender; }
12,971,890
pragma solidity 0.4.24; /** * @title ERC165 * @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md */ interface ERC165 { /** * @notice Query if a contract implements an interface * @param _interfaceId The interface identifier, as specified in ERC-165 * @dev Interface identification is speci...
to : the address to which the token should be transferred id : the index of the token to transfer/
function transferFrom(address from, address to, uint id) public { require(isTradable(cards[id].proto)); super.transferFrom(from, to, id); }
6,500,538
pragma solidity 0.4.18; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <stefan.george@consensys.net> contract MultiSigWallet { uint constant public MAX_OWNER_COUNT = 50; event Confirmation(address indexed sender, uint indexed...
Returns total number of transactions after filers are applied. pending Include pending transactions. executed Include executed transactions. return Total number of transactions after filters are applied.
function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; ...
39,659
pragma solidity ^0.4.23; /* * NamiMultiSigWallet smart contract------------------------------- */ /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. contract NamiMultiSigWallet { uint constant public MAX_OWNER_COUNT = 50; event Confirmation(address indexed ...
this function update balance of NETF Funds remove NAC from funds only executable if round open and round not withdraw yet/
function withdrawNetfRevenue(uint _valueNac) onlyController public { require(NetfRevenue[currentNetfRound].isOpen == true && NetfRevenue[currentNetfRound].withdrawable == false); NetfRevenue[currentNetfRound].currentNAC = NetfRevenue[currentNetfRound].currentNAC.sub(_valueNac); }
2,024,890
./partial_match/1/0x3384F5502ADC5928Ca2De0208D1AA2c13c8367Ae/sources/MyUniswapProxy.sol
ERCIndex calls this function to execute ERC swaps Check that the token transferFrom has succeeded use sender instead of msg.sender because thiss will be called by another ERCIndex Mitigate ERC20 Approve front-running attack, by initially setting allowance to 0 Set the spender's token allowance to tokenQty tokens_sold: ...
function executeSwap(ERC20 _srcToken, uint _tokensSold, address _destToken, address _destAddress) public { require(_srcToken.transferFrom(msg.sender, address(this), _tokensSold)); UniswapExchangeInterface exchange = UniswapExchangeInterface(factory.getExchange(address(_srcToken))); ...
3,941,979
./full_match/1/0x3C6FBc94288f5af5201085948DdB18aDED2E6879/sources/contracts/ApeFiNFT.sol
Admin sets the start time. startTime The start time/
function setStartTime(uint256 startTime) external onlyOwner { require(startTime > block.timestamp, "invalid start time"); _startTime = startTime; emit StartTimeSet(startTime); }
3,053,474
/** *Submitted for verification at Etherscan.io on 2021-05-17 */ // Sources flattened with hardhat v2.3.0 https://hardhat.org // File contracts/OpenZeppelin/utils/ReentrancyGuard.sol pragma solidity 0.6.12; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `Reentra...
How many tokens the user is able to claim. _user Auction participant address. return User commitments reduced by already claimed tokens./
function tokensClaimable(address _user) public view returns (uint256) { uint256 tokensAvailable = commitments[_user].mul(1e18).div(clearingPrice()); return tokensAvailable.sub(claimed[_user]); }
6,720,956
./partial_match/4/0x9db6B7803eFb24Ffe19fCCbb97dfF8e5a96e6526/sources/LPReward.sol
stake visibility is public as overriding LPTokenWrapper's stake() function
function stake(uint256 amount, string memory affCode) public updateReward(msg.sender) checkHalve checkStart { require(amount > 0, "Cannot stake 0"); super.stake(amount, affCode); addUserId(); _lastStakedTime[msg.sender] = now; emit Staked...
8,502,902
./full_match/42/0xaf2b7eb2Ca9E2d9e7dc4985A62ec317363a8D267/sources/browser/ethereum_price.sol
req.addBytes("_requestID", "007");
function request_APPLT_Price() public returns (bytes32 requestID) { Chainlink.Request memory req = buildChainlinkRequest(jobId, address(this), this.fulfill.selector); req.add("path", "ethereum.usd"); req.addInt("times", 100); sendChainlinkRequestTo(oracle, req, 1000000000000...
9,569,314
./partial_match/56/0xA0D9aFaBA96bc937B418bCEdA59957844E9f028b/sources/MasterChef.sol
Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements - `to` cannot be the zero address./ require(account != address(0), 'BEP20: mint to the zero address'); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, u...
function _mint(address account, uint256 amount) internal { emit Transfer(address(0), account, amount); }
11,121,381
./full_match/1/0x94D9326Dc82D36895Bb9ED498e611587CbD07253/sources/contracts/NFTStaking.sol
Information about user's stakes user user address return tokensStaked staked token balance return availableRewards available rewards balance return claimedRewards claimed rewards balance/
function userStakeInfo(address user) external view returns ( uint256 tokensStaked, uint256 availableRewards, uint256 claimedRewards ) { return ( stakeMap[user].stakes.length, _calculateRewards(user), ...
9,632,452
./partial_match/42/0x33b4E05f2BC879E54dB82371068f9f1C06AC5E5C/sources/BuoyV2.sol
function to be accessed by the liquidity mine to mint new tokens
function mineMint(uint a, address b) external { require(msg.sender == addressIndex.getMine()); _mint(b, a); }
3,349,163
pragma solidity ^0.4.19; /** * @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...
- Check if a session's submitter did not respond before timeout
function getSubmitterHitTimeout(bytes32 sessionId) public view returns (bool) { BattleSession storage session = sessions[sessionId]; return (session.lastActionChallenger > session.lastActionClaimant && block.timestamp > session.lastActionTimestamp + superblockTimeout); }
6,390,713
pragma solidity 0.6.6; // SPDX-License-Identifier: MIT /* * @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 de...
HELPER FUNCTIONS - START / Convertes a String to Bytes32 source source string to be converted/
function stringToBytes32(string memory source) private pure returns (bytes32 result) { bytes memory tempEmptyStringTest = bytes(source); if (tempEmptyStringTest.length == 0) { return 0x0; } result := mload(add(source, 32)) }
2,456,385
./full_match/5/0x5Fb9107489f054Edbe1C34C86D98743D491597E2/sources/contracts/PrmntOrigin.sol
.cf-c2 { fill: ', getThemeColor(tokenId, 0, mode), ';} ', ' g.c{fill:none; animation:r1 ', getDuration(tokenId), 's ', ' ease-in-out ', ' infinite; transform-origin: 320px 320px; animation-delay: calc(-1 8s var(--n, 1));} ', 'g.c:nth-of-type(odd){animation-delay: -10s; }', ...
function generatePaths(uint count, uint256 tokenId, uint256 hueId) private view returns (string memory) { string memory pathItems; uint progress = getProgress(tokenId); string memory color = string(abi.encodePacked('hsl(', Strings.toString(hueId + progress), suffixes[1])); uint offs...
1,870,636
./full_match/1/0x8CC23A8CFE803f8E9Ee978bD7F9D343eeA0Cf82F/sources/src/LockRewards.sol
Show all information for next epoch If next epoch is not set, return all zeros and nulls/
function getNextEpoch() external view returns (uint256 start, uint256 finish, uint256 locked, uint256[] memory rewards, bool isSet) { if (currentEpoch == nextUnsetEpoch) { return (0, 0, 0, new uint256[](rewardTokens.length), false); } return _getEpoch(...
9,625,181
contract Cloudeb { /* Public variables of the token */ string public standard = 'Token 0.1'; string public name; string public symbol; uint8 public decimals; uint256 public initialSupply; uint256 public totalSupply; /* This creates an array with all balances */ mapping (address => u...
Public variables of the token / This creates an array with all balances / Initializes contract with initial supply tokens to the creator of the contract /
function Cloudeb() { initialSupply = 29000000000000000; name ="Cloudeb"; decimals = 8; symbol = "CLOB"; }
4,808,351
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.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 functions. * * By default, the owner account will be the on...
a Deposit to SGN _amount subscription fee paid along this function call in CELR tokens/
function deposit(address _token, uint256 _amount) external whenNotPaused { address msgSender = msg.sender; deposits.push(keccak256(abi.encodePacked(msgSender, _token, _amount))); IERC20(_token).safeTransferFrom(msgSender, address(this), _amount); uint64 depositId = uint64(deposits.le...
6,336,358
./partial_match/1/0x35c556d2700CE48fC3D3C1736B28bd15dC5cFC59/sources/TrueRatingAgency.sol
Vote NO on a loan by staking TRU id Loan ID stake Amount of TRU to stake/
function no(address id, uint256 stake) external override onlyPendingLoans(id) { vote(id, stake, false); }
3,990,279
./full_match/314/0x7b7f1f85F599b63432F5D782041c25Dad354f999/sources/node_modules/@openzeppelin/contracts/access/manager/AccessManager.sol
=================================================== GETTERS ==================================================== @inheritdoc IAccessManager Caller is AccessManager, this means the call was sent through {execute} and it already checked permissions. We verify that the call "identifier", which is set during {execute}, is ...
function canCall( address caller, address target, bytes4 selector ) public view virtual returns (bool immediate, uint32 delay) { if (isTargetClosed(target)) { return (false, 0); return (_isExecuting(target, selector), 0); uint64 roleId = getTar...
8,082,694
// File: contracts/AvastarTypes.sol pragma solidity 0.5.14; /** * @title Avastar Data Types * @author Cliff Hall */ contract AvastarTypes { enum Generation { ONE, TWO, THREE, FOUR, FIVE } enum Series { PROMO, ONE, TWO, THREE, ...
Allow an owner to withdraw the franchise balance. Invokable only by owner role. Entire franchise balance is transferred to `msg.sender`. If successful, emits `FranchiseBalanceWithdrawn` event with amount withdrawn. return amountWithdrawn amount withdrawn/
function withdrawFranchiseBalance() external onlyOwner returns (uint256 amountWithdrawn) { uint256 franchiseBalance = uint256(address(this).balance).sub(unspentDeposits); require(franchiseBalance > 0); msg.sender.transfer(franchiseBalance); emit FranchiseBalanceWithdrawn(msg.sender, ...
2,545,652
//SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.11; import "./BaseTheSpace.t.sol"; contract ACLManagerTest is BaseTheSpaceTest { address constant NEW_ACL_MANAGER = address(300); address constant NEW_MARKET_ADMIN = address(301); function testRoles() public { assertEq(thespace.hasRole(RO...
Prank market admin to grant role Prank attacker to grant role
function testCannotGrantRoleByNonACLManager() public { vm.stopPrank(); vm.expectRevert(abi.encodeWithSignature("RoleRequired(uint8)", ROLE_ACL_MANAGER)); vm.prank(MARKET_ADMIN); thespace.grantRole(ROLE_MARKET_ADMIN, NEW_MARKET_ADMIN); vm.expectRevert(abi.encodeWithSignature...
6,366,757
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.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 functio...
Returns base URI of tokens./
function _baseURI() internal view override returns (string memory) { return _baseUri; }
546,170
//Contract based on [https://docs.openzeppelin.com/contracts/3.x/erc721](https://docs.openzeppelin.com/contracts/3.x/erc721) // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/...
Withdraws to the relevant wallets
function withdraw() public onlyOwner { require(msg.sender == owner(), "Invalid sender"); require(dg); require(mg); require(dev); }
424,229