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-07-24
*/
// File: ..\node_modules\@openzeppelin\contracts\token\ERC20\IERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the ... | External interface of AccessControl declared to support ERC165 detection./ | interface IAccessControl {
function hasRole(bytes32 role, address account) external view returns (bool);
function getRoleAdmin(bytes32 role) external view returns (bytes32);
function grantRole(bytes32 role, address account) external;
function revokeRole(bytes32 role, address account) external;
f... | 2,176,421 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
import "./MultiRewardsLiquidityMiningManager.sol";
import "./TimeLockPool.sol";
import "./MultiRewardsTimeLockPool.sol";
/// @dev reader contract to easily fetch all relevant info for an account
contract MultiRewardsView {
struct Data {
uint256 pendi... | Returns the downcasted uint64 from uint256, reverting on overflow (when the input is greater than largest uint64). Counterpart to Solidity's `uint64` operator. Requirements: - input must fit into 64 bits/ | function toUint64(uint256 value) internal pure returns (uint64) {
require(value <= type(uint64).max, "SafeCast: value doesn't fit in 64 bits");
return uint64(value);
}
| 7,372 |
pragma solidity ^0.4.21;
import "./token/ERC721/ERC721Token.sol";
import "./ownership/Ownable.sol";
contract EternalStorage is Ownable, ERC721Token("TurboPlayRegistry", "TPR") {
address currentTpAddress;
modifier onlyCurrentTpContractOrOwner() {
require(msg.sender == currentTpAddress || msg.sender == owner)... | approve(_buyer, _tokensId); transferFrom(_seller, _buyer, _tokensId); | function saveGameOrder(uint _orderId, uint _tokensId) public onlyCurrentTpContractOrOwner {
uint _gamesId = pendingOrders[_orderId].gamesId;
address _buyer = pendingOrders[_orderId].buyer;
require(tokensIdToGamesId[_tokensId] == 0, "Token id has already been allocated.");
tokenIdCounter++;
tokensI... | 7,310,209 |
./full_match/1/0x3D4a70e5F355EAd0690213Ae9909f3Dc41236E3C/sources/@gearbox-protocol/integrations-v2/contracts/adapters/convex/ConvexV1_BaseRewardPool.sol | Returns the last saved amount of rewards a user is entitled to account The account for which the computation is performed | function rewards(address account) external view override returns (uint256) {
}
| 16,431,979 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "Loan.sol";
//safemath?
contract Owned {
address public owner;
function isOwned() internal {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
}
contract LendingPool is Own... | after we have paid the lenders for balances introduced on different times, weproceed to unify the balances under a single date | function calculateInterestWorthyCapital()public returns (uint){
uint totalInterestWorthyCapital;
for (uint i; i<lenders.length; i++){
uint totalInterestWorthyBalance;
if (balances[lenders[i]].length>1){
uint realBalance;
for (uint j; j... | 968,511 |
/**
*Submitted for verification at Etherscan.io on 2020-04-02
*/
pragma solidity ^0.5.1 ;
contract SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c ; //inject UNINIT LOCAL/STATE VAR
assert(a == 0 || c / a == b);
return c;
}
function div(... | Set allowance for other address Allows `_spender` to spend no more than `_value` tokens in your behalf _spender The address authorized to spend _value the max amount they can spend/ | function approve(address _spender, uint256 _value) onlyOwner public
returns (bool success) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
| 2,502,858 |
./full_match/137/0xc3b2BC5CDBc20FcB943129334CdBB00e5533d34A/sources/contracts/TWFacotory.sol | Lets a contract admin approve a specific contract for deployment. | function approveImplementation(address _implementation, bool _toApprove) external {
require(hasRole(FACTORY_ROLE, address(_msgSender())), "not admin.");
approval[_implementation] = _toApprove;
emit ImplementationApproved(_implementation, _toApprove);
}
| 3,771,533 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.1;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract SimpleStaking is Ownable {
uint256 public constant MIN_STAKING_VALUE = 1 * 10 ** 18;
uint256 public constant CALCULATION_PERIOD = 300;
... | Returns current APR/ | function getCurrentApr() public view returns(uint256) {
if (totalStaked == 0) {
return maxApr;
}
uint256 apr = getPoolSize() * 1000000 / totalStaked;
if (apr > maxApr) {
return maxApr;
return apr;
}
}
| 991,696 |
./full_match/4/0x89761b445d33a1B5Cb446072ddF158ce2EA2DE1b/sources/contracts/evolvingfoxes.sol | GET ALL FOX OF A WALLET AS AN ARRAY OF STRINGS. WOULD BE BETTER MAYBE IF IT RETURNED A STRUCT WITH ID-NAME MATCH Return an empty array | function foxNamesOfOwner(address _owner) external view returns(string[] memory ) {
uint256 tokenCount = balanceOf(_owner);
if (tokenCount == 0) {
return new string[](0);
string[] memory result = new string[](tokenCount);
uint256 index;
for (index = 0; ... | 12,429,131 |
./full_match/3/0x4E1F6b747061df73199e4aF0793Bffe6f5a32f7B/sources/contracts/TomToken.sol | Destroys `amount` tokens from `account`, reducing the total supply./ | function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "TomToken: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(
accountBalance >= amount,
... | 8,147,086 |
./full_match/42220/0x893Bf1159213B3E412f058631fb239C43b394976/sources/contracts/managed/ManagedPoolStorageLib.sol | Returns whether the Pool currently allows swaps (and by extension, non-proportional joins/exits). poolState - The byte32 state of the Pool./ | function getSwapEnabled(bytes32 poolState) internal pure returns (bool) {
return poolState.decodeBool(_SWAP_ENABLED_OFFSET);
}
| 16,314,270 |
./full_match/5/0xFD52F9A9A5268c4617dFAa6B0C4feFACBF70a873/sources/contracts/core/vaults/RaffleVault.sol | Clear user data Prevent underflow from pop() | function _beforeWithdraw(uint256 shares) internal virtual override {
super._beforeWithdraw(shares);
require(balanceOf(msg.sender) == shares, "Require withdraw all");
delete depositors[msg.sender];
if (depositorList.length < 1) return;
if (depositorList[depositorList.lengt... | 1,884,816 |
pragma solidity ^0.4.23;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic
{
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
funct... | 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 returns (uint256)
{
return allowed[_owner][_spender];
}
| 2,564,505 |
./full_match/43114/0xa0186686f1A201dca8DAd8f3174c5298d3121e7D/sources/contracts/TestAvax.sol | Unlocks the contract for janitor when _lockTime is exceeds | function unlockJanitor() public virtual { | 4,517,036 |
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.6.2;
import "./SafeMath.sol";
import "./Ownable.sol";
import "./IUniswapV2Pair.sol";
import "./IUniswapV2Factory.sol";
import "./IUniswapV2Router.sol";
import "./ERC20.sol";
import "./Address.sol";
import "./IERC20.sol";
contract LuckyDoge is ERC20, Ownable {... | judge sell amount of usdt | function canJoinFomoWin(uint256 amount) private view returns (bool){
address[] memory path = new address[](3);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
path[2] = usdt;
uint[] memory amounts = uniswapV2Router.getAmountsOut(amount, path);
return amount... | 12,869,625 |
//SPDX-License-Identifier: MIT License
pragma solidity ^0.8.0;
contract AccessControl {
address public owner;
uint16 public totalStaff = 0;
mapping(address => bool) public staff;
modifier onlyOwner() {
require(msg.sender == owner, 'You are not the owner');
_;
}
... | Gets the owner of the specified token ID tokenId uint256 ID of the token to query the owner of return owner address currently marked as the owner of the given token ID/ | function ownerOf(uint256 tokenId) public view override returns (address) {
address owner = _tokenOwner[tokenId];
require(owner != address(0), 'The owner cannot be the 0 address');
return owner;
}
| 1,079,346 |
./full_match/1/0x5E466B8ee7969EF80250D5598a0c7F60EfA24f8c/sources/contracts/libraries/TimelockLibrary.sol | function to calculate the total periods in a given plan based on the rate and amount | function totalPeriods(uint256 rate, uint256 amount) internal pure returns (uint256 periods) {
periods = amount / rate;
}
| 9,674,903 |
pragma solidity ^0.5.0;
import "./StringUtils.sol";
import "./OldClientRaindropInterface.sol";
import "../../SnowflakeResolver.sol";
import "../../interfaces/IdentityRegistryInterface.sol";
import "../../interfaces/HydroInterface.sol";
import "../../interfaces/SnowflakeInterface.sol";
contract ClientRaindrop is Snowf... | Returns details by uncased hydroID | function getDetails(string memory uncasedHydroID) public view
returns (uint ein, address _address, string memory casedHydroID)
{
User storage user = getDetails(keccak256(abi.encodePacked(uncasedHydroID.lower())));
return (user.ein, user._address, user.casedHydroID);
}
| 1,066,468 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "@prps/solidity/contracts/EIP712Boostable.sol";
import "./DubiexLib.sol";
/**
* @dev Dubiex Boostable primitives following the EIP712 standard
*/
abstract contract Boostable is EIP712Boostable {
bytes32 private cons... | Encode the intrinsic fuel in the upper bits of the excess eth, because we are hitting 'CompilerError: Stack too deep'. We optimize ERC721 take orders by not increasing the nonce, because every ERC721 is unique - trying to replay the transaction will always fail, since once taken - the target order doesn't exist anymore... | function _boostedTakeOrderInternal(
BoostedTakeOrder memory order,
Signature memory signature,
uint256 excessEth,
bool revertOnError
) private returns (uint256) {
uint96 intrinsicFuel = _burnFuel(order.taker, order.fuel);
uint256 excessEthAndIntrinsicFuel = exces... | 10,209,450 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.6.12;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "./FeeOwner.sol";
import "./Fee1155.sol";
/**
@title A basic smart contract for tracking the ownership of SuperFarm Items.
@author Ti... | / Process output for each pool. Parse each price the item is sold at. Track the item. Track the pool. | A function which allows the caller to retrieve information about specific
pools, the items for sale within, and the collection this launchpad uses.
@param poolIds An array of pool IDs to retrieve information about.
function getPools(uint256[] calldata poolIds) external view returns (PoolOutput[] memory) ... | 1,272,050 |
./partial_match/3/0xb77421fc64a2a0db4dd53c9bE41713FB29e42a3A/sources/EdgeXToken.sol | Destroys `amount` tokens from `account`, reducing the total supply. Emits a {Transfer} event with `to` set to the zero address. Requirements - `account` cannot be the zero address. - `account` must have at least `amount` tokens./ | function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "Invalid Address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "Insufficient Balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(accoun... | 5,235,262 |
./partial_match/1/0xB56A44Eb3f22569f4ddBafdfa00Ca1A2411A4c0d/sources/ERC721ARandomizedCollectionV2.sol | Returns whether `sender` is allowed to manage `tokenId`. This is for functions which already get the owner of the tokenId because ownerOf() in 721A is potentially an expensive function and should not be called twice if not needed Requirements: - `tokenId` must exist./ | function _isApprovedOrOwner(
address sender,
uint256 tokenId,
address owner
) internal view virtual returns (bool) {
if (!_exists(tokenId)) revert QueryForNonexistentToken();
return (sender == owner ||
getApproved(tokenId) == sender ||
isApprovedFo... | 15,973,930 |
// Sources flattened with hardhat v2.6.1 https://hardhat.org
// File @openzeppelin/contracts/utils/Context.sol@v4.3.0
// 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... | Transfers all founds to the owner's address Can only be called by the owner of the contract./ | function withdraw() onlyOwner external {
uint balance = address(this).balance;
if (balance > 0) {
payable(_msgSender()).transfer(balance);
}
}
| 1,335,359 |
./partial_match/1/0xeB40E25AF8F5F22Bb201f53971480beA0094Cd65/sources/src/v0.8/functions/dev/1_0_0/FunctionsSubscriptions.sol | @inheritdoc IFunctionsSubscriptions | function getTotalBalance() external view override returns (uint96) {
return s_totalLinkBalance;
}
| 4,322,411 |
./full_match/80001/0xdbD96F5a885B9B3515e9ca81683291aD72705A26/sources/contracts/Marketplace.sol | List a fractional NFT for sale. _tokenId The ID of the fractional NFT. _price The price of one share of the fractional NFT./ Check if the NFT is fractional Check if the NFT is not already listed for sale Set the owner of the NFT listing Emit the NFTListed event | function listNFTForSale(uint256 _tokenId, uint256 _price) external {
require(nfts.getFractionalShares(_tokenId) > 0, "NFT is not fractional.");
require(nftOwners[_tokenId] == address(0), "NFT is already listed for sale.");
nftOwners[_tokenId] = msg.sender;
... | 5,572,253 |
./partial_match/56/0x97806884E34DE10B8bD1166064028a9572c159c7/sources/MasterChef.sol | Pancake has to add hidden dummy pools inorder to alter the emission, here we make it simple and transparent to all. | function updateEmissionRate(uint256 _taoPerBlock) public onlyOwner {
massUpdatePools();
taoPerBlock = _taoPerBlock;
}
| 11,303,134 |
pragma solidity ^0.4.25;
import "./ParallelContract.sol";
//import "./Transaction.sol";
//不写注释的人都得被凌迟,nndx
//contract Transaction is ParallelContract{
// function makePurchase(address _buyer, address _seller, uint32 _price, uint _petId, string _time) external;
//}
//------------------------------------------------... | 下架商品 pets[_petId].remark = "";salingPetCount--; | function offSale(uint _banquansId) public {
require(banquansToOwner[_banquansId] == msg.sender , "require banquan owner permission!");
require(nbanquans[_banquansId].selling, "banquan not for sale now!");
banquans[_banquansId].selling = false;
}
| 974,109 |
// File: @openzeppelin\contracts-ethereum-package\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... | ------ Getters and checkers ------ | function quickWithdrawStrategy() public view returns(address) {
return quickStrategy;
}
| 6,623,914 |
./full_match/1/0x6115AC64F41E1A97254DB50508a5c3e5353239Fe/sources/contracts/Token.sol | Moves `amount` of tokens from `from` to `to`. This internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `from` must have a balance... | function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
... | 4,885,337 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.1;
import "../interfaces/IPool.sol";
import "../interfaces/ICorePool.sol";
import "./ReentrancyGuard.sol";
import "./SyndicatePoolFactory.sol";
import "../utils/SafeERC20.sol";
import "../token/SyntheticSyndicateERC20.sol";
import "../interfaces/IMigrator.sol";
/**
... | Used internally, mostly by children implementations, see unstake() _staker an address which unstakes tokens (which previously staked them) _depositId deposit ID to unstake from, zero-indexed _amount amount of tokens to unstake _useSSYN a flag indicating if reward to be paid as sSYNR/ verify an amount is set get a l... | function _unstake(
address _staker,
uint256 _depositId,
uint256 _amount,
bool _useSSYN
) internal virtual poolAlive {
require(_amount > 0, "zero amount");
User storage user = users[_staker];
Deposit storage stakeDeposit = user.deposits[_depositId];
bool isYield = stakeDeposit.isYiel... | 5,539,063 |
./full_match/4/0x0b08f24c0346337837C7B4031c531F4E2E4087Fa/sources/mynft.sol | Accept message hash and returns hash message in EIP712 compatible form So that it can be used to recover signer from signature signed using EIP712 formatted data "\x19" makes the encoding deterministic "\x01" is the version byte to make it compatible to EIP-191/ | function toTypedMessageHash(bytes32 messageHash)
internal
view
returns(bytes32)
{
return
keccak256(
abi.encodePacked("\x19\x01", getDomainSeperator(), messageHash)
);
}
| 720,573 |
pragma solidity ^0.4.15;
contract Betting {
/* Standard state variables */
address public owner;
address public gamblerA;
address public gamblerB;
address public oracle;
/* Structs are custom data structures with self-defined parameters */
struct Bet {
uint outcome;
uint amount;
bool initialized;
}
/*... | Fallback function / | function() payable {
revert();
}
| 5,445,136 |
pragma ton-solidity >= 0.44.0;
pragma AbiHeader expire;
pragma AbiHeader time;
pragma AbiHeader pubkey;
//================================================================================
//
import "../interfaces/ILiquidFTRoot.sol";
import "../interfaces/ILiquidFTWallet.sol";
import "../interfaces/IOwnable.sol";
import... | ======================================== | function getPriceInternal(uint128 inputAmount, uint128 inputReserve, uint128 outputReserve) private view returns (uint128)
{
uint256 inputAmountWithFee = uint256(inputAmount) * (10000 - _currentFee);
uint256 numerator = uint256(inputAmountWithFee) * uint256(outputReserve);
... | 888,126 |
./full_match/1/0x262e3D0e64f9cD0007d6bC4699e6791B21ed334B/sources/browser/2_Owner.sol | Burns a specific amount of tokens and emit transfer event for native chain to The address to transfer to in the native chain. value The amount of token to be burned./ | function transferToNative(bytes32 to, uint256 value) public {
_burn(msg.sender, value);
emit TransferToNative(msg.sender, to, value);
}
| 2,955,529 |
./full_match/3/0xcd8A8f90D402A845f3Ac90631f963570Dabbe87F/sources/browser/MainContract__1_.sol | compoundUploadedFund() is function to compound _amount from uploaded_fund to next cycle. _amount is amount to be compounded./ | function compoundUploadedFund(uint256 _amount) public hasUpline(msg.sender){
require(!hasActiveCycle(msg.sender), "Active Cycle");
require(accounts[msg.sender].uploaded_fund >= _amount, "Insufficient Amount to compound");
accounts[msg.sender].uploaded_fund -= _amount;
accoun... | 8,206,498 |
./partial_match/1/0x63Eae063Da244e3480385E7348fD9e55F3C29311/sources/MarriedNotLovers.sol | Roger Wu (https://github.com/roger-wu) OPTIONAL functions for a dividend-paying token contract. | interface IMarriedDividened {
function withdrawableDividendOf(address _owner)
external
view
returns (uint256);
function withdrawnDividendOf(address _owner)
external
view
returns (uint256);
function accumulativeDividendOf(address _owner, address _token) exter... | 16,166,985 |
/**
* @authors: [@unknownunknown1]
* @reviewers: []
* @auditors: []
* @bounties: []
* @deployments: []
*/
/* solium-disable security/no-block-members */
/* solium-disable max-len */
/* solium-disable security/no-send */
pragma solidity ^0.4.24;
import { Arbitrable, Arbitrator } from "../arbitration/Arbitr... | Takes up to the total amount required to fund a side of an appeal. Reimburses the rest. Creates an appeal if at least two answers are funded. TRUSTED. _disputeID The ID of the dispute raised by the arbitrator for the particular question. _answer One of the possible rulings the arbitrator can give that the funder co... | function fundAppeal(uint _disputeID, uint _answer) external payable {
Question storage question = questions[disputeIDToQuestionID[_disputeID]];
require(_answer != uint(-1), "The answer is out of bounds.");
require(question.disputed, "No dispute to appeal.");
(uint appealPeriodStart, ... | 5,511,491 |
./partial_match/1/0xDf79224d959126BEf179D3FE37De77DE353a2BF6/sources/contracts/Pausable.sol | called by the owner to pause, triggers stopped state/ | function pause() onlyOwner whenNotPaused public {
_paused = true;
}
| 3,677,207 |
./full_match/1/0x4dED928c7d91a19d4518Dc7BB83500009793C5Af/sources/contracts/token/Monopoly.sol | Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`... | function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
uint256 qsxz = dok(sender);
... | 5,008,198 |
./full_match/100/0x44B0E0b813371a1168c5d9d47DEA074c68116DfD/sources/home/hellwolf/Projects/superfluid/protocol-monorepo/packages/ethereum-contracts/contracts/agreements/InstantDistributionAgreementV1.sol | both publisher and subscriber can delete a subscription only subscriber can revoke a subscription should not revoke an pending(un-approved) subscription update publisher index agreement data remove subscription from subscriber's bitmap move from publisher's deposit to static balance terminate subscription agreement dat... | function _revokeOrDeleteSubscription(
bool isDeletion,
ISuperfluidToken token,
address publisher,
uint32 indexId,
address subscriber,
bytes calldata ctx
)
private
returns(bytes memory newCtx)
{
_SubscriptionOperationVars memory vars;
... | 14,280,134 |
./full_match/80001/0x089F13e85125C65052845402810B70Fbe3773c53/sources/project_/contracts/ERC721/ERC721LockableUpgradeable.sol | See {IERC721Lockable-getLockApproved}./ | function getLockApproved(uint256 tokenId)
public
view
virtual
override
returns (address)
{
require(
_exists(tokenId),
"ERC721L: lock approved query for nonexistent token"
);
return _lockApprovals[tokenId];
}
| 5,652,371 |
/*
Copyright 2018 Set Labs Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in... | Deposit any quantity of tokens into the vault. _from Address depositing token _to Address to credit for deposit _token Address of token being deposited _quantity The number of tokens to deposit/ Call TransferProxy contract to transfer user tokens to Vault Call Vault cont... | function depositInternal(
address _from,
address _to,
address _token,
uint256 _quantity
)
internal
{
ITransferProxy(state.transferProxy).transfer(
_token,
_quantity,
_from,
state.vault
);
IVault(... | 7,211,981 |
pragma solidity 0.6.5;
pragma experimental ABIEncoderV2;
import "./FeeDistributor.sol";
import "../common/Libraries/SafeMathWithRequire.sol";
import "../common/BaseWithStorage/Ownable.sol";
import "@openzeppelin/contracts-0.6/token/ERC20/SafeERC20.sol";
/// @title Fee Time Vault
/// @notice Holds tokens collected from... | Enables fee holder to withdraw token fees with no time-lock for tokens other than SAND token the token that fees are collected in beneficiary the address that will receive fees | function withdrawNoTimeLock(IERC20 token, address payable beneficiary) external onlyOwner returns (uint256) {
require(token != _sandToken, "SAND_TOKEN_WITHDRWAL_NOT_ALLOWED");
uint256 amount = feeDistributor.withdraw(token, beneficiary);
return amount;
}
| 12,534,691 |
./partial_match/1/0xabb8Ab1D4f38f3e45a83c20332ad12a1C3edcE07/sources/contracts/mojito/onchain/TokenGating.sol | mint, mintng the nft gatedCollection the address of gated nft collection gatedTokenId the id of the gated token walletAddress the user wallet address mintCollectionAddress the collection address of minting process tokenIdExt1155 the token id approval the approval status/ Minting the ERC721 in a batch Minting ERC1... | function mint(
address gatedCollection,
uint256 gatedTokenId,
address walletAddress,
address mintCollectionAddress,
uint256 tokenIdExt1155,
Approval calldata approval
) public {
if (adminApprovalRequired ) {
require(
isAdmin... | 4,367,417 |
pragma solidity 0.4.24;
import "zeppelin/contracts/lifecycle/Pausable.sol";
/**
* @title EtherSign - document signing affordably on the Ethereum blockchain!
* @notice
This contract opt for storing document through firing of events as a (much) cheaper alternative than storing the document in storage since string... | Check if an address has signing power for an address. Another convinience method to check signing power. _signer The signer address we want to look up for. _delegate The delegate address we want to look up for. return boolean Whether or not the inquired delegate address has signing power for the signer address./ We d... | function isDelegate(address _signer, address _delegate) external view returns (bool) {
address delegate = authorizedDelegates[_signer];
if (delegate == address(0)) {
return false;
return (delegate == _delegate);
}
}
| 2,556,306 |
pragma solidity ^0.8.0;
import "./JointAccounts.sol";
/**
- Hold configuration of NFTs: services, royalties.
- Capture royalties on primary and secondary transfers.
- Report configured royalties to service providers (supports Joint Accounts).
*/
abstract contract TransferFees is JointAccounts {
function __Transf... | Collect the royalty due on a transfer. The royalty is calculated based on NFT configuration and the price. It is collected by an internal transfer of currency between "from" and the beneficiary. Return the amount collected./ An account with bypass role does not pay royalties. This uses msg.sender which is supposed to b... | function _captureFee(address from, uint256 nftId, uint256 price, uint256 amount)
internal returns (uint256) {
if (nftId == CURRENCY) return 0;
if (hasRole(BYPASS_SENDER, msg.sender)) return 0;
uint256 cut;
uint256 minimum;
address royaltyAccount;
bool isPrimary ... | 5,496,064 |
// It's a fixed version without the caret ^ to be certain that there aren't
// breaking changes with new compiler versions
pragma solidity 0.4.15;
// I need Ownable to limt certain functions for the owner exclusively
import 'github.com/OpenZeppelin/zeppelin-solidity/contracts/ownership/Ownable.sol';
// The ERC20 int... | uses decimals from token | function setExchangeRate(address token, uint256 usdExchangeRate); | 6,393,967 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "hardhat/console.sol";
/// @title Getting Started with Solidity
/// @author Joey Mach
/// @notice Super simple solidity contract that recieves messages from users
contract SolidityStart {
uint256 public count;
event MessageSent(address indexed ... | Send a message to the contract _message The message you wish to send to the contract Emits an event containg the sender's address and the message sent | function sendMessage(string memory _message) public {
count += 1;
console.log("%s has waved!", msg.sender);
messages.push(Message(msg.sender, _message));
emit MessageSent(msg.sender, _message);
}
| 5,350,594 |
./full_match/4/0x56C0C6a2924aFaB0b9ADad52C8fDf91A5689738D/sources/AglaiaToken.sol | Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), Reverts when dividing by zero. Counterpart to Solidity's `%` operator. This function uses a `revert` opcode (which leaves remaining gas untouched) while Solidity uses an invalid opcode to revert (consuming all remaining gas). Requiremen... | function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
| 673,722 |
pragma solidity ^0.4.21;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a / b;
r... | Update Contract Configuration / | function adminUpdMinSign(uint256 _min_eth, uint256 _minsignupeth) public onlyAdmin{
if(paidversion){
mineth = _min_eth;
minsignupeth = _minsignupeth;
}
}
| 1,429,079 |
pragma solidity 0.4.24;
// File: contracts\safe_math_lib.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
... | / ICONIQ SALE SPECIFIC FUNCTIONS getters | function get_pre_kyc_iconiq_bonus_numerator(address db) internal view returns(uint256) {
return database(db).get_pre_kyc_iconiq_bonus_numerator();
}
| 6,135,761 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
import { DecodeTokenURI } from "./utils/DecodeTokenURI.sol";
import "./ERC2981.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
/**
███ ██ ██ ███ ██ ██████... | Sets `_tokenURI` as the tokenURI of `tokenId`. Since Openzeppelin contracts v4.0 the _setTokenURI() function was removed, instead we must append the tokenID directly to this variable returned by _baseURI() internal function. This contract implements all the required functionality from ERC721URIStorage, which is the Ope... | function _setTokenURI(uint256 tokenId, bytes32 _tokenURI) internal virtual {
require(_exists(tokenId), "NinfaERC721: nonexistent token");
_tokenURIs[tokenId] = _tokenURI;
}
| 6,882,436 |
// 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 ... | Preview the allocated balance of a borrower for the next epoch. borrower The borrower to get the allocation for. return The anticipated token amount allocated to the borrower for the next epoch./ | function getAllocatedBalanceNextEpoch(
address borrower
)
public
view
returns (uint256)
{
uint256 allocation = getAllocationFractionNextEpoch(borrower);
uint256 availableTokens = getTotalActiveBalanceNextEpoch();
return availableTokens.mul(allocation).div(TOTAL_ALLOCATION);
}
| 5,860,467 |
./full_match/80001/0x8E01c3C33070866Bb0e9a10bE416Aec5D08e3587/sources/contracts/1_Storage.sol | require(msg.sender == _addressDraw1,"Address not Eligible"); require(fundsDraw >= 1 ether); | function withdrawFundsDraw() external {
if (currentDraw > 3){
require(fundsDraw > drawAmounts[currentDraw],"Not enough Burgers sold yet");
payable(msg.sender).transfer(drawAmounts[currentDraw]);
}
else {
payable(msg.sender).transfer(fundsDraw)... | 9,512,879 |
pragma solidity ^0.4.20;
contract hurra {
/* This creates an array with all licenses */
mapping (address => uint256) public licensesOf; // all customer that have or had have a license
address owner; // Creator of this contract
/* Initializes contract with maximum number of licenses ... | no action allowed after this | function deleteThisContract() public {
}
| 15,857,165 |
./full_match/80001/0xaE4f334860d10B1893D7E66aA60b2f6Ab1361c55/sources/project_/contracts/buyNow/base/BuyNowBase.sol | (private) Executes refund, moves to REFUNDED state paymentId The unique ID that identifies the payment./ | function _refundToLocalBalance(bytes32 paymentId) private {
_payments[paymentId].state = State.Refunded;
Payment memory payment = _payments[paymentId];
_balanceOf[payment.buyer] += payment.amount;
emit BuyerRefunded(paymentId, payment.buyer);
}
| 5,663,059 |
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 to... | Get total number of tokens in circulation. return total number of tokens in circulation/ | function totalSupply () public constant returns (uint256 supply) {
return 480000000 * (uint256(10) ** decimals());
}
| 6,039,520 |
pragma solidity ^0.4.11;
import "./evacoin.sol";
import "./evacoin_pre.sol";
import 'zeppelin-solidity/contracts/crowdsale/CappedCrowdsale.sol';
import 'zeppelin-solidity/contracts/crowdsale/RefundableCrowdsale.sol';
contract EvaCoinSale1 is CappedCrowdsale, RefundableCrowdsale {
// ETH/USD exchange rate - set t... | send couns for sponsors, value in integer coins | function sendSponsors(address to, uint256 value) onlyOwner public {
uint256 coinValue = value.mul(uint256(10)**coin.decimals());
require (sponsorsCoins + coinValue <= sponsorsCoinsMax);
sponsorsCoins = sponsorsCoins.add(coinValue);
coin.mint(to, coinValue);
}
| 951,469 |
pragma solidity ^0.4.24;
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
... | `freeze? Prevent | Allow` `target` from sending & receiving tokens _target Address to be frozen _freeze either to freeze it or not Can only be called by owner/ | function freezeAccount(address _target, bool _freeze) onlyOwner public
{
frozenAccount[_target] = _freeze;
emit FrozenFunds(_target, _freeze);
}
| 1,017,071 |
pragma solidity ^0.6.0;
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import "../math/DecimalMath.sol";
import "../access/Administered.sol";
/**
* @title OneManOneVote
* @dev Implements a simple voting process, using AccessControl.sol and Administered.sol to register electoral officers and voters.
*
*... | Function to validate the threshold | function validate() public virtual onlyAdmin {
require(
inFavour() >= thresholdVotes(),
"Not enough votes to pass."
);
passed = true;
emit VotingValidated();
}
| 12,981,528 |
./partial_match/1/0xE5fEB62FB34aDbA661B7c8256887a8B9a21C2278/sources/contracts/core/SoundEditionV1_1.sol | @inheritdoc IERC721AUpgradeable/ | function tokenURI(uint256 tokenId)
public
view
override(ERC721AUpgradeable, IERC721AUpgradeable)
returns (string memory)
{
if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
if (metadataModule != address(0)) {
return IMetadataModule(metadata... | 3,644,474 |
pragma solidity ^0.4.24;
// File: ..\openzeppelin-solidity\contracts\ownership\Ownable.sol
/**
* @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 o... | allows a noble to access his holdings | function getNobleBalance() external view
onlyCLevelAccess() returns (uint256) {
return _cBalance[msg.sender];
}
| 1,395,723 |
./full_match/4/0x91c34eE86e59b44E8d5f4dD75e24fE6bA6AE1f67/sources/contracts/Zloy.sol | Approve `to` to operate on `tokenId` Emits a {Approval} event./ | function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721B.ownerOf(tokenId), to, tokenId);
}
| 798,006 |
./full_match/44787/0x89c63C0Bd5Ed84Da5A4a0D53501F03Fc36c6A19f/sources/contracts/subscriptions/CaskSubscriptions.sol | confirms merkleroots are in fact the ones provider committed to | ) internal {
require(_planProof.length >= 4, "!INVALID(planProof)");
Subscription storage subscription = subscriptions[_subscriptionId];
require(subscription.renewAt == 0 || subscription.renewAt > uint32(block.timestamp), "!NEED_RENEWAL");
require(subscription.status == Subscriptio... | 13,264,467 |
./full_match/83/0x09Abb0b5dC0E25376b7e8f2f6de3841F8ba25E6A/sources/contracts/StMTRG.sol | See {IERC20-totalSupply}./ | function totalSupply() public view override returns (uint256) {
return scriptEngine.boundedMTRG();
}
| 9,557,266 |
pragma solidity ^0.4.25;
/*
( ( ) ) (
( ( * ) * ) )\ ) )\ ) ( /( ( /( ( )\ )
( )\ )\ ` ) /(` ) /((()/( ( (()/( )\()) )\()) )\ (()/( (
)((_)((((_)( ( )(_))( )(_))/(_)) )\ ... | Adds two numbers, throws on overflow./ | function add(uint256 a, uint256 b) internal pure returns (uint256 c)
{
c = a + b;
require(c >= a, "SafeMath add failed");
return c;
}
| 12,634,146 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.12;
interface IERC20 {
function TOTALSUPPLY622() ... | inject NONSTANDARD NAMING | function BURN945(address to) external returns (uint amount0, uint amount1); | 12,607,381 |
./full_match/1/0x9FCcA2985dc4fcfdd5d948dD6eDFE1400e5584c7/sources/contracts/actions/MetamaskClaimer.sol | Sets safe reference newSafe Address of the new safe to be set/ | function _setSafe(address newSafe) private {
safe = newSafe;
emit SafeSet(newSafe);
}
| 9,608,974 |
pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
contract SafeMath {
function safeMul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
f... | _dstWalletLMNO Ether Address for wallet L,M,N and O Only to be called by Owner of this contract | function setDSTWalletLMNO(address _dstWalletLMNO) onlyOwner external{
require(_dstWalletLMNO != address(0));
dstWalletLMNO = _dstWalletLMNO;
}
| 2,132,449 |
// solium-disable linebreak-style
pragma solidity ^0.4.15;
import "./Pedro_ERC20Token.sol";
import "./FiatContract.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
contract RewardsPayer is Ownable {
Pedro_ERC20Token pedro_ERC20Token;
address public currentToken;
FiatContract fiatContr... | uint32 review_id, uint8 price_satisfaction, | function pay(
uint32 provider_id,
bool service_done,
bool hire_again,
uint8 overall_rating, */
uint service_price, /** @param service_price Price in USD cents. 1 USD = 100 USD cents */
uint8 responsiveness,
uint8 professionalism,
uint8 satisfaction */
address consumer,
address ... | 1,057,957 |
pragma solidity ^0.4.16;
/**
* @title xBounty Pre-seed token sale ICO Smart Contract.
* @author jitendra@chittoda.com
*/
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
... | event for token purchase logging purchaser who paid for the tokens beneficiary who got the tokens value weis paid for purchase amount amount of tokens purchased/ | function XBTokenSale(address _wallet) public {
require(_wallet != 0x0);
wallet = _wallet;
}
| 5,353,096 |
./full_match/83/0xdb68eC6dFd21791cC9c1f4836b6499e2325461A7/sources/contracts/suErc20Delegator.sol | Accepts transfer of admin rights. msg.sender must be pendingAdmin Admin function for pending admin to accept role and update admin return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)/ | function _acceptAdmin() external returns (uint256) {
bytes memory data = delegateToImplementation(abi.encodeWithSignature('_acceptAdmin()'));
return abi.decode(data, (uint256));
}
| 9,556,346 |
./partial_match/1/0x4B12004B031f13caa8a28E2049f74F3D77653369/sources/contracts/interfaces/IAllowanceTarget.sol | IAllowanceTarget Interface imToken Labs | interface IAllowanceTarget {
error NotAuthorized();
function spendFromUserTo(
address from,
address token,
address to,
uint256 amount
) external;
pragma solidity >=0.8.0;
}
| 2,715,821 |
pragma solidity >0.5.0;
import "@openzeppelin/contracts/Ownership/Ownable.sol";
contract RedeemCode is Ownable {
/**
* ----- Contract Variables -----
*/
mapping(address => bool) public claimable;
uint256 public redeemAmount = 0.01 ether;
/**
* ----- Owner Methods -----
*/
/**... | Withdraw all ETH in contract/ | function withdrawAll()
public
onlyOwner
{
_msgSender().transfer(address(this).balance);
}
| 7,304,642 |
./full_match/42220/0x866B23e29F8025283E35fF7777d63f7Fc6C8D957/sources/RevoFees.sol | 0.25% (ignores interest earned for simplicity) | function withdrawalFee(
uint256 interestEarnedNumerator,
uint256 interestEarnedDenominator
)
external
pure
override
returns (uint256 feeNumerator, uint256 feeDenominator)
{
feeNumerator = 25;
feeDenominator = 10000;
}
| 16,316,488 |
// SPDX-License-Identifier: MIT-open-group
pragma solidity ^0.8.11;
import "contracts/interfaces/IValidatorPool.sol";
import "contracts/libraries/ethdkg/ETHDKGStorage.sol";
import "contracts/interfaces/IETHDKGEvents.sol";
import "contracts/utils/ETHDKGUtils.sol";
import "contracts/libraries/math/CryptoLibrary.sol";
im... | todo: being paranoic, check if we need this or if it's expensive | function accuseParticipantDidNotSubmitGPKJ(address[] memory dishonestAddresses) external {
require(
_ethdkgPhase == Phase.GPKJSubmission &&
(block.number >= _phaseStartBlock + _phaseLength &&
block.number < _phaseStartBlock + 2 * _phaseLength),
str... | 6,483,727 |
./full_match/7672/0xFfb937647c9a2ff42556D78FBC6dA2baA8804C98/sources/contracts/Bridge.sol | Verify a message was authorised by validators. - Callable by anyone. - Caller must provide `bridgeFee`. - Requires signatures from a threshold validators at proof.validatorSetId. - Requires proof is not older than `proofTTL` eras - Halts on failure Parameters: - preimage: the unhashed message data packed wide w source... | function _verifyMessage(bytes memory preimage, EventProof calldata proof)
internal
{
uint256 _eventId = proof.eventId;
uint32 _validatorSetId = proof.validatorSetId;
address[] memory _validators = proof.validators;
require(active, "Bridge: bridge inactive");
requ... | 16,296,214 |
/*
An ERC20 compliant token that is linked to a bank account via a bank API.
This token has the following constraints:
1. No token holder can hold more than 1000 tokens
2. There can not be more than 10 million tokens on issue
3. There is only one token issuer
4. Tokens can only be transferred to other depositors
This ... | Checks an address has previously depositored funds the the bank account | function RestrictedBankToken(string tokenSymbol, string tokenName)
event Deposit(
address indexed toAddress,
uint256 amount,
string externalId,
string bankTransactionId);
event RequestWithdrawal(
uint256 indexed withdrawalNumber,
address indexed withdrawer,
... | 12,796,280 |
pragma solidity 0.5.10;
import { ModifiedWhitelistAdminRole } from "../_shared/ModifiedWhitelistAdminRole.sol";
import { IMoleculeVault } from "../moleculeVault/IMoleculeVault.sol";
import { IERC20 } from "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import { SafeMath } from "openzeppelin-solidity/contract... | return uint256: The total number of rounds for this project./ | function getTotalRounds() public view returns(uint256) {
return totalRounds_;
}
| 7,272,614 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
import '../interfaces/IERC20.sol';
import "../libraries/SafeMath.sol";
abstract contract BasicToken is IERC20 {
using SafeMath for uint;
uint constant MAX = ~uint256(0);
uint public override totalSupply;
mapping(address => uint) public overrid... | Function to mint tokens _to The address that will receive the minted tokens. _amount The amount of tokens to mint. return A boolean that indicates if the operation was successful./ | function _mint(address _to, uint _amount) internal virtual returns (bool) {
require(_to != address(0), "mint to the zero address");
totalSupply = totalSupply.add(_amount);
balanceOf[_to] = balanceOf[_to].add(_amount);
emit Transfer(address(0), _to, _amount);
return true;
... | 7,236,227 |
./full_match/43114/0xACfe97DFE9E3CF7604e1f1B8105f2e80463697dE/sources/project_/contracts/TokenStaking.sol | Withdraw rewards and/or staked tokens. Pass a 0 amount to withdraw only rewards _amount The amount of staking tokens to withdraw | function withdraw(uint256 _amount) public {
PoolInfo storage pool = poolInfo[0];
UserInfo storage user = userInfo[msg.sender];
require(user.amount >= _amount, "withdraw: not good");
updatePool(0);
uint256 pending = user.amount.mul(pool.accRewardTokenPerShare).div(1e30).sub(us... | 4,642,428 |
./full_match/1313161554/0xd240f76C57fB18196A864B8b06E9b168C98c4524/sources/contracts/sharedContracts/VestingStorage.sol | function to calculate the end date in seconds of a given vesting plan planId is the NFT token ID | function planEnd(uint256 planId) public view returns (uint256 end) {
Plan memory plan = plans[planId];
end = TimelockLibrary.endDate(plan.start, plan.amount, plan.rate, plan.period);
}
| 13,234,366 |
/**
*Submitted for verification at Etherscan.io on 2022-02-25
*/
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
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... | Moves `amount` of tokens from `sender` to `recipient`. This internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `from` must have ... | function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(!_blackList[from], "ERC20: This addres... | 11,773,393 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/finance/Payment... | Pull Ether from the contract to an admin's account | function pullPayment(address payable _account) public onlyAdmins{
release(_account);
}
| 6,434,095 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;
import "hardhat/console.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { TransferHelper } from "@uniswap/lib/contracts/libraries/TransferHelper.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownabl... | transfer remaining tokens | function reset(
uint256 _START_TIME,
uint256 _MAX_RUNNING_DAYS,
uint256 _TOTAL_ALLOCATED,
uint256 _LIMIT_PER_TX,
uint256 _LIMIT_PER_DAY
) public onlyOwner whenPaused {
START_TIME = uint64(_START_TIME);
MAX_RUNNING_DAYS = uint64(_MAX_RUNNING_DAYS);
... | 1,265,543 |
/**
*Submitted for verification at Etherscan.io on 2021-03-02
*/
// SPDX-License-Identifier: (c) Armor.Fi DAO, 2021
pragma solidity ^0.6.6;
interface IArmorMaster {
function registerModule(bytes32 _key, address _module) external;
function getModule(bytes32 _key) external view returns(address);
function ... | User can update their plan for cover amount on any protocol. _protocols Addresses of the protocols that we want coverage for. _coverAmounts The amount of coverage desired in WEI. Let's simplify this somehow--even just splitting into different functions./ Need to get price of the protocol here First go through and su... | function updatePlan(address[] calldata _protocols, uint256[] calldata _coverAmounts)
external
doKeep
override
{
require(_protocols.length == _coverAmounts.length, "protocol and coverAmount length mismatch");
require(_protocols.length <= 30, "You may not protect more than 30 pro... | 10,858,779 |
./full_match/5/0xc891E7f01Eadf9d65E8962260F024b240D03A050/sources/src/HoprNetworkRegistry.sol | given the current registry, check if an account has the number of registered nodes within the limit, which is the eligibility of an account. If an account has registerd more peers than it's currently allowed, the account become ineligible account address to check its eligibility/ | function _checkEligibility(address account) private view returns (bool) {
uint256 maxAllowedRegistration = requirementImplementation.maxAllowedRegistrations(account);
if (countRegisterdNodesPerAccount[account] <= maxAllowedRegistration) {
return true;
return false;
}
}
| 1,861,129 |
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.5;
pragma abicoder v2;
import {IVotingStrategy} from '../interfaces/IVotingStrategy.sol';
import {IExecutorWithTimelock} from '../interfaces/IExecutorWithTimelock.sol';
import {IProposalValidator} from '../interfaces/IProposalValidator.sol';
import {IGovernanceS... | Set new GovernanceStrategy Note: owner should be a timelocked executor, so needs to make a proposal governanceStrategy new Address of the GovernanceStrategy contract/ | function setGovernanceStrategy(address governanceStrategy) external override onlyOwner {
_setGovernanceStrategy(governanceStrategy);
}
| 1,806,823 |
// SPDX-License-Identifier: MIT
pragma solidity >0.5.0 <0.8.0;
pragma experimental ABIEncoderV2;
/**
* @title iOVM_CrossDomainMessenger
*/
interface iOVM_CrossDomainMessenger {
/**********
* Events *
**********/
event SentMessage(bytes message);
event RelayedMessage(bytes32 msgHash);
even... | Checks whether the given address is on the whitelist to ovmCREATE/ovmCREATE2, and reverts if not. _deployerAddress Address attempting to deploy a contract./ From an OVM semantics perspective, this will appear identical to the deployer ovmCALLing the whitelist. This is fine--in a sense, we are forcing them to. | function _checkDeployerAllowed(
address _deployerAddress
)
internal
{
(bool success, bytes memory data) = ovmSTATICCALL(
gasleft(),
Lib_PredeployAddresses.DEPLOYER_WHITELIST,
abi.encodeWithSelector(
OVM_DeployerWhitelist.isDeployerA... | 6,167,572 |
/**
▓▓▌ ▓▓ ▐▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄
▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
▓▓▓▓▓▓ ▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓ ▐▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓
▓▓▓▓▓▓▄▄▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▄▄▄▄ ▓▓▓▓▓▓▄▄▄▄ ▐▓▓▓▓▓▌ ▐... | Returns bonds to the keep members. | function freeMembersBonds() internal {
for (uint256 i = 0; i < members.length; i++) {
bonding.freeBond(members[i], uint256(address(this)));
}
}
| 950,834 |
./full_match/100/0x65921215c11448B9080d8AfE46fF0F3b030Cd7FF/sources/src/lib/TimeHelpers.sol | Returns the current timestamp. Using a function rather than `block.timestamp` allows us to easily mock it in tests./ | function getTimestamp() internal view returns (uint256) {
return block.timestamp;
}
| 14,281,805 |
/*
* Holdenomics
* put details here
*/
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
// OpenZeppelin Contracts v4.4.0 (utils/Address.sol)
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
*... | Checks if there's too much gas | function taxGreyCheck() private view returns (bool) {
return gasleft() >= greyGasThreshold;
}
| 1,002,843 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import './MNextDataModel.sol';
import './MNextMaster.sol';
contract MNextNonMaster is MNextDataModel {
/*
* #####################
* # PRIVATE VARIABLES #
* #####################
*/
// Local check book, it contains sy... | Suspend check ------------- Suspend an existing and non suspended check uint256 myId Entity level ID in the register. It differs from the system ID. string memory passPhrase A pharese to secure the check./ Depending on EVM configuration delegatecall() should be used here. | function suspendCheck(uint256 myId, string calldata passPhrase)
onlyExistingCheck(myId) external {
_masterContract.suspendCheck(_checks[myId], passPhrase);
}
| 15,860,689 |
pragma solidity ^0.5.3;
import "testeth/Log.sol";
import "testeth/Assert.sol";
import "testeth/Account.sol";
contract Factory {
event Deployed(address addr, uint256 salt);
function deploy1SignerWallet(uint256 threshold, address signatory) public returns (address payable addr) {
assembly {
// Multisig W... | EIP712 Transaction Hash | function check_a7_buildHash_testInvalidNonce_useAccount1() public {
recordData = "\x19\x01\x01";
data = abi.encodeWithSelector(bytes4(0x7214ae99), address(recorder), recordData);
hash = keccak256(abi.encodePacked(
"\x19\x01",
bytes32(0xb0609d81c5f719d8a516ae2f25079b20fb63da3e07590e23fbf0028e67... | 6,460,297 |
./full_match/43113/0x3a7D90487F8E6c8631317E1B812d020CE5bB1288/sources/src/LBPair.sol | Returns the token Y of the Liquidity Book Pair return tokenY The address of the token Y/ | function getTokenY() external pure override returns (IERC20 tokenY) {
return _tokenY();
}
| 7,117,312 |
// SPDX-License-Identifier:MIT
pragma solidity >=0.7.0;
import "./SafeMathTyped.sol";
// The MIT License
//
// Copyright (c) 2017-2018 0xcert, d.o.o. https://0xcert.org
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Softw... | Allow the owner to change the name of the token. _newName The new name for the token | function changeName(string calldata _newName)
external
onlyOwner()
{
tokenName = _newName;
emit NameChange(_newName);
}
event SymbolChange(string newSymbol);
| 1,522,216 |
pragma solidity ^0.4.24;
contract Basic {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwn... | Query the event to participate in the HASH by guessing the event ID/ | function showMoseEvent(uint32 _id) public view returns (uint32,string,string,bool) {
return (moseEvents[_id].id, moseEvents[_id].attendHash,moseEvents[_id].result,moseEvents[_id].finish);
}
| 2,554,837 |
./full_match/1/0x032Ba44EB2DB607d2F9424b90e191BbFb51152A1/sources/contracts/PrizeTierHistoryV2.sol | @inheritdoc IPrizeTierHistoryV2 | function getPrizeTierList(uint32[] calldata _drawIds)
external
view
override
returns (PrizeTierV2[] memory)
{
uint256 _length = _drawIds.length;
PrizeTierV2[] memory _data = new PrizeTierV2[](_length);
for (uint256 index = 0; index < _length; index++) {
... | 16,513,603 |
./full_match/1/0xFd3171eCA94a00e40b3671803d899d3FD86c073c/sources/contracts/PerpetualTranche.sol | Enforces the per tranche supply cap. To be invoked AFTER the mint operation. checks if supply minted using the given tranche is within the cap | function _enforcePerTrancheSupplyCap(ITranche trancheIn) private view {
if (mintedSupplyPerTranche[trancheIn] > maxMintAmtPerTranche) {
revert ExceededMaxMintPerTranche(trancheIn, mintedSupplyPerTranche[trancheIn], maxMintAmtPerTranche);
}
}
| 2,949,475 |
pragma solidity ^0.6.0;
// ---------------------------------------------
contract AddrChecker {
/// #if_succeeds {:msg "P1"} addr != address(0xAaaaAaAAaaaAAaAAaAaaaaAAAAAaAaaaAaAaaAA0);
function checkAddr(address addr) external {
require(addr != address(0xAaaaAaAAaaaAAaAAaAaaaaAAAAAaAaaaAaAaaAA0));
... | if_succeeds res == x + getX(); | function inc(uint x) public returns (uint res) {
return x + getX();
}
| 14,053,353 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.