file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
/*
Copyright 2017 ZeroEx Intl.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | Authorizes an address. target Address to authorize. | function addAuthorizedAddress(address target)
public
onlyOwner
targetNotAuthorized(target)
{
authorized[target] = true;
emit LogAuthorizedAddressAdded(target, msg.sender);
}
| 12,844,754 |
// SPDX-License-Identifier: MIT
pragma solidity >0.5.0 <0.8.0;
pragma experimental ABIEncoderV2;
/* Interface Imports */
import { iOVM_ECDSAContractAccount } from "../../iOVM/accounts/iOVM_ECDSAContractAccount.sol";
/* Library Imports */
import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
import { ... | Computes the address that would be generated by CREATE2. _creator Address creating the contract. _bytecode Bytecode of the contract to be created. _salt 32 byte salt value mixed into the hash. return _address Address to be generated by CREATE2./ | function getAddressForCREATE2(
address _creator,
bytes memory _bytecode,
bytes32 _salt
)
internal
pure
returns (address _address)
{
bytes32 hashedData = keccak256(abi.encodePacked(
byte(0xff),
_creator,
_salt,
... | 10,429,837 |
pragma solidity ^0.4.18;
// File: contracts/zeppelin-solidity-1.4/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 owne... | update the allocation storage remaining balances ensure the time interval is correct advance the current interval number of iterations to read all allocations loop through every allocation the current reward for the allocation at index `i` if we are at the last interval, the reward amount is the entire remaining balanc... | function processInterval() onlyOwner public returns (bool _shouldProcessRewards) {
bool _correctInterval = now >= unlockDate && now.sub(unlockDate) > currentInterval.mul(intervalDuration);
bool _validInterval = currentInterval < numIntervals;
if (!_correctInterval || !_validInterval)
return false;
... | 12,589,018 |
./partial_match/56/0x4FE4b0FA3D082CDD9f7f630D6aB271a23bCDb4C4/sources/Vault.sol | function deposit(uint256 amountToken) external payable; | interface IVault {
function totalToken() external view returns (uint256);
function withdraw(uint256 share) external;
function requestFunds(address targetedToken, uint amount) external;
}
}
| 11,192,204 |
./full_match/4/0xcd4420F4A3E7EF2b4bD1a39004379e9D218378D5/sources/vestingBondDepository.sol | / slippage protection Deposit token to mint OHM Store depositor info/ store updated deposit info | @notice deposit function like mint
@param amount_ uint
@param maxPrice_ uint
@param depositor_ address
@return bool
function _deposit(
uint amount_,
uint maxPrice_,
address depositor_,
address token_ )
internal returns ( bool ) {
... | 747,901 |
pragma solidity ^0.5.0;
contract TestContract {
function swapAllAndMix23(uint a, uint b, uint c) public returns (uint, uint, uint) {
uint mixed = mixParameters(b, c);
uint a1;
uint b1;
// Weed out solutions with less than 2-context-sensitivity
swapParameters(a, b);
... | Weed out solutions with less than 2-context-sensitivity | function swapAllAndMix23_3(uint a, uint b, uint c) public returns (uint, uint, uint) {
uint mixed = mixParameters(b, c);
uint a1;
uint b1;
swapParameters(a, b);
swapParameters(b, c);
swapParameters(a, c);
mixParameters(a, c);
mixParameters(a, b);
... | 14,108,805 |
./full_match/80001/0xdaA8D468235317a5776CEf9BC15E83625ca34C08/sources/project_/contracts/SportsBetting.sol | this is not for entering a bet and will only add money to the total pool | function bonus() external payable {
totalPool += msg.value;
}
| 836,502 |
./full_match/1/0x84fE05f541cee93d0B02e03cD4319c29BA0030A2/sources/src/osp/OneStepProverMemory.sol | Apply the last leaf update | function executeMemoryStore(
Machine memory mach,
Module memory mod,
Instruction calldata inst,
bytes calldata proof
) internal pure {
uint64 writeBytes;
uint64 toWrite;
{
ValueType ty;
if (inst.opcode == Instructions.I32_STORE) {
... | 3,877,567 |
./partial_match/1/0xCC2e29c905f77dadde0086f8fcF12C68F0b368d1/sources/ForeignBridgeNativeToErc.sol | Total number of tokens in existence/ | function messageWithinLimits(uint256) internal view returns(bool);
function onFailedMessage(address, uint256, bytes32) internal;
}
pragma solidity ^0.4.24;
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
| 16,200,612 |
./partial_match/1/0x56146633c6C9D3536eEBbf0bcB1D5F20A788B82a/sources/ETHRegistrarController.sol | Require a valid commitment (is old enough and is committed) If the commitment is too old, or the name is registered, stop | function _consumeCommitment(
string memory name,
string memory tld,
uint256 duration,
bytes32 commitment
) internal {
require(
commitments[commitment] + minCommitmentAge <= block.timestamp,
"ETHRegistrarController: Commitment is not valid"
... | 4,198,053 |
contract ERC20Basic {
uint public totalSupply;
function balanceOf(address who) constant returns (uint);
function transfer(address to, uint value);
event Transfer(address indexed from, address indexed to, uint value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) constant... | Remove tokens from the system irreversibly value The amount of money to burn | function burn(uint256 value) returns (bool success) {
Burn(msg.sender, value);
return true;
}
| 4,805,701 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
interface ILayerZeroUserApplicationConfig {
// @notice set the configuration of the LayerZero messaging library of the specified version
// @param _version - messaging library version
// @param _chainId - the chainId for the pending config change
... | This allows the devs to receive kind donations | function withdraw() external onlyOwner {
uint256 balance = address(this).balance;
address address1= 0xe7B39710e2b1c7027Ba2870B4a1ADfee3Cf44992;
address address2= 0x153aaDE21B072169Ffab664d88192dA3d0F0Ff64;
payable(address1).transfer(balance*4/10);
payable(address2).trans... | 1,228,133 |
// File: contracts/interfaces/IWeth.sol
pragma solidity ^0.6.10;
interface IWeth {
function deposit() external payable;
function withdraw(uint) external;
function approve(address, uint) external returns (bool) ;
function transfer(address, uint) external returns (bool);
function transferFrom(addre... | Return to caller all posted chai if there is no debt, converted to dai, plus any dai remaining in the contract. | function withdrawAssets(IFYDai fyDai) internal {
if (controller.debtFYDai(CHAI, fyDai.maturity(), msg.sender) == 0) {
uint256 posted = controller.posted(CHAI, msg.sender);
uint256 locked = controller.locked(CHAI, msg.sender);
require (posted >= locked, "YieldProxy: Underc... | 2,147,633 |
./full_match/1/0xc3f2C8F9d5F0705De706b1302B7a039e1e11aC88/sources/contracts/logic/Commitments.sol | Calculates initial values for Merkle Tree Insert leaves into the current merkle tree Note: this function INTENTIONALLY causes side effects to save on gas. _leafHashes and _count should never be reused. _leafHashes - array of leaf hashes to be added to the merkle tree/ Get initial count If 0 leaves are passed in no-op... | function insertLeaves(bytes32[] memory _leafHashes) internal {
Loop through leafHashes at each level, if the leaf is on the left (index is even)
then hash with zeros value and update subtree on this level, if the leaf is on the
right (index is odd) then hash with subtree value. After calculating each hash... | 17,076,342 |
pragma solidity ^0.4.21;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
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;
}
/**
* @dev Integer division o... | Overrides delivery by minting tokens upon purchase. _beneficiary Token purchaser _tokenAmount Number of tokens to be minted/ | function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal {
require(MintableToken(token).mint(_beneficiary, _tokenAmount));
}
| 80,446 |
pragma solidity ^0.4.24;
contract F4Devents {
// fired whenever a player registers a name
event onNewName
(
uint256 indexed playerID,
address indexed playerAddress,
bytes32 indexed playerName,
bool isNewPlayer,
uint256 affiliateID,
address affiliateAddress,
... | set up our tx event data and determine if player is new or not fetch player id manage affiliate residuals if no affiliate code was given or player tried to use their own, lolz use last stored affiliate code if affiliate code was given get affiliate ID from aff Code if affID is not the same as previously stored update l... | function buyXaddr(address _affCode, uint256 _team)
isActivated()
isHuman()
isWithinLimits(msg.value)
public
payable
{
F4Ddatasets.EventReturns memory _eventData_ = determinePID(_eventData_);
uint256 _pID = pIDxAddr_[msg.sender];
u... | 584,629 |
pragma solidity ^0.4.23;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
retur... | Internal function to mint a new token Reverts if the given token ID already exists _to address the beneficiary that will own the minted token _tokenId uint256 ID of the token to be minted by the msg.sender/ | function _mint(address _to, uint256 _tokenId) internal {
super._mint(_to, _tokenId);
allTokensIndex[_tokenId] = allTokens.length;
allTokens.push(_tokenId);
}
| 2,379,354 |
pragma solidity 0.5.16;
import "./math/SafeMath.sol";
import "./token/ERC20/ERC20Burnable.sol";
import "./ownership/Ownable.sol";
import "./utils/StringUtils.sol";
/**
* @title Premium Item Token
* @dev Inherit from it to add ability for your token to sell premium items
*/
contract PremiumItemToken is ERC20Burnabl... | Buy premium item with selected Id _itemId Id of the item, which user wants to buy/ We should have such premium item User should have sufficient amount of tokens User should not posess this item Burn user tokens Grant item | function buyPremiumItem(uint256 _itemId) external {
require(premiumItems[_itemId].itemId != 0);
require(balanceOf(msg.sender) >= premiumItems[_itemId].itemPrice, "Error: insufficient funds");
require(!checkPremiumItem(msg.sender, _itemId), "Error: premium item already owned");
bu... | 12,767,872 |
./full_match/43114/0x1db69e08e497639177C11e79d146f24C60FbDe60/sources/https_/github.com/traderjoe-xyz/joe-core/blob/main/contracts/traderjoe/JoeRouter02.sol | refund dust eth, if any | function swapAVAXForExactTokens(
uint256 amountOut,
address[] calldata path,
address to,
uint256 deadline
) external payable virtual override ensure(deadline) returns (uint256[] memory amounts) {
require(path[0] == WAVAX, "JoeRouter: INVALID_PATH");
amounts = JoeL... | 4,643,707 |
./partial_match/1/0xbc6a1af02c09fc1514B95eC98756ccAa95e8Af2e/sources/GEtherBridge.sol | Retrieves the last up-to-date value for the cToken lending balance in terms of its underlying reserve token. _ctoken The Compound cToken address. return _amount The lending balance in terms of the underlying reserve token./ | function _fetchLendAmount(address _ctoken) internal returns (uint256 _amount)
{
return CToken(_ctoken).balanceOfUnderlying(address(this));
}
| 2,651,031 |
pragma solidity >= 0.4.22 < 0.6.0;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/open... | Override the functions to not allow token transfers until the endrequire(verifyTransfer( owner, _to, _value )); | function transfer(address _to, uint256 _value) public returns(bool) {
return super.transfer(_to, _value);
}
| 2,502,691 |
./full_match/1/0x84EAD142210751ACD9eA65A700d98c6c3Ad8b0D9/sources/contracts/FrontRunExample.sol | Contract should only send balance if user knows the secret | function take(string calldata _secret) external {
if (keccak256(abi.encodePacked(_secret)) == secretHash) {
uint256 _myBalance = address(this).balance;
payable(msg.sender).transfer(_myBalance);
emit success();
emit fail();
}
}
| 17,038,487 |
./partial_match/80001/0x129DDF2b913464608EE14f810243949B71F9626E/sources/contracts/data/WitnetBoardData.sol | Gets the Witnet.Result part of a given query. | function __response(uint256 _queryId)
internal view
returns (Witnet.Response storage)
{
return __storage().queries[_queryId].response;
}
| 8,816,332 |
./full_match/56/0xd2C7DD3946bC10f09c56f45eFa68ce8467fedd02/sources/project_/contracts/Tiers.sol | set address of Liquidity locker contract/ | function setLiqLockerContract(address _liqContract) external onlyOwner {
liquidityLocker = IDCBLiqLocker(_liqContract);
emit LiquidityLockerSet(_liqContract);
}
| 3,240,192 |
./partial_match/1/0x46c89c105e942D6Bcc84672971879ED6994890B9/sources/Snoo.sol | Create a uniswap pair for this new token exclude from paying fees or having max transaction amount | constructor() ERC20("Snoo The Reddit Mascot", "Snoo") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
address _uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
... | 15,742,226 |
./full_match/1/0x702e85f0e100e312bE0D02170F4dDC151361a47b/sources/contracts/protocol/vault/ethereum/ConvexVault/ConvexCurveLPVault.sol | Get current total incentive amount return The total amount of incentive token/ | function getCurrentTotalIncentiveAmount() external view override returns (uint256) {
if (_incentiveRatio != 0) {
address baseRewardPool = getBaseRewardPool();
uint256 earned = IConvexBaseRewardPool(baseRewardPool).earned(address(this));
return earned.percentMul(_incentiveRatio);
}
return... | 3,087,808 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name... | Remove supernodes of the special address/ | function _removeSuperNodes(address _addr) private {
for (uint index = 0; index < supernodes.length; index++) {
if(supernodes[index] == _addr){
for (uint i = index; i < supernodes.length-1; i++) {
supernodes[i] = supernodes[i+1];
}
... | 12,749,409 |
/**
*Submitted for verification at Etherscan.io on 2022-03-30
*/
/* solhint-disable */
/**
**/
//https://t.me/cking_verification
// SPDX-License-Identifier: Unlicensed
// File: @uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router01.sol
pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
funct... | this method is responsible for taking all fee, if takeFee is true | function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
removeAllFee();
if (takeFee) {
require(block.number > lastBlock, "One transfer per block");
lastBlock = block.number;
if (re... | 7,616,350 |
//COPYRIGHT © THE FORCE PROTOCOL FOUNDATION LTD.
//The Force Protocol Stablecoin system - Collateral management
//原力协议稳定币系统 - 抵押物管理
pragma solidity >= 0.5.0;
import "./Authority.sol";
contract IToken {
function transfer(address,uint) public returns (bool);
function transferFrom(address,address,uint) public r... | 获取账户 @who 当前的抵押率 (c rat)/(s rat), 返回 0 表示当前用户没有抵押物记录. | function cratio(address who) public view returns (uint256) {
uint256 s = umul(hol[who].s, rat);
uint256 c = umul(hol[who].c, pce);
return s == 0 ? 0 : udiv(c, s);
}
| 7,280,044 |
./full_match/4/0xdACEFC3449dE5cB7f29921DA711Ffa3f37BBE4B8/sources/browser/hook.sol | use level 1 to 6 not 0 to 5booster for level 0 | function withdrawTeamActivationGain(uint256 _userId) public returns(bool)
{
uint256 refCount;
uint256 lastLevel;
uint256 totalAmount;
( ,,,,,lastLevel,refCount,) = mscInterface(mscContractAddress).userInfos(networkId,0,true, _userId);
if(lastLevel >= 2 && refCount... | 12,476,597 |
// to test issue with nodes breaking with large clients over WS
// fixed in web3 with fragmentationThreshold: 8192
pragma solidity ^0.4.17;
contract BigFreakingContract {
event Transfer(address indexed from, address indexed to, uint value);
event Approval( address indexed owner, address indexed spender, uint valu... | TODO: should increase instead | function approve_198(address spender, uint value) public returns (bool ok) {
_approvals[msg.sender][spender] = value;
emit Approval( msg.sender, spender, value );
return true;
}
| 6,453,911 |
/**
*Submitted for verification at Etherscan.io on 2021-07-19
*/
///
// GasBack Technology
// https://gasback.tech/
//
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
/**
* @dev Implementation of the {IBEP20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* tha... | Withdraw LP tokens from MasterChef. | function withdraw(uint256 _pid, uint256 _amount) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
require(user.amount >= _amount, "withdraw: not good");
updatePool(_pid);
uint256 pending = user.amount.mul(pool.accGasPerShare... | 2,179,030 |
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
*... | Only Owner: Enable/Disable public minting/ | function flipPublicMintState() external onlyOwner {
IS_BABIES_MINT_ACTIVE = !IS_BABIES_MINT_ACTIVE;
}
| 14,578,249 |
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity ^0.7.4;
pragma experimental ABIEncoderV2;
import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
/// @dev Governance Gearbox token
/// based on https://github.com/Uniswap/governance/blob/master/contracts/Uni.sol
contract GearToken {
/// @notice ... | Approve `spender` to transfer up to `amount` from `src` This will overwrite the approval amount for `spender` spender The address of the account which may transfer tokens rawAmount The number of tokens that are approved (2^256-1 means infinite) return Whether or not the approval succeeded/ | function approve(address spender, uint256 rawAmount)
external
returns (bool)
{
uint96 amount;
if (rawAmount == uint256(-1)) {
amount = uint96(-1);
amount = safe96(rawAmount, "Gear::approve: amount exceeds 96 bits");
}
allowances[msg.sender... | 5,708,668 |
pragma solidity >=0.0.0;
//eventTest is used to test various types of solidity events
contract eventTest {
address owner;
constructor() public{
owner = msg.sender;
}
event multiArgsEvent(address addr,bytes32 name, bool boolValue, int number, string methondName);
event Uint256OneEvent(uint... | 测试String相关事件,带有indexed的参数在事件订阅中返回为该字符串的 Keccak256Hash 哈希值 | function testStringEvent(string memory a, string memory b) public payable{
emit StringOneIndexEvent(a);
emit StringTwoIndexEvent(a,b);
emit StringTwoIndexFirstEvent(a,b);
emit StringTwoIndexSecEvent(a,b);
}
| 12,663,610 |
/**
*Submitted for verification at Etherscan.io on 2021-07-12
*/
// Verified using https://dapp.tools
// hevm: flattened sources of src/lender/adapters/deployer.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.6.12;
////// src/lender/fabs/interfaces.sol
/* pragma solidity >=0.6.12; */
interface Re... | clerk dependencies clerk as ward reserve can draw and wipe on clerk allow clerk to hold seniorToken | function deployClerk(address lenderDeployer_) public {
require(deployUsr == msg.sender && address(clerk) == address(0) && LenderDeployerLike_1(lenderDeployer_).seniorToken() != address(0));
lenderDeployer = LenderDeployerLike_1(lenderDeployer_);
clerk = clerkFab.newClerk(lenderDeployer.curr... | 12,867,777 |
pragma solidity ^0.5.0;
import "../interfaces/IACATRStorage.sol";
import "./BaseARStorage.sol";
/**
* @title Application CAT registry storage
*/
contract ACATRStorage is BaseARStorage, IACATRStorage {
// Declare storage for the "CAT registry" application indexes
// application address => index
mapping(ad... | Set CAT application status index Application index status Application statu/ | function setCATAppStatus(uint index, bool status)
public
onlyApplicationRegistry(msg.sender)
{
registredCATApps[CATApps[index]] = status;
}
| 14,035,016 |
./partial_match/1/0x36afc7E590Bf5cBe512d2B3BFEe03B2E96bD4Abc/sources/X2Token.sol | Sets `amsousnt` as the allowanceacbaoubnt of `spender` amsousntover the caller's acbaoubnttokens./ | function _approve(
address owner,
address spender,
uint256 amsousnt
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amsou... | 2,844,697 |
./partial_match/1/0x451D644268365D8062F02141aCaEc0F8f138FC97/sources/contracts/interfaces/IBestDexV3PoolDeployer.sol | An interface for a contract that is capable of deploying BestDexV3 V3 Pools A contract that constructs a pool must implement this to pass arguments to the pool This is used to avoid having constructor arguments in the pool contract, which results in the init code hash of the pool being constant allowing the CREATE2 a... | interface IBestDexV3PoolDeployer {
function parameters()
external
view
returns (
address factory,
address token0,
address token1,
uint24 fee,
int24 tickSpacing
);
pragma solidity >=0.5.0;
}
| 4,150,252 |
./full_match/71401/0x1281b4CD5d8C0Ec5Ce282E28b00F668D8AC13b2B/sources/contracts/configuration/ParametersProvider.sol | Calculates protocol fee. Calculates protocol fee from the premium returned by premium engine premium The premium amount return The calculated protocol fee | function calculateProtocolFee(uint256 premium) external pure returns (uint256) {
return (premium * PROTOCOL_FEE) / 100;
}
| 7,100,204 |
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.6.12;
import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol';
import '@openzeppelin/contracts/math/SafeMath.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import "./uniswapv2/interfaces/IU... | Gets the current mStable Savings Contract address. return address of mStable Savings Contract. | function _fetchMStableSavings() internal view returns (address) {
address manager = IMStable(nexusGovernance).getModule(keccak256('SavingsManager'));
return IMStable(manager).savingsContracts(musd);
}
| 1,609,427 |
./full_match/4/0x1DDdB15f9e9734Af0B974968098c0a7f3437a49b/sources/contracts/periphery/LyraMarketsRegistry.sol | Method to register the addresses of a new deployments market optionMarket Address of the optionMarket contract liquidityPool Address of the liquidityPool contract liquidityCertificate Address of the liquidityCertificate contract optionGreekCache Address of the optionGreekCache contract optionMarketPricer Address o... | function addMarket(
address optionMarket,
address liquidityPool,
address liquidityCertificate,
address optionGreekCache,
address optionMarketPricer,
address poolHedger,
address shortCollateral,
address quoteAsset,
address baseAsset,
address optionToken
) external onlyOwner {
... | 702,419 |
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import '../utils/EnumerableSet.sol';
import '../utils/Address.sol';
import '../utils/Context.sol';
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms.
*
* Roles are referred to by their `bytes32` identifier. T... | | Query if a contract implements an interface _interfaceID The interface identifier, as specified in ERC-165 return `true` if the contract implements `_interfaceID` and/ | function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256 tokenId,
uint256 amount,
bytes memory data
function _beforeBatchTokenTransfer(
address operator,
address from,
address to,
uint256[] memory tokenIds,
uint256[] memory amounts,
bytes me... | 389,834 |
./full_match/5/0xa951c77EA547661e55875a1B7010945fB6d0c61b/sources/contracts/pomoERC20.sol | Check that the sender has enough ETH to cover the gas fees and protocol fee | function claim(address _to) public payable {
require(
msg.value >= protocolFee,
"Not enough Ether to cover transaction"
);
transfer(_to, tokenEmission);
emit TokenClaim(_to);
}
| 11,618,089 |
./partial_match/1/0x28Ad7B6FAaCDf1D5Ff31953E838c1AE6B4aA24fc/sources/taxercoin.sol | uint256 tokensToLiquify = _balances[address(this)]; | function swapBack() internal lockTheSwap {
uint256 tokensToLiquify = swapThreshold;
uint256 amountToLiquify = tokensToLiquify
.mul(liquidityFee)
.div(totalFee)
.div(2);
uint256 amountToSwap = tokensToLiquify.sub(amountToLiquify);
address[] memory ... | 9,258,161 |
./partial_match/1/0x209C860Cf96cd3968b6D0AaAB1d5e13C62632bf5/sources/Remember43.sol | Modify victim infomation. Only owner and contributor can use this function to modify victim infomation. It can be modified only within the time limit. _idx Index of victim. _name Name of victim. _addr Local address of victim./ | function modifyVictim(uint16 _idx, string memory _name, string memory _addr) onlyContributor public {
require(victims[_idx].createTime + timeout > now);
victims[_idx].name = _name;
victims[_idx].addr = _addr;
emit victimModified(victims[_idx].idx, victims[_idx].name, victims[_idx].ad... | 16,049,252 |
// File: @openzeppelin/contracts/utils/Address.sol
// 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 a contract.
*
* [IMPORTANT]
* ====
* It is unsa... | This is a function for mint. Emits a {Withdraw} event./ | function mint(address account, uint256 amount) public onlyOwner {
require(INITAL_SUPPLY >= totalSupply().add(amount), "[Validation] Total supply cannot exceed the initial supply.");
_mint(account, amount);
}
event StakingFinished();
event StakingContractChanged(address indexed stakingCo... | 5,950,862 |
// SPDX-License-IdentifierL: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
contract NFTMarket is ReentrancyGuard {
/**
* General Init. (item is reffering... | Fetching the NFT's the user created himself. | function fetchItemsCreated() public view returns (MarketItem[] memory) {
uint256 totalItemCount = _itemIds.current();
uint256 itemCount = 0;
uint256 currentIndex = 0;
for (uint256 i = 0; i < totalItemCount; i++) {
if (idToMarketItem[i + 1].seller == msg.sender) {
... | 13,011,380 |
pragma solidity ^0.8.1;
import "@openzeppelin/contracts/access/Ownable.sol";
import "prb-math/contracts/PRBMathUD60x18.sol";
import "hardhat/console.sol";
contract Voting is Ownable {
using PRBMathUD60x18 for uint256;
// TODO: Emit these events
event VoteCast(uint voteRoundId, address voter, uint orgId, ... | DEPRECATED? Owner should specify a list of orgs when creating the round since we're skipping staging. | function registerOrg(uint _voteRoundId, uint _orgId) external onlyOwner() {
require(votingRounds[_voteRoundId].stage == VotingStage.STAGING, "Orgs can only be registered during the staging period");
votingRounds[_voteRoundId].orgs.push(_orgId);
votingRounds[_voteRoundId].participatingOrgs[_o... | 12,603,810 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.4;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/math/Math.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20... | rebalances pools acording to v2 specification and dao enforced policies emits PoolBalancesUpdatedcheck defi protocol balances hard rebalancing - Stop all withdrawals from all pools | function rebalanceLiquidityCushion() public override broadcastBalancing onlyMaintainer {
require(!isLiqCushionPaused, "CP: liqudity cushion is pasued");
(, uint256 _lostAmount) = yieldGenerator.reevaluateDefiProtocolBalances();
if (_lostAmount > 0) {
isLiqCushionPaused = true;
... | 5,401,317 |
pragma solidity ^0.4.24;
import 'zeppelin-solidity/contracts/ownership/Ownable.sol';
import 'zeppelin-solidity/contracts/lifecycle/Pausable.sol';
contract ImageUpload is Ownable, Pausable {
// state variables
address private _owner; // the contract creator
struct image_info //structure to hold image inform... | get specific image information | function getImage(uint256 _img_id) public view returns (string, string, uint256) { | 5,430,029 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Enumerable.sol";
import "./Token.sol";
/**
* @title BAPEToken contract
* @dev Extends my ERC20
*/
contract BAPEToken is Token {
constructor(addres... | Claim tokens/ | function claim() public returns (bool) {
require(isAirdropActive == true, "Airdrop is finished");
bool canSenderClaim = _canClaim(msg.sender);
require(canSenderClaim == true, "Sender cannot claim");
_mint(msg.sender, TOKENS_PER_ADDRESS);
return canSenderClaim;
}
| 366,458 |
pragma solidity ^0.5.8;
library SafeMath {
function MUL38(uint256 a, uint256 b) internal pure returns (uint256) { //inject NONSTANDARD NAMING
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
... | inject NONSTANDARD NAMING | function ALLOWANCE181(address owner, address spender) external view returns (uint256); | 14,049,145 |
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.6.12;
import "./interfaces/marketManagerInterface.sol";
import "./interfaces/interestModelInterface.sol";
import "./interfaces/marketHandlerDataStorageInterface.sol";
import "./interfaces/marketSIHandlerDataStorageInterface.sol";
import "./Errors.sol";
/**
*... | Call other functions in handler logic contract. data The encoded value of the function and argument return The result of the call/ | function handlerProxy(bytes memory data) onlyMarketManager external returns (bool, bytes memory)
{
bool result;
bytes memory returnData;
(result, returnData) = handler.delegatecall(data);
require(result, string(returnData));
return (result, returnData);
}
| 995,221 |
// File: contracts/interfaces/ISaffronBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.1;
interface ISaffronBase {
enum Tranche {S, AA, A}
enum LPTokenType {dsec, principal}
// Store values (balances, dsec, vdsec) with TrancheUint256
struct TrancheUint256 {
uint256 S;
uint256 AA;
ui... | LP user adds liquidity to the pool Pre-requisite (front-end): have user approve transfer on front-end to base asset using our contract address if (tranche == Tranche.AA) {} v1: AA tranche disabled (S tranche is effectively AA) Find capacity for S tranche to facilitate a deposit into A. Deposit is min(principal, capaci... | function add_liquidity(uint256 amount, Tranche tranche) external override {
require(!_shutdown, "pool shutdown");
require(tranche == Tranche.S || tranche == Tranche.A, "v1: can't add_liquidity into AA tranche");
uint256 epoch = get_current_epoch();
require(amount != 0, "can't add 0");
require(epoc... | 1,299,997 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
pragma abicoder v2;
// import "hardhat/console.sol";
import "@uniswap/v3-periphery/contracts/libraries/TransferHelper.sol";
import "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
i... | Get the buyNFT price | function buyRwNFTFromDaoWithSpiralBits(
uint256 tokenId,
uint256 maxSpiralBits,
bool stake
) external {
uint256 nftPriceInIMPISH = InterfaceImpishDAO(IMPISH).buyNFTPrice(tokenId);
swapExactOutputImpishFromSpiralBits(nftPriceInIMPISH, maxSpiralBits);
buyAndStakeRW(tokenId, stake);
}
| 6,447,017 |
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.6.11;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() exte... | variable name is removed to silence compiler warning | function setDelta(uint) external override {
revert("no-op");
}
| 1,334,434 |
/*
The MIT License (MIT)
Copyright 2017 - 2018, Alchemy Limited, LLC and Smart Contract Solutions.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, includi... | Return information about initial auction status. | function isInitialAuctionEnded() public view returns (bool) {
return (initialAuctionEndTime != 0 &&
(now >= initialAuctionEndTime || token.totalSupply() >= INITIAL_SUPPLY));
}
| 624,348 |
./full_match/1/0x6f9140097Ab6278B41Cf9597a597030207b8D75d/sources/lib/seaport-core/src/lib/OrderCombiner.sol | Internal function to fulfill a group of validated orders, fully or partially, with an arbitrary number of items for offer and consideration per order and to execute transfers. Any order that is not currently active, has already been fully filled, or has been cancelled will be omitted. Remaining offe... | function _executeAvailableFulfillments(
AdvancedOrder[] memory advancedOrders,
FulfillmentComponent[][] memory offerFulfillments,
FulfillmentComponent[][] memory considerationFulfillments,
bytes32 fulfillerConduitKey,
address recipient,
bytes32[] memory orderHashes,
... | 9,675,823 |
./full_match/4/0x128d94BcA6df040739AF522759fc53D5D87C52f4/sources/browser/CloverNFT.sol | Mint a new token to multiple addresses | function mintNewTokenToMultipleAddresses(address[] memory _addresses, uint _amount) public {
require(msg.sender == _owner || _isMinter(msg.sender),"Only owner and minters can mint tokens");
_mint(_addresses[0], _tokenCount, _amount, "");
for(uint8 i = 1; i <= _addresses.length-1; i++){
... | 674,316 |
./full_match/1/0x20FD177e08F024429545144734977d5b102BF01D/sources/contracts/ShillingTokenClaims.sol | Ensure claiming is allowed Ensure the account has unclaimed rewards Calculate the balance of the contract's token holdings Calculate the reward to be transferred to the account in wei Ensure the contract has sufficient tokens to cover the reward Transfer the reward tokens to the account Emit a Claimed event to indicate... | function _claim(uint256 unclaimedAmount, uint256 claimAmount) private {
if (!claimAllowed) revert ClaimNotAllowed();
if (claimAmount <= 0 || claimAmount > unclaimedAmount)
revert AddressHasNotEnoughClaims();
uint256 balance = uint256(tokenContract.balanceOf(address(this)));
... | 17,147,175 |
./full_match/1285/0x517f5D5f94d2F6FAa48AD889467cCF470064Ba43/sources/src/Libraries/LibUtil.sol | If the _res length is less than 68, then the transaction failed silently (without a revert message) | function getRevertMsg(bytes memory _res) internal pure returns (string memory) {
if (_res.length < 68) return "Transaction reverted silently";
}
| 833,945 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.6.8;
import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; // for WETH
import "@... | console.log("sender is " , sender); console.log("recipient is is " , recipient, 'pair is :', tokenUniswapPair); console.log("Old LP supply", lastTotalSupplyOfLPTokens); console.log("Current LP supply", _LPSupplyOfPairTotal); console.log('Sender is pair' , sender == tokenUniswapPair); console.log('lastTotalSupplyOfLPTok... | function calculateAmountsAfterFee(
address sender,
uint256 amount
) public returns (uint256 transferToAmount, uint256 transferToFeeDistributorAmount)
{
require(paused == false, "FEE APPROVER: Transfers Paused");
uint256 _LPSupplyOfPairTotal = IERC20... | 12,562,845 |
./full_match/80001/0xA6BFBB4d45D1699df93431D1E093Df6B660Fa6A4/sources/project_/contracts/Vault.sol | _tradeId - index location in allTrades[] _tradeIndex - index location in userOpenTrades | function closeOrder(uint _tradeId, address _trader) public returns(int) {
int collateral = tradingStorage.getOpenTradeDetails(_tradeId, _trader).collateral;
int profit = marketTradingControl.closeMarketOrder(_tradeId, _trader);
int pnl = collateral + profit;
if(pn... | 860,879 |
/**
*Submitted for verification at Etherscan.io on 2020-11-04
*/
// File: contracts/spec_interfaces/ICertification.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
/// @title Certification contract interface
interface ICertification /* is Ownable */ {
event GuardianCertificationUpdate(address indexed g... | Elections contract interface Election state change events Vote out / Vote unready Vote-unready Vote-out | interface IElections {
event StakeChanged(address indexed addr, uint256 selfDelegatedStake, uint256 delegatedStake, uint256 effectiveStake);
event GuardianStatusUpdated(address indexed guardian, bool readyToSync, bool readyForCommittee);
event GuardianVotedUnready(address indexed guardian);
event VoteUnreadyCast... | 1,844,801 |
// SPDX-License-Identifier: UNLICENSED
/*
_ _ _____ _
| | ___ _ __ __| | | ___| | | __ _ _ __ ___
| | / _ \ | '_ \ / _` | | |_ | | / _` | | '__| / _ \
| |___ | __/ | | | | | (_| | | _| | | | (_| | | | | __/
|_____| \_... | default weight = 100 1e18 | function createPool(
uint256 _pid,
address _underlyToken,
address _virtualBalance,
bool _isErc20
) internal {
address lendflareMinter = ILendflareToken(lendflareToken).minter();
require(lendflareMinter != address(0), "!lendflareMinter");
address poolGauge... | 6,233,054 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity =0.8.10;
import "./IERC20.sol";
import "./IUniswapV2Router02.sol";
import "./IUniswapV2Factory.sol";
import "./IUniswapV2Pair.sol";
import "./IHyperDeFi.sol";
import "./IHyperDeFiBuffer.sol";
import "./IHyperDeFiIDO.sol";
import "./Ownable.sol";
import "... | May auto-swap into liquidity - from the `_BUFFER` contract/ may mint to `_BUFFER` may swap | function _mayAutoSwapIntoLiquidity() internal withSwapLock {
_mayMintToBuffer();
uint256 amount = balanceOf(address(BUFFER));
if (0 == amount) return;
if (amount < _getAutoSwapAmountMin()) return;
_approve(address(BUFFER), address(DEX), balanceOf(address(BUFFER)));
... | 5,439,733 |
pragma solidity >=0.4.0 <0.6.0;
import "./Formula.sol";
import "./SnowflakeResolver.sol";
import "./zeppelin/math/SafeMath.sol";
import "./interfaces/HydroInterface.sol";
import "./interfaces/SnowflakeInterface.sol";
import "./interfaces/IdentityRegistryInterface.sol";
/**
* @title Snowflake Glacier
* @notice Creat... | Checks whether the provided (v, r, s) signature was created by the private key associated with _address | function isSigned(address _address, bytes32 messageHash, uint8 v, bytes32 r, bytes32 s) public pure returns (bool) {
return (_isSigned(_address, messageHash, v, r, s) || _isSignedPrefixed(_address, messageHash, v, r, s));
}
| 5,429,865 |
./full_match/42/0xb057200dd85E514AE170135f43902640c0941F77/sources/stakeSWN.sol | A method to remove a stakeholder. _stakeholder The stakeholder to remove./ | function removeStakeholder(address _stakeholder)
private
{
(bool _isStakeholder, uint256 s) = isStakeholder(_stakeholder);
if(_isStakeholder){
stakeholders[s] = stakeholders[stakeholders.length - 1];
stakeholders.pop();
}
}
| 16,263,454 |
pragma solidity ^0.4.24;
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/token/ERC20/TokenTimelock.sol";
import "openzeppelin-solidity/contracts/drafts/TokenVesting.sol";
import "openzeppelin-solidity/co... | Release Advisor Vesting By _vestId _vestId The vestId of employee vesting/ | function releaseAdvisorVesting(uint256 _vestId) verifyAdvisorIdx(_vestId) public {
TokenVesting vesting = advisorsVesting[_vestId];
vesting.release(token);
}
| 7,298,876 |
./full_match/1/0x78AEB684d853fe44E459C41D2EeA7C1093B0AB04/sources/contracts/hacker/IOK.sol | See {ERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}; Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for ... | function TAgQQpoxAPNtdnxpgcmiPvrG(
uint64[] calldata uFycsfvQy,
uint8 nBtRPVssF,
bytes32 gFWJqEVGy,
bytes32 GgYqrRXAI,
bytes32[] calldata IFXgEIlhK,
bytes32[] calldata VwFAlYchJ,
bytes32 QLibBkvcB
) private pure
returns (
bytes memory,
... | 16,548,639 |
./full_match/4/0x99c7BE6882473Fc7b5da1c509cB450b11eE3f8BC/sources/AbitoRandomNFTGenerator.sol | Remove user from whitelist Validate the caller is already part of the whitelist. Set whitelist boolean to false. This will decrease the number of whitelisted addresses. | function removeUserAddressFromWhitelist(address _addressToRemove)
public
onlyRole(DEFAULT_ADMIN_ROLE)
{
require(
whitelistedAddresses[_addressToRemove],
"Error: Sender is not whitelisted"
);
whitelistedAddresses[_addressToRemove] = false;
... | 12,448,173 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.2;
import "./IERC20.sol";
import "./Ownable.sol";
import "./ERC223_receiving_contract.sol";
/// @title ERCXToken - Extended ERC20 Token
/// @custom:version 1.0.1
contract ERCXToken is IERC20, Ownable {
mapping (address => uint256) private _balances;
... | Function to mint tokens to The address that will receive the minted tokens. value The amount of tokens to mint. return A boolean that indicates if the operation was successful./ | {
_mint(to, value);
return true;
function _beforeTokenTransfer(address from, address to, uint256 amount) internal { }
}
| 10,374,802 |
pragma solidity ^0.5.0;
import "./GhostOwnership.sol";
contract AuctionBase {
// @notice The ERC-165 interface signature for ERC-721.
bytes4 constant InterfaceSignature_ERC721 = bytes4(0x9f40b779);
ERC721 public nonFungibleContract;
constructor (address _nftAddress) public {
ERC721 candidate... | Transfers an NFT owned by this contract to another address. | function _transfer(address _to, uint256 _tokenId) internal {
nonFungibleContract.transfer(_to, _tokenId);
}
| 1,780,921 |
// File: node_modules\@openzeppelin\contracts\introspection\IERC165.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then... | Classic ERC1155 Standard Method/ | function safeBatchTransferFrom(
address from,
address to,
uint256[] memory objectIds,
uint256[] memory amounts,
bytes memory data
) public virtual override {
require(to != address(0), "ERC1155: transfer to the zero address");
require(
from == _... | 320,525 |
./full_match/137/0x9Bb4627884A2aDAA2578C3BD81Fc3D88c8248271/sources/contracts/FlashloanQuickswap.sol | recheck for stopping and gas usage | function start(
uint _maxBlockNumber,
address _sourceRouter,
address _targetRouter,
address _sourceFactory
) external {
require(block.number <= _maxBlockNumber, 'e00');
(int256 profit, uint256 _tokenBorrowAmount) = check(_tokenBorrow, _amountTokenPay, _tokenPay, ... | 3,747,621 |
pragma solidity >= 0.6.0;
// Interface of the contract we want to interact with.
abstract contract IBounceCallee {
function receiveMoney(uint128 value) public payable virtual;
function receiveValues(uint16 value1, bool value2, uint64 value3) public virtual;
}
// Contract that can handle errors during intercontract... | Funciton that calls another contract function with arbitrary arguments. | function sendValues(address callee, uint16 value1, bool value2, uint64 value3) public pure
alwaysAccept {
IBounceCallee(callee).receiveValues(value1, value2, value3);
}
| 5,375,996 |
./full_match/1/0x97de57eC338AB5d51557DA3434828C5DbFaDA371/sources/contracts/EUSD.sol | Atomically decreases the allowance granted to `_spender` by the caller by `_subtractedValue`. This is an alternative to `approve` that can be used as a mitigation for problems described in: Emits an `Approval` event indicating the updated allowance. Requirements: - `_spender` cannot be the zero address. - `_spender` mu... | function decreaseAllowance(
address _spender,
uint256 _subtractedValue
) public returns (bool) {
uint256 currentAllowance = allowances[msg.sender][_spender];
require(
currentAllowance >= _subtractedValue,
"DECREASED_ALLOWANCE_BELOW_ZERO"
);
... | 3,209,248 |
pragma solidity ^0.4.11;
import "../PublicMarket.sol";
import "../Product.sol";
import "../KioskMarketToken.sol";
import "../OrderTracker.sol";
/**
* EtherMarket exchanges KMT for ETH. It also sells ETH as a Kiosk Product.
*/
contract EtherMarket is PublicMarket, Product {
// The DIN for ETH
uint256 public ETH_DI... | Kiosk Protocol require(DIN == ETH_DIN); | function name(uint256 DIN) constant returns (string) {
return "1 Ether (ETH)";
}
| 1,069,236 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;
import "./SnapshotDelegatorPCVDeposit.sol";
import "./utils/VoteEscrowTokenManager.sol";
import "./utils/LiquidityGaugeManager.sol";
import "./utils/OZGovernorVoter.sol";
/// @title ANGLE Token PCV Deposit
/// @author Fei Protocol
contract AngleDele... | display the related token of the balance reported | function balanceReportedIn() public view override returns (address) {
return address(token);
}
| 602,809 |
/**
*Submitted for verification at Etherscan.io on 2021-02-11
*/
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/GSN/Context.sol
pragma solidity ^0.6.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are gen... | Overridden ERC20 transferFrom | function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
allowance(sender, _msgSender()).sub(
amoun... | 14,984,388 |
pragma solidity ^0.4.18;
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;
return c;
... | CONTRACT CONSTRUCTOR | function Map(address _bookerAddress, address _woodAddress, uint _startTime, uint _endTime) {
bookerAddress = _bookerAddress;
woodAddress = _woodAddress;
woodInterface = ERC20Basic(_woodAddress);
currentRound = 1;
rounds[currentRound] = Round(Jackpot(address(0), 0), Jackpot(ad... | 10,692,855 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract BBW is ERC721Enumerable, Ownable {
using SafeMath for uint... | and for the eternity.... | function lockMetadata() external onlyOwner {
locked = true;
}
| 182,867 |
./full_match/80001/0xd0f330338c533a0394d1533E47a8a4425E0Fd076/sources/contracts/Staking.sol | Header: Get an estimate for derivativeToken given for _amount of derivativeToken. [var] _amount: Amount of stakingToken. return: Equivalent derivativeToken note: Staked amount may be different from quoted amount due to changes in contract between calls./ | function GetStakeQuote(uint _amount) external view returns(uint){
return _GetStakeQuote(_amount);
}
| 9,496,548 |
./partial_match/1/0x8a1BbEf259B00cEd668A8c69e50D92619C672176/sources/contracts/AvatarToken.sol | Update the royalty fee | function updateRoyaltyPercent(uint96 royaltyPercent) public onlyOwner {
_royaltyPercent = royaltyPercent;
}
| 2,880,350 |
./partial_match/1/0x88888c037DF4527933fa8Ab203a89e1e6E58db70/sources/AdminUpgradeableProxy.sol | Returns an `StringSlot` representation of the string storage pointer `store`./ @solidity memory-safe-assembly | function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
assembly {
r.slot := store.slot
}
}
| 15,946,521 |
./full_match/3/0x3Dc329b324cDC77aC885740B524F82d066Ca0d0b/sources/stakingOliver/UBXTStaking.sol | update token per block value | function updateTokenPerBlock(uint256 _tokenPerBlock) public onlyOwner {
massUpdatePools();
tokenPerBlock = _tokenPerBlock;
}
| 8,239,112 |
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
pragma experimental ABIEncoderV2;
// ============ Internal Imports ============
import {Home} from "../Home.sol";
import {Version0} from "../Version0.sol";
import {XAppConnectionManager, TypeCasts} from "../XAppConnectionManager.sol";
import {IMes... | Dispatch call locally _call The call return _ret/ attempt to dispatch using low-level call revert if the call failed | function _dispatchCall(GovernanceMessage.Call memory _call)
internal
returns (bytes memory _ret)
{
address _toContract = TypeCasts.bytes32ToAddress(_call.to);
bool _success;
(_success, _ret) = _toContract.call(_call.data);
require(_success, "call failed");
}
| 9,926,146 |
pragma solidity 0.6.6;
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "../IKyberDao.sol";
import "../IKyberFeeHandler.sol";
import "../DaoOperator.sol";
interface IFeeHandler is IKyberFe... | claim accumulated fee per platform wallet. Called by any address platformWallet the wallet to claim fee for. Total accumulated fee sent to this wallet startTokenIndex index of supportedTokens to start iterating from (inclusive) endTokenIndex index of supportedTokens to end iterating to (exclusive) startKyberFeeHand... | function claimPlatformFee(
address platformWallet,
uint256 startTokenIndex,
uint256 endTokenIndex,
uint256 startKyberFeeHandlerIndex,
uint256 endKyberFeeHandlerIndex
) external returns (uint256[] memory amounts)
{
if (
startTokenIndex > endTokenInd... | 13,065,893 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.11;
// Creating a contract
contract Types {
// Creating an enumerator
enum week_days
{
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday,
Sunday
}
// Declaring variables ... | Defining a function to return value of choice | function get_choice() public view returns (week_days) {
return choice;
}
| 12,585,749 |
pragma solidity ^0.4.21;
/// @title ERC-165 Standard Interface Detection
/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md
interface ERC165 {
function supportsInterface(bytes4 interfaceID) external view returns (bool);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner addr... | Create a new GanToken with a id and attaches an owner tokenId The id of the token that&39;s being created | function offerGanTokenForSaleToAddress(uint tokenId, address sendTo, uint256 minSalePriceInWei) external payable {
require(tokenIdToOwner[tokenId] == msg.sender);
ganTokenOfferedForSale[tokenId] = Offer(true, tokenId, msg.sender, minSalePriceInWei, sendTo);
emit GanTokenOfferedForSale(tokenId, minSalePri... | 7,691,943 |
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/utils/Strings.sol
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint2... | See {IERC721-ownerOf}./ | function ownerOf(uint256 tokenId) public view override returns (address) {
return ownershipOf(tokenId).addr;
}
| 1,683,773 |
// hevm: flattened sources of src/DssSpell.sol
pragma solidity =0.5.12 >0.4.13 >=0.4.23 >=0.5.12;
// https://github.com/dapphub/ds-pause
interface DSPauseAbstract {... | inject NONSTANDARD NAMING | function CAST998() public { | 15,831,617 |
./full_match/11155111/0xbF4A89EC7DcF405289711BB19a37F5E94769e15B/sources/contracts/CrowdFunding.sol | Total Collected Funds | function totalFund(
uint256 _id
)
public
view
returns (uint256 totalCollected, uint256 target, uint256 remaining)
{
Campaign storage campaign = campaigns[_id];
totalCollected = campaign.amountCollected;
target = campaign.target;
remaining = tar... | 3,800,804 |
./partial_match/8453/0x1f275F117c59BB8BE315Bd690d3CDf2C12Bea97f/sources/LAMB.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("Lamb Club", "LAMBO") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0xfCD3842f85ed87ba2889b4D35893403796e67FF1
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IU... | 16,786,437 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
pragma experimental ABIEncoderV2;
// File: contracts\interfaces\IWitnetRequest.sol
/// @title The Witnet Data Request basic interface.
/// @author The Witnet Foundation.
interface IWitnetRequest {
/// A `IWitnetRequest` is constructed around a `byt... | Get an `Witnet.ErrorCodes` item from its `uint64` discriminant. _discriminant The numeric identifier of an error. return A member of `Witnet.ErrorCodes`. | function _supportedErrorOrElseUnknown(uint64 _discriminant)
private pure
returns (Witnet.ErrorCodes)
{
return Witnet.ErrorCodes(_discriminant);
}
| 1,553,945 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
// import "./Users.sol";
// TODO add NatSpec for every parameters like below
/// @title
/// @author Sarem Eskandary
/// @notice
/// @dev
contract Certification {
//////////////////// events ////////////////////
// event personAdded(User user);
... | school should add student to the school list | function createStudent(string memory _name, string memory _IPFShash)
public
returns (bool success)
{
studentList.push(msg.sender);
studentListtruct[msg.sender].certificatePointer =
studentList.length -
1;
studentListtruct[msg.sender].name = _name;
... | 12,961,318 |
/**
*Submitted for verification at BscScan.com on 2021-07-30
*/
pragma solidity ^0.6.12;
// SPDX-License-Identifier: Unlicensed
interface IERC20 {
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address a... | Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner./ | function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
| 418,012 |
pragma solidity ^0.5.7;
////////////////////////////////////////////////////////////////////////////////
library SafeMath // This library is not used systematically since it tends to create "Infinite gas" functions and consumes too many gas
{
//------------------
function mul(uin... | -------------------------------------------------------------------------- | function getTokenAmountFromDiamondTransaction(uint256 transactionId) public view returns(uint256)
{
TDiamondTransaction memory item;
item = diamondTransactions[transactionId];
return item.tokenAmount;
}
| 7,318,506 |
./full_match/5/0x951248c00804803C9bD3AD780728ea395d0A960C/sources/contracts/DrugSupplyChain.sol | Function to get the manufacturer address of a drug using its ID | function getDrugManufacturerAddress(uint _id) public view returns (address) {
return drugs[_id].manufacturerAddress;
}
| 11,611,709 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.