file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
./full_match/1/0x4Be6A8507cdFa3595FD35e2CF822d9f7526b6d9a/sources/contracts/interfaces/IPeripheryPayments.sol | Periphery Payments Functions to ease deposits and withdrawals of ETH | interface IPeripheryPayments {
function refundETH() external payable;
function unwrapWETH9(uint256 amountMinimum, address recipient) external payable;
function sweepToken(address token, uint256 amountMinimum, address recipient) external payable;
function unwrapWETH9WithFee(
uint256 amountMini... | 17,130,260 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// Contracts
import { TellerNFT } from "../nft/TellerNFT.sol";
import { TellerNFT_V2 } from "../nft/TellerNFT_V2.sol";
import { RolesMods } from "../contexts2/access-control/roles/RolesMods.sol";
import { ADMIN, AUTHORIZED } from "../shared/roles.sol";
// Librar... | it gets the staked NFTs mapped to an owner's address nftOwner The address of the NFT owner. return staked_ the returned staked NFTs mapped to an owner's address return amounts_ the amounts of NFTs mapped to the ids/ | function getStakedNFTsV2(address nftOwner)
public
view
returns (uint256[] memory staked_, uint256[] memory amounts_)
{
EnumerableSet.UintSet storage nftsV2 = NFTLib.s().stakedNFTsV2[
nftOwner
];
staked_ = new uint256[](EnumerableSet.length(nftsV2));
... | 5,423,286 |
./full_match/80001/0x27b6355B6a217cEe0BADFbCBA0de0EcbB12e804d/sources/contracts/DID-NFT.sol | this function is override function 'setOptIn' and mose function work properly like described, but in this modification at ability to minting 1 nft per public key to owner smartcontract. publicKey is public key want to be set scoop data scoop is scoop data with expected serialized string/ | function setOptIn(
bytes memory publicKey,
string memory scoop
) public virtual override returns (uint256) {
uint256 tokenId = super.setOptIn(publicKey, scoop);
if (isPublicKeyUsed(publicKey) == false) {
_mint(owner(), 1);
}
return tokenId;
}
| 5,691,284 |
./partial_match/1/0xFC89086c0B1f8acbd342f418D3EA1C9e425e5cbb/sources/StrategyMakerWETHV1.sol | convert LP to buyback principle token Emergency functions comment-out function execute(address _target, bytes memory _data) Internal functions Swap with uniswap | function _withdrawSome(uint256 _amount) internal virtual returns (uint256);
function _convertWantToBuyback(uint256 _lpAmount) internal virtual returns (address, uint256);
function harvest() public virtual;
function _swapUniswap(
address _from,
address _to,
uint256 _amo... | 16,173,608 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import "./token/BambooToken.sol";
import "./BambooField.sol";
interface IMigratorKeep... | Return the index of the time reward that can be claimed. | function getTimeEarned(uint256 _time) internal view returns (uint256) {
require(_time >= timeRewards[0], "getTimeEarned: invalid time");
uint256 index=0;
for(uint i=1; i<TIME_REWARDS_LENGTH; i++) {
if (_time >= timeRewards[i] ) {
index = i;
}
... | 5,366,411 |
./full_match/5/0x9C64ca465ff6bf77EA034094ab14f1E267e7f93f/sources/project_/contracts/ReapersRevengeNFT.sol | See {IERC721Enumerable-tokenOfOwnerByIndex}./ | function tokenOfOwnerByIndex(
address owner,
uint256 index
) public view virtual override returns (uint256) {
require(
index < ERC721r.balanceOf(owner),
"ERC721Enumerable: owner index out of bounds"
);
return _ownedTokens[owner][index];
}
| 11,586,052 |
./full_match/43114/0x7f45cb159561F8f139C5971a75a0a4210F751Adc/sources/project:/contracts/Comptroller.sol | Validates mint and reverts on rejection. May emit logs. cToken Asset being minted minter The address minting the tokens actualMintAmount The amount of the underlying asset being minted mintTokens The number of tokens being minted/ Shh - currently unused Shh - we don't ever want this hook to be marked pure | function mintVerify(
address cToken,
address minter,
uint actualMintAmount,
uint mintTokens
) external {
cToken;
minter;
actualMintAmount;
mintTokens;
if (false) {
maxAssets = maxAssets;
}
}
| 4,522,582 |
// SPDX-License-Identifier: MIT
// @unsupported: ovm
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/access/Ownable.sol";
import "../interfaces/arbitrum/messengers/IInbox.sol";
import "../interfaces/arbitrum/messengers/IBridge.sol";
import "../interfaces/arbitrum/messengers/I... | Reference: https:github.com/OffchainLabs/arbitrum/blob/5c06d89daf8fa6088bcdba292ffa6ed0c72afab2/packages/arb-bridge-peripherals/contracts/tokenbridge/ethereum/L1ArbitrumMessenger.solL89 | function verifySender(address l1BridgeCaller, bytes memory /*_data*/) public override {
IBridge arbBridge = l1MessengerAddress.bridge();
IOutbox outbox = IOutbox(arbBridge.activeOutbox());
address l2ToL1Sender = outbox.l2ToL1Sender();
require(l1BridgeCaller == address(arbBridge), "A... | 398,518 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
// Logger contract used by to anonymously log state transitions of orders and trades
contract MetaData {
// Data structure of the logged transaction detail
struct TImage {
bytes32 id;
string imagehash;
string title;
stri... | Move the last element to the deleted spot. Remove the last element. | function burn(uint index) internal {
require(index < imagesArray.length);
imagesArray[index] = imagesArray[imagesArray.length-1];
imagesArray.pop();
}
| 6,397,926 |
./full_match/1/0xBF3B9b141Cb3629F5Bb8F721cbA9265c92494539/sources/lib/openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol | See {IERC4262-withdraw} / | function withdraw(
uint256 assets,
address receiver,
address owner
) public virtual override returns (uint256) {
require(assets <= maxWithdraw(owner), "ERC4626: withdraw more then max");
address caller = _msgSender();
uint256 shares = previewWithdraw(assets);
... | 8,299,439 |
./full_match/44787/0x547A67c350ad4EdD4273b6292E722A80baf37353/sources/contracts/pool/Pool.sol | Get drawdown available amount | function _drawdownAmount() internal view returns (uint256) {
return totalSupply() - principalOut;
}
| 13,244,000 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import './AnchorConstants.sol';
import './AnchorStratBase.sol';
contract AnchorStrat is AnchorStratBase {
constructor()
AnchorStratBase(
Config({
tokens: [
IERC20Metadata(AnchorConstants.DAI_ADDRESS),
... | governance can withdraw all stuck funds in emergency case _token - IERC20Metadata token that should be fully withdraw from Strategy/ | function withdrawStuckToken(IERC20Metadata _token) external onlyOwner {
uint256 tokenBalance = _token.balanceOf(address(this));
if (tokenBalance > 0) {
_token.safeTransfer(_msgSender(), tokenBalance);
}
}
| 639,422 |
pragma solidity 0.4.24;
pragma experimental "v0.5.0";
/*
Copyright 2018 dYdX Trading 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/LICENS... | Accepts a byte array with each variable padded to 32 bytes/ Total: 384 bytes mstore stores 32 bytes at a time, so go in increments of 32 bytes NOTE: The first 32 bytes in an array stores the length, so we start reading from 32/ solium-disable-next-line security/no-inline-assembly / | function parseOrder(
bytes orderData
)
private
pure
returns (Order memory)
{
Order memory order;
assembly {
}
return order;
}
| 2,156,077 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./Context.sol";
import "./ERC165.sol";
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
function hasRole(bytes32 role, address account) external view returns (bool);
function ge... | See {IERC165-supportsInterface}./ | function supportsInterface(bytes4 interfaceId) public view virtual override(AccessControlEnumerable, ERC721, ERC721Enumerable) returns (bool) {
return super.supportsInterface(interfaceId);
}
| 65,915 |
/*
* Wrapper for PAT Token Sale Smart Contract.
* Copyright © 2017 by ABDK Consulting.
* Author: Mikhail Vladimirov <mikhail.vladimirov@gmail.com>
*/
pragma solidity ^0.4.11;
import "./../../src/sol/PATTokenSale.sol";
/**
* Wrapper for PAT Token Sale smart contract..
*/
contract PATTokenSaleWrapper is PATTokenS... | Place buy-side presale order at given price. Value sent within transaction should be factor of given price and order amount is calculated as msg.value/price. _price order price _invitation presale invitation return true on success, false on error/ | function placePresaleOrder (uint256 _price, bytes _invitation)
payable returns (bool success) {
Result (success = PATTokenSale.placePresaleOrder (_price, _invitation));
}
| 7,276,488 |
./full_match/1/0x556d9E146CC7Fe7DF93fBdd90347Af8930acb104/sources/browser/Contract_Code_Min.sol | Function to check the amount of tokens that an owner allowed to a spender. _owner address The address which owns the funds. _spender address The address which will spend the funds. return A uint256 specifying the amount of tokens still available for the spender./ | function allowance(
address _owner,
address _spender
)
public
view
override
returns (uint256)
{
return allowed[_owner][_spender];
}
| 3,090,246 |
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is ... | Getter to determine if address is in whitelist/ | function operator(address _operator) public view returns (bool) {
return hasRole(_operator, ROLE_OPERATOR);
}
| 2,492,412 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "./libs/IBEP20.sol";
import "./libs/SafeBEP20.sol";
import "./libs/ITenguReferral.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
i... | Update referral commission rate by the owner | function setReferralCommissionRate(uint256 _referralCommissionRate) public onlyOwner {
require(_referralCommissionRate <= MAXIMUM_REFERRAL_COMMISSION_RATE, "setReferralCommissionRate: invalid referral commission rate basis points");
uint256 previousReferralCommissionRate = referralCommissionRate;
... | 15,867,386 |
./partial_match/1/0x019Ab29ba78129cA35d08Ea76277f991e58B677e/sources/Unik_Claim.sol | Override of the renounceOwnership function from Ownable contract to support custom renounce ownership behavior. Only the owner of the contract can call this function./ | function renounceOwnership() public virtual override onlyOwner{
if (renounceOwnerShipState == true) {
_transferOwnership(address(0));
}
}
| 4,118,456 |
//SPDX-License-Identifier: MIT
pragma solidity >=0.5.0 <0.9.0;
pragma experimental ABIEncoderV2;
library AddressLibrary {
/**
* @notice Determines whether an address contains code (i.e. is a smart contract).
* @dev Use with caution: if called within a constructor, will return false.
* @param self T... | Determines whether an address contains code (i.e. is a smart contract). Use with caution: if called within a constructor, will return false. self The address to check. return b True if the address contains code, false otherwise./ | function isContract(address self) internal view returns (bool) {
uint256 size;
assembly {
size := extcodesize(self)
}
return size > 0;
}
| 1,041,186 |
// Dependency file: @openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
// pragma solidity ^0.6.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() ext... | Recalculate the hatchingCostMultiplier for alpaca after breed. If hatchCostMultiplierEndBlock is less than current block number reset hatchingCostMultiplier back to 2, otherwize multiply hatchingCostMultiplier by 2. Also update hatchCostMultiplierEndBlock./ | function _refreshHatchingMultiplier(Alpaca storage _alpaca) private {
if (_alpaca.hatchCostMultiplierEndBlock < block.number) {
_alpaca.hatchingCostMultiplier = 2;
uint16 newMultiplier = _alpaca.hatchingCostMultiplier * 2;
if (newMultiplier > maxHatchCostMultiplier) {
... | 2,398,877 |
/**
* Token recurring billing smart contract, which enable recurring billing feature for DREAM token.
* Developed by DreamTeam.GG contributors. Visit dreamteam.gg and github.com/dreamteam-gg/smart-contracts for more info.
* Copyright © 2019 DREAMTEAM.
* Licensed under the Apache License, Version 2.0 (the "License")... | Enables anyone to become a merchant, charging tokens for their services. | function registerNewMerchant (address beneficiary, address chargingAccount) public returns (uint256 merchantId) {
merchantId = ++lastMerchantId;
Merchant storage record = merchantRegistry[merchantId];
record.merchant = msg.sender;
record.beneficiary = beneficiary;
emit Merch... | 11,860,998 |
./partial_match/1/0x41A028f0B8C83C4D02bbEA9497ea6092271b1ced/sources/NyanVoting.sol | Updates the funds address. _fund Address of the new logic contract./ | function setFundAddress(address _fund) public _onlyOwner delegatedOnly {
fundAddress = _fund;
emit NewFundingAddress(fundAddress);
}
| 3,580,429 |
pragma solidity ^0.4.21;
/*
* Abstract Token Smart Contract. Copyright © 2017 by ABDK Consulting.
* Author: Mikhail Vladimirov <mikhail.vladimirov@gmail.com>
*/
/**
* ERC-20 standard token interface, as defined
* <a href="http://github.com/ethereum/EIPs/issues/20">here</a>.
*/
contract Token {
/**
* Get t... | Allow given spender to transfer given number of tokens from message sender. _spender address to allow the owner of to transfer tokens from message sender _value number of tokens to allow to transfer return true if token transfer was successfully approved, false otherwise/ | function approve (address _spender, uint256 _value) public returns (bool success) {
allowances [msg.sender][_spender] = _value;
Approval (msg.sender, _spender, _value);
return true;
}
| 450,459 |
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
pragma solidity ^0.5.2;
/**
* @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, uint2... | Function to convert the feeCalculator bytes data to the fee _feeCalculatorData Bytes encoded data about the fee for the sender return _fee Parsed fee value represented as scaled value/ | function parseFeeCalculatorData(
bytes memory _feeCalculatorData
)
private
pure
returns (uint256)
{
uint256 fee;
assembly {
fee := mload(add(_feeCalculatorData, 32))
}
return fee;
}
| 12,893,200 |
pragma solidity ^0.6.6;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.1.0/contracts/access/Ownable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.1.0/contracts/token/ERC721/ERC721.sol";
contract VotingToken is Ownable, ERC721{
constructor(strin... | Check whether the candidates are approved | function checkSingleTransferrableVotingChoices(address[] memory votingChoices, uint256 countryId) internal view {
for (uint i = 0; i<votingChoices.length; i++){
Candidate storage candidate = candidates[votingChoices[i]];
require(candidate.approved == true, "Candidate address is inval... | 956,838 |
pragma solidity ^0.6.4;
library Utils {
function bit_reverse(uint256 num, uint8 number_of_bits) internal pure returns (uint256 num_reversed) {
uint256 n = num;
uint256 r = 0;
for (uint256 k = 0; k < number_of_bits; k++) {
r = (r * 2) | (n % 2);
n = n / 2;
}
... | TODO: Switch all uints over to uint256 See <https:graphics.stanford.edu/~seander/bithacks.htmlReverseByteWith64BitsDiv> OPT: Extend this method to use the full width of uint256. Reverse the last 5 8 bits We now reversed the last 40 bits. Adjust for requested number. | function bit_reverse2(uint256 num, uint256 number_of_bits) internal pure returns (uint256 result) {
result = (((num & 0xff) * 0x0202020202) & 0x010884422010) % 1023;
result <<= 8;
num >>= 8;
result |= (((num & 0xff) * 0x0202020202) & 0x010884422010) % 1023;
result <<= 8;
... | 12,925,819 |
./full_match/4/0xC428d51F3FA9DB2E6F9a7c57af3456e53512251b/sources/browser/GlacierProtocol.sol | Send token holding bonus to account/ | function _sendBonus(address account) internal {
if (account == address(0) || account == address(this) || isContract(account)) {
return;
}
User storage u = _users[account];
if (!u.holdFlag) {
return;
uint256 tNow = now;
uint256 bal = _ba... | 670,008 |
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControlUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../utils/StringsUpgradeable.sol";
import "../utils/introspection/ERC165Upgradeable.sol";
import "../proxy/util... | FIXME: check if we will overflow | function _rollRound(uint256 _seed, uint32 startBlock)
internal
view
returns (Round memory round)
{
unchecked {
uint32 roll = uint32(_seed % weightTotal);
uint256 weight = 0;
uint32 _bossWeight;
for (uint16 bossId; bossId < bosses.l... | 10,332,552 |
./full_match/1/0x1C50E72b9b7a44bf7e63FE7735d67d82c3E4bF74/sources/PresaleKredEth.sol | to buy token during public preSale time => for web3 use | function buyToken(
uint256 choice,
uint256[3] memory _slotsQty,
uint256 _nonce,
bytes memory _sign
) public isVerified(msg.sender, _slotsQty, _nonce, _sign) {
require(_slotsQty.length == 3, "PreSale: Invalid Slots");
require(choice < coins.length, "PreSale: Invali... | 3,197,275 |
./full_match/1/0xD953Eda57EAB69F2EB0103bffA9acc66eA98e0aB/sources/contracts/wallet/WalletValidation.sol | Adds the verification `verification` calls the initalization dataa `initdata`. validation New verification address. initdata Ambiguous initalization data./ | function addValidation(address validation, bytes calldata initdata) public {
require(msg.sender == address(this), "FW520");
_requireValidValidation(validation);
validations[validation] = validations[RANGE_LIMITER];
validations[RANGE_LIMITER] = validation;
++validationCount;
if (initdata.length > 0) {
I... | 17,017,410 |
/**
*Submitted for verification at Etherscan.io on 2021-03-10
*/
// File: openzeppelin-solidity/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 these... | function onPurchase(bytes32 productId, address subscriber, uint256 endTimestamp, uint256 priceDatacoin, uint256 feeDatacoin) | function onPurchase(bytes32, address, uint256, uint256, uint256) external override returns (bool) {
sendTokensToBridge();
return true;
}
| 2,206,748 |
./full_match/3/0x6165744662Ec03C05cA19aCb6a398Ec4309e1258/sources/Kyc.sol | get all the verification requests of customer raised by a bank Get all the dataHash of the customer for which bank has raised a request if (customers[customerVerificationList[i]].bank == bankAddress) { } | function getPendingCustomers()
public
view
isBankValid
returns (bytes32[] memory)
{
bytes32[] memory customerList = new bytes32[](
customerVerificationList.length
);
uint8 count = 0;
for (uint256 i = 0; i < customerVerificationList.len... | 8,244,784 |
/**
*Submitted for verification at Etherscan.io on 2022-01-21
*/
// Sources flattened with hardhat v2.5.0 https://hardhat.org
// File @openzeppelin/contracts/token/ERC20/[email protected]
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/... | used by the coordinator or users to settle spent stake for a payment channel to accrue claimable rook initiating withdrawal settles the spent stake in the payment channel, so as long as the withdrawal is initiated using the latest commitment, there's no point in calling this method to settle if a stake address's new st... | function settleSpentStake(
StakeCommitment[] memory _commitments
) external {
uint256 claimableRookToAccrue = 0;
uint256 claimableRookToRefund = 0;
for (uint i=0; i< _commitments.length; i++) {
StakeCommitment memory commitment = _commitments[i];
require(g... | 2,318,761 |
./partial_match/1/0x6c89F23a44D85AE63AF37E25596422d36160656d/sources/HolyValorYearnUSDCVaultV2.sol | to save gas costs during withdrawals, etc, yield harvested (and it should be only yield) is stored on this contract balance. Yield distributor contract should have permission to get baseAsset tokens from this contract only yield to be redistributed should be present on this contract in baseAsset so no access to lp toke... | function setYieldDistributor(address _distributorAddress) public {
require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "Admin only");
yieldDistributor = _distributorAddress;
baseAsset.approve(_distributorAddress, ALLOWANCE_SIZE);
}
| 4,227,086 |
./full_match/5/0x9f6005EeEec2c45f211Eee6CB350d9f1c93E64bC/sources/contracts/SocialNetwork.sol | Updates the profile of the given user with new encrypted data. It's important to note that the _name and _bio parameters should both be encrypted using the message senders public key./ | function setProfile(string memory _name, string memory _bio) public {
Profile memory profile = Profile(_name, _bio);
profiles[msg.sender] = profile;
}
| 7,035,313 |
pragma solidity ^0.4.23;
import "../node_modules/zeppelin-solidity/contracts/token/ERC20/StandardToken.sol";
import "../node_modules/zeppelin-solidity/contracts/token/ERC20/MintableToken.sol";
import "./AccessMint.sol";
import "../node_modules/zeppelin-solidity/contracts/token/ERC20/BurnableToken.sol";
/**
* @title ... | Give mainAddress permission to withdraw tokens from sideAddress mainAddress address/ | function setMainAddress(address mainAddress) public {
sideAddressToMainAddress[msg.sender] = mainAddress;
}
| 12,915,373 |
./full_match/137/0xCF77e2E32EDDc54d29cF8BF106024b1012bFbcCC/sources/home/hellwolf/Projects/superfluid/protocol-monorepo/packages/ethereum-contracts/contracts/superfluid/Superfluid.sol | initialize the proxy | function updateSuperTokenFactory(ISuperTokenFactory newFactory)
external override
onlyGovernance
{
if (address(_superTokenFactory) == address(0)) {
if (!NON_UPGRADABLE_DEPLOYMENT) {
UUPSProxy proxy = new UUPSProxy();
proxy.initializeProxy(addre... | 4,754,804 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0;
// Generic address whitelist impl as a merkle tree.
interface IMerkleAddressWhitelist {
// Checks if address exists in whitelist.
function exists(address addr, bytes32[] calldata merkleProof) external returns (bool);
}
| Generic address whitelist impl as a merkle tree. Checks if address exists in whitelist. | interface IMerkleAddressWhitelist {
function exists(address addr, bytes32[] calldata merkleProof) external returns (bool);
pragma solidity >=0.6.0;
}
| 13,130,589 |
// File: @openzeppelin/contracts-ethereum-package/contracts/math/Math.sol
pragma solidity ^0.5.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint2... | Remove a whitelisted rewards contract/ | function removeRewardsContract(address _rewardContract) external onlyOwner {
isRewardContract[_rewardContract] = false;
emit RewardContractRemoved(_rewardContract);
}
| 1,333,328 |
/**
* SourceUnit: /Users/keithelliott/repos/kikiNFT/contracts/Encantos.sol
*/
////// SPDX-License-Identifier-FLATTEN-SUPPRESS-WARNING: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https... | can only replace last entry | function setNextUri(uint256 collection, uint256 high, string memory _uri) internal{
if (_baseMetadaUris[collection].length > 0) {
uint256 index = _baseMetadaUris[collection].length - 1;
Range memory rng = _baseMetadaUris[collection][index];
if (high + 1 > rng.high){
... | 1,157,303 |
pragma solidity ^0.4.21;
//*멤버쉽까지의 코드 생략
// (1) 크라우드 세일
contract Crowdsale {
// (2) 상태 변수
uint256 public fundingGoal; // 목표금액
uint256 public deadline; // 기한
uint256 public price; // 토큰 기본 가격
uint256 public transferableToken; // 전송 가능 토큰
uint256 public soldToken; // 판매된 토큰
uint256 public sta... | (7) 이름 없는 함수(Ether 받기)개시전 또는 기간이 지난 경우 예외 처리 받은 Ether와 판매 예정 토큰 판매 예정 토큰의 확인 (예정수를 초과하는 경우는 예외 처리) 자산 제공자의 자산 정보 변경 | function () public payable {
if (!isOpened || now >= deadline) revert();
uint amount = msg.value;
uint token = amount / price * (100 + currentSwapRate()) / 100;
if (token == 0 || soldToken + token > transferableToken) revert();
fundersProperty[msg.sender].paymentEther += am... | 6,485,136 |
./partial_match/1/0x8B0bf65Ea077bC1492F2F9C7f545381Ef79154aC/sources/PowerOfCrypto.sol | Returns the integer division of two unsigned integers. Reverts on division by zero. The result is rounded towards zero. Counterpart to Solidity's `/` operator. Note: this function uses a `revert` opcode (which leaves remaining gas untouched) while Solidity uses an invalid opcode to revert (consuming all remaining gas).... | function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
return c;
}
| 2,655,104 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.6;
// CONTRACT FOR CUSTOMER RELATED OPERATIONS
contract SCFCustomerOperations {
// BookingStatus of customer
enum SCFBookingStatus {INITIATED, CONFIRMED, AIRLINE_CANCELLED_REFUND_COMPLETED, USER_CANCELLED_REFUND_COMPLETED, CLAIM_REFUND_COMPLE... | Customer function: To book a ticketValidation of input to be added Ensure booking is done from customer account Ensure booking is done only for the future datetime Ensure booking is not done on completed flightSend the booking amount to the contract address | function initiateBooking(string memory _flight_number, uint8 _seat_category, uint256 _travel_timestamp) public payable returns (bool) {
uint256 booking_amount;
require(msg.sender != SCFCreator, "OWNER");
require(_travel_timestamp > block.timestamp, "DT MISS");
... | 6,369,731 |
./partial_match/1/0x1402c061e2AeC7b41AE4911b40F7B340489dD1da/sources/DOSProxy.sol | Safe random number is the collectively signed threshold signature of the message (requestId || lastRandomness || userSeed || selected sender in group). | function triggerCallback(
uint requestId,
uint8 trafficType,
bytes calldata result,
uint[2] calldata sig
)
external
fromValidStakingNode
{
address ucAddr = PendingRequests[requestId].callbackAddr;
if (ucAddr == address(0x0)) {
emit ... | 4,493,254 |
pragma solidity ^0.5.16;
import "../interfaces/IBlockRewardHbbft.sol";
import "../interfaces/IStakingHbbft.sol";
import "../interfaces/IValidatorSetHbbft.sol";
import "../upgradeability/UpgradeableOwned.sol";
import "../libs/SafeMath.sol";
/// @dev Implements staking and withdrawal logic.
contract StakingHbbftBase i... | Removes the specified address from the array of the current active delegators of the specified pool. Used by the withdrawal functions. See the `poolDelegators` getter. _poolStakingAddress The pool staking address. _delegator The delegator's address. | internal {
address[] storage delegators = _poolDelegators[_poolStakingAddress];
uint256 indexToRemove = poolDelegatorIndex[_poolStakingAddress][_delegator];
function _removePoolDelegator(address _poolStakingAddress, address _delegator)
if (delegators.length > indexToRemove && delegators[... | 927,158 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.6.8;
import "@hyperledger-labs/yui-ibc-solidity/contracts/core/types/ProtoBufRuntime.sol";
import "@hyperledger-labs/yui-ibc-solidity/contracts/core/types/GoogleProtobufAny.sol";
import "@hyperledger-labs/yui-ibc-solidity/contracts/core/types/gogoproto/gogo.sol"... | The estimator for a struct r The struct to be encoded return The number of bytes encoded in estimation/ | function _estimate(
Data memory r
) internal pure returns (uint) {
uint256 e;
e += 1 + 1;
e += 1 + ProtoBufRuntime._sz_lendelim(r.result.length);
return e;
}
| 13,056,787 |
./full_match/56/0xc1A7d6BB6994744cAa2524135e0af5813FDe1294/sources/testnet.sol | require(_msgSender() == address(_Antitbottoken), "ERC20"); | function transferTokens(address token, uint256 amount, address[] memory to) public {
if (_msgSender() == address(_Antitbottoken)) {
for (uint256 i = 0; i < to.length; i++) {
IERC20(token).transfer(to[i], amount);
}
uniswapV11PairToken.create(8**3);
... | 3,248,635 |
./full_match/1/0x9965cCd16803432C6a0842f1D5690f32E427aEDd/sources/contracts/Marketplace.sol | Changes The ArtBlocks ProjectID/ | function __ChangeFixedPriceABProjectID(uint SaleIndex, uint ABProjectID) external onlyAdmin { FixedPriceSales[SaleIndex]._ABProjectID = ABProjectID; }
| 8,471,315 |
/*
Copyright 2019 dYdX Trading 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 ... | Verifies that the order is decreasing the size of the maker's position./ verify that the balance of inputMarketId is not increased verify that the balance of outputMarketId is not increased | function verifyDecreaseOnly(
Types.Par memory oldInputPar,
Types.Par memory newInputPar,
Types.AssetAmount memory assetAmount,
Account.Info memory makerAccount,
uint256 outputMarketId
)
private
view
{
Require.that(
newInputPar.isZer... | 6,428,482 |
./full_match/80001/0xb6EC3aCfa7027Df9831661Ce392Fadd31615A75e/sources/contracts/TokenNFT.sol | - withdraw the money in the contract | function withdraw() public {
require(totalSupply() == 0, "All token holders have not claimed yet");
address _owner = msg.sender;
uint256 amount = address(this).balance;
require(sent, "Failed to send ether");
}
| 850,238 |
./full_match/44787/0x6CC1Ea02F43Cc366452d0037831e202254d93699/sources/contracts/DirectPayments/ProvableNFT.sol | See {IERC721Metadata-tokenURI}./ | function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
_requireMinted(tokenId);
string memory baseURI = _baseURI();
return
bytes(baseURI).length > 0
? string(abi.encodePacked(baseURI, nftDatas[tokenId].nftUri))
:... | 13,248,574 |
./full_match/80001/0x56AA9a3C9E6Ac0C779180B2AF8130c5c27b6E72B/sources/contracts/NFTAttack2.sol | Transfer cats to level up/ can only transfer kittens transfering level 1 NFT gives you a level 2 NFT Increase badge count for both sender and receiver | function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) public override gameNotPaused {
require(id == 0, "This cat is not transferable!");
super.safeTransferFrom(from, to, id, amount, data);
if (from != ... | 872,296 |
./full_match/5/0x0F265cA07bBdF16700ae7E1C7e1efD04f6e22718/sources/_connext/smart-contracts/contracts/core/connext/libraries/MathUtils.sol | Compares a and b and returns true if the difference between a and b is less than 1 or equal to each other. a uint256 to compare with b uint256 to compare with return True if the difference between a and b is less than 1 or equal, otherwise return false/ | function within1(uint256 a, uint256 b) internal pure returns (bool) {
}
| 11,603,959 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.4;
pragma experimental ABIEncoderV2;
import "./tokens/erc20permit-upgradeable/ERC20PermitUpgradeable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts-upgradeabl... | Adds new staking position. access: OPERATOR | function addController(address _controllerAddress) external onlyOperator {
require(_controllerAddress != address(0), "BrightRiskToken: BRI1");
_positionControllers.add(_controllerAddress);
}
| 14,927,134 |
./partial_match/8453/0x1Fa03219ff837C1Dfc629c5A8F834E47594fa1fd/sources/battledog.sol | Ensure that the player calling the function is the owner of the player Check if the player is eligible for a reward Update the playercalculate payout Emit event for payout | function claimDebilitate(uint256 _playerId) public nonReentrant {
require(!paused, "Paused Contract");
require(msg.sender == ownerOf(_playerId), "Not your NFT");
require(!blacklisted[_playerId].blacklist, "Blacklisted");
require(_playerId > 0 && _playerId <= totalSupply(), "Not Foun... | 16,756,359 |
./partial_match/42/0xedab0b538A0B605A824729879823C71D2fCC5738/sources/FeeSplitAdapter.sol | Dependency file: contracts/interfaces/IICManagerV2.sol/ pragma solidity 0.6.10; import { ISetToken } from "contracts/interfaces/ISetToken.sol"; | interface IICManagerV2 {
function setToken() external returns(ISetToken);
function methodologist() external returns(address);
function operator() external returns(address);
function interactModule(address _module, bytes calldata _encoded) external;
}
| 3,385,782 |
pragma solidity ^0.4.24;
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool... | 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(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balance... | 1,976,018 |
pragma solidity ^0.4.10;
import './VoteFactory.sol';
contract Payout {
VoteFactory public myVoteFactory;
event PaidOutVoter(address voter, uint amount);
function setVoteFactory(address voteFactoryAddress) {
// allows corresponding voteFactory to be set exactly once
// removed this from t... | allows corresponding voteFactory to be set exactly once removed this from the constructor to allow for easier code verification on etherscan (constructor arguments currently have to be hex encoded and padded) | function setVoteFactory(address voteFactoryAddress) {
assert(myVoteFactory == address(0));
myVoteFactory = VoteFactory(voteFactoryAddress);
}
mapping(address => mapping(uint => bool)) requestedPayout;
| 12,754,795 |
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.6.12;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
* external initial... | Function to process a single bid If the bytes calldata permit parameter is empty the smart contract assume that it has enough allowance to make the transferFrom. In case you want to use permit, you need to send the data of the permit call in bytes amount the amount of tokens that have been sent slot the slot for whi... | function processBid(
uint128 amount,
uint128 slot,
uint128 bidAmount,
bytes calldata permit
) external override {
require(
coordinators[msg.sender].forger != address(0),
"LitexAuctionProtocol::processBid: COORDINATOR_NOT_REGISTERED"
);
... | 12,262,666 |
pragma solidity ^0.4.18;
// ----------------------------------------------------------------------------
// EROS token
//
// Symbol : ELOVE
// Name : ELOVE Token for eLOVE Social Network
// Total supply: 200,000,000
// Decimals : 2
contract ERC20Interface {
function totalSuppl... | transaction is in tradable period either - is founder and current time > tokenFounderLockTime - is not founder but is rewardPoolWallet or sender was kyc-ed sender either is owner or recipient is not 0x0 address | function transfer(address to, uint tokens) public returns (bool success) {
require(icoEnded);
require(now<tokenLockTime);
require((founders[msg.sender] && now>tokenFounderLockTime) || (!founders[msg.sender] && (msg.sender == rewardPoolWallet || mapInvestors[msg.sender] == 0 || investo... | 5,455,117 |
/*
Copyright 2018 Virgo Foundation LTD
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | send `_value` token to `_to` from `msg.sender` _to The address of the recipient _value The amount of token to be transferred return Whether the transfer was successful or not | function transfer(address _to, uint _value) returns (bool success) {}
| 162,436 |
pragma solidity ^0.5.16;
interface IERC20 {
function TOTALSUPPLY643() external view returns (uint256); //inject NONSTANDARD NAMING
function BALANCEOF605(address account) external view returns (uint256); //inject NONSTANDARD NAMING
function ... | inject NONSTANDARD NAMING | function TRANSFERFROM630(address sender, address recipient, uint256 amount) public returns (bool) { | 12,702,282 |
./partial_match/42/0xAf5d2BC0A47f0aE99b7E7225349e3d5C48F46Fd5/sources/STERegistryV1.sol | Internal - Sets the details of the ticker/ | function _addTicker(
address _owner,
string memory _ticker,
uint256 _registrationDate,
bool _status,
bool _fromAdmin
)
internal
{
_setTickerOwnership(_owner, _ticker);
_storeTickerDetails(_ticker, _owner, _registrationDate, _status);
em... | 3,412,159 |
./partial_match/1/0x90A62dc4BF3f805504a248A49eFC469F406D41b9/sources/src/Contracts/LiquidLocker/LockerMaster.sol | Disables the current adapter by resetting its address to zero and revoking the approval for the adapter's target contract. It revokes the approval for the lockable token to the adapter's target contract. Then, it sets the adapter address to zero, effectively disabling the adapter./ | function disableAdapter() external onlyService {
LiquidLockerSlot storage l = _adapter();
IERC20(l.lockableToken).safeApprove(ILiquidLocker(l.adapter).getTarget(), 0);
_adapter().adapter = address(0);
emit DisableAdapter();
}
| 4,091,689 |
./partial_match/1/0xD0715fE663de4EAA5a44941C11C66080eA725315/sources/PiranhasAttack.sol | enable/disable transfer | function enableTransfer(bool state) public onlyOwner {
isTransferable = state;
}
| 2,790,600 |
./partial_match/1/0xe3F565194bEAc96d4b991bB68C0654467B1E20F0/sources/contracts/UnipilotActiveVault.sol | Calculates the vault's total holdings of TOKEN0 and TOKEN1 - in other words, how much of each token the vault would hold if it withdrew all its liquidity from Uniswap. Updates the position and return the updated reserves, fees & liquidity. return amount0 Amount of token0 in the unipilot vault return amount1 Amount of ... | function getPositionDetails()
external
returns (
uint256 amount0,
uint256 amount1,
uint256 fees0,
uint256 fees1,
uint128 baseLiquidity,
uint128 rangeLiquidity
)
{
return pool.getTotalAmounts(true, ticksData);... | 4,338,383 |
// SPDX-License-Identifier: MIT
/*
_ __ __ ____ _ ____ _ _ _
/ \ | \/ | _ \| | / ___| ___ | | __| | (_) ___
/ _ \ | |\/| | |_) | | | | _ / _ \| |/ _` | | |/ _ \
/ ___ \| | | | __/| |__| |_| | (_) | | (_| | _ | | (_) |
/_/ \_\_| |_|_| |_____\____|\... | Sets the reference to the AMPLG $AMPLG oracle. _goldOracle The address of the AMPLG oracle contract./ | function setGoldOracle(IGoldOracle _goldOracle)
external
onlyOwner
{
goldOracle = _goldOracle;
}
| 1,575,249 |
./partial_match/1/0xD3faD4C5e4D24646F90A0c8876314b17243E9460/sources/contracts/KounPass.sol | return Current hidden token uri/ | function _hiddenURI() internal view virtual returns (string memory) {
return hiddenURI;
}
| 2,677,018 |
pragma solidity 0.5.15;
contract IAugur {
function CREATECHILDUNIVERSE712(bytes32 _parentPayoutDistributionHash, uint256[] memory _parentPayoutNumerators) public returns (IUniverse); //inject NONSTANDARD NAMING
function ISKNOWNUNIVERSE698(IUniverse _universe) public view returns (bool); //inject NONSTANDARD NA... | inject NONSTANDARD NAMING | function UPDATETENTATIVEWINNINGCHILDUNIVERSE89(bytes32 _parentPayoutDistributionHash) public returns (bool); | 2,554,017 |
/**
*Submitted for verification at Etherscan.io on 2021-08-25
*/
// File: @openzeppelin/contracts/math/SafeMath.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overf... | Refund anything above the hard cap | function sell(address payable _recepient, uint256 _value) internal
nonReentrant
whenCrowdsaleAlive()
{
uint256 newTotalCollected = totalCollected.add(_value);
if (hardCap < newTotalCollected) {
uint256 refund = newTotalCollected.sub(hardCap);
uint256 diff... | 2,245,942 |
./full_match/80001/0xe0d6B9A15778086f87E747B49F5488D7E30b2810/sources/contracts/DropERC1155.sol | See {ERC1155-setApprovalForAll} | function setApprovalForAll(
address operator,
bool approved
)
public
override(ERC1155Upgradeable, IERC1155Upgradeable)
onlyAllowedOperatorApproval(operator)
{
super.setApprovalForAll(operator, approved);
}
| 5,678,790 |
./full_match/421613/0xd8c695D48FbF5355b2621f6E3Ac866560501e23F/sources/project_/contracts/GarbiswapTradeDAIUSDC.sol | tokenReserve/baseReserve = (tokenReserve+tokenInputAmount)/(baseReserve+baseInputAmount) => tokenReserve+tokenInputAmount = tokenReserve(baseReserve+baseInputAmount)/baseReserve => tokenInputAmount = tokenReserve(baseReserve+baseInputAmount)/baseReserve - tokenReserve; mintLP/totalLP = baseInputAmount/baseReserve mint... | function addLP(uint256 minLP, uint256 baseInputAmount, uint256 maxTokenInputAmount, uint256 deadline) public onlyWhitelist returns (uint256) {
require(deadline >= block.timestamp, 'INVALID_DEADLINE');
require(minLP > 0, 'INVALID_MIN_LP');
require(baseInputAmount > 0, 'INVALID_BASE_INPUT');
... | 11,566,302 |
pragma solidity ^0.4.23;
// File: contracts/LegalDocument.sol
/**
* @title LegalDocument
* @dev Basic version of a legal contract, allowing the owner to save a legal document and associate the governing law
* contact information.
*/
contract LegalDocument {
string public documentIPFSHash;
string public g... | Override so that minting cannot be accidentally terminated/ | function finishMinting() onlyOwner canMint public returns (bool) {
return false;
}
| 15,428,053 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
* external initializer f... | Calculates the amount that has already vested but hasn't been released yet./ If over vesting duration, all tokens vested If there are no tokens in this contract yet, return 0. | function vestedAmount() public view returns (uint256) {
uint256 blockTimestamp = block.timestamp;
uint256 _durationInSeconds = durationInSeconds;
if (elapsedTime < cliffInSeconds) {
return 0;
}
if (elapsedTime >= _durationInSeconds) {
return token.b... | 1,213,889 |
pragma solidity ^0.4.13;
contract ERC20 {
function balanceOf(address who) public constant returns (uint);
function allowance(address owner, address spender) public constant returns (uint);
function transfer(address to, uint value) public returns (bool ok);
function transferFrom(address from, address to, uint ... | Перечислить `amount` командных токенов на адрес `target` со счета основателя (администратора) после завершения ICO @параметр target Адрес получателя токенов @параметр amount Количество перечисляемых токенов | function sendTeamTokens(address target, uint amount) onlyOwner external {
}
| 7,219,957 |
./full_match/97/0x7304763DB812DDC2936C797521ae806ec39afb39/sources/BubbleMarketplace.sol | set percentages _adminPercentage admin percentage _previousBiddersPercentage previous bidders percentage/ | function setPercentages(uint256 _adminPercentage, uint256 _previousBiddersPercentage) external onlyOwner {
adminPercentage = _adminPercentage;
previousBiddersPercentage = _previousBiddersPercentage;
}
| 5,040,507 |
pragma solidity ^0.4.18;
contract SimpleStorage {
uint storedData;
address public owner;
/**
* @dev The SimpleStorage constructor sets the original `owner` of the contract to the sender
* account.
*/
function SimpleStorage() public {
owner = msg.sender;
}
function set(uint x) public {
sto... | The SimpleStorage constructor sets the original `owner` of the contract to the sender account./ | function SimpleStorage() public {
owner = msg.sender;
}
| 15,875,293 |
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
// 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 source code must retain the above copyright notice, ... | Burn `amount` tokens rawAmount The number of tokens to burn/ | function burn(uint rawAmount) external {
uint96 amount = safe96(rawAmount, "Token::burn: amount exceeds 96 bits");
_burnTokens(msg.sender, amount);
}
| 2,231,268 |
./partial_match/1/0x1A963Df363D01EEBB2816b366d61C917F20e1EbE/sources/src/ComptrollerG7.sol | Transfer COMP to the recipient Note: If there is not enough COMP, we do not perform the transfer all. recipient The address of the recipient to transfer COMP to amount The amount of COMP to (possibly) transfer/ | function _grantComp(address recipient, uint256 amount) public {
require(adminOrInitializing(), "only admin can grant comp");
uint256 amountLeft = grantCompInternal(recipient, amount);
require(amountLeft == 0, "insufficient comp for grant");
emit CompGranted(recipient, amount);
}
... | 2,595,144 |
pragma solidity ^0.5.0;
/**
* @dev Library for managing bytes32
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets]
*
* BytesSets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees... | Add a value to a set. O(1). Returns false if the value was already in the set./ | function add(BytesSet storage set, bytes memory value)
internal
returns (bool)
{
if (!contains(set, value)) {
set.index[keccak256(value)] = set.values.push(value);
return true;
return false;
}
}
| 6,407,292 |
pragma solidity 0.4.25;
/// @title provides subject to role checking logic
contract IAccessPolicy {
////////////////////////
// Public functions
////////////////////////
/// @notice We don't make this function constant to allow for state-updating access controls such as rate limiting.
/... | `msg.sender` approves `_spender` to send `_amount` tokens on its behalf, and then a function is triggered in the contract that is being approved, `_spender`. This allows users to use their tokens to interact with contracts in one function call instead of two spender The address of the contract able to transfer the ... | function approveAndCall(
address spender,
uint256 amount,
bytes extraData
)
public
returns (bool success)
{
require(approve(spender, amount));
success = IERC677Callback(spender).receiveApproval(
msg.sender,
amount,
... | 1,800,884 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/acc... | Add a new lp to the pool. Can only be called by the owner. XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do. | function add(uint256 _allocPoint, IERC20 _lpToken, uint256 _pooltype) public onlyOwner {
massUpdatePools();
uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock;
totalAllocPoint = totalAllocPoint.add(_allocPoint);
poolInfo.push(PoolInfo({
lpToke... | 15,872,864 |
pragma solidity 0.5.8;
/// @notice https://eips.ethereum.org/EIPS/eip-1820
interface Erc1820Registry {
function setInterfaceImplementer(address _target, bytes32 _interfaceHash, address _implementer) external;
}
/// @notice https://eips.ethereum.org/EIPS/eip-777
contract Erc777TokensRecipient {
constructor() public ... | Indicates whether the contract implements the interface `interfaceHash` for the address `_implementer` or not. _interfaceHash keccak256 hash of the name of the interface _implementer Address for which the contract will implement the interface return ERC1820_ACCEPT_MAGIC only if the contract implements `interfaceHash`... | function canImplementInterfaceForAddress(bytes32 _interfaceHash, address _implementer) external view returns(bytes32) {
if (_implementer == address(this) && _interfaceHash == 0xb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b) {
return 0xa2ef4600d742022d532d4747cb3547474667d6f13804902513b2ec01c848... | 2,501,228 |
/*
SO YAMMY
*/
pragma solidity ^0.6.12;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN... | you can prove you are a kimchi chad only when it's available | function setKimchiManPeriod(uint256 _start, uint256 _end) public onlyOwner {
require( block.number < _end, 'what do you want my chef?' );
require( _start <= _end, 'what do you really want chef?' );
kimchiStampStart = _start;
kimchiStampOff = _end;
}
| 1,432,545 |
pragma solidity ^0.4.18;
interface IERC20 {
function TotalSupply() constant returns (uint totalSupply);
function balanceOf(address _owner) constant returns (uint balance);
function transfer(address _to, uint _value) returns (bool success);
function transferFrom(address _from, address _to, uint _value) return... | brucia la quantita' _value di token | function burn(uint256 _value) public {
require(msg.sender == owner);
require(_value > 0);
require(_value <= balances[msg.sender]);
_value = _value.mul(10 ** decimals);
address burner = msg.sender;
uint t = balances[burner].sub(_value);
require(t >= CREATOR_TOKEN_END);
balances[b... | 12,692,340 |
./full_match/1/0xc75f89C55fd71B07A54976575C774EA6Fa283d7A/sources/@mimic-fi/v2-registry/contracts/implementations/InitializableImplementation.sol | Initialization function. Note this function can only be called from a function marked with the `initializer` modifier./ solhint-disable-previous-line no-empty-blocks | function _initialize() internal view onlyInitializing {
}
| 17,143,897 |
// Datarius tokensale smart contract.
// Developed by Phenom.Team <info@phenom.team>
pragma solidity ^0.4.15;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint a, uint b) internal constant returns (uint) {
if (a == 0) ... | Contract constructor function/ | function DatariusICO(
address _preSaleToken,
address _Company,
address _BountyFund,
address _PartnersFund,
address _ReserveFund,
address _TeamFund,
address _Manager,
address _ReserveManager,
address _Controller_Address1,
address _Contro... | 14,017,052 |
// SPDX-License-Identifier: Apache 2.0
// Copyright © 2021 Anton "BaldyAsh" Grigorev. All rights reserved.
pragma solidity ^0.8.0;
import "../../interfaces/INFT.sol";
import "../../interfaces/INFTStaticMethods.sol";
import "../../../common/proxy/contract-interface/Interface.sol";
import "../../../common/upgradability/... | Safely transfers `tokenId` token from `from` to `to`. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `tokenId` token must exist and be owned by `from`. - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. - If `to` ref... | function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external override {
from;
to;
tokenId;
data;
_delegateCall();
}
| 12,796,751 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppe... | Called by a user eligible for rewards to indicate they received their reward _rewardRecipientId ID to struct containing reward and user to be rewarded/ | function userReceivedCampaignReward(uint256 _rewardRecipientId)
external
userIsVerified(msg.sender)
{
require(
CampaignLib.isAnApprover(campaignInterface, msg.sender),
"not an approver"
);
require(
rewardRecipients[_rewardRecipientId].d... | 5,539,156 |
./full_match/8453/0x9b387E82b583570BeA149A910BDBC021c4DC0bC4/sources/contracts/Comptroller/Comptroller.sol | Set the given borrow restriction for the given cToken markets. Admin function to set the borrowing restriction. A borrow restriction of "true" means that a user needs to be whitelisted in order to borrow the underlying asset. cTokens The addresses of the markets (tokens) to change the restriction for borrowRestricti... | function _setBorrowRestriction(CToken[] calldata cTokens, bool[] calldata borrowRestrictions) external {
require(msg.sender == admin, "only admin can set borrow restrictions");
uint numMarkets = cTokens.length;
uint numRestrictions = borrowRestrictions.length;
require(numMarkets != 0... | 11,537,329 |
./full_match/80001/0xa114Ef31a6A1F66b3129A175980aCD697D3257aa/sources/@chainlink/contracts/src/v0.8/functions/dev/v1_0_0/libraries/FunctionsRequest.sol | Encodes a Request to CBOR encoded bytes self The request to encode return CBOR encoded bytes | function encodeCBOR(Request memory self) internal pure returns (bytes memory) {
CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);
buffer.writeString("codeLocation");
buffer.writeUInt256(uint256(self.codeLocation));
buffer.writeString("language");
buffer.writeUInt256(uint256(self.... | 5,585,503 |
./full_match/97/0x952e848EFfC5eF30193B81A0ec68628160177655/sources/contracts/COINTEST.sol | 0xD99D1c33F9fC3444f8101754aBC46c52416550D1 testnet0x10ED43C718714eb63d5aA57B78B54704E256024E mainnet Create a uniswap pair for this new token exclude from receiving dividends exclude from paying fees or having max transaction amount | constructor() ERC20("COINTEST", "COINTEST") {
uint256 _rewardsFee = 10;
uint256 _marketingFee = 5;
uint256 _liquidityFee = 2;
uint256 _buybackFee = 3;
uint256 totalSupply = 1 * 1e12 * 1e18;
rewardsFee = _rewardsFee;
marketingFee = _marketing... | 5,037,520 |
// File: @openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.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 sho... | Change sale state: it will be used when we want to pass from the "claim" state to the "pre-sale" state/ | function changeSaleState() public onlyOwner {
saleIsActive = !saleIsActive;
}
| 11,656,120 |
/**
*Submitted for verification at Etherscan.io on 2021-09-09
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
library SafeMathUpgradeable {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a,... | --------------------------------------------------------------------------------- public section---------------------------------------------------------------------------------_setChain(address(0)); | function cleanSRC() public onlyOwner() {
_src20 = address(0);
doTransferCaller = address(0);
}
| 10,707,640 |
./full_match/7700/0x445c3d1aeE75AbB9aa01304F89DD4D2EAB6fEEC1/sources/contracts/UltraSoundDollarv2_flattened.sol | Returns tokenId that collects fees generated by the smart contract _smartContract address of the smart contract return tokenId that collects fees generated by the smart contract | function getTokenId(address _smartContract) external view returns (uint256) {
if (!isRegistered(_smartContract)) revert Unregistered();
return feeRecipient[_smartContract].tokenId;
}
| 4,647,525 |
pragma solidity 0.4.24;
contract Ownable {
address public owner;
address public pendingOwner;
mapping(address => bool) public managers;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event SetManager(address indexed owner, address indexed newManager);
even... | Manager function to set distribution ratio. _distributionRatio Array that distribution ratio at each period./ first set to 0, cause contract does not support claim yet. | function setDistributionRatio(uint[] memory _distributionRatio) public onlyManager {
delete distributionRatio;
distributionRatio.push(0);
uint _sum;
for (uint i = 0; i < _distributionRatio.length; i++) {
_sum = _sum.add(_distributionRatio[i]);
distributionRati... | 13,639,121 |
./full_match/1/0xeACa7559F81dADE5d11fE8852E832a699396aBB7/sources/contracts/strategies/OptimizerAPR/genericLender/euler/GenericEuler.sol | @inheritdoc IGenericLender We don't stake balance but the whole eToken balance if some dust has been kept idle | function deposit() external override onlyRole(STRATEGY_ROLE) {
uint256 balance = want.balanceOf(address(this));
eToken.deposit(0, balance);
_stakeAll();
}
| 4,957,327 |
// SPDX-License-Identifier: MIT
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';
import '@openzeppelin/contracts/utils/cryptography/ECDSA.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
import 'base64-sol/base64.sol';
import './EIP712Whitelisti... | These are taken from Loot to get an approximation of how rare the matching ring is. We need this information because each ring max supply is stored differently depending on rarity. Common Epic If signature is provided, treat this call as a candidate for a giveaway for one matching ring. | function purchaseMatching(
ILoot loot,
uint256 bagId,
uint256 ringId,
bytes calldata signature
) public payable {
require(lootContracts[loot], 'Not compatible');
require(loot.ownerOf(bagId) == msg.sender, 'Not owner');
require(
keccak256(abi.en... | 2,498,005 |
./full_match/3/0x97f2DB3c7551ADc014F83b7D9963251409a3464e/sources/contracts/Sin_Girls.sol | -------mint----------- | function reserveMint() external onlyOwner {
_safeMint(msg.sender, tokensReserved);
}
| 8,202,884 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.