file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
/**
*Submitted for verification at Etherscan.io on 2021-06-09
*/
// Sources flattened with hardhat v2.0.11 https://hardhat.org
// File @openzeppelin/contracts/token/ERC20/[email protected]
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the... | Retrieves the addresses and units required to mint a particular quantity of CKToken. _ckToken Instance of the CKToken to issue _quantity Quantity of CKToken to issue return address[] List of component addresses return uint256[] List of component units required to issue th... | function getRequiredComponentUnitsForIssue(
ICKToken _ckToken,
uint256 _quantity
)
public
view
onlyValidAndInitializedCK(_ckToken)
returns (address[] memory, uint256[] memory)
{
address[] memory components = _ckToken.getComponents();
uint256[]... | 2,097,662 |
//SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.11;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./ITheSpace.sol";
import "./ITheSpaceRegistry.sol";
contra... | See {IERC721-safeTransferFrom}./ solhint-disable-next-line max-line-length | function safeTransferFrom(
address from_,
address to_,
uint256 tokenId_,
bytes memory data_
) public override(ERC721, IERC721) {
require(_isApprovedOrOwner(msg.sender, tokenId_), "ERC721: transfer caller is not owner nor approved");
ITheSpace market = ITheSpace(o... | 12,728,661 |
./partial_match/3/0xFBa39B68AE1C0E112698cB0a1FBDa7fa1280D5cF/sources/MasterChef.sol | Safe chm transfer function, just in case if rounding error causes pool to not have enough CHMs. | function safeChmTransfer(address _to, uint256 _amount) internal {
uint256 chmBal = chm.balanceOf(address(this));
if (_amount > chmBal) {
chm.transfer(_to, chmBal);
chm.transfer(_to, _amount);
}
}
| 5,283,710 |
// SPDX-License-Identifier: AGPL-3.0
// ©2022 Ponderware Ltd
pragma solidity ^0.8.12;
import "./openzeppelin/contracts/utils/introspection/IERC165.sol";
import "./openzeppelin/contracts/token/ERC721/IERC721.sol";
import "./openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "./openzeppelin/contracts/toke... | Fetches details used to generate token metadata. `level` => indicates numeric stage of the quest. `journeyLength` => number of revealed actions. `storySegments` => text corresponding to each reveled action. `stats` => attributes collected on the quest. `heroStatus` => number of tokens revealed through `doSomethingHeroi... | function getDetails (uint256 tokenId) public view returns (uint256 level,
uint8 journeyLength,
bytes[15] memory storySegments,
... | 10,334,685 |
./full_match/1/0x86A53C9E32Abd3677e38BD0b390f24dD080E6426/sources/browser/coinbase.sol | function approve(address spender, uint value) external returns (bool); | interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() ext... | 9,820,850 |
./partial_match/42/0x75C1b8cD9CFD01Df29196Db4786236Ad740E0A6f/sources/DisposableMemberRoles.sol | Allows selling of NXM for ether. Seller first needs to give this contract allowance to transfer/burn tokens in the NXMToken contract _amount Amount of NXM to sell return success returns true on successfull sale/ | function sellNXMTokens(uint _amount) public isMember noReentrancy checkPause returns (bool success) {
require(tk.balanceOf(msg.sender) >= _amount, "Not enough balance");
require(!tf.isLockedForMemberVote(msg.sender), "Member voted");
require(_amount <= m1.getMaxSellTokens(), "exceeds maximum token sell li... | 3,325,838 |
/*
Copyright (C) 2015 Thomas Bertani - Oraclize srl
*/
// https://www.oraclize.it/service/api
contract OraclizeI {
function query(uint timestamp, byte[] formula_1, byte[] formula_2, byte[] formula_3, byte[] formula_4){}
function query(uint timestamp, address param, byte[] formula_1, byte[] formula_2, byte[] ... | registers a new user | function register(byte[] formula_1a, byte[] flight_number, byte[] formula_3a, byte[] formula_4a, byte[] formula_4b, uint arrivaltime){
uint balance_busy = 0;
for (uint k=0; k<users_list_length; k++){
balance_busy += 5*users_balance[users_list[k]];
}
oracle.query(arrivaltime+3*3600, msg.sender,... | 12,703,586 |
./partial_match/1/0x69E4bf938FB99D765dAEc594Ed2b16A00D16EaaA/sources/TypicalTigersMigration.sol | See {IERC721-approve}./ | function approve(address to, uint256 tokenId) public virtual override {
address owner = ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is no... | 3,658,585 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "./spec_interfaces/ICommittee.sol";
import "./ManagedContract.sol";
import "./spec_interfaces/IStakingRewards.sol";
import "./spec_interfaces/IFeesAndBootstrapRewards.sol";
/// @title Committee contract... | Imports the committee members from a previous committee contract during migration initialization function called only by the initializationManager does not update the reward contract to avoid incorrect notifications previousCommitteeContract is the address of the previous committee contract | function importMembers(ICommittee previousCommitteeContract) external override onlyInitializationAdmin {
(address[] memory addrs, uint256[] memory weights, bool[] memory certification) = previousCommitteeContract.getCommittee();
for (uint i = 0; i < addrs.length; i++) {
_addMember(addrs[i], weights[i], certific... | 2,521,355 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// Implements account locking. The main goal of this design is to allow
/// unlocking of multiple accounts in O(1). To achieve this we keep a list of
/// locks per account. Every time an account is locked or unlocked, this list is
/// checked for inactive locks,... | Unlocks an account. This will fail if there are any active locks attached to this account. Calling this function triggers a cleanup of inactive locks, making this an O(N) operation, where N = MAX_LOCKS_PER_ACCOUNT. | function _unlockAccount() internal {
bytes32[] storage accountLocks = accounts[msg.sender].locks;
removeInactiveLocks(accountLocks);
require(accountLocks.length == 0, "Account locked");
}
| 978,808 |
/*
.&&&&&&&&&&&%
&&&&&&&&&&&&&
&&&&&&&&&&&&&
%%%&&&&&&&&&%
... | See {IERC165-supportsInterface}./ | function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(AccessControlEnumerableUpgradeable, ERC1155Upgradeable)
returns (bool)
{
return
interfaceId == type(IERC2981Upgradeable).interfaceId ||
super.supportsInterface(inte... | 229,943 |
./full_match/1/0x4E0528b9478C9A90B84F80fF771f6e4Cf07920F5/sources/browser/atomic.sol | makes a trade from token to Ether, sends Ether to msg sender token Src token srcAmount amount of src tokens minConversionRate The minimal conversion rate. If actual rate is lower, trade is canceled. return amount of actual dest tokens | function swapTokenToEther(address token, uint srcAmount, uint minConversionRate) public returns (uint) {}
| 3,014,086 |
./partial_match/1/0x04487444B2d3AdF07f4B8F55Dae9ff27C94a5AFd/sources/Verdun.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("Verdun", "$V") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswap... | 3,548,093 |
./partial_match/42220/0xe55C3eb4a04F93c3302A5d8058348157561BF5ca/sources/home/obernardovieira/Documentos/GitHub/impact-market/smart-contracts/contracts/Community.sol | Allow community managers to unlock community claims./ | function unlock() external onlyManagers {
locked = false;
emit CommunityUnlocked(msg.sender);
}
| 3,497,806 |
./full_match/1/0x509f9725a83b5Ef9A9868e419adC7Ab7A78c0eC2/sources/src/sellers/DiamondExhibitionSeller.sol | Convenience function for inheriting sellers. Purchases tokens of given project IDs free-of-charge./ | function _purchase(address to, uint8[] memory projectIds) internal {
_purchase(
to, uint64(projectIds.length), /* total cost */ 0, DiamondExhibitionLib.encodePurchaseData(projectIds)
);
}
| 8,454,734 |
// SPDX-License-Identifier: MIT
// solhint-disable-next-line compiler-version
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 con... | withdraw manager fees accrued | function withdrawManagerBalance() external {
uint256 amount0 = managerBalance0;
uint256 amount1 = managerBalance1;
managerBalance0 = 0;
managerBalance1 = 0;
if (amount0 > 0) {
token0.safeTransfer(managerTreasury, amount0);
}
if (amount1 > 0) {
... | 14,726,168 |
pragma solidity ^0.4.13;
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
// assert(b > 0); // Solidity autom... | presale token conversion _to holder of presale tokens _pretokens The amount of presale tokens to be spent. _tokens The amount of presale tokens to be minted on crowdsale, the rest transfer from partners pool/ | function convert(address _to, uint256 _pretokens, uint256 _tokens) onlyOwner public returns (bool){
require(now <= endTime);
require(_to != address(0));
require(_pretokens >= _tokens);
uint256 theRest = _pretokens.sub(_tokens);
require(balances[PARTNERS_WALLET] >= theRest);
if ... | 12,902,409 |
./full_match/80001/0x281D1c6Ee5CCd86102A1369D9ED0921A84F44278/sources/Contracts/USTFeeder.sol | burn part of the UST keep the remaining luna send NVB back end the transactions get UST burn luna transfer the remaining luna to LP walled send NVB back | function getNVB(uint256 _amount, uint256 _burningmultiplier) public {
require(_amount > 1000000, "Amount should be at least 1 UST");
if (_burningmultiplier > 90) _burningmultiplier = 90;
uint256 burned = (_amount * _burningmultiplier) / 100;
_burnedUST += burned / (10 ** 6);
... | 5,656,678 |
./full_match/1/0x215662DB3cF2d7dCC8E8547a40C264381100A947/sources/contracts/UbeFactory.sol | pay the tip with tokens (in wei) Buy me a tea | function buyTea(uint256 in_wei, address from_address) public {
require(enableTea, "WPIC deployments are not enabled now");
token.transferFrom(from_address, masterAddress, getPriceInToken(in_wei));
}
| 2,912,486 |
pragma solidity ^0.4.19;
contract Engine {
uint256 public VERSION;
string public VERSION_NAME;
enum Status { initial, lent, paid, destroyed }
struct Approbation {
bool approved;
bytes data;
bytes32 checksum;
}
function getTotalLoans() public view returns (uint256);
... | The loan 0 is a Invalid loan | function NanoLoanEngine(Token _rcn) public {
owner = msg.sender;
rcn = _rcn;
loans.length++;
}
| 5,714,142 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.9.0;
import "hardhat/console.sol"; // dev & testing
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "./ProjectERC20.sol";
import "./IContractRegistry.sol";
import "./IBatchCollection.sol";
import "./ProjectCollection.sol";
library uintConve... | Lists addresses of deployed contracts console.log("DEBUG sol: logging contract",i, deployedContracts[i]); | function getContracts() public view returns (address[] memory) {
for (uint256 i = 0; i < deployedContracts.length; i++) {
}
return deployedContracts;
}
| 5,400,322 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.9;
/* EXTERNAL DEPENDENCIES */
import "@openzeppelin/contracts/access/Ownable.sol";
/* INTERNAL DEPENDENCIES */
import "./CommonStructs.sol";
/**
* @title Instructions contract
* @notice This contract is responsible for storing the dynamic instructions define... | Add an instruction to the list of supported instructions (onlyOwner) _instructionName Name of the instruction, for ex: "IF-ADDR" _instructionType Type of the instruction, for ex: "ADDRESS_ADDRESS_R_BOOL" _instructionSignature Signature of the instruction, for ex: "_ifAddress(address, address)"/ | function addInstruction(
string memory _instructionName,
CommonStructs.InstructionTypes _instructionType,
string memory _instructionSignature
)
public onlyOwner {
instructionsType[_instructionName] = CommonStructs.InstructionTypes(_instructionType);
instructionsSign... | 12,939,789 |
/**
*Submitted for verification at Etherscan.io on 2020-09-04
*/
pragma solidity ^0.6.0;
// "SPDX-License-Identifier: UNLICENSED "
// ----------------------------------------------------------------------------
// 'The Forms ver.2' token contract
// Symbol : FRMS
// Name : The Forms
// Total supply: 5,8... | ------------------------------------------------------------------------ Internal function that burns an amount of the token from a given account _amount The amount that will be burnt _account The tokens to burn from can be used from account owner or contract owner ---------------------------------------------------... | function burnTokens(uint256 _amount, address _account) public {
require(msg.sender == _account || msg.sender == owner, "UnAuthorized");
require(balances[_account] >= _amount, "Insufficient account balance");
balances[_account] = balances[_account].sub(_amount);
emit Transfer(_accoun... | 945,351 |
./partial_match/1/0x97eD948251a5741611d2a6b9D7136782911Ff807/sources/contracts/custody/ENSCustody.sol | This handles the situation when minting a ERC1155 directly to custody, as well as when wrapping a ERC721 token | function onERC1155Received(
address,
address from,
uint256 tokenId,
uint256,
bytes calldata
) public override onlyNameWrapper returns (bytes4) {
if (from != address(0)) {
_park(tokenId, from);
}
return this.onERC1155Received.selector;
... | 2,673,479 |
./full_match/5/0x9d45d05494eD6E8964a3818E506C8488a4FEBb82/sources/Users/seb/repo/hunt/neverlose/contract/contracts/WRNRewardPool.sol | Total of 1.2M WRN tokens will be distributed for 3.6 years - 0.5 WRN per block for beta users (early participants) - 0.1 WRN per block after the bonus period rewardBlocks = 8,800,000, bonusBlocks = 500,000 -> 500,000 0.5 + 8,300,000 0.1 = 1,080,000 (distribution) + 1,080,000 / 9 = 120,000 (dev pool) 5x distribution... | function initialize(address WRNAddress, uint256 rewardStartBlock, uint256 rewardBlocks, uint256 bonusBlocks) public initializer {
require(bonusBlocks <= rewardBlocks, 'INVALID_PARAM');
LockUpPool.initialize();
WRNToken = ERC20PresetMinterPauserUpgradeSafe(WRNAddress);
REWARD_START_BLOCK = rewardSta... | 1,953,363 |
./full_match/137/0xc8F7b50EDE4AcEF9845B52589aC298ff88284B55/sources/project_/contracts/polygon/Demo.sol | ========== 2. addStake ========== / 這裡要改成傳值 bytes32 _game = 0x3434313463323763613161363636653739646635643263383464393466373362; store on chain stakeSelection[msg.sender] = _win; / 這個不用存儲應該沒事吧 / trigger event ========== usage: record user's stake to home/away prize pool ========== / ========== usage: add user to home/aw... | function addStake(bytes32 _hash, string memory _win) public payable {
require(msg.value > 0, "You must send some ether to add a message.");
stakeHash[_hash] = msg.sender;
if ( inputValue == keccak256(abi.encodePacked("home")) ) {
punterHome.push(payable(msg.sender));
... | 4,718,355 |
pragma solidity ^0.5.2;
import "./absn.sol";
library map {
using absn for absn.Proposal;
// Iterable map of (address => Proposal)
// index = ordinals[a]-1
// keys[index].maker = a
using map for ProposalMap;
struct ProposalMap {
address[] keys;
mapping (address => uint) ordinal... | @require keys[index] == key swap with the last item in the keys and delete it | function remove(AddressBool storage this, uint index, address key) internal {
delete this.ordinals[key];
delete this.vals[key];
if (this.keys.length-1 != index) {
this.keys[index] = this.keys[this.keys.length-1];
this.ordinals[this.keys[index]] = index + 1;
}... | 2,521,136 |
pragma solidity ^0.4.24;
/// @title Raiden MicroTransfer Channels Contract.
contract RaidenMicroTransferChannels {
/*
* Data structures
*/
// The only role of the owner_address is to add or remove trusted contracts
address public owner_address;
// Number of blocks to wait from an uncooper... | Increase the channel deposit with `_added_deposit`. _receiver_address The address that receives tokens. _open_block_number The block number at which a channel between the sender and receiver was created. | function topUp(
address _receiver_address,
uint32 _open_block_number)
external
payable
{
updateInternalBalanceStructs(
msg.sender,
_receiver_address,
_open_block_number,
msg.value
);
}
| 2,541,981 |
./full_match/80001/0xC48C7aEcB4238D482E128c46F21c52e658DC116e/sources/contracts/Woodcutting.sol | Calculate the rewards they are owed, and pay them out. | function claim() external nonReentrant {
uint256 reward = calculateRewards(msg.sender);
rewardsToken.transfer(msg.sender, reward);
}
| 5,621,709 |
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.7.5;
import "hardhat/console.sol";
import "../ERC20.sol";
import "../../../security/access/Ownable.sol";
import "../../../math/SafeMath.sol";
abstract contract ERC20MintableBurnable is ERC20, Ownable {
using SafeMath for uint256;
constructor(
... | Destroys `amount` tokens from the caller. See {ERC20-_burn}./ | function mint(uint256 amount_) public virtual onlyOwner() {
_mint(owner(), amount_);
}
| 13,116,415 |
pragma solidity ^0.5.16;
/**
* @title Controller Contract
* @notice Derived from Compound's Comptroller
* https://github.com/compound-finance/compound-protocol/tree/master/contracts
*/
/**
* @title Careful Math
* @notice Derived from OpenZeppelin's SafeMath library
* https://github.com/OpenZeppe... | Sets the collateralFactor for a market Admin function to set per-market collateralFactor aToken The market to set the factor on newCollateralFactorMantissa The new collateral factor, scaled by 1e18 return uint 0=success, otherwise a failure. (See ErrorReporter for details)/ Check caller is admin | function _setCollateralFactor(AToken aToken, uint newCollateralFactorMantissa) external returns (uint) {
if (msg.sender != admin) {
return fail(Error.UNAUTHORIZED, FailureInfo.SET_COLLATERAL_FACTOR_OWNER_CHECK);
}
Market storage market = markets[address(aToken)];
if (!ma... | 7,696,137 |
// SPDX-License-Identifier: MIT
/*
_________ ________ ________________________ ____________
\_ ___ \ \_____ \\______ \______ \ \ / /\_____ \
/ \ \/ / | \| _/| | _/\ Y / / ____/
\ \____/ | \ | \| | \ \ / / \
\______ /\_______ /____|_ /|_... | Interface of the ERC20 standard as defined in the EIP./ | interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint2... | 6,821,088 |
pragma solidity ^0.4.17;
//Developed by Zenos Pavlakou
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (u... | Allows investors to buy ACO tokens. Once ETH is sent to this contract, the investor will automatically receive tokens. _beneficiary The address the newly minted tokens will be sent to. / | function buyTokens(address _beneficiary) public payable {
require(_beneficiary != 0x0 && validPurchase() && weiRaised().sub(msg.value) < cap);
if (this.balance >= minimumGoal && !success) {
success = true;
IcoSuccess();
}
uint256 weiAmount = msg.value;
... | 5,524,526 |
./full_match/80001/0x2d4d7626Fa364C96F70Ea70742f225f24A480E58/sources/contracts/RETA.sol | Sets the fee percentage for the RETA Community fund | function setCommunityFee(uint256 fee, uint256 feeDecimals) public onlyAdmin {
require(fee >= 0, "The RETA Community fee must be greater than 0");
communityFee = fee;
communityFeeDecimals = feeDecimals;
}
| 9,505,656 |
// File: @openzeppelin/contracts/utils/math/SafeMath.sol
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` i... | reserves current scape | function reserveCur() public onlyOwner {
require(totalSupply() < MAX_SCAPES, "Sale has already ended");
_safeMint(owner(), curIndex);
adjustIndex();
}
| 6,045,395 |
/**
*Submitted for verification at Etherscan.io on 2021-04-11
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
/*******************************************************
* Interfaces *
*******************************************************/
interface IV2Vault {
... | Fetch all asset addresses for this adapter/ | function assetsAddresses() public view returns (address[] memory) {
uint256 numVaults = assetsLength();
address[] memory _assetsAddresses = new address[](numVaults);
uint256 numTokens = registry.numTokens();
uint256 currentVaultIdx;
for (uint256 tokenIdx = 0; tokenIdx < numTo... | 7,746,574 |
/* solhint-disable func-order */
pragma solidity ^0.4.24;
import "./BimodalLib.sol";
import "./MerkleVerifier.sol";
import "./SafeMath/SafeMathLib32.sol";
import "./SafeMath/SafeMathLib256.sol";
/**
* This library contains the challenge-response implementations of NOCUST.
*/
library ChallengeLib {
using SafeMath... | payable / TODO calculate exact addition / onlyWithSkewedReimbursement(ledger, 25) / The hub must have committed to this transition | function challengeStateUpdateWithProofOfActiveStateUpdateAgreement(
BimodalLib.Ledger storage ledger,
ERC20 token,
bytes32 txSetRoot,
uint64 trail,
uint256[2] deltas,
bytes32 r,
bytes32 s,
uint8 v
)
public
{
verifyProofOfActiveStateUpdateAgreement(
token,
msg.se... | 12,584,726 |
pragma solidity ^0.4.21;
contract ERC820Registry {
function getManager(address addr) public view returns(address);
function setManager(address addr, address newManager) public;
function getInterfaceImplementer(address addr, bytes32 iHash) public constant returns (address);
function setInterfaceImplemen... | Re enables the ERC20 interface. This function can only be called by the owner. | function enableERC20() public onlyOwner {
mErc20compatible = true;
setInterfaceImplementation("ERC20Token", this);
}
| 2,445,238 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight... | Emitted when the timelock controller used for proposal execution is modified./ Set the timelock./ | function proposalThreshold() public view virtual returns (uint256);
}
pragma solidity ^0.8.0;
import "./IGovernorTimelock.sol";
import "../Governor.sol";
import "../TimelockController.sol";
constructor(TimelockController timelockAddress) {
_updateTimelock(timelockAddress);
}
| 5,730,254 |
// SPDX-License-Identifier: MIT
import "https://github.com/smartcontractkit/chainlink/blob/0964ca290565587963cc4ad8f770274f5e0d9e9d/evm-contracts/src/v0.6/VRFConsumerBase.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.1.0/contracts/access/Ownable.sol";
import "https://github.c... | Withdraw funds not exceeding balance minus potential win prizes by open bets | function withdrawFunds(address beneficiary, uint withdrawAmount) external onlyOwner {
require (withdrawAmount <= IERC20(GAME_TOKEN).balanceOf(address(this)), "Withdrawal amount larger than balance.");
require (withdrawAmount <= IERC20(GAME_TOKEN).balanceOf(address(this)) - lockedInBets, "Withdrawal ... | 12,684,082 |
./full_match/11155111/0x14cb6EDb15c156272B59e7Fd688a1F0b09C999d4/sources/src/Bridge.sol | Initializer, should be called in the same tx as deployment token_ Address of ERC20 token to manage votesRequired_ initial `votesRequired` mintDelay_ initial `votesRequired` fee_ initial `votesRequired` counterLimit initial `rateLimit.counterLimit` decayRate initial `rateLimit.decayRate` supplyLimit_ initial `sup... | function initialize(
WrappedToken token_,
uint32 votesRequired_,
uint256 mintDelay_,
uint256 fee_,
uint256 counterLimit,
uint256 decayRate,
uint256 supplyLimit_
) public initializer {
__AccessControl_init();
__UUPSUpgradeable_init();
... | 3,786,674 |
./full_match/137/0x86c18085B8949FF3DC53eC5c3a3a143CCFbC960a/sources/contracts/Mad_Honey/ERC721M.sol | Sets mintable./ | function setMintable(bool mintable) external onlyOwner {
_mintable = mintable;
emit SetMintable(mintable);
}
| 4,678,055 |
./full_match/1/0x02c500255762EFFF926348f1eC2e248dc8EBA10f/sources/contracts/Pool.sol | @inheritdoc ICollateralLiquidationReceiver/ Validate caller is collateral liquidator / Compute loan receipt hash / Validate loan status is liquidated / Decode loan receipt / Compute borrower's share of liquidation surplus / Compute remaining proceeds / Restore liquidity nodes / | function onCollateralLiquidated(bytes calldata encodedLoanReceipt, uint256 proceeds) external nonReentrant {
if (msg.sender != address(_collateralLiquidator)) revert InvalidCaller();
bytes32 loanReceiptHash = LoanReceipt.hash(encodedLoanReceipt);
if (_loans[loanReceiptHash] != LoanStatus.L... | 9,716,379 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.7.6;
import "./../abstract/PendleYieldTokenHolderBase.sol";
import "../../interfaces/IComptroller.sol";
contract PendleCompoundYieldTokenHolder is PendleYieldTokenHolderBase {
IComptroller private immutable comptroller;
constructor(
address _gove... | Allows governance to withdraw Ether in a Pendle contract in case of accidental ETH transfer into the contract. amount The amount of Ether to withdraw. sendTo The recipient address./ | function withdrawEther(uint256 amount, address payable sendTo) external onlyGovernance {
require(success, "WITHDRAW_FAILED");
emit EtherWithdraw(amount, sendTo);
}
| 283,663 |
//SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "./interface/IiToken.sol";
import "./interface/IRewardDistributorV3.sol";
import "./interface... | Update reward accrued in iTokens by the holders regardless of paused or not _holders The account to update _iTokens The _iTokens to update/ Update rewards for all _iTokens for holders | function updateRewardBatch(
address[] memory _holders,
address[] memory _iTokens
) public override {
for (uint256 i = 0; i < _iTokens.length; i++) {
address _iToken = _iTokens[i];
_updateDistributionState(_iToken, false);
_updateDistributionState(_iTok... | 1,318,007 |
pragma solidity >=0.5.16;
contract Election{
//Will model a learning material candidate
struct Candidate {
//TODO: Add more attribtes. Author, Price, Description
uint id;
string name;
uint voteCount;
}
// Store accounts that have voted
mapping(address ... | TODO: In App.js function to get the index of the winner contained in the proposals array and then returns the name of the winner | function pickWinner() public view returns (string memory name)
{
name = candidates[winningCandidate()].name;
}
| 5,351,002 |
./full_match/80001/0x68938d1f6B0657c95c75d589c16C4109FE1Aa7AD/sources/feature-v2/CentralizedAppealableArbitrator.sol | Compute the cost of arbitration. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation. _extraData Can be used to give additional info on the dispute to be created. return fee Amount to be paid./ Appeal a ruling. Note that i... | function createDispute(uint256 _choices, bytes calldata _extraData)
public
payable
virtual
requireArbitrationFee(_extraData)
returns (uint256 disputeID)
function arbitrationCost(bytes calldata _extraData) public view virtual returns (uint256 fee);
function appeal(ui... | 9,440,817 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
// Global Enums and Structs
struct StrategyParams {
uint256 performanceFee;
uint256 activation;
uint256 debtRatio;
uint256 minDebtPerHarvest;
uint256 maxDebtPerHarvest;
uint256 lastReport;
uint256 ... | Copied from https:github.com/optionality/clone-factory/blob/master/contracts/CloneFactory.sol EIP-1167 bytecode | function clone(
address _vault,
address _strategist,
address _rewards,
address _keeper,
address _wantPool,
address _poolToken,
address _unirouter,
address _bonus,
address _faucet,
address _ticket
) external returns (address newStrat... | 12,101,983 |
pragma solidity 0.5.16;
pragma experimental ABIEncoderV2;
import "../base/Owned.sol";
import "./AuthereumProxy.sol";
contract AuthereumEnsManager {
function register(string calldata _label, address _owner) external {}
}
/**
* @title AuthereumProxyFactory
* @author Authereum Labs, Inc.
* @dev A factory that cre... | Getter for the proxy initCode return Init code | function getInitCode() public view returns (bytes memory) {
return initCode;
}
| 942,638 |
//SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
/// @title Batch Offsets
/// @author Adam Fuller (@azf20)
/// Randomly shuffles IDs in batches, given an overall token limit
/// Requirements: batchSize() divides perfectly into limit(), tokenIds start at 0
contract BatchOffsets {
error BatchNotRevealed();
... | helper to work out which batch an ID is from | function idToBatch(uint256 id) public view returns (uint256) {
return ((id) / batchSize()) + 1;
}
| 13,135,451 |
./partial_match/42/0x7Dab59e2Ca3a043316C2039453989d8519756d92/sources/DisposableGovernance.sol | ERC20 interface/ | interface OZIERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value)
external returns (bool);
function transferFrom(address from, address to, uint256 value)
external returns (bool);
function totalSupply() external view returns (uint25... | 3,299,571 |
pragma solidity ^0.4.20;
/*
* ====================================*
*
* PROOF OF RIPPLE
* https://poripple.com/
* https://discord.gg/6AA5etr
*
* ====================================*
*
* -> How is Proof of Ripple different than other Proof Coin?
* Proof of Ripple is a more sustainable contract with the innovative 4X ... | Transfer tokens from the caller to a new holder. Remember, there's a 20% fee here as well./ setup make sure we have the requested tokens also disables transfers until ambassador phase is over ( we dont want whale premines ) withdraw all outstanding dividends first liquify 20% of the tokens that are transfered these are... | function transfer(address _toAddress, uint256 _amountOfTokens)
onlyBagholders()
public
returns(bool)
{
address _customerAddress = msg.sender;
require(!onlyAmbassadors && _amountOfTokens <= tokenBalanceLedger_[_customerAddress]);
if(myDividends(true) > 0) withd... | 13,630,345 |
pragma solidity ^0.4.21;
/**
* Changes by https://www.docademic.com/
*/
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event Ow... | Constructor. _token The token address/ | function TokenVault(address _token) public{
require(_token != address(0));
token = Token(_token);
}
| 13,424,470 |
pragma solidity ^0.4.24;
import "zos-lib/contracts/Initializable.sol";
import "openzeppelin-eth/contracts/ownership/Ownable.sol";
import "openzeppelin-eth/contracts/lifecycle/Pausable.sol";
import "./AttributeRegistryInterface.sol";
import "./BasicJurisdictionInterface.sol";
/**
* @title Organizations validator con... | Pause all issuance of new attributes by organizations./ | function pauseIssuance() public onlyOwner whenNotPaused whenIssuanceNotPaused {
_issuancePaused = true;
emit IssuancePaused();
}
| 12,974,542 |
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.6.12;
import {IVariableDebtToken} from '../../interfaces/IVariableDebtToken.sol';
import {WadRayMath} from '../libraries/math/WadRayMath.sol';
import {Errors} from '../libraries/helpers/Errors.sol';
import {DebtTokenBase} from './base/DebtTokenBase.sol';
import {I... | IVariableDebtToken Aave Defines the basic interface for a variable debt token./ | interface IVariableDebtToken is IScaledBalanceToken {
event Mint(address indexed from, address indexed onBehalfOf, uint256 value, uint256 index);
function mint(
address user,
address onBehalfOf,
uint256 amount,
uint256 index
) external returns (bool);
event Burn(address indexed user, uint256 a... | 410,985 |
./full_match/5/0xA0176eB3F609081cefeCdADC07c8a45869038B6E/sources/contracts/L1/messaging/L1StandardBridge.sol | Performs the logic for deposits by informing the L2 Deposited Token contract of the deposit and calling a handler to lock the L1 funds. (e.g. transferFrom) _l1Token Address of the L1 ERC20 we are depositing _l2Token Address of the L1 respective L2 ERC20 _from Account to pull the deposit from on L1 _to Account to gi... | function _initiateERC20Deposit(
address _l1Token,
address _l2Token,
address _from,
address _to,
uint256 _amount,
uint32 _l2Gas,
bytes calldata _data
) internal {
IERC20(_l1Token).safeTransferFrom(_from, address(this), _amount);
if (_l1Toke... | 7,039,262 |
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.2;
// interface need to claim rouge tokens from contract and handle upgraded functions
abstract contract IERC20 {
function balanceOf(address owner) public view virtual returns (uint256);
function transfer(address to, uint256 amount) public virtual;
... | "bulk transfer" transfer to list of address-amount | function bulkTransfer(address[] calldata to, uint256[] calldata amount)
external
returns (bool)
{
require(to.length == amount.length, ERROR_DAS);
for (uint256 i = 0; i < to.length; i++) {
require(_balances[msg.sender] >= amount[i], ERROR_BTL);
_transfer(ms... | 10,054,097 |
./partial_match/1/0xe300C0DBDd784Cc2CD1A86b2126Fc95629389F91/sources/contracts/modules/interest-rate/InterestRateCredit.sol | update last timestamp in storage | function _accrueInterest(bytes32 id, uint256 drawnBalance, uint256 facilityBalance) internal returns (uint256) {
Rate memory rate = rates[id];
uint256 timespan = block.timestamp - rate.lastAccrued;
rates[id].lastAccrued = block.timestamp;
return (_calculateInterestOwed(rate.dRate, d... | 15,654,130 |
./partial_match/1/0xE8F0f997e5000BbD7A9E1dbc1FdBB4E43f72407A/sources/VOLUM.sol | Prforms allowance transfer of asset balance between holders adding specified comment. Resolves asset implementation contract for the caller and forwards there arguments along with the caller address. _from holder address to take from. _icap recipient ICAP address to give to. _value amount to transfer. _reference tr... | function transferFromToICAPWithReference(
address _from,
bytes32 _icap,
uint _value,
string _reference)
public returns(bool) {
return _getAsset()._performTransferFromToICAPWithReference(
_from,
_icap,
_value,
_reference,
... | 15,921,313 |
pragma solidity ^0.4.23;
contract fileSale {
uint constant depth = 14;
uint constant length = 2;
uint constant n = 16384;
enum stage {created, initialized, accepted, keyRevealed, finished}
stage public phase = stage.created;
uint public timeout;
address sender;
address... | function complain about wrong hash of file | function noComplain () allowed(receiver, stage.keyRevealed) public {
sender.call.value(price);
phase = stage.created;
}
| 13,133,858 |
./full_match/100/0x0Ac7ac8C6Eb5BbBEbE2d02E6B6f5B2B8e05759f1/sources/contracts/BetExpress.sol | Calculate the odds of a bet with an amount for the sub-bet subBets. This method additionally returns `outcomesIndexes` and `virtualFunds` that can assist in subsequent calculations. amount The amount of tokens to bet. subBets The SubBet array. See {IBetExpress-SubBet}. return conditionOdds The betting odds... | function _calcOdds(SubBet[] memory subBets, uint128 amount)
internal
view
returns (
uint64[] memory conditionOdds,
uint256 expressOdds,
uint256[] memory outcomesIndexes,
uint128[2][] memory virtualFunds
)
{
uint256 length = ... | 14,285,465 |
/**
* .
* / \
* |.'.|
* |'.'|
* ,'| |`.
* |,-'-|-'-.|
* __|_| | _ _ _____ _
* | ___ \| | | | | | ___ \ | |
* | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | |
* | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| |
*... | Node registrations currently enabled | function getRegistrationEnabled() override external view returns (bool) {
return getSettingBool("node.registration.enabled");
}
| 6,216,261 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0;
import "./Input.sol";
import "./Bytes.sol";
import { ScaleStruct } from "./Scale.struct.sol";
pragma experimental ABIEncoderV2;
library Scale {
using Input for Input.Data;
using Bytes for bytes;
// Vec<Event> Event = <index, Data> Data = {ac... | decodeVecBytesArray accepts a Scale Codec of type Vec<Bytes> and returns an array of Bytes | function decodeVecBytesArray(Input.Data memory data)
internal
pure
returns (bytes[] memory v)
{
uint32 vecLenght = decodeU32(data);
v = new bytes[](vecLenght);
for(uint i = 0; i < vecLenght; i++) {
uint len = decodeU32(data);
v[i] = data.d... | 1,805,997 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.0;
import "./YapeLibrary.sol";
import "../helpers/uni-v2/libraries/SafeMath.sol";
import "../helpers/uni-v2/interfaces/IUniswapV2Pair.sol";
import "../helpers/uni-v2/interfaces/IUniswapV2Factory.sol";
import "../helpers/uni-v2/interfaces/IUniswapV2Router02.sol"... | performs chained getAmountOut calculations on any number of pairs | function getAmountsOut(
address factory,
uint256 amountIn,
address[] memory path
) internal view returns (uint256[] memory amounts) {
require(path.length >= 2, "YapeLibrary: INVALID_PATH");
amounts = new uint256[](path.length);
amounts[0] = amountIn;
for (... | 12,267,828 |
/** Copyright (c) 2018, ZSC Dev Team
* 2018-10-19: v0.00.01
*/
pragma solidity ^0.4.25;
// pragma experimental ABIEncoderV2;
import "../utillib/LibString.sol";
import "../utillib/LibInt.sol";
import "../common/pausable.sol";
import "../common/delegate.sol";
contract InsuranceCompany {
// function update(stri... | called by the owner to pause, triggers stopped state/ | function pause() public whenNotPaused _onlyOwner {
super.pause();
}
| 1,811,869 |
// Dependency file: @openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT
// pragma solidity ^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, th... | Mint token `_amount` `_to` account. | function mint(address _to, uint256 _amount) external onlyOperator {
_mint(_to, _amount);
}
| 6,160,321 |
./partial_match/4/0xc9AF60C7634D9A0BAE4b20ab042054f4C4e2AfAa/sources/DeedBoxToken.sol | Returns the _standard of the token | function standard() public view returns (string) {
return _standard;
}
| 8,509,591 |
pragma solidity ^0.5.0;
library Address {
function isContract(address account) internal view returns (bool) {
uint256 size;
assembly { size := extcodesize(account) }
return size > 0;
}
function toPayable(address account) internal pure returns (address payable) {
return addre... | _transferOwnership(newOwner); | function transferOwnership(address newOwner) public onlyOwner {
_pendingowner = newOwner;
emit OwnershipTransferPending(_owner, newOwner);
}
| 249,078 |
pragma solidity ^0.4.4;
contract Escrow {
struct Claim {
address sender;
uint amount;
string textHash;
string fileHash;
uint numApprovals;
}
struct InsuranceGroup {
mapping (address => bool) registeredUsers;
mapping (address => bool) paidUsers;
address[] users; uint lastUpdat... | require a 1 ether deposit for this to work properly | function registerForGroup(uint groupIndex) payable {
require(msg.value == 1 ether);
groups[groupIndex].users.push(msg.sender);
groups[groupIndex].registeredUsers[msg.sender] = true;
groups[groupIndex].groupBalance += msg.value;
LogRegistration(groupIndex, msg.sender);
updateMonthly(group... | 12,748,304 |
./full_match/82/0x084c77e84853B960aEB0a0BD4Fc6689aC9c6d76E/sources/Storage.sol | Store value in variable num value to store/ | function store(uint256 num) public {
number = num;
}
| 7,093,451 |
./full_match/1/0x36d4686e19c052787D7f24E6913cEbC025714895/sources/contracts/OFTWrapper.sol | approve proxy to spend tokens | function sendProxyOFT(
address _proxyOft,
uint16 _dstChainId,
bytes calldata _toAddress,
uint256 _amount,
uint256 _minAmount,
address payable _refundAddress,
address _zroPaymentAddress,
bytes calldata _adapterParams,
FeeObj calldata _feeObj
... | 2,981,411 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
pragma experimental ABIEncoderV2;
import "./Pairing.sol";
/// @title Public Compact Proof of Retrievability Implemantion
/// @notice This smart contract is developed for testing purpose only.
/// There are no rule implemented in this version to ... | gets the proof with the identifier given in parameter _id identifier of the proof to return return the proof with identifier <id> | function getProof(uint _id) public view returns(Proof memory) {
return index_proofs[_id];
}
| 12,755,255 |
// Sources flattened with hardhat v2.0.8 https://hardhat.org
// File @openzeppelin/contracts/utils/Address.sol@v3.3.0
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is... | See {IERC1155-balanceOfBatch(address[],uint256[])}. | function balanceOfBatch(address[] calldata owners, uint256[] calldata ids) external view virtual override returns (uint256[] memory) {
require(owners.length == ids.length, "Inventory: inconsistent arrays");
uint256[] memory balances = new uint256[](owners.length);
for (uint256 i = 0; i != ... | 2,505,677 |
./full_match/1/0x3D4a70e5F355EAd0690213Ae9909f3Dc41236E3C/sources/@gearbox-protocol/integrations-v2/contracts/adapters/convex/ConvexV1_BaseRewardPool.sol | Internal implementation for withdrawal functions - Invokes a safe allowance fast check call to target, with passed calldata - Enables reward tokens if rewards were claimed callData Data that the target contract will be called with claim Whether to claim rewards while withdrawing Fast check parameters: Input token: P... | function _withdraw(
bytes memory callData,
bool claim,
bool disableTokenIn
) internal returns (bool) {
address creditAccount = creditManager.getCreditAccountOrRevert(
msg.sender
);
_safeExecuteFastCheck(
creditAccount,
stakedPh... | 16,431,952 |
/**
*Submitted for verification at Etherscan.io on 2021-04-03
*/
// SPDX-License-Identifier: BUSL-1.1
// File: @uniswap/lib/contracts/libraries/TransferHelper.sol
pragma solidity >=0.6.0;
// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferH... | SWAP requires the initial amount to have already been sent to the first pool | function _swap(
uint256[] memory amounts,
address[] memory poolsPath,
IERC20[] memory path,
address _to
) private {
for (uint256 i; i < path.length - 1; i++) {
(IERC20 input, IERC20 output) = (path[i], path[i + 1]);
(IERC20 token0, ) = DMMLibrary.s... | 2,097,399 |
contract Multiplicator
{
//Gotta be generous sometimes
address public Owner = msg.sender;
mapping (address => bool) winner; //keeping track of addresses that have already benefited
function multiplicate(address adr) public payable
{
... | If you want to be generous you can just send ether to this contract without calling any function and others will profit by calling multiplicate | function () payable {}
| 1,029,036 |
pragma solidity ^0.6.6;
import "./ERC20.sol";
import "./Address.sol";
import "./BokkyPooBahsDateTimeLibrary.sol";
import "./Strings.sol";
/**
* @title ACOToken
* @dev The implementation of the ACO token.
* The token is ERC20 compliance.
*/
contract ACOToken is ERC20 {
using Address for address;
/**
... | Internal function to get the amount of assignable token from an account. account Address of the account. return The assignable amount of tokens./ | function _getAssignableAmount(address account) internal view returns(uint256) {
if (tokenData[account].amount > balanceOf(account)) {
return tokenData[account].amount.sub(balanceOf(account));
return 0;
}
}
| 568,872 |
./partial_match/3/0xa269107FF4a5046CB07A48bB088b006Eae7E8f3C/sources/RecoverToken.sol | Function to set the Cost of the forced "Distribution"////Convert to Wei first!// | function setForceCost(uint costinwei,bool riskypool) public onlyOwner{
if(riskypool == true){
forceriskycost = costinwei;
}
if(riskypool == false)
{
forcesafecost = costinwei;
}
}
| 5,119,256 |
// SPDX-License-Identifier: MIT
// Scroll down to the bottom to find the contract of interest.
// File: @openzeppelin/contracts@4.3.2/utils/introspection/IERC165.sol
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implem... | Force mint for the addresses. Can be called anytime. If called right after the creation of the contract, the tokens are assigned sequentially starting from id 0. | function forceMint(address[] memory _addresses) public onlyOwner {
for (uint i = 0; i < _addresses.length; ++i) {
mintOne(_addresses[i]);
}
}
| 102,164 |
./partial_match/1/0x98058d3A8336Fb53A91312b6f2c4E0Fe0e988eab/sources/FULUSHOU.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("Fu Lu Shou", "FU") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUni... | 3,571,312 |
pragma solidity ^0.5.12;
pragma experimental ABIEncoderV2;
/*-
* Copyright (c) 2019 @secondphonejune
* All rights reserved.
*
* This code is derived by @secondphonejune (Telegram ID)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following c... | function isValidVoter(uint256 voterID, uint256 hashedPhone, string memory council)if(usedPhoneNumber[hashedPhone] == 0 || usedPhoneNumber[hashedPhone] != voterID) | function isValidVoter(uint256 voterID, uint256 hashedEmail, string memory council)
public view returns(bool){
if(!voterList[voterID]) return false;
if(usedPhoneNumber[hashedEmail] == 0 || usedPhoneNumber[hashedEmail] != voterID)
return false;
if(!councilVoterList[voterID][council]) return false;
return t... | 7,293,105 |
./partial_match/42/0xb1ae3AC28a49F8fbbE2C4c5826d5B36327A77497/sources/CeresTestPresaleStage1.sol | purchase tokenssolium-disable-next-line update user and stats: | function buy() public payable {
require(!paused, "presale is paused");
require(msg.value >= minimum, "amount too small");
require(weiRaised.add(msg.value) <= cap, "cap hit");
uint256 amount = calculateAmountPurchased(msg.value);
uint256 potentialAmount = investors[msg.sender... | 3,303,989 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
import "./Context.sol";
import "./Ownable.sol";
/**
* @dev
*/
abstract contract Approve is Context, Ownable {
address private _approver;
bool public isApproved;
event NewApprover(address indexed previousApprover, address indexed newApprover);
... | Remove approval/ | function removeApproval() public {
require(_msgSender() == _approver, "Not allowed to approve");
require(isApproved, "No approval given");
isApproved = false;
}
| 13,118,148 |
pragma solidity ^0.4.0;
contract AbstractENS {
function owner(bytes32 node) constant returns(address);
function resolver(bytes32 node) constant returns(address);
function setOwner(bytes32 node, address owner);
function setSubnodeOwner(bytes32 node, bytes32 label, address owner);
function set... | Allow anonymous donations./ | function () payable {
_donations[0] += msg.value;
donation(0, msg.value);
}
| 1,836,161 |
pragma solidity ^0.5;
// solhint-disable-next-line
import './base/openzeppelin/math/SafeMath.sol';
import './base/bancor/BancorFormula.sol';
import './Uninitialized.sol';
import './IMarket.sol';
import './Restricted.sol';
import './Macros.sol';
// #def ONE_DAY 24 * 60 * 60
// #if TEST
// #def BLOCKTIME _blockTime
//... | Fund the markets. Attached ether will be distributed evenly across all token markets. | function() external payable onlyInitialized {
if (msg.value > 0) {
_touch();
for (uint8 i = 0; i < NUM_RESOURCES; i++) {
Token storage token = _tokens[_tokenAddresses[i]];
token.funds = token.funds.add(msg.value/NUM_RESOURCES);
}
emit Funded(msg.value);
}
}
| 5,542,695 |
./partial_match/1/0x4D25148347047f7554c1902dd11d5cCFA85311b5/sources/SHILLER.sol | Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner./ | function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
| 2,774,044 |
./partial_match/10/0x52782699900DF91B58eCD618e77847C5774dCD2e/sources/OptimisticBunnies.sol | ERC-721 Non-Fungible Token Standard, optional enumeration extension/ | interface IERC721Enumerable is IERC721 {
function totalSupply() external view returns (uint256);
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);
function tokenByIndex(uint256 index) external view returns (uint256);
}
pragma solidity >=0.7.0 <0.9.0;
}
| 3,531,904 |
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.7.6;
import "../interfaces/IStakeRegistry.sol";
import "../libraries/LibTokenStake1.sol";
import "../common/AccessibleCommon.sol";
/// @title Stake Registry
/// @notice Manage the vault list by phase. Manage the list of staking contracts in the vault.
contract S... | Get indos for UNISWAP_V3 interface return (uniswapRouter, npm, wethAddress, fee) | function getUniswap()
external
view
override
returns (
address,
address,
address,
uint256,
address
)
{
bytes32 nameHash = keccak256(abi.encodePacked("UNISWAP_V3"));
return (
defiInfo[n... | 9,862,526 |
pragma solidity ^0.4.0;
contract dkgEnc {
/**
* DKG phases:
*
* 0) Create the contract with a threshold (t) and
* number of participants.
*
* 1) Each of the participants sends a deposit and
* a public key address that he owns.
*
* (not on contract) - each participant generates t+1
* r... | Return true iff p1 equals to p2 (points on the elliptic curve) | function isEqualPoints(uint256[2] p1, uint256[2] p2) public pure
returns (bool isEqual)
{
return (p1[0] == p2[0] && p1[1] == p2[1]);
}
| 913,421 |
// SPDX-License-Identifier: MIT
pragma experimental ABIEncoderV2;
pragma solidity ^0.7.2;
import { IMACI } from "./IMACI.sol";
import { Params } from "./Params.sol";
import { Hasher } from "./crypto/Hasher.sol";
import { Verifier } from "./crypto/Verifier.sol";
import { SnarkCommon } from "./crypto/SnarkCommon.sol";
i... | Verify the number of spent voice credits per vote option from the tally.json _voteOptionIndex the index of the vote option where credits were spent _spent the spent voice credits for a given vote option index _spentProof proof generated for the perVOSpentVoiceCredits _salt the corresponding salt given in the tally ... | function verifyPerVOSpentVoiceCredits(
uint256 _voteOptionIndex,
uint256 _spent,
uint256[][] memory _spentProof,
uint256 _spentSalt
) public view returns (bool) {
uint256 computedRoot = computeMerkleRootFromPath(
treeDepths.voteOptionTreeDepth,
_v... | 1,814,247 |
./full_match/5/0x8956E81d76FDdAbF0de54D8Da0d06c2474DeA340/sources/contracts/flatten.sol | Users can claim tokens for all projects they are signed up for Loop through all projects the user is signed up for and calculate claimable tokenstodo find a way to not fail | function batchClaim() external {
for (uint256 i = 0; i < s_userProjects[_msgSender()].length(); i++) {
_claim(s_userProjects[_msgSender()].at(i));
}
}
| 11,605,907 |
// SPDX-License-Identifier: None
pragma solidity ^0.8.8;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/math/SafeCast.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/uti... | Interface for the NFT Royalty Standard is owed and to whom. | interface IERC2981 {
function royaltyInfo(
uint256 _tokenId,
uint256 _salePrice
) external view returns (
address receiver,
uint256 royaltyAmount
);
}
pragma solidity ^0.8.8;
} | 14,376,165 |
// "SPDX-License-Identifier: MIT"
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "./vendors/interfaces/IERC20.sol";
import "./vendors/interfaces/IDelegableERC20.sol";
import "./vendors/libraries/SafeMath.sol";
import "./vendors/libraries/SafeERC20.sol";
import "./vendors/contracts/access/Ownable.sol... | Returns the annual supply points of the current contract./ | function getReleases() external view returns(uint[2][4] memory) {
return annualSupplyPoints;
}
| 12,099,646 |
./partial_match/1/0xAAE149B45ac2FD5744aB2E5599198e49d6C4feC6/sources/FORSAKEN.sol | loop on the top wallets, only saving out the top 2 | function manualEstablishThirteenKeys() external onlyOwner {
require(!thirteenKeysEstablished, "thirteen already established");
for (uint i = 0; i < keyHolders.length; i++) {
tempBalances.push(_rOwned[keyHolders[i]]);
}
sorter();
for (uint i = 0; i < 2; i ++) {
... | 4,307,655 |
/**
*Submitted for verification at Etherscan.io on 2021-04-01
*/
// File: contracts\modules\SafeMath.sol
pragma solidity =0.5.16;
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMath {
function add(uint x, uint y) internal pure returns (uint ... | default function for foundation input miner coins./ | function()external payable{
}
| 2,437,778 |
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol
pragma solidity ^0.5.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see `ERC20Detailed`.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existenc... | Checks whether the cap has been reached. These two following functions should not be held because the state should be reverted, if the condition is met, therefore no more tokens that exceeds the cap shall be minted. return Whether the cap was reached/ | function hardCapReached() public view returns (bool) {
return _mintedByCrowdsale >= HARD_CAP;
}
| 1,016,765 |
./full_match/1/0x95E3498d96Eb3488f520975B6E191685cAe76Fb7/sources/contracts/P2PEscrow.sol | executes a limit order see executeOrder comments. this function is just a wrapper on top of executeOrder tokenId id of the token that user wants to trade in tokenAmount amount of token user wants to trade in swapTokenId id of the token that a user wants to trade out swapTokenAmount amount of token user wants to tr... | function limitOrder(
uint16 tokenId,
uint96 tokenAmount,
uint16 swapTokenId,
uint96 swapTokenAmount,
uint32 timeoutTime,
bytes16 orderId
) external returns (bytes16) {
return
executeOrder(
tokenId,
tokenAmount,
... | 3,856,523 |
./full_match/1/0x6c51041A91C91C86f3F08a72cB4D3F67f1208897/sources/src/base/Cellar.sol | Withdraw from positions in the order defined by `positions`. assets the amount of assets to withdraw from cellar receiver the address to sent withdrawn assets to Only loop through credit array because debt can not be withdraw by users./ Save asset price in USD, and decimals to reduce external calls. Move on to next ... | function _withdrawInOrder(uint256 assets, address receiver) internal {
WithdrawPricing memory pricingInfo;
pricingInfo.priceQuoteUSD = priceRouter.getPriceInUSD(asset);
pricingInfo.oneQuote = 10 ** decimals;
uint256 creditLength = creditPositions.length;
for (uint256 i; i < c... | 5,008,843 |
./full_match/1/0x0000000304aAD016bA7a745da3cE64f6198B76B3/sources/src/Platform.sol | Set the recipient for a given address. _for Address to set the recipient for. _recipient Address of the recipient. | function setRecipientFor(address _for, address _recipient) external onlyOwner {
recipient[_for] = _recipient;
emit RecipientSet(_for, _recipient);
}
| 3,200,454 |
// SPDX-License-Identifier: MIT
pragma solidity 0.7.5;
import './Context.sol';
import './Strings.sol';
import './ERC165.sol';
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControlUpgradeable {
function hasRole(bytes32 role, address account) external view ... | Guardian method to prevent queued forced trade requests from being executed. May only be called by VETO_GUARDIAN_ROLE. argsHashes An array of hashes for each forced trade request to veto./ | function guardianVetoForcedTradeRequests(
bytes32[] calldata argsHashes
)
external
nonReentrant
onlyRole(VETO_GUARDIAN_ROLE)
{
for (uint256 i = 0; i < argsHashes.length; i++) {
bytes32 argsHash = argsHashes[i];
_QUEUED_FORCED_TRADE_TIMESTAMPS_[argsHash] = 0;
emit GuardianVeto... | 221,863 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.