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.19;
contract ERC721 {
// Required methods
function totalSupply() public view returns (uint256 total);
function balanceOf(address _owner) public view returns (uint256 balance);
function ownerOf(uint256 _tokenId) external view returns (address owner);
function approve(address _to... | Computes incentive reward for launching tournament finishTournament() _tournamentBank NOTE: We don't use SafeMath (or similar) in this function because _currentBank max is equal ~ 20000000 finney, and (tournamentOwnersCut + tournamentIncentiveCut) <= 10000 (see the require() statement in the Tournament constructor). T... | function _computeTournamentIncentiveReward(uint256 _currentBank, uint256 _incentiveCut) internal pure returns (uint256){
return _currentBank * _incentiveCut / 10000;
}
| 5,942,420 |
/*
Copyright 2017 Dharma Labs Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writi... | Constructor points the repayment router at the deployed registry contract./ | function RepaymentRouter (address _debtRegistry, address _tokenTransferProxy) public {
debtRegistry = DebtRegistry(_debtRegistry);
tokenTransferProxy = TokenTransferProxy(_tokenTransferProxy);
}
| 6,422,864 |
./full_match/5/0x5e88650C4e38206addb2561cec3103Fa6C6A9bF7/sources/contracts/collections/ERC721A/extensions/ERC721ARoleBasedLockableExtension.sol | Unlocks locked token(s) to be able to transfer./ | function unlock(uint256 tokenId) public virtual nonReentrant {
require(hasRole(LOCKER_ROLE, msg.sender), "NOT_LOCKER_ROLE");
_unlock(tokenId);
}
| 1,890,316 |
./partial_match/4/0x8Af0D8E910b23Ca0a6C0c832efA07EE494AB4346/sources/DMEX_Base.sol | send AMB bridge instruction | function sendDepositInstructionToAMBBridge(address user, address token, uint256 amount) internal
{
bytes4 methodSelector = DMEXXDAI(DMEX_XDAI_CONTRACT).depositTokenForUser.selector;
bytes memory data = abi.encodeWithSelector(methodSelector, token, amount, user);
uint256 gas = IAMB(AMBBr... | 8,702,371 |
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.7.0;
import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router01.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol";
import "./UniswapV2Library.sol";
import "... | get token 0 from pair if token 0 is provided _token return tokenReserve as reserve 0 and wethReserve as reserve1 else return wethReserve as reserve 0 and tokenReserve as reserve1 | function getReservesForTokenPool(address _token)
public
view
returns (uint256 wethReserve, uint256 tokenReserve)
{
IUniswapV2Pair pair = IUniswapV2Pair(
uniswapV2Factory.getPair(_token, weth)
);
uint112 _wethReserve;
uint112 _tokenReserve;
if (pair.token0() == _token) {
... | 10,450,594 |
./full_match/4/0x0A87021D82453AB0B18a375aFfdB8C689e05A182/sources/sirtoken3.sol | Get account token balance. account_ address Requred: - validAddress(account_) non 0 address return uint256 account balance/ | function balanceOf(
address account_
) public view virtual override returns (uint256) {
return _balances[account_];
}
| 12,424,915 |
pragma solidity ^0.5.3;
contract Freezable {
bool public frozen;
address public freezer;
// onlyFreezer functions can only be called by the specified `freezer` address
modifier onlyFreezer() {
require(msg.sender == freezer);
_;
}
// onlyWhenNotFrozen functions can only be called when `frozen` is ... | Unreezes the contract, enabling `onlyWhenNotFrozen` functions./ | function unfreeze() external onlyFreezer {
frozen = false;
}
| 12,640,284 |
./partial_match/56/0xf4FFdD2758c6c76D38Ad0c12ef260B9467687E51/sources/PlatiniumFinance.sol | Transfers ownership of the contract to a new account (`newOwner`)./ | function _transferOwnership(address newOwner) internal {
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
| 11,209,845 |
pragma solidity ^0.5.13;
import "./ItemFactory.sol";
/**
* @title ProShop
* @notice Main contract for sales side of the In-game Pro Shop System
*/
contract ProShop is ItemFactory {
/**
* @notice emitted upon the withdrawal of a Shop's balance
*/
event ShopBalanceWithdrawn(uint256 shopId, uint25... | Get the count of Items associated with a given Owner/ | function getOwnerItemCount(address _owner) external view returns (uint256) {
return ownedItems[_owner].length;
}
| 12,801,019 |
pragma solidity ^0.5.0;
/**
* @title Roles
* @dev Library for managing addresses assigned to a Role.
*/
library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev Give an account access to this role.
*/
function add(Role storage role, address account) internal {
... | Set the recipient address Only callable by Governance address _recipient - address for new recipient/ | function setRecipientAddress(bytes32 _recipient) external {
_requireIsInitialized();
require(msg.sender == governanceAddress, ERROR_ONLY_GOVERNANCE);
recipient = _recipient;
}
| 1,616,643 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20... | The contract owner takes back the reward shared with the users here _stakeID Id of the stake pool _rewardID Id of the reward _amount Amount of deposit to reward | function withdrawRewardByPoolID(uint _stakeID, uint _rewardID, uint256 _amount) public onlyOwner returns(bool){
poolRewardVariableInfo[_stakeID][_rewardID].balance = poolRewardVariableInfo[_stakeID][_rewardID].balance.sub(_amount);
IERC20 selectedToken = getRewardTokenContract(_stakeID, _rewardID);... | 13,084,411 |
pragma solidity ^0.8.0;
// File: @openzeppelin/contracts/utils/Context.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
* m... | Mints tokens/ If we haven't set the starting index and this is either 1) the last saleable token or 2) the first token to be sold after the end of pre-sale, set the starting index block | function mintCryptoCopyCat(uint256 numberOfTokens) external payable {
require(saleIsActive, "Sale must be active to mint");
require(numberOfTokens <= maxToMint, "Invalid amount to mint per once");
require(totalSupply().add(numberOfTokens) <= MAX_CRYPTO_COPY_CATS_SUPPLY, "Purchase would excee... | 1,102,334 |
./full_match/43113/0x3a7D90487F8E6c8631317E1B812d020CE5bB1288/sources/src/libraries/PairParameterHelper.sol | Get the base factor from the encoded pair parameters params The encoded pair parameters, as follows: [0 - 16[: base factor (16 bits) [16 - 256[: other parameters return baseFactor The base factor/ | function getBaseFactor(bytes32 params) internal pure returns (uint16 baseFactor) {
baseFactor = params.decodeUint16(OFFSET_BASE_FACTOR);
}
| 7,117,511 |
./full_match/44787/0xa6616Fc321E5Dc0ab8C79324Ca052E33617AD310/sources/contracts/donationMiner/DonationMinerImplementation.sol | Initializes all reward periods that haven't been initialized yet until the current one. The first donor in a reward period will pay for that operation./ | function initializeRewardPeriods() internal {
RewardPeriod storage _lastPeriod = rewardPeriods[rewardPeriodCount];
while (_lastPeriod.endBlock < block.number) {
rewardPeriodCount++;
RewardPeriod storage _newPeriod = rewardPeriods[rewardPeriodCount];
_newPeriod.ag... | 13,251,920 |
./full_match/3/0x226ca7e445FB98709d238CF024f89E499FF9b6D1/sources/contracts/tokens/Address.sol | solhint-disable-next-line avoid-low-level-calls, avoid-call-value | function sendValue(address payable _recipient, uint256 _amount) internal {
require(address(this).balance >= _amount, "Address: insufficient balance");
require(success, "Address: unable to send value, recipient may have reverted");
}
| 8,108,714 |
pragma solidity 0.4.25;
/*===========================================================================================*
*************************************** https://p4d.io ***************************************
*============================================================================================*
*
... | Allows a customer to pay for a global name on the P4D network There's a 0.01 ETH registration fee per name All ETH is distributed to P4D token holders via updateSubdivsFor()/ | function registerName(string memory _name)
payable
public
{
address _customerAddress = msg.sender;
require(!onlyAmbassadors || ambassadors_[_customerAddress]);
require(bytes(_name).length > 0);
require(msg.value >= nameRegistrationFee);
uint256 excess = S... | 7,264,021 |
./full_match/1/0x4452b85dE653D2c39f565Bba8f0CbebbF76fDc57/sources/EMPlaws.sol | This function certifies a previously added law structure to be accepted as a law | function addLaw(address _associatedContract) external
checkAddingLaw(_associatedContract)
{
laws[_associatedContract].status = 2;
}
| 9,785,328 |
./partial_match/1/0x848c8b8b1490E9799Dbe4fe227545f33C0456E08/sources/src/interfaces/ISavingsVaultViewer.sol | Fixed rate product vault view functions interface Describes view functions | interface ISavingsVaultViewer {
function SUPPORTED_MATURITIES() external view returns (uint8);
function BP() external view returns (uint16);
function AUM_SCALED_PER_SECONDS_RATE() external view returns (uint);
function MINTING_FEE_IN_BP() external view returns (uint);
function BURNING_FEE_IN_BP(... | 16,158,728 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;
import "./Parameters.sol";
abstract contract Bridge is Parameters {
mapping(bytes32 => bool) public queuedTransactions;
function queueTransaction(address target, uint256 value, string memory signature, bytes memory data, uint256 eta) internal ret... | the Abrogation Proposal is a mechanism for the DAO participants to veto the execution of a proposal that was already accepted and it is currently queued. For the Abrogation Proposal to pass, 50% + 1 of the vSTANDARD holders must vote FOR the Abrogation Proposal | function startAbrogationProposal(uint256 proposalId, string memory description) public {
require(state(proposalId) == ProposalState.Queued, "Proposal must be in queue");
require(
daoStaking.votingPowerAtTs(msg.sender, block.timestamp - 1) >= _getCreationThreshold(),
"Creation... | 1,170,650 |
// 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... | Computes the amount of token0 for a given amount of liquidity and a price range sqrtRatioAX96 A sqrt price representing the first tick boundary sqrtRatioBX96 A sqrt price representing the second tick boundary liquidity The liquidity being valued return amount0 The amount of token0 | function getAmount0ForLiquidity(
uint160 sqrtRatioAX96,
uint160 sqrtRatioBX96,
uint128 liquidity
) internal pure returns (uint256 amount0) {
if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);
return
FullMath.mu... | 9,321 |
./full_match/421613/0xec665Bc237cBdf7a998Fd98Fc6e2dEB5A4E5134b/sources/src/Games/CoinToss.sol | Resolves the bet using the Chainlink randomness. _id The bet ID. _randomNumbers Random numbers list. Contains only one for this game. solhint-disable-next-line private-vars-leading-underscore rolled faces | function _callback(
uint256 _id,
uint256[] calldata _randomNumbers
) internal {
CoinTossBet storage coinTossBet = coinTossBets[_id];
Bet storage bet = bets[_id];
bool[] memory _rolled = new bool[](_randomNumbers.length);
uint256[] memory _payouts = new uint256[](_... | 11,569,374 |
pragma solidity ^0.4.23;
contract MoneyBomber{
// scaleFactor is used to convert Ether into tokens and vice-versa: they're of different
// orders of magnitude, hence the need to bridge between the two.
uint256 constant scaleFactor = 0x10000000000000000;// 2^64
int constant crr_n = 1;//CRR numerator
int constant c... | Send the cashed out stake to the address that requested the withdraw. | function fullCycleSellBonds(uint256 balance) internal {
withdrawSum += balance;
msg.sender.transfer(balance);
emit onWithdraw(msg.sender, balance);
}
| 253,688 |
pragma solidity 0.4.24;
import "../BaseDerivative.sol";
import "../interfaces/IndexInterface.sol";
import "../interfaces/implementations/OlympusExchangeInterface.sol";
import "../interfaces/WithdrawInterface.sol";
import "../interfaces/MarketplaceInterface.sol";
import "../interfaces/RebalanceInterface.sol";
import ".... | _tokenPercentage must come in TOKEN_DENOMIANTOR | function getETHFromTokens(uint _tokenPercentage) internal {
ERC20Extended[] memory _tokensToSell = tokensWithAmount();
uint[] memory _amounts = new uint[](_tokensToSell.length);
uint[] memory _sellRates = new uint[](_tokensToSell.length);
OlympusExchangeInterface exchange = OlympusEx... | 15,836,656 |
./partial_match/56/0x6Beb0d16889C8D43b7668EeDb6e67A08e7520C97/sources/CommunityFund.sol | tokenA is always MDO | function _removeLiquidity(
address _lpAdd,
address _tokenB,
uint256 _liquidity
) internal {
_removeLiquidity2(_lpAdd, dollar, _tokenB, _liquidity);
}
| 11,044,083 |
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view r... | 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./ | function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), _owner, a... | 529,429 |
/*
* This code has not been reviewed.
* Do not use or deploy this code before reviewing it personally first.
*/
pragma solidity ^0.5.0;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "openzeppelin-solidity/contracts/lifecycle/Pausab... | Execute hold./ | function executeHold(address token, bytes32 holdId, uint256 value, bytes32 secret) external returns (bool) {
return _executeHold(
token,
holdId,
value,
secret,
false
);
}
| 2,487,611 |
./full_match/4/0xFf7D9Cfad809cd5af35781ca2f344ba9A15F2df1/sources/Eff.sol | generate the pancake pair path of token -> weth make the swap | function swapETHForTokens(
address routerAddress,
address recipient,
uint256 ethAmount
) public {
IPancakeRouter02 pancakeRouter = IPancakeRouter02(routerAddress);
address[] memory path = new address[](2);
path[0] = pancakeRouter.WETH();
path[1] = address... | 667,283 |
/**
*Submitted for verification at Etherscan.io on 2021-02-21
*/
// CAN ONLY MAKE DUCK EVERY 10 MIN.
//SPDX-License-Identifier:UNLICENSED
pragma solidity 0.8.1;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally ... | Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`... | function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(amount > 1000, "amount to small, maths wi... | 6,566,455 |
/*
.----------------. .----------------. .----------------. .----------------. .----------------. .----------------. .----------------.
| .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. |
| | ____ ____ | || | _________ ... | Interface of the ERC20 standard as defined in the EIP. Does not include the optional functions; to access them see {ERC20Detailed}./ | 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 mint(address account, uint amount) external;
function burn(address ... | 10,571,595 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.2;
pragma experimental ABIEncoderV2;
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/utils/ReentrancyGuard.sol';
import { SafeMath } from '@openzeppelin/contracts/math/Safe... | anyone can call this to close out the previous round by calling "closePositions" on all actions. can only be called when the vault is locked. It sets the state to unlocked and brings funds from each action to the vault. iterrate through each action, close position and withdraw funds/ asset amount used in minting opti... | function closePositions() public {
actionsInitialized();
require(state == VaultState.Locked, "O11");
state = VaultState.Unlocked;
address cacheAddress = underlying;
address[] memory cacheActions = actions;
for (uint256 i = 0; i < cacheActions.length; i = i + 1) {
uint256 lockedAsset = ... | 1,583,002 |
pragma solidity ^0.5.0;
contract Election {
event votedEvent(
uint indexed _candidateId
);
// Model candidate
struct Candidate{
uint Id;
string name;
uint voteCount;
}
//Read/Write Candidates
mapping(uint => Candidate) public candidat... | require a valid candidate record that voter has voted update candidate vote Countfire voted event | function vote (uint _candidateId) public {
require(!voters[msg.sender]);
require(_candidateId > 0 && _candidateId <= candidateCount);
voters[msg.sender] = true;
candidates[_candidateId].voteCount ++;
emit votedEvent(_candidateId);
}
| 12,560,082 |
./partial_match/421613/0x29FCD623D8329De1B8D7571EA7251Da291dE2380/sources/contracts/bond/BondDepository.sol | auto-adjust control variable to hit capacity/spend target _id ID of market _time uint48 timestamp (saves gas when passed in)/ | function _tune(uint256 _id, uint48 _time) internal {
Metadata memory meta = metadata[_id];
if (_time >= meta.lastTune + meta.tuneInterval) {
Market memory market = markets[_id];
uint256 timeRemaining = terms[_id].conclusion - _time;
uint256 price = _marketPrice(_id);
uint256 c... | 16,826,072 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import "../interfaces/IVault.sol";
import "../libraries/ERC20Extends.sol";
import "../l... | The minimum tick that may be passed to getSqrtRatioAtTick computed from log base 1.0001 of 2-128 The maximum tick that may be passed to getSqrtRatioAtTick computed from log base 1.0001 of 2128 The minimum value that can be returned from getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK) The maximum value... | function getSqrtRatioAtTick(int24 tick) internal pure returns (uint160 sqrtPriceX96) {
uint256 absTick = tick < 0 ? uint256(- int256(tick)) : uint256(int256(tick));
require(absTick <= uint256(MAX_TICK), 'T');
uint256 ratio = absTick & 0x1 != 0 ? 0xfffcb933bd6fad37aa2d162d1a594001 : 0x100000... | 5,843,920 |
pragma solidity 0.6.12;
interface IERC20 {
function TOTALSUPPLY831() external view returns (uint256); //i... | inject NONSTANDARD NAMING | function LOG714(string memory p0, bool p1, bool p2, address p3) internal view { | 14,087,834 |
// contracts/TokenVesting.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.8.11;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@openzeppelin/contracts-upgradeable/prox... | Revokes the vesting schedule for given identifier. vestingScheduleId the vesting schedule identifier/ | function revoke(
bytes32 vestingScheduleId
) public virtual onlyOwner onlyIfVestingScheduleNotRevoked(vestingScheduleId) {
VestingSchedule storage vestingSchedule = vestingSchedules[vestingScheduleId];
require(vestingSchedule.revocable == true, "TokenVesting: vesting is not revocable");
uint128 vestedAmount =... | 7,300,542 |
//SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.9.0;
import "hardhat/console.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownabl... | Deploys the new delegated inmediatly into the strategy _asset The asset which is going to be deployed _delegator Delegator address, use to update mapping/ | function deployCapital(address _asset, address _delegator) internal {
StrategyInfo storage strategyInfo = strategies[_asset];
require(strategyInfo.strategyAddress != address(0), "notSetStrategy!");
DelegatorInfo storage delegator = delegators[_delegator][_asset];
if (delegator.amo... | 13,120,828 |
./full_match/44787/0x612e95C6509bB95fb50e0721D64CDdF732e58Dc5/sources/contracts/community/CommunityAdminImplementation.sol | Adds a new manager to a community _community address of the community _account address to be added as community manager/ | function addManagerToCommunity(ICommunity _community, address _account)
external
override
onlyOwner
{
_community.addManager(_account);
}
| 13,266,303 |
/**
*Submitted for verification at Etherscan.io on 2020-07-14
*/
/**
*Submitted for verification at Etherscan.io on 2019-10-02
*/
pragma solidity ^0.5.8;
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigne... | approve is for transfer authentication | function approve(address _spender, uint256 _value) external onlyWhenNotStopped returns (bool)
{
require(_spender != address(0));
require(balances[msg.sender] >= _value);
require(msg.sender != _spender);
approvals[msg.sender][_spender] = _value;
emit Approval(msg.sender,... | 12,651,215 |
./full_match/1/0x500Dd74CdeAaDd09F689E8fC42Bf8e5D3a6A7a1C/sources/contracts/StrategyConvexStables.sol | Specify tokens used in yield process, should not be available to withdraw via withdrawOther() | function _onlyNotProtectedTokens(address _asset) internal virtual;
function getProtectedTokens()
public
view
virtual
returns (address[] memory)
{
return new address[](0);
}
| 2,998,311 |
/**
*Submitted for verification at Etherscan.io on 2021-07-28
*/
// File: @openzeppelin/upgrades/contracts/Initializable.sol
pragma solidity 0.5.1;
/**
* @title Initializable
*
* @dev Helper contract to support initializer functions. To use it, replace
* the constructor with a function that has the 'initialize... | Verifies if an address owns all the tokens in the list. _owner Address which will be verified as owner of the tokens _tokenIds List of tokens/ | function _isOwnerForAll(address _owner, uint256[] memory _tokenIds) private returns (bool) {
uint256 count = _tokenIds.length;
address _tokenOwner;
for (uint256 index = 0; index < count; index++) {
_tokenOwner = ownerOf(_tokenIds[index]);
if(_tokenOwner != _owner) {
... | 6,494,215 |
pragma solidity ^0.5.8;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "./SortedFractionMedianList.sol";
import "./interfaces/ISortedOracles.sol";
import "../common/Initializable.sol";
/**
* @title Maintains a sorted list of oracle ... | Removes an Oracle. oracleAddress The address of the oracle./ | function removeOracle(address token, address oracleAddress, uint256 index) external onlyOwner {
require(
token != address(0) &&
oracleAddress != address(0) &&
oracles[token].length > index &&
oracles[token][index] == oracleAddress,
"token addr null or oracle addr null or index of tok... | 916,617 |
./full_match/1/0x666E6748db572ebC3AE40e4Ce7748bC9bE7A5AAe/sources/Users/kstasi/Documents/side/dANT/contracts/Rewards.sol | Returns claimed and unclaimed user's reward. _user Address of the user. return _reward User's reward. | function getReward(address _user)
public
virtual
view
returns (uint256 _reward)
{
UserInfo storage user = userInfo[_user];
_reward = user.reward;
for (uint256 i = user.depositHead; i < user.depositTail; i++) {
DepositInfo memory deposit = user.... | 4,935,877 |
./full_match/122/0xFAE02d404c327A1Eb2fB38eb89C38860a02D70e6/sources/contracts/LiquidStakingPool.sol | Sets the validator index of the protocol _index the value to set the current index to/ | function _setValidatorIndex(uint256 _index) internal {
_validatorsIndex = _index;
}
| 16,366,203 |
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
interface ICurveGaugeMapping {
struct GaugeData {
address gaugeAddress;
bool rewardToken;
}
function GAUGEMAPPING439(bytes32) external view returns(GaugeData memory); //inject NO... | inject NONSTANDARD NAMING | function GETCURVEMINTORADDR2() internal pure returns (address){ | 1,074,621 |
./full_match/137/0x1EE74Ae391C6cA3395Af47d57a36aFC42A507F9F/sources/project_/FanPass.sol | Override _baseURI function to return your base URI | function _baseURI() internal view virtual override returns (string memory) {
return tokenData.baseTokenURI;
}
| 4,698,030 |
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) {
// Gas optimization: this is cheaper than ... | Adds two numbers, throws on overflow./ | function add(uint256 _a, uint256 _b) internal pure returns (uint256) {
uint256 c = _a + _b;
assert(c >= _a);
return c;
}
| 2,059,333 |
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/GSN/Context.sol
pragma solidity ^0.6.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... | Returns sum of token locked in other contracts and token stored in the pool. Default tokensHere. It will be in token defined decimals./ | function totalValue() public view virtual returns (uint256) {
return tokensHere();
}
| 324,878 |
// SPDX-License-Identifier: MIT
// https://github.com/Brickken/license/blob/main/README.md
pragma solidity ^0.8.0;
import "@openzeppelin/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/openzeppelin-c... | Batch `depositFor` function/ | function depositForBatched(address[] calldata accounts, uint256[] calldata amounts) public virtual onlyRole(MINTER_ROLE) returns (bool succeeded) {
require(accounts.length == amounts.length, "Mismatch between accounts and amounts lenghts");
require(accounts.length > 0, "Invalid input lenghts");
... | 1,401,519 |
pragma solidity 0.4.25;
/**
* @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 cheap... | Get number of days for reward on mining. Maximum 100 days. return An uint256 representing number of days user will get reward for./ | function getDaysForReward() public view returns (uint rewardDaysNum){
if(lastMiningBalanceUpdateTime[msg.sender] == 0) {
return 0;
uint value = (now - lastMiningBalanceUpdateTime[msg.sender]) / (1 days);
if(value > 100) {
return 100;
return value;
}
}
}
| 12,540,327 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
// BottlenoseToken w... | Returns the address is excluded from antiWhale or not./ | function isExcludedFromAntiWhale(address _account) public view returns (bool) {
return _excludedFromAntiWhale[_account];
}
| 12,787,094 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.5.0 <0.9.0;
import './common/SafeMath.sol';
import './common/Destructible.sol';
/** @title Credit contract.
* Inherits the Ownable and Destructible contracts.
*/
contract Credit is Destructible {
/** @dev Usings */
// Using SafeMath for our calculat... | Toggle active state function. Only accessible to the owner of the contract. Toggles the active state of the contract. return bool/ Log active status change. | function toggleActive() external onlyOwner returns (bool) {
active = !active;
LogCreditStateActiveChanged(active, block.timestamp);
return active;
}
| 1,014,002 |
pragma solidity ^0.4.21;
/**
* @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) {
if (a == 0) {
return 0;
}
c ... | checks the state when validating a purchase/ | function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal {
require(_beneficiary != address(0));
super._preValidatePurchase(_beneficiary, _weiAmount);
require(_weiAmount >= 500000000000000000);
}
| 6,264,765 |
./full_match/43114/0x78F48e2e68A7C09E22fBa362C0FccA51b4772683/sources/IglooMasterV7.10_Strategies.sol | set your own personal xpefiDistributionBipstrack if user has ever set their own xpefiDistributionBips | function setXpefiDistributionBips(uint256 _xpefiDistributionBips) external {
require(_xpefiDistributionBips <= MAX_BIPS, "input too high");
if (!xpefiDistributionBipsSet[msg.sender]) {
xpefiDistributionBipsSet[msg.sender] = true;
}
xpefiDistributionBips[msg.sender] = _xpe... | 4,505,953 |
./full_match/11155111/0x7DAB44b642cE9c008b5E0c1a9240236cB67481C6/sources/contracts/BloodDonation.sol | Function to add a new organization _adminAddress The address of an admin/ | function addOrganization(address _adminAddress) public {
require(msg.sender == _isAdmin, "Only admin can add organization");
_isOrganization[_adminAddress] = true;
}
| 3,801,507 |
./full_match/421613/0xc3A8621DA59B35dDCD3e01504F182D9AC9F36b5B/sources/src/arbitration/SortitionModule.sol | Executes the next delayed stakes. _iterations The number of delayed stakes to execute. | function executeDelayedStakes(uint256 _iterations) external {
require(phase == Phase.staking, "Should be in Staking phase.");
uint256 actualIterations = (delayedStakeReadIndex + _iterations) - 1 > delayedStakeWriteIndex
? (delayedStakeWriteIndex - delayedStakeReadIndex) + 1
... | 11,570,386 |
./partial_match/1/0x8770B2a109AEE8CDbe278FaE6CaE5Aa4Bcd13E1c/sources/Users/ryanbreen/Workspace/Alkemi/alkemi-earn/alkemi-earn-protocol/contracts/TestTokens.sol | How much has the owner delegated/approved to the delegate | function allowance(address owner, address delegate) external view returns (uint){
return allowed[owner][delegate];
}
| 3,595,631 |
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity 0.8.10;
import {ILensHub} from '../interfaces/ILensHub.sol';
import {Events} from '../libraries/Events.sol';
import {Helpers} from '../libraries/Helpers.sol';
import {Constants} from '../libraries/Constants.sol';
import {DataTypes} from '../libraries/DataTypes... | @inheritdoc ILensHub | function collectWithSig(DataTypes.CollectWithSigData calldata vars)
external
override
whenNotPaused
{
_validateRecoveredAddress(
_calculateDigest(
keccak256(
abi.encode(
COLLECT_WITH_SIG_TYPEHASH,
... | 12,861,967 |
./partial_match/1/0x1111111254EEB25477B68fb85Ed929f73A960582/sources/AggregationRouterV5.sol | If `approve(from, to, amount)` fails, try to `approve(from, to, 0)` before retry | function forceApprove(IERC20 token, address spender, uint256 value) internal {
if (!_makeCall(token, token.approve.selector, spender, value)) {
if (!_makeCall(token, token.approve.selector, spender, 0) ||
!_makeCall(token, token.approve.selector, spender, value))
{
... | 9,171,629 |
pragma solidity ^0.4.25;
/**
.----------------. .----------------. .----------------. .----------------.
| .--------------. || .--------------. || .--------------. || .--------------. |
| | ____ ____ | || | ____ | || | _____ | || | ________ | |
| | |_ || _| |... | -------o Function 05 - Claim Token That Has Been Unlocked | function Unlocktoken(address tokenAddress, uint256 id) public {
require(tokenAddress != 0x0);
require(id != 0);
Safe storage s = _safes[id];
require(s.user == msg.sender);
require(s.tokenAddress == tokenAddress);
if (s.amountbalance == 0) { revert(); } else ... | 5,409,697 |
pragma solidity ^0.4.18;
import "./zeppelin/token/PausableToken.sol";
contract TrinityToken is PausableToken {
string public constant name = "Trinity";
string public constant symbol = "TNC";
uint8 public constant decimals = 8;
bool private changed;
modifier validDestination( address to... | assign the admin account assign the total tokens to Trinity 1 B | function TrinityToken() public {
admin = msg.sender;
changed = false;
totalSupply = 1 * 1000 * 1000 * 1000 * 100000000;
balances[msg.sender] = totalSupply;
Transfer(address(0x0), msg.sender, totalSupply);
}
| 12,561,660 |
/**
*Submitted for verification at Etherscan.io on 2020-01-16
*/
pragma solidity 0.5.10;
/**
* @author @veronicaLC (Veronica Coutts)
* @title The interface for the market factory
*/
interface IMarketFactory {
/**
* @notice Vyper cannot handle arrays of unknown length,
* and thus the fu... | @veronicaLC (Veronica Coutts) & @RyRy79261 (Ryan Nobel) Market/ Emitted when a spender is approved Emitted when a transfer, mint or burn occurs Emitted when tokens are minted Emitted when tokens are burnt Emitted when the market is terminated | interface IMarket {
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
event Transfer(address indexed from, address indexed to, uint value);
event Mint(
);
event Burn(
);
event MarketTerminated();
function approve(address _spender, uin... | 12,535,520 |
// Sources flattened with hardhat v2.6.6 https://hardhat.org
// File deps/@openzeppelin/contracts-upgradeable/proxy/Initializable.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.24 <0.7.0;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be de... | Total wrapped ibBTC shares | function totalShares() public view returns (uint256) {
return _totalSupply;
}
| 1,369,532 |
./full_match/1/0xCDAD0ad4DD1F614a6502043Ef546e447b25Ffb99/sources/src/token/ERC20MintBurn.sol | Burns tokens from the caller. Callable only by one of the burner addresses. _value amount of tokens to burn. Should be less than or equal to caller balance./ | function burn(uint256 _value) external virtual {
require(isBurner(msg.sender), "ERC20MintBurn: not a burner");
_burn(msg.sender, _value);
}
| 4,882,701 |
pragma solidity 0.6.12;
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
... | if the address has no limitations just return 0 | function getMinLockedAmount(address _addr) view public returns (uint256 locked) {
uint256 i;
uint256 a;
uint256 t;
uint256 lockSum = 0;
TokenLockState storage lockState = lockingStates[_addr];
if (lockState.latestReleaseTime < now) {
return 0;
}
for (i=... | 7,382,198 |
pragma solidity ^0.5.16;
import "./ComptrollerInterface.sol";
import "./CTokenInterfaces.sol";
import "./ErrorReporter.sol";
import "./Exponential.sol";
import "./EIP20Interface.sol";
import "./InterestRateModel.sol";
/**
* @title tropykus CToken Contract
* @notice Abstract base for CTokens
* @author tropykus
*/
... | Gets balance of this contract in terms of the underlying This excludes the value of the current message, if any return The quantity of underlying owned by this contract/ Performs a transfer in, reverting upon failure. Returns the amount actually transferred to the protocol, in case of a fee. This may revert due to i... | function getCashPrior() internal view returns (uint256);
function doTransferIn(address from, uint256 amount)
internal
returns (uint256);
function doTransferIn(
address from,
uint256 amount,
bool isMax
) internal returns (uint256);
function doTransferOut(add... | 12,741,828 |
pragma solidity ^0.5.13;
import "openzeppelin-solidity/contracts/math/Math.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "solidity-bytes-utils/contracts/BytesLib.sol";
import "./interfaces/IValidators.sol";
import "../common/C... | Updates the group membership history of a particular account. account The account whose group membership has changed. group The group that the account is now a member of. return True upon success. Note that this is used to determine a validator's membership at the time of an election, and so group changes within a... | function updateMembershipHistory(address account, address group) private returns (bool) {
MembershipHistory storage history = validators[account].membershipHistory;
uint256 epochNumber = getEpochNumber();
uint256 head = history.numEntries == 0 ? 0 : history.tail.add(history.numEntries.sub(1));
if (hi... | 905,935 |
/**
* The edgeless casino contract v2 holds the players's funds and provides state channel functionality.
* The casino has at no time control over the players's funds.
* State channels can be updated and closed from both parties: the player and the casino.
* author: Julia Altenried
**/
pragma solidity ^0.... | allow authorized wallets to withdraw funds from the bonkroll to this address receiver the receiver&39;s address / | function allowReceiver(address receiver) public onlyOwner {
allowedReceiver[receiver] = true;
}
| 2,416,639 |
// 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... | Returns x y, reverts if overflows x The multiplicand y The multiplier return z The product of x and y | function mul160(uint160 x, uint160 y) internal pure returns (uint160 z) {
require(x == 0 || (z = x * y) / x == y);
}
| 9,468 |
./partial_match/1/0x69b4fAac37Df45DC1Ce898f550Fe10E0714f71c1/sources/TEDpresale.sol | function to change the end date of the ICO/ | function setEndDate(uint256 daysToEndFromToday) public onlyOwner returns(bool) {
daysToEndFromToday = daysToEndFromToday * 1 days;
endTime = now + daysToEndFromToday;
}
| 2,628,854 |
pragma solidity 0.5.0; // Update to Solidity 0.5
contract Merchandise {
address owner;
bool online;
struct Item {
uint itemId;
address seller;
address buyer;
string itemName;
string itemDesc;
uint itemPrice;
bool sold;
bool shipped;
b... | string storage location ^^ must be explicitly declared | function getItem(uint itemId) public view returns(
uint, string memory, string memory, uint, bool, bool, bool
) {
return (
items[itemId].itemId,
items[itemId].itemName,
items[itemId].itemDesc,
items[itemId].itemPrice,
items[itemId].sold... | 1,003,683 |
./partial_match/1/0x3a7055B5B46976b129dCfAB9F73d7fae8ddD54E7/sources/Cramereum.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("Cramereum", "CRAMER") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_... | 11,018,908 |
// SPDX-License-Identifier: GPL-3.0
// Forked from https://github.com/ourzora/core @ 450cd154bfbb70f62e94050cc3f1560d58e0506a
pragma solidity >=0.8.4;
pragma experimental ABIEncoderV2;
import "./ERC721Burnable.sol";
import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import { Cou... | Return the metadata URI for a piece of media given the token URI return the metadata URI for the token/ | function tokenMetadataURI(uint256 tokenID)
external
view
override
onlyTokenCreated(tokenID)
returns (string memory)
{
return _tokenMetadataURIs[tokenID];
}
| 12,704,594 |
pragma solidity ^0.4.11;
import "./token/StandardToken.sol";
import "./ownership/Ownable.sol";
contract ENSBidToken is StandardToken, Ownable {
// [x] 實作 ERC20
// [x] 股權形式分配的 Token 模式
// [x] 開發團隊的 Token 鎖定一年
// [x] 發售 50%,開發團隊 50%
// [x] 分潤模式,提供一個 function 可以將分配利潤發放給 token holder
event ShareBenefit(stri... | Contract constructor./ | function ENSBidToken() {
paused = false;
}
| 2,464,480 |
./full_match/1/0x3c1164531d5857029ae5412E49999306547834d8/sources/@rmrk-team/evm-contracts/contracts/RMRK/equippable/RMRKMinifiedEquippable.sol | Used to check if nesting a given token into a specified token would create an inheritance loop. If a loop would occur, the tokens would be unmanageable, so the execution is reverted if one is detected. The check for inheritance loop is bounded to guard against too much gas being consumed. currentId ID of the token t... | function _checkForInheritanceLoop(
uint256 currentId,
address targetContract,
uint256 targetId
) private view {
for (uint256 i; i < _MAX_LEVELS_TO_CHECK_FOR_INHERITANCE_LOOP; ) {
(
address nextOwner,
uint256 nextOwnerTokenId,
... | 9,657,676 |
// Copyright (C) 2015 Forecast Foundation OU, full GPL notice in LICENSE
// Bid / Ask actions: puts orders on the book
// price is denominated by the specific market's numTicks
// amount is the number of attoshares the order is for (either to buy or to sell).
// price is the exact price you want to buy/sell at [wh... | If worst ask is not set or price higher than worst ask price, this order is the new worst ask./ | function updateWorstAskOrder(bytes32 _orderId, IMarket _market, uint256 _price, uint256 _outcome, IERC20 _kycToken) private returns (bytes32) {
bytes32 _worstAskOrderId = worstOrder[getBestOrderWorstOrderHash(_market, _outcome, Order.Types.Ask, _kycToken)];
if (_worstAskOrderId == bytes32(0) || _pri... | 991,674 |
pragma solidity 0.4.25;
/**
*
* ETHPROFIT.SPACE
*
* ETH CRYPTOCURRENCY DISTRIBUTION PROJECT
*
* - GAIN 3% PER 24 HOURS (interest is charges in equal parts every 10 min)
* - Life-long payments
* - The revolutionary reliability
* - Minimal contribution 0.01 eth
* - Currency and payment - ETH
* - Contribution all... | (3) 3% if balance < 10 000 000 ETH | function dailyPercent() internal view returns(Percent.percent memory p) {
uint balance = address(this).balance;
if (balance < 10000000 ether) {
}
}
| 7,242,022 |
./partial_match/1/0xdcA642D5F821599A328bb6f282C86d95f6AE8C36/sources/BBNB.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("Buyback N Burn", "BBNB") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUni... | 3,930,777 |
./full_match/80001/0x9E2fB73B223a35ef5C83Bf7722aaE83aAb86e430/sources/contracts/LUCIANSOULS.sol | 1. Override the claim function to ensure a few things: - They own an NFT from the TICKET contract - They own an NFT from the SOUL contract | function verifyClaim(
address _claimer,
uint256 _tokenId,
uint256 _quantity
) public view virtual override{
if (_tokenId >= 2) {
require(this.balanceOf(_claimer, 0) >= _quantity, "You don't own enough TICKET NFTs");
require(this.balanceOf(_claimer, 0) >= _... | 5,666,765 |
pragma solidity ^0.8.3;
import "./LoanRouter.sol";
import "./interfaces/IBondController.sol";
import "./interfaces/ITranche.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol... | Controller for a ButtonTranche bond system/ | interface IBondController {
event Deposit(address from, uint256 amount, uint256 feeBps);
event Mature(address caller);
event RedeemMature(address user, address tranche, uint256 amount);
event Redeem(address user, uint256[] amounts);
event FeeUpdate(uint256 newFee);
function collateralToken() ex... | 425,684 |
./partial_match/1/0x1776e1F26f98b1A5dF9cD347953a26dd3Cb46671/sources/NumeraireBackend.sol | Check if it is safe to subtract two numbers | function safeSubtract(uint a, uint b) internal returns (uint) {
uint c = a - b;
assert(b <= a && c <= a);
return c;
}
| 4,382,407 |
./full_match/5/0x12C0758b11f16157306F04336B1399FAc36679D2/sources/contracts/bankroll/facets/BankrollFacet.sol | Permantly suspend player. This function sets suspension time to the maximum allowed time./ | function permantlyBan() external {
gs().suspendedTime[msg.sender] = 2 ** 256 - 1;
gs().isPlayerSuspended[msg.sender] = true;
}
| 7,040,554 |
// Abstract contract for the full ERC 20 Token standard
// https://github.com/ethereum/EIPs/issues/20
pragma solidity ^0.4.8;
contract SafeMath {
function safeDiv(uint a, uint b) internal returns (uint) {
assert(b > 0);
uint c = a / b;
assert(a == b * c + a % b);
return c;
... | Ends the funding period and sends the ETH home move to operational | function finalize() external {
if (isFinalized) revert();
if (block.number <= fundingEndBlock && totalSupplyWithOutBonus < tokenCreationCapWithOutBonus - tokenCreationMinPayment) revert();
isFinalized = true;
}
| 7,239,121 |
./partial_match/1/0xBEE571A0A8599adA125e1A33E56287c3c594a5e2/sources/MYIDENTITYCOIN.sol | totalSupply : Display total supply of token/ | function totalSupply() virtual override public view returns (uint) {
return _totalSupply;
}
| 2,581,659 |
./full_match/5/0xcc92C04f5EF23801616Be4929a85c394659274a9/sources/contracts/PropertyNFT.sol | Batch Mint an NFT in one transaction | function mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts
) public onlyAuthorized {
emit MintBatch(to, ids, amounts);
_mintBatch(to, ids, amounts, "");
}
| 1,933,312 |
// 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... | Register the addresses that you want to allow to be receive. _whiteAddresses address[] The specify what to receive target./ | function addAllowReceivers(address[] memory _whiteAddresses) public onlyOwner {
for (uint256 i = 0; i < _whiteAddresses.length; i++) {
addAllowReceiver(_whiteAddresses[i]);
}
}
| 12,838,342 |
/**
*Submitted for verification at Etherscan.io on 2020-10-11
*/
// File: solidity/contracts/utility/interfaces/IOwned.sol
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity 0.6.12;
/*
Owned contract interface
*/
interface IOwned {
// this function isn't since the compiler emits automaticall... | checks whether or not the converter has an ETH reserve return true if the converter has an ETH reserve, false otherwise/ | function hasETHReserve() public view returns (bool) {
return reserves[ETH_RESERVE_ADDRESS].isSet;
}
| 12,987,263 |
/**
*Submitted for verification at Etherscan.io on 2020-05-15
*/
// File: @openzeppelin/contracts/math/SafeMath.sol
pragma solidity ^0.6.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in... | Burns `numTokens` of `tokenCurrency` and sends back the proportional amount of `collateralCurrency`. Can only be called by a token sponsor. Might not redeem the full proportional amount of collateral in order to account for precision loss. This contract must be approved to spend at least `numTokens` of `tokenCurrency`... | function redeem(FixedPoint.Unsigned memory numTokens)
public
onlyPreExpiration()
noPendingWithdrawal(msg.sender)
fees()
nonReentrant()
returns (FixedPoint.Unsigned memory amountWithdrawn)
{
PositionData storage positionData = _getPositionData(msg.sender);
... | 7,794,985 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "./SafeMath.sol";
import "./HoldefiPausableOwnable.sol";
import "./HoldefiCollaterals.sol";
/// @notice File: contracts/HoldefiPrices.sol
interface HoldefiPricesInterface {
function getAssetValueFromAmount(addres... | Returns borrow index and borrow rate for the given market at current time newBorrowIndex = oldBorrowIndex + (deltaTime borrowRate) market Address of the given market return borrowIndex Borrow index of the given market return borrowRate Borrow rate of the given market return currentTime Current block timestamp | function getCurrentBorrowIndex (address market)
public
view
returns (
uint256 borrowIndex,
uint256 borrowRate,
uint256 currentTime
)
{
borrowRate = holdefiSettings.marketAssets(market).borrowRate;
currentTime = block.timestamp;
uint256 deltaTimeBorrow = currentTime.sub(marketAssets[market].b... | 13,514,333 |
pragma solidity ^0.4.11;
// ----------------------------------------------------------------------------
// OAX 'openANX Token' crowdfunding contract - locked tokens
//
// Refer to http://openanx.org/ for further information.
//
// Enjoy. (c) openANX and BokkyPooBah / Bok Consulting Pty Ltd 2017.
// The MIT Licence.
... | ------------------------------------------------------------------------ Add to 1y locked balances and totalSupply ------------------------------------------------------------------------ | function add1Y(address account, uint value) private {
balancesLocked1Y[account] = balancesLocked1Y[account].add(value);
totalSupplyLocked1Y = totalSupplyLocked1Y.add(value);
}
| 5,428,387 |
// SPDX-License-Identifier: MIT
// Created by Flux Team
// Copy from Compund and editor by Flux.
pragma solidity 0.6.8;
import "./SafeMath.sol";
struct Exp {
uint256 mantissa;
}
library Exponential {
using SafeMath for uint256;
uint256 private constant expScale = 1e18; // solhint-disable-line const-nam... | Checks if left Exp <= right Exp./ | function lessThanOrEqual(Exp memory left, Exp memory right) internal pure returns (bool) {
return left.mantissa <= right.mantissa;
}
| 5,451,362 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
import {GammaOperator} from "./GammaOperator.sol";
import {IGammaRedeemerV1} from "./interfaces/IGammaRedeemerV1.sol";
import {IPokeMe} from "./interfaces/IPokeMe.sol";
import {ITaskTreasury} from "./interfaces/ITaskTreasury.sol";
import {IResolver} from "./interf... | return if otoken is whitelisted on Gamma _otoken otoken address return true if isWhitelistedOtoken returns true for _otoken/ | function isWhitelistedOtoken(address _otoken) public view returns (bool) {
return whitelist.isWhitelistedOtoken(_otoken);
}
| 27,796 |
./full_match/1/0x56356710715D2D29232D0D8784390e2a1C42514E/sources/arb-bridge-peripherals/contracts/tokenbridge/ethereum/gateway/L1GatewayRouter.sol | _gateway l1 gateway address _maxGas max gas for L2 retryable exrecution _gasPriceBid gas price for L2 retryable ticket _maxSubmissionCost base submission cost L2 retryable tick3et return Retryable ticket ID/ | function setGateway(
address _gateway,
uint256 _maxGas,
uint256 _gasPriceBid,
uint256 _maxSubmissionCost
) external payable returns (uint256) {
return setGateway(_gateway, _maxGas, _gasPriceBid, _maxSubmissionCost, msg.sender);
}
| 9,736,274 |
// SPDX-License-Identifier: Unlicensed
pragma solidity 0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning ... | exclude from paying fees or having max transaction amount | constructor() ERC20("TWEET", "TWT") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswap... | 540,749 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
import "./utils/Pausable.sol";
import "./base/CappedCrowdsale.sol";
import "./base/RefundableCrowdsale.sol";
import "./base/TokenController.sol";
/**
* @title MemePreSale
* @notice Meme Token Sale round one presale contract, with mincap (goal), softca... | Sets whitelist The length of _whitelistLimits says that the first X days of token sale is closed, meaning only for whitelisted addresses. _add Array of addresses to add to whitelisted ethereum accounts _remove Array of addresses to remove to whitelisted ethereum accounts _whitelistLimits Array of limits in wei, wh... | function setWhitelist(address[] memory _add, address[] memory _remove, uint256[] memory _whitelistLimits) public onlyOwner beforeSale {
uint256 i = 0;
if (_whitelistLimits.length > 0) {
whitelistDayCount = uint8(_whitelistLimits.length);
for (i = 0; i < _whitelistLimits.lengt... | 6,444,806 |
./full_match/3/0xa0826607DBc6345EC7757C25cdd946965e97Ad7A/sources/contracts/elections.sol | this function sets the state to Created. this function indicates the start of the election./ | function startVote() public inState(State.Created) onlyOwner {
state = State.Voting;
}
the owner cannot vote. Specifies the address the voter voted for, and sets
the flag to indicate that the voter has now voted. It increments the
candidate's vote count and the total vote coun... | 8,182,857 |
//Address: 0x5db2d4a2e6d06f9afe906fc33036f77ebe87b59b
//Contract name: GizerToken
//Balance: 0 Ether
//Verification Date: 2/15/2018
//Transacion Count: 1
// CODE STARTS HERE
pragma solidity ^0.4.19;
// ----------------------------------------------------------------------------
//
// GZR 'Gizer Gaming' token public... | check token amounts do the transfers | function transferMultiple(address[] _addresses, uint[] _amounts) external {
require( tradeable() );
require( _addresses.length == _amounts.length );
require( _addresses.length <= 100 );
uint i;
uint tokens_to_transfer = 0;
for (i = 0; i < _addresses.length; i++) {
tokens_to_tra... | 1,001,682 |
./full_match/11155111/0x274F2B629E8AB1b5606a78428976c5cA867e8155/sources/src/SimpleStorage.sol | function that stores and updates myFavoriteNumber.... Hint: Everytime you updates the state of a blockchain, is going to cost gas. | function store(uint256 _favoriteNumber) public {
myFavoriteNumber = _favoriteNumber;
}
| 3,801,131 |
// SPDX-License-Identifier: MIT
pragma solidity 0.5.17;
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns ... | Gets the balance of the specified address. me The address to query the balance of. return An uint256 representing the amount owned by the passed address./ | function balanceOf(address me) public view returns (uint256) {
return _balances[me];
}
| 12,169,998 |
// SPDX-License-Identifier: MIT
// Creator: Mai of Tessera Labs
// Special Thanks to Diversity from Divine Anarchy for all his help reviewing
pragma solidity ^0.8.12;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `u... | Locks `_owner`'s tokens from any form of transferring. Requirements: - The `caller` cannot have their tokens locked currently. Emits a {Locked} event./ | function lock(uint256 _cooldown) public {
require(!_addressData[_msgSender()].locked, "Tokens currently locked");
require(_cooldown > 0 && _cooldown < 31, "Invalid Cooldown");
unchecked {
uint256 proposedCooldown = _cooldown * 1 days;
require(block.timestamp + propose... | 303,786 |
// 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,... | Update a setting, overrides inherited setting method with extra checks for this contract Some safety guards for certain settings | function setSettingUint(string memory _settingPath, uint256 _value) override public onlyDAONodeTrustedProposal {
if(getBool(keccak256(abi.encodePacked(settingNameSpace, "deployed")))) {
if(keccak256(abi.encodePacked(_settingPath)) == keccak256(abi.encodePacked("minipool.scrub.period"))) {
... | 12,028,781 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.