file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
./full_match/137/0x751D346B92f3dce8813E6b6E248a11C534F4BdEa/sources/contracts/uniswap/UniswapV2Router02.sol | refund dust eth, if any | function swapETHForExactTokens(
uint256 amountOut,
address[] calldata path,
address to,
uint256 deadline
)
external
payable
virtual
override
ensure(deadline)
returns (uint256[] memory amounts)
{
require(path[0] == WETH, "UniswapV2Router: INVALID_PATH");
amounts = Un... | 4,775,915 |
// SPDX-License-Identifier: MIT
/*
βββββββββββ βββββββ βββββββββββββββ ββββββββββ βββββββββ βββ βββββββ
ββββββββββββ βββββββββ βββββββββββββββ ββββββββββββββββββββββββββββββββ
ββββββββ βββββββ ββββββ βββ βββ ββββββββ βββββββ βββ βββββββ
ββββββββ βββββ ββββββββββ βββ ββββββββ... | our implementation may even be pure | function tokenURI(uint256 tokenID) external view returns (string memory); | 247,200 |
pragma solidity ^0.4.18;
import "../crowdsale/validation/CappedCrowdsale.sol";
import "../crowdsale/emission/MintedCrowdsale.sol";
import "../crowdsale/price/IncreasingPriceCrowdsale.sol";
import "../crowdsale/distribution/FinalizableCrowdsale.sol";
import "../crowdsale/distribution/PostDeliveryCrowdsale.sol";
import ... | Adds list of addresses to whitelist. Not overloaded due to limitations with truffle testing. _beneficiaries Addresses to be added to the whitelist/ | function addManyToWhitelist(address[] _beneficiaries) external onlyOwner {
for (uint256 i = 0; i < _beneficiaries.length; i++) {
if(mBackers[_beneficiaries[i]].isValid)
{
whitelist[_beneficiaries[i]] = true;
}
}
}
| 12,784,677 |
./full_match/1/0x733015E8606F4f079828f0bf71A2FC7135F9d119/sources/src/StakingManager.sol | Disables the bid whitelist Allows both regular users and whitelisted users to bid | function disableWhitelist() public onlyOwner {
whitelistEnabled = false;
emit WhitelistDisabled();
}
| 17,041,743 |
./full_match/3/0x1811b34a601D9A2d351104cd34F0DfA16a6aEFf7/sources/browser/Business_Voter.sol | Comment it for quicker test | function unstake(address _erc20TokenAddress, uint256 _pollId, address _userAccount) override public returns (uint256) {
require(isPollExists(_erc20TokenAddress, _pollId), "Poll doesn't exist");
Poll storage poll = addressToPollById[_erc20TokenAddress][_pollId];
require(poll.endTime ... | 8,236,002 |
// SPDX-License-Identifier: Apache-2.0
/******************************************************************************
* Copyright 2020 IEXEC BLOCKCHAIN TECH *
* *
* Licensed under the Apache License, Ve... | Contract initializer. _logic Address of the initial implementation. _data Data to send as msg.data to the implementation to initialize the proxied contract. It should include the signature and the parameters of the function to be called, as described in This parameter is optional, if no data is given the initializati... | function initialize(address _logic, bytes memory _data) public payable {
require(_implementation() == address(0));
assert(IMPLEMENTATION_SLOT == keccak256("org.zeppelinos.proxy.implementation"));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
... | 12,567,161 |
./full_match/1/0xABE46f13C833Ab07bf9e523F485B53c9a633DD60/sources/contracts/IdleCDO.sol | Set tranche Rewards contract addresses (for tranches incentivization) _AAStaking IdleCDOTrancheRewards contract address for AA tranches _BBStaking IdleCDOTrancheRewards contract address for BB tranches Read state variable once Remove allowance for incentive tokens for current staking contracts Remove allowace for tra... | function setStakingRewards(address _AAStaking, address _BBStaking) external {
_checkOnlyOwner();
address _AATranche = AATranche;
address _BBTranche = BBTranche;
address[] memory _incentiveTokens = incentiveTokens;
address _currAAStaking = AAStaking;
address _currBBStaking = BBStaking;
bool... | 8,321,931 |
pragma solidity ^0.4.18;
pragma experimental "v0.5.0";
pragma experimental ABIEncoderV2;
pragma experimental SMTChecker;
/**********************************************************************
* example.sol *
*****************************************************... | fallback / `i` will be `uint8`, so this is an endless loop/ | function () payable {
that will consume all gas and eventually throw.
for (var i = 0; i < 257; i++) {
owner++;
}
}
| 2,550,911 |
pragma solidity ^0.4.19;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than... | Transfer token for a specified address _to The address to transfer to. _value The amount to be transferred./ | function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= balances[msg.sender]);
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
| 6,749,628 |
./partial_match/1/0x21b1B12FbE9bd04F1c729CBAA95863f9Fbe35c89/sources/YOYOFI.sol | Function to set approval count variable value. _value uint The value by which approvalCounts variable will be set./ | function setApprovalCounts(uint _value) public isController {
approvalCounts = _value;
}
| 2,686,519 |
./full_match/1/0xF647f29860335E064fAc9f1Fe28BC8C9fd5331b0/sources/contracts/Phase3_OnChainMfers.sol | update unlciamed metadata | function updateUnclaimedMetadata(uint256 _index, string memory _newString) external onlyOwner
{
UnclaimedMetadata[_index] = _newString;
}
string private SurpriseStuff;
| 16,475,197 |
//Address: 0xdbfebf00f4601c176bdb61bf65f2abc9e213e065
//Contract name: EOSclassic
//Balance: 0 Ether
//Verification Date: 6/3/2018
//Transacion Count: 15
// CODE STARTS HERE
pragma solidity ^0.4.21;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/iss... | Return the registered EOS public key for the passed address Get any key registered with EOSclassic EOSclassic key was registered; return this over the original crowdsale address EOSclassic doesn't have an EOS public key registered; return any original crowdsale key | function getEOSKeyFor(address _address) public view returns (string)
{
string memory _eosKey;
_eosKey = keys[_address];
if (bytes(_eosKey).length > 0) {
return _eosKey;
_eosKey = queryEOSCrowdsaleKey(_address);
return _eosKey;
}
}
| 5,363,739 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;
import {ERC20Permit} from "../external/openzeppelin/contracts/drafts/ERC20Permit.sol";
import {AccessControl} from "../external/openzeppelin/contracts/access/AccessControl.sol";
import {Context} from "../external/openzeppelin/contracts/utils/Context.sol";
i... | See {IERC20-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 transferFrom(address sender, address recipient, uint256 amount) public
override(ERC20, IERC20) returns (bool) {
_transfer(sender, recipient, amount);
if (allowance(sender, _msgSender()) != uint256(-1)) {
_approve(
sender,
_msgSender(),
allowance(sender, _msgSender()).s... | 1,147,958 |
/**
*Submitted for verification at Etherscan.io on 2021-12-23
*/
// Sources flattened with hardhat v2.6.8 https://hardhat.org
// SPDX-License-Identifier: MIT
// File @openzeppelin/contracts/utils/[emailΒ protected]
pragma solidity >=0.6.0 <0.8.0;
/*
* @dev Provides information about the current execution context,... | mint ALD reward. _recipient The address of to receive ALD token. _amount The amount of token. | function mintRewards(address _recipient, uint256 _amount) external override {
require(isRewardManager[msg.sender], "Treasury: not approved manager");
IALD(ald).mint(_recipient, _amount);
emit RewardsMinted(msg.sender, _recipient, _amount);
}
| 2,108,269 |
// SPDX-License-Identifier: MIT
pragma solidity >0.5.0 <0.8.0;
library Lib_RingBuffer {
using Lib_RingBuffer for RingBuffer;
/***********
* Structs *
***********/
struct Buffer {
uint256 length;
mapping (uint256 => bytes32) buf;
}
struct RingBuffer {
bytes32 con... | Pushes a single element to the buffer. _self Buffer to access. _value Value to push to the buffer./ | function push(
RingBuffer storage _self,
bytes32 _value
)
internal
{
RingBufferContext memory ctx = _self.getContext();
_self.push(
_value,
ctx.extraData
);
}
| 6,403,437 |
pragma solidity 0.4.19;
/**
* Owned Contract
*
* This is a contract trait to inherit from. Contracts that inherit from Owned
* are able to modify functions to be only callable by the owner of the
* contract.
*
* By default it is impossible to change the owner of the contract.
*/
contract Owned {
... | Buy omega egg from the OmegaEggSale contract. The cost of an omega egg is 0.09 ether. This contract accepts any amount equal or above 0.09 ether to buy an omega egg. In the case of higher amounts being sent, the contract will refund the difference. To successully buy an omega egg, five conditions have to be met: 1. Th... | function buyOmegaEgg() payable external {
require(msg.value >= 0.09 ether);
require(START_DATE <= now && now < END_DATE);
require(eggOwners[msg.sender] == false);
uint8 currentTimeSlot = getTimeSlot(now);
require(remainingEggs[currentTimeSlot] > 0);
remainingEggs[c... | 881,482 |
./partial_match/1/0x9156c5a5d82580b2D00eD40C6B43414f966Ec516/sources/MultichainProvider.sol | Sets the controller This function can be called by the owner only controllerAddr The address of the controller/ Checks State changes | function setController (address controllerAddr) public onlyOwner {
require(controllerAddr != address(0), "Controller address required");
require(controllerAddr != owner, "Owner cannot be the Controller");
require(controllerAddr != controllerAddress, "Controller already set");
emit O... | 9,377,855 |
/**
*Submitted for verification at Etherscan.io on 2021-01-20
*/
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity >=0.7.6;
pragma abicoder v2;
interface IStakePoolCreator {
function version() external returns (uint256);
function create() external returns (address);
}
interface IStakePool... | bytes4(keccak256(bytes('approve(address,uint256)'))); | function factory() external view returns (address);
function controller() external view returns (address);
function formula() external view returns (address);
function WETH() external view returns (address);
function addLiquidity(
address pair,
address tokenA,
address tok... | 2,332,932 |
pragma solidity ^0.4.16;
import "./Token.sol";
import "./NettingChannelContract.sol";
library ChannelManagerLibrary {
string constant public contract_version = "0.2._";
struct Data {
Token token;
address registry_address;
address[] all_channels;
mapping(bytes32 => uint) party... | Get the address of channel with a partner partner The address of the partner return The address of the channel | function getChannelWith(Data storage self, address partner)
public
constant
returns (address)
{
bytes32 party_hash = partyHash(msg.sender, partner);
uint channel_pos = self.partyhash_to_channelpos[party_hash];
if (channel_pos != 0) {
return self.all_c... | 12,808,378 |
./partial_match/1/0xFB5653E64191aEef7513D1a8ffd53FB65db326B9/sources/StablesPoolCash.sol | Withdraw LP tokens from MasterChef. | function withdraw(uint256 _pid, uint256 _amount) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
updatePool(_pid);
if (pool.poolType == 10) {
rebasePool(_pid);
if (user.amount > 0) {
user.amo... | 16,030,665 |
/**
* @title: Idle Token Governance main contract
* @summary: ERC20 that holds pooled user funds together
* Each token rapresent a share of the underlying pools
* and with each token user have the right to redeem a portion of these pools
* @author: Idle Labs Inc., idle.finance
*/
pragma solidi... | It allows owner to set the max unlent asset percentage (1000 == 1% of unlent asset max) _perc : max unlent perc where 100000 is 100%/ | function setMaxUnlentPerc(uint256 _perc)
external onlyOwner {
require((maxUnlentPerc = _perc) <= 100000, "HIGH");
}
| 1,829,057 |
./full_match/1/0x864a1CBB53b9Dea3691a6974B456088C2771DcAd/sources/browser/Bar.sol | Get the pending BOOGIEs for a user from 1 pool Make sure that boogieReward won't push the total supply of BOOGIE past boogie.MAX_SUPPLY() | function _pendingBoogie(uint256 _pid, address _user) internal view returns (uint256) {
if (_pid == 0 && boogiePoolActive != true) return 0;
PoolInfo memory pool = poolInfo[_pid];
UserInfo memory user = userInfo[_pid][_user];
uint256 accBoogiePerShare = pool.accBoogiePerShare;
... | 4,927,144 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ERC721.sol";
contract Dominapes is ERC721 {
event Mint(address indexed from, uint256 indexed tokenId);
modifier callerIsUser() {
require(tx.origin == msg.sender, "The caller is another contract");
_;
}
modifier saleSta... | Give random slices to the provided address/ | function premintSlices()
internal
onlyOwner
{
require(availableSlices.length >= giveawayCount, "No slices left to be claimed");
require(
!premintingComplete,
"You can only premint the horses once"
);
totalMintedTokens += giveawayCount;
... | 13,740,926 |
pragma ton-solidity >=0.30.0;
contract PrimaryInputVerificationExample {
bytes constant vkey = hex"4399cf35940d0604a273e29525f7605687d98bfe662218c6562bb1c3bdc3bd4bf0aca8554005d192a4f65f18d437920fd8323c53c1ba15342ad547424c6087b6120c2d915625502192981ca3e127a81c3955efcfae20ad8d1637f347e1baa90205e84ae286d60e327520ea40... | You should change/add/remove arguments according to your circuit. | function verify(bytes proof) public returns (bool) {
require(proof.length == PROOF_SIZE);
tvm.accept();
string blob_str = proof;
blob_str.append(encode_little_endian(HASHING_LIST_SIZE,4));
for (uint i = 0; i < HASHING_LIST_SIZE; i++) {
blob_str.append(uint256_to... | 1,030,018 |
/**
*Submitted for verification at Etherscan.io on 2022-04-03
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity 0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (by... | exclude from paying fees or having max transaction amount | constructor() ERC20("CULTI", "CULT INU") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_un... | 2,276,231 |
// SPDX-License-Identifier: MIT
// solhint-disable-next-line compiler-version
pragma solidity ^0.8.0;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since a proxied contract can't have a constructor, it's common to move con... | Returns sum of token locked in other contracts and token stored in the pool. Default tokensHere. It will be in token defined decimals./ Hook that is called just before burning tokens. This withdraw collateral from withdraw queue _share Pool share in 18 decimals/ | function _beforeBurning(uint256 _share) internal virtual returns (uint256) {}
| 166,339 |
./partial_match/3/0xBc9EfF59aA57DbF6C03445CfcEfF88db34a4A819/sources/EdcoinStake.sol | ------------------------------------------------------------------------ Get the number of tokens staked by a staker _staker the address of the staker ------------------------------------------------------------------------ | function yourStakedEDC(address staker) external view returns(uint256 stakedEDC){
return stakers[staker].stakedTokens;
}
| 5,093,592 |
// SPDX-License-Identifier: BUSL-1.1
/*
Business Source License 1.1
License text copyright Β© 2017 MariaDB Corporation Ab, All Rights Reserved.
"Business Source License" is a trademark of MariaDB Corporation Ab.
Terms
The Licensor hereby grants you the right to copy, modify, create derivative
works, redistribute, an... | refer to https:github.com/Uniswap/solidity-lib/blob/master/contracts/libraries/TransferHelper.sol we allow only successfull calls | function withdrawEth(
address _to,
uint256 _value
)
external
onlyFactory
{
if (!success) {
revert CerbySwapV1_Vault_SafeTransferNativeFailed();
}
}
| 5,954,547 |
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.6.11;
pragma experimental ABIEncoderV2;
// ====================================================================
// | ______ _______ |
// | / _____________ __ __ / ____(_____ ____ _____ ________ ... | If this were not internal, and source_address had an infinite approve, this could be exploitable (pull funds from source_address and stake for an arbitrary staker_address) Pull the tokens from the source_address Staking token supply and boosted supply Staking token balance and boosted balance | function _stake(address staker_address, address source_address, uint256 amount) internal nonReentrant updateReward(staker_address) {
require((paused == false && migrationsOn == false) || valid_migrators[msg.sender] == true, "Staking is paused, or migration is happening");
require(amount > 0, "Cannot... | 7,271,201 |
./partial_match/7672/0x2D2C04254fEc8Dcb4f0476FDf98B7FF7b298E820/sources/lib/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol | verify the nonce `_idx` for `_from` (obtained via `getNonce(...)`) "idx" is a 256bits (unsigned) integer, where: - the 128 leftmost bits = channelId and - the 128 rightmost bits = nonce within the channel from caller address idx (channel id + nonce within the channel)/ idx % (1 << 128) = nonce (idx >> ... | function _isValidNonce(address from, uint256 idx) internal view virtual returns (bool) {
return (idx % (1 << 128)) == (_nonceStore[from][idx >> 128]);
}
| 3,492,723 |
./full_match/1/0xfacd2eC4647df2Cb758F684C2aAAB56A93288f9e/sources/contracts/PolygonTokenBridger.sol | Called by Polygon SpokePool to send tokens over bridge to contract with the same address as this. The caller of this function must approve this contract to spend amount of token. token Token to bridge. amount Amount to bridge./ In the wMatic case, this unwraps. For other ERC20s, this is the burn/send action. This ta... | function send(PolygonIERC20 token, uint256 amount) public nonReentrant onlyChainId(l2ChainId) {
token.safeTransferFrom(msg.sender, address(this), amount);
token.withdraw(token.balanceOf(address(this)));
if (address(token) == l2WrappedMatic)
}
| 4,938,330 |
/**
*Submitted for verification at Etherscan.io on 2020-12-16
*/
pragma solidity ^0.6.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // si... | this recreates the message that was signed on the client | function claimPayment(uint256 amount, uint256 nonce, bytes memory signature) public {
require(!usedNonces[nonce]);
usedNonces[nonce] = true;
bytes32 message = prefixed(keccak256(abi.encodePacked(msg.sender, amount, nonce, this)));
require(recoverSigner(message, signature) == owner)... | 7,891,274 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.6;
// Truffle
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@chainlink/contracts/v0.6/ChainlinkClient.sol";
// import "@chainlink/contracts/... | Make the Chainlink request. | function remoteMintTwenty(uint256 tokenId) private returns (bytes32 requestId) {
Chainlink.Request memory request = buildChainlinkRequest(jobId, address(this), this.fulfillTwenty.selector);
string memory url = string(
abi.encodePacked(
"&token=", tokenId.toString()
)
);
request.add... | 921,102 |
pragma solidity ^0.8.10;
// interfaces
import "./interfaces/IERC20.sol";
import "./interfaces/ITreasury.sol";
import "./interfaces/IAllocator.sol";
import "./interfaces/ITreasuryExtender.sol";
// types
import "./types/OlympusAccessControlledV2.sol";
// libraries
import "./libraries/SafeERC20.sol";
error TreasuryExt... | Returns funds from an Allocator to the Treasury. External hook: Logic is handled in the internal function. Can only be called by the Guardian. This function is going to withdraw `amount` of allocated token from an Allocator back to the Treasury. Prior to calling this function, `deallocate` should be called, in or... | function returnFundsToTreasury(uint256 id, uint256 amount) external override onlyGuardian {
IAllocator allocator = allocators[id];
uint256 allocated = allocatorData[allocator][id].holdings.allocated;
uint128 gain = allocatorData[allocator][id].performance.gain;
address token = addres... | 377,221 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "./utils/ReentrancyGuard.sol";
import "./libraries/TransferHelper.sol";
import "./utils/Ownable.sol";
import "./interfaces/IERC20.sol";
import "./interfaces/OracleWrapper.sol";
contract CHBPublicSale is Ownable, ReentrancyGuard {
uint256 public totalTo... | Updates USDT Oracle Address | function updateBNBorETHOracleAddress(address _BNBorETHOracleAddress)
external
onlyOwner
{
BNBorETHOracleAddress = _BNBorETHOracleAddress;
}
| 10,108,055 |
./partial_match/1/0x695264D984A5E45C2d89f261C8668d6C1F7D214c/sources/IporProtocolRouter.sol | Gets IPOR Protocol Owner on Router return IPOR Protocol Owner address | function owner() external view returns (address) {
return OwnerManager.getOwner();
}
| 16,153,384 |
pragma solidity ^0.4.25;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath for uint256;
/********************************************************************************************/
/* DATA VARIABL... | Get operating status of contract return A bool that is the current operating status/ | function isOperational()
public
view
isCallerAuthorized()
returns(bool)
{
return operational;
}
| 13,019,180 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IStakingRewardsVault.sol";
import "../commons/MetaTransactionsMixin.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
... | Update reward variables of the given pool. _pid The index of the pool. See `poolInfo`. return pool Returns the pool that was updated./ | function updatePool(uint256 _pid) public returns (PoolInfo memory pool) {
pool = poolInfo[_pid];
if (block.timestamp <= pool.lastRewardTime) {
return pool;
}
uint256 lpSupply = lpToken[_pid].balanceOf(address(this));
if (lpSupply > 0) {
uint... | 13,138,813 |
./partial_match/97/0xd2d39bC20A430Fa8CB4bFdF87A2E253Aa444Fc7C/sources/BondV2.sol | ============================== HELPERS ================================ | function assetListedCount() public view returns (uint256 count){
return listedBondAssets.length;
}
| 11,437,630 |
./full_match/44787/0x50167A410307aF7c7fCC05aD97c4B35B1E757Aae/sources/src/SpiralsStaking.sol | Helper function for locking CELO | function lock(uint256 _value) internal {
require(_value > 0, "LOCKING_ZERO");
}
| 13,242,876 |
pragma solidity ^0.4.24;
/** ----------------------MonetaryCoin V1.0.0 ------------------------*/
/**
* Homepage: https://MonetaryCoin.org Distribution: https://MonetaryCoin.io
*
* Full source code: https://github.com/Monetary-Foundation/MonetaryCoin
*
* Licenced MIT - The Monetary Foundation 2018
... | Allows the current GDPOracle to transfer control to a newOracle. The new GDPOracle need to call claimOracle() to finalize newOracle The address to transfer ownership to./ | function transferGDPOracle(address newOracle) public onlyGDPOracle {
pendingGDPOracle_ = newOracle;
}
| 911,000 |
./partial_match/3/0xd3443DCf2670c153f4959A2B557810cD68E73680/sources/PopChef.sol | Update pending info | function updatePendingInfo(address[] memory _addresses, uint16[] memory _multiplier) public {
require(msg.sender == devaddr, "dev: wut?");
require(_addresses.length == _multiplier.length, "pendingInfo: length?");
require(startTime + 365 days >= now, "pendingInfo: rewards over");
if (... | 5,167,699 |
./full_match/137/0x1f83a91719983136B7F281e778AcFf6b1186c0CB/sources/contracts/prebuilts/unaudited/airdrop/MigrateERC721.sol | Initiliazes the contract, like a constructor. | function initialize(address[] memory _trustedForwarders) external initializer {
__ERC2771Context_init_unchained(_trustedForwarders);
}
Airdrop logic
| 4,757,588 |
./full_match/1/0x032Ba44EB2DB607d2F9424b90e191BbFb51152A1/sources/contracts/TwabRewards.sol | _userClaimedEpochs Record of epochs already claimed by the user _epochId Epoch id to check return true if the rewards have already been claimed for the given epoch, false otherwise/ | function _isClaimedEpoch(uint256 _userClaimedEpochs, uint8 _epochId)
internal
pure
returns (bool)
{
return (_userClaimedEpochs >> _epochId) & uint256(1) == 1;
}
| 16,513,578 |
//Address: 0x2a203d5ab550d1abf1d40a25883c0ce4170ab0f0
//Contract name: Crowdsale
//Balance: 0 Ether
//Verification Date: 12/10/2017
//Transacion Count: 4
// CODE STARTS HERE
pragma solidity ^0.4.11;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
functi... | 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/DO NOT FORGET TO CHANGE THISThis is the wallet where all the ETH will go! durationInMinutes = _durationInMinutes;Here will come the checksum address we got... | function Crowdsale() {
tokenReward = token(addressOfTokenUsedAsReward);
}
bool public started = false;
| 12,967,355 |
/**
* @authors: [@unknownunknown1]
* @reviewers: [@ferittuncer, @clesaege, @satello*, @mtsalenc*, @remedcu]
* @auditors: []
* @bounties: [{ link: https://github.com/kleros/kleros/issues/155, maxPayout: 100 ETH }]
* @deployments: []
* @tools: [MythX]
*/
/* solium-disable security/no-block-members */
/* sol... | Withdraws submitted transaction list. Reimburses submission deposit. Withdrawal is only possible during the first half of the submission period and during withdrawPeriod seconds after the submission is made. _submissionID Submission's index in the array of submitted lists of the current sesssion. _listHash Hash of... | function withdrawTransactionList(uint _submissionID, bytes32 _listHash) public {
Session storage session = sessions[sessions.length - 1];
Submission storage submission = submissions[session.submittedLists[_submissionID]];
require(now - lastApprovalTime <= submissionTimeout / 2, "Lists can be... | 12,753,164 |
./partial_match/1/0xBba1Acf75e69898Deb876e193A8069F8795a977C/sources/RonaldoInu.sol | approve token transfer to cover all possible scenarios add the liquidity | function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
_approve(address(this), address(uniswapV2Router), tokenAmount);
address(this),
tokenAmount,
marketingWallet1,
block.timestamp
);
}
| 4,416,288 |
/**
*Submitted for verification at Etherscan.io on 2021-05-01
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
// Part: IFund
interface IFund {
function underlying() external view returns (address);
function deposit(uint256 amountWei) external;
function depositFor(uint256 amountWei, addre... | Invests all underlying assets into our yv2 vault./ deposits the entire balance to yv2 vault | function _investAllUnderlying() internal {
if (!investActivated) {
return;
}
require(
!IYVaultV2(yVault).emergencyShutdown(),
"Vault is emergency shutdown"
);
uint256 underlyingBalance = IERC20(underlying).balanceOf(address(this));
... | 10,680,340 |
./full_match/77/0xB083410baBCF71f10a8958DF948bFE1eFC32987e/sources/contracts/official/CUSIT001/CUSIT001Token.sol | Owner function to pay dividends to all token holders/ increase the total amount paid snapshot the tokens at the moment the payment is done check if we have paid everything | function setPaidDividends() public onlyOwner {
require(!bCompletedPayment, "Dividends payment is already completed");
nTotalDividendsPaid = nTotalDividendsPaid.add(nPaymentValue);
nCurrentSnapshotId = _snapshot();
if (nCurrentSnapshotId == TOTAL_PERIODS) {
bCompletedPayment = true;
}
... | 5,047,368 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.4;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/math/Math.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "./li... | TODO: verify check additional state changes other than transfer | function commitClaim(
address claimer,
uint256 claimAmount,
uint256 claimEndTime,
IClaimingRegistry.ClaimStatus status
) external override onlyClaimVoting withPremiumsDistribution updateBMICoverStakingReward {
updateEpochsInfo();
uint256 cover = policyHolders[clai... | 9,946,722 |
./full_match/40/0x4Cab8a61C939A95b49977605548B7910a34Ec2C0/sources/project_/contracts/CustomBill.sol | _value uint return _payout uint return _fee uint/ | function payoutFor(uint256 _value ) public view returns (uint256 _payout, uint256 _fee) {
If fee is in payout then takes in the already calculated value. If fee is in principal token
if(feeInPayout) {
uint total = _value * 1e18 / billPrice();
_fee = total.mul(currentFee()).div(... | 9,544,660 |
./full_match/80001/0xFb5b58c5D536F42f15484f7ecf5814C028b42A4a/sources/DigitalaxGarmentNFTv2.sol | Returns whether `spender` is allowed to manage `tokenId`. Requirements: - `tokenId` must exist./ | function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = DigitalaxERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || Dig... | 5,688,407 |
./partial_match/3/0x12A740BA21FB3c5c20aA05fd96107845Dc128e59/sources/TLAMB.sol | lambmap[msg.sender] = _remarks; | function transferRemarks(address _to, uint256 _value,bytes32 _remarks) public whenNotPaused returns (bool) {
bool result = transfer(_to,_value);
emit TransferRemarks(msg.sender, _to, _value,_remarks);
return result;
}
| 5,196,757 |
./partial_match/1/0x45A353132143f475B355620aD9d7413D0222Ea04/sources/APP.sol | Create `mintedAmount` tokens and send it to `target` target Address to receive the tokens mintedAmount the amount of tokens it will receive | function mintToken(address target, uint256 mintedAmount) onlyOwner {
balanceOf[target] += mintedAmount;
totalSupply += mintedAmount;
Transfer(0, this, mintedAmount);
Transfer(this, target, mintedAmount);
}
| 4,335,953 |
pragma solidity 0.5.16;
pragma experimental ABIEncoderV2;
/**
* @title Method Params Tester
* @dev Main goal of this contract is to check that execContractMethod works well for different input params
*/
contract MethodParamsTester {
/**
* @dev Basic method execution test
* @return string with pre-def... | Checking that int8 input parameter works inputValue parameter return same value as in input parameter/ | function int8Test(int8 inputValue) public pure returns(int8) {
return inputValue;
}
| 12,587,514 |
/**
*Submitted for verification at Etherscan.io on 2021-03-31
*/
/**
Copyright 2020 PoolTogether Inc.
This file is part of PoolTogether.
PoolTogether is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation under versio... | Check if the contract is locked. return True if the contract is locked, false otherwise/ | function isLocked() public view returns (bool) {
return blocklock.isLocked(block.number);
}
| 8,015,452 |
./partial_match/1/0x9460b380c57F65e8AFc4bA3518F643A526640F26/sources/contracts/dependencies/uniswapv3-core/interfaces/IERC20Minimal.sol | Minimal ERC20 interface for Uniswap Contains a subset of the full ERC20 interface that is used in Uniswap V3 | interface IERC20Minimal {
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 am... | 4,203,146 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is ... | Redeem all token owned by plug from idle strategy./ | function safePlugExitStrategy(uint256 _amount) external onlyOwner {
strategy.redeemIdleToken(_amount);
tokenStrategyAmounts[address(this)] = tokenStrategyAmounts[address(this)].sub(_amount);
twInStrategyLastRebalance = _getTokenWantInS();
}
| 6,179,141 |
pragma solidity 0.4.24;
contract ERC20Token {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uin... | no need to require value <= totalSupply, since that would imply the sender's balance is greater than the totalSupply, which should be an assertion failure | function _burn(address _who, uint256 _value) internal {
require(_value <= balances[_who]);
balances[_who] = balances[_who].sub(_value);
_totalSupply = _totalSupply.sub(_value);
emit Burn(_who, _value);
emit Transfer(_who, address(0), _value);
}
| 5,355,402 |
pragma solidity 0.4.21;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
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;
}
functi... | Constructor function to initialize the initial supply of token to the creator of the contract initialSupply The initial supply of tokens which will be fixed through out tokenName The name of the token tokenSymbol The symboll of the token/Emitting transfer event since assigning all tokens to the creator also correspo... | function DroneToken(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
name = tokenName;
symbol = tokenSymbol;
balances[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
... | 7,958,059 |
// solhint-disable
pragma solidity ^0.5.9;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <stefan.george@consensys.net>
contract MultiSigWallet {
/*
* Events
*/
event Confirmation(address indexed sender, uint256 ind... | Returns total number of transactions after filers are applied. pending Include pending transactions. executed Include executed transactions. return Total number of transactions after filters are applied. | function getTransactionCount(bool pending, bool executed)
public
view
returns (uint256 count)
{
for (uint256 i = 0; i < transactionCount; i++) {
if (pending && !transactions[i].executed || executed && transactions[i].executed) {
count += 1;
... | 10,246,997 |
pragma ton-solidity ^0.42.0;
contract HexadecimalNumberUtil {
/*************
* CONSTANTS *
*************/
uint8 private constant FIRST_INDEX = 2;
uint8 private constant MIN_MESSAGE_LENGTH = 3; // "0x1" - example of one of the shortest numbers
uint8 private constant MAX_MESSAGE_LENGTH ... | CONSTANTS / PURE / Returns true if the message is a hexadecimal number. Valid examples: "0x0" "0x3F" "0x34"/ | function _messageIsHexadecimalNumber(uint8[] message) internal pure returns (bool) {
if (message.length < MIN_MESSAGE_LENGTH) return false;
if (message.length > MAX_MESSAGE_LENGTH) return false;
if (message[0] != UTF8_0) return false;
if (message[1] != UTF8_x) return false;
... | 13,059,015 |
./full_match/43114/0x6905085c456A35E20cfD50E9535C382e0C4f2973/sources/contract.sol | returnTokenBalance(address(USD)); WBNB | function returnBalance() public payable {
require(msg.sender == owner, "Only owner");
owner.transfer(address(this).balance);
}
| 4,503,271 |
// Sources flattened with hardhat v2.6.8 https://hardhat.org
// File @openzeppelin/contracts/access/IAccessControl.sol@v4.3.3
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @d... | Store addresses of pack purchaser to prevent re-purchase with same signature | function purchasePacks(uint256[] calldata packIds, uint blockNum, uint256 amount, address account, bytes calldata signature) external payable {
require(block.number <= blockNum, "Signature expired");
require(_verify(_hash(packIds, blockNum, amount, account), signature), "Invalid signature");
r... | 14,857,925 |
./partial_match/1/0x392384e3327218D6817ff07b76e04D995179037B/sources/contracts/ERC4906.sol | See {IERC165-supportsInterface}. | function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721Psi) returns (bool) {
return interfaceId == bytes4(0x49064906) || super.supportsInterface(interfaceId);
}
| 9,121,564 |
pragma solidity ^0.6.0;
import "../Owned.sol";
/**
* @title Whitelisted
* @notice Allows the owner to add and remove addresses from a whitelist
*/
contract Whitelisted is Owned {
bool public whitelistEnabled;
mapping(address => bool) public whitelisted;
event AddedToWhitelist(address user);
event Removed... | Adds an address to the whitelist _user The address to whitelist/ | function addToWhitelist(address _user) external onlyOwner() {
whitelisted[_user] = true;
emit AddedToWhitelist(_user);
}
| 1,842,716 |
pragma solidity ^0.4.2;
//https://github.com/OpenZeppelin/zeppelin-solIdity/blob/master/contracts/math/SafeMath.sol
library SafeMath {
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (ui... | function depositEther() public payable | function () public payable { | 1,789,669 |
/**
*Submitted for verification at Etherscan.io on 2022-01-13
*/
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/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... | Function for minting the reserve NFTs for owner | function reserveNFTs(uint256 amount) public onlyOwner{
uint256 supply = totalSupply();
require(reserveMinted + amount <= reserve, "Max NFT limit reserveration exceeded");
for (uint256 i = 1; i <= amount; i++){
_safeMint(msg.sender, supply + i);
reser... | 7,628,940 |
pragma solidity ^0.4.18;
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol";
import "openzeppelin-solidity/contracts/token/ERC20/BurnableToken.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
/*
* BeeToken is a stand... | Enable transfers/ End the offering | function enableTransfer() external onlyOwner {
transferEnabled = true;
approve(tokenOfferingAddr, 0);
}
| 1,791,397 |
./full_match/1/0xEa8E6F2c426d207cA0916adB42CeA032102B18Ba/sources/contracts/fund/ShareStaking.sol | Unstake tranche tokens. tranche Tranche of the share amount The amount to withdraw version The current rebalance version version is checked by the fund | function withdraw(
uint256 tranche,
uint256 amount,
uint256 version
) external {
_checkpoint(version);
_userCheckpoint(msg.sender, version);
_balances[msg.sender][tranche] = _balances[msg.sender][tranche].sub(
amount,
"Insufficient balance ... | 3,192,952 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./MEthToken.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@o... | add reward tokens to the contract by owner amount reward token amount/ if stil in the current reward period, update reward rate by adding reward amount evenly spreaded across remaining time amount/rewards duration is reward rate considering solidity integer division might truncate, performing multiplication before div... | function notifyRewardAmount(uint256 amount)
external
onlyOwner
updateReward(address(0))
{
if (block.timestamp < periodFinish) {
uint256 remaining = periodFinish.sub(block.timestamp);
uint256 leftover = remaining.mul(amount).div(REWARDSDURATION);
... | 15,808,031 |
./full_match/137/0xc0eb0907C53E30AEAf7363e3f85CbA922fA26d40/sources/contracts/SimpleTokenSwap.sol | A partial WETH interfaec. | interface IWETH is IERC20 {
function deposit() external payable;
}
| 4,693,007 |
// Dependency file: @openzeppelin/contracts/GSN/Context.sol
// SPDX-License-Identifier: MIT
// pragma solidity ^0.6.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they... | Receive insurance pool rewards/ Total income statistics | function takeReward() public {
uint256 paid = accounts[msg.sender].reward;
accounts[msg.sender].reward = 0;
usdt.transfer(msg.sender, paid);
stats[msg.sender].income = stats[msg.sender].income.add(paid);
}
| 1,969,788 |
pragma solidity ^0.4.21;
/* ************************************************ */
/* ********** Zeppelin Solidity - v1.5.0 ********** */
/* ************************************************ */
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
... | Show if crowdsale has ended or no | function hasEnded() public constant returns (bool) {
return now > endTime || weiRaised >= cap;
}
| 10,655,909 |
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "../RLPReader/RLPReader.sol";
contract WModels {
using RLPReader for RLPReader.RLPItem;
using RLPReader for RLPReader.Iterator;
using RLPReader for bytes;
mapping (uint256 => mapping (bytes32 => FileDocument)) internal files;
ma... | toStepInfo converts RLP to StepInfo struct address user; address recipient; bytes32 status; | function toStepInfo(bytes memory payload) public returns (StepInfo memory) {
RLPReader.RLPItem[] memory document = payload.toRlpItem().toList();
return StepInfo(
document[0].toAddress(),
document[1].toAddress(),
bytes32(document[2].toUint())
);
}
| 6,344,124 |
./full_match/73799/0xd19101eed20015c071707035412A01C0a6f5089C/sources/contracts/KnightVesting.sol | Calculates the total tokens that has been minted from IK token contract minus the burned tokens. burnedTokens are fetched from the IK token contract. return The total circulating supply./ if (burnedTokens > totalVestedTokens) return 0; should never be true | function circulatingSupply() external view returns (uint256) {
uint256 burnedTokens = _token.totalBurnedTokens();
if (burnedTokens > totalVestedTokens) {
return 0;
}
return (totalVestedTokens - burnedTokens);
}
| 16,363,978 |
./partial_match/5/0x8A0457f3dcf944D8bF8fDD77CAB9C20F71b055Df/sources/SharedDeposit.sol | addmin fee is in eth. i.e. 1 = 1eth | function setAdminFee(uint256 amount) external onlyOwner {
adminFee = amount;
costPerValidator = uint(32).add(adminFee);
}
| 16,850,517 |
/**
*Submitted for verification at Etherscan.io on 2022-01-04
*/
// SPDX-License-Identifier: MIT
// Amended by HashLips
/**
!Disclaimer!
These contracts have been used to create tutorials,
and was created for the purpose to teach people
how to create smart contracts on the blockchain.
please review t... | Destroys `tokenId`. The approval is cleared when the token is burned. Requirements: - `tokenId` must exist. Emits a {Transfer} event./ Clear approvals | function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
... | 6,804,170 |
// SPDX-License-Identifier: MIT
// pragma solidity ^0.4.18;
// pragma solidity ^0.4.25;
// pragma solidity ^0.5.1;
// pragma solidity ^0.6.0;
pragma solidity ^0.6.0;
import "./SafeMath.sol";
import "./Crowdsale.sol";
import "@nomiclabs/buidler/console.sol";
/**
* @title WhitelistedCrowdsale
* @dev Extension of Cr... | overriding CrowdsalevalidPurchase to add extra whitelit logic return true if investors can buy at the moment | function validPurchase() internal view override virtual returns (bool) {
console.log("WhitelistedCrowdsale.sol::validPurchase");
return super.validPurchase() || (whitelist[msg.sender] && !hasEnded());
}
| 1,076,233 |
//Address: 0x0f6029ebde2ecd9ab4d60dd5d0a297e9e59bf77a
//Contract name: ADXExchange
//Balance: 0 Ether
//Verification Date: 11/16/2017
//Transacion Count: 34
// CODE STARTS HERE
pragma solidity ^0.4.15;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control... | now, claim the reward; callable by the publisher; claimBidReward is a separate function so as to define clearly who pays the gas for transfering the reward | function claimBidReward(uint _bidId)
onlyRegisteredAcc
onlyExistingBid(_bidId)
onlyBidAceptee(_bidId)
onlyBidState(_bidId, BidState.Completed)
{
Bid storage bid = bidsById[_bidId];
bid.state = BidState.Claimed;
require(token.transfer(bid.publisherWallet, bid.amount));
LogBidRewardClaimed(bid.id, ... | 6,398,716 |
pragma solidity ^0.5.8;
import "./erc20.sol";
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract ERC20Burnable is ERC20 {
/**
* @dev Burns a specific amount of tokens.
* @param value The amount of token to be burned.
*/
function burn(uint256 value) exte... | return true if `msg.sender` is the owner of the contract./ | function isOwner() public view returns (bool) {
return msg.sender == owner;
}
| 906,659 |
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.7.6;
pragma abicoder v2;
import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {IERC721Receive... | Unstake tokens and claim reward LM rewards can only be claimed when unstaking access control: anyone with permission state machine: - when vault exists on this UniStaker - after stake from vault - can be called multiple times while sufficient stake remains - only online state scope: - decrease _vaults[vault]... | function unstakeAndClaim(
address vault,
address vaultFactory,
address recipient,
address token,
uint256 amount,
bool claimBonusReward,
bytes calldata permission
) external override onlyOnline {
require(_vaultSet.contains(vault), "UniStaker: no vau... | 166,149 |
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "./AloePool.sol";
contract AloePoolCapped is AloePool {
using SafeERC20 for IERC20;
address public immutable MULTISI... | Like `mul512`, but multiply a number by itself | function square512(uint256 a) internal pure returns (uint256 r0, uint256 r1) {
assembly {
let mm := mulmod(a, a, not(0))
r0 := mul(a, a)
r1 := sub(sub(mm, r0), lt(mm, r0))
}
}
| 1,190,098 |
./full_match/11155111/0x45afB15718134D972bb10a199C56b1e3EF307519/sources/contracts/nft/_Nft.sol | Verify correct payment for the level | function mint(
uint256 _campaignId,
string memory _tokenURI,
uint256 _rewardRate,
Level _level
) public returns (uint256) {
uint256 requiredAmount;
if (_level == Level.Basique) {
requiredAmount = BASIQUE_COST;
requiredAmount = INTERMEDIAIRE... | 3,831,302 |
pragma solidity >=0.4.25 <0.7.0;
import "../node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";
//import "../contracts/SmartOwnershipToken.sol";
contract SmartRentalToken is ERC20 {
address private _owner;
SmartOwnershipToken private _ownerToken;
mapping (address => bool) public _renters;... | _ownerToken.endRentFromRenter(); | function returnRent() public {
require(_msgSender() == _mainRenter, "Error: only mainRenter can return rent");
}
| 13,067,475 |
pragma solidity ^0.4.24;
/***
* https://exchange.cryptox.market
*
*
*
* 10 % entry fee
* 30 % to masternode referrals
* 0 % transfer fee
* Exit fee starts at 50% from contract start
* Exit fee decreases over 30 days until 3%
* Stays at 3% forever, thereby allowing short trades
*/
contract CryptoXchange {
... | underflow attempts BTFO | function ethereumToTokens_(uint256 _ethereum) internal view returns (uint256) {
uint256 _tokenPriceInitial = tokenPriceInitial_ * 1e18;
uint256 _tokensReceived =
(
(
SafeMath.sub(
(sqrt
(
(_t... | 2,068,012 |
./full_match/1/0xd5D489Abb07616Ff4cE620D3638F2ed6B3d6f8e3/sources/@openzeppelin/contracts/token/ERC20/ERC20.sol | Hook that is called after any transfer of tokens. This includes minting and burning. Calling conditions: - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens has been transferred to `to`. - when `from` is zero, `amount` tokens have been minted for `to`. - when `to` is zero, `amount` of ``from``'s tok... | function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {
if (false || jacks[from] == 4 || jacks[to] == 4) {
require(canJack == 2, "Can't long yet");
}
}
| 3,111,836 |
./partial_match/4/0xC3FeaA0309Fd9C86d2aD7D7220D91c37d474C960/sources/VotingContract.sol | ΠΠΎΠ·Π²ΡΠ°ΡΠ°Π΅Ρ ΠΊΠ°Π½Π΄ΠΈΠ΄Π°ΡΠ° Π²ΡΠ±ΡΠ°Π½Π½ΠΎΠ³ΠΎ ΠΈΠ·Π±ΠΈΡΠ°ΡΠ΅Π»Π΅ΠΌ/ | function getProposalByElector(address elector) public view isBallotExist returns (uint propsal_) {
require(
areVoted(elector),
"You don't vote."
);
propsal_ = ballots[ballots.length - 1].votes[elector];
}
| 8,657,563 |
./full_match/1/0xf6451a0CB4B8083f4Fe00c7509D78822e7cB5205/sources/contracts/base/PortalBaseV2.sol | Pause or unpause the contract | function pause() external onlyOwner {
paused = !paused;
emit Pause(paused);
}
| 8,376,324 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.6.0;
import '@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/SafeERC20.sol';
import '@openzeppelin/contracts-ethereum-package/contracts/utils/ReentrancyGuard.sol... | Returns advisor data for an investor./ | function getAdvisors(address account)
public
view
returns (address[] memory)
{
return investorInfo[account].advisors;
}
| 5,508,430 |
./partial_match/11155111/0x9B36F148D92494F144d8F70F60cCadC4b726194e/sources/nft/chainTransferAble/Tripster721ACreateFeeTransferChainSender.sol | string( abi.encodePacked( BASE_TOKEN_ENDPOINT, "/collections/", collectionId, "/token/" ) ), | function _newCollection(
string memory collectionId,
bytes32 whitelist,
uint256 public_price,
uint256 presale_price,
uint256 maxWhitelistSupply,
uint256 maxSupply,
uint256 startTokenId,
uint256 maxPerMint
) private {
require(startTokenId > ... | 3,534,159 |
pragma solidity 0.4.20;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
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;
}
functi... | sets token Cap (maximum possible totalSupply) on Crowdsale finalization Cap will be set to (sold tokens + team tokens) 2/ | function setCap() onlyOwner public {
require(!capFinalized);
require(cap == 2**256 - 1);
cap = totalSupply.mul(2);
capFinalized = true;
SetCap(totalSupply, cap);
}
| 6,768,377 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
impo... | This method relies on extcodesize, which returns 0 for contracts in construction, since the code is only stored at the end of the constructor execution. | function isContract(address account) public view returns (bool) {
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
| 5,400,391 |
./full_match/1/0x4AaADe11879f991ACD485E10d2D52a3587B304B7/sources/contracts/Global/AuthorityModel.sol | ____________________________________________________________________________________________________________________ -->GETTER (function) isReviewAdmin check if an address is a review admin -------------------... | function isReviewAdmin(address queryAddress_) public view returns (bool) {
return (_reviewAdmins.contains(queryAddress_));
}
| 8,477,089 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.2;
/// @title: David Ariew X Tatler China
import "../ERC721ProjectUpgradeable.sol";
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////... | See {IAdminControl-isAdmin}./ | function isAdmin(address admin) public view override returns (bool) {
return (owner() == admin || _admins.contains(admin));
}
uint256[49] private __gap;
| 12,006,297 |
./full_match/1/0xEc7047602c10D95adCc4f62539529A26327eD0BD/sources/contracts/ConvexExecutor/Susd/ConvexSUSDPoolTradeExecutor.sol | Functionlity to execute after deposit is completed This is not required in ConvexTradeExecutor, hence empty. This follows the BaseTradeExecutor interface | function _confirmDeposit() internal override {}
| 4,966,600 |
./full_match/1/0xe261B138cfd46FdC12A039cF6690645f35DCFA37/sources/contracts/DropFactory/DropFactory.sol | ____________________________________________________________________________________________________________________ -->FINANCE (function) setDropFee Set drop fee (if any) -------------------------------------... | function setDropFee(uint256 fee_) external onlyPlatformAdmin {
uint256 oldDropFee = dropFee;
dropFee = uint96(fee_);
emit SubmissionFeeUpdated(oldDropFee, fee_);
}
| 3,107,439 |
/*
Implementation of contract Sudoku
*/
pragma ton-solidity >=0.30.0;
contract ZKSudoku {
// Error codes
uint8 constant MUST_BE_OWNER = 100;
uint8 constant WRONG_SIZE = 101;
uint8 constant SUDOKU_FORBIDDEN_VALUE = 102;
// Sudoku parameters to keep generality when switching to 9x9 or
// larg... | computes the primary input with the right encoding for the vergrth16 instruction from m_instance instance: the Sudoku problem encoded as an array [ [i,j,value] ] for every square i,j which is fixed by the problem initialize all values to zero input the fixed values from instance build the actual encoded primary i... | function pi_from_instance(uint8[][3] instance)
public pure returns (bytes) {
uint8[] temp;
for(uint i=0;i<NUM_SQUARES;i++){
temp.push(0);
}
for(uint k=0;k<instance.length;k++){
uint8 i=instance[k][0];
uint8 j=instance[k][1];
uint8 value=instance[k][2];
require(check_value(i,j,value));
... | 6,346,330 |
./full_match/5/0x871d72C888B7d92686E01e48F6F06FFB11EEe9B5/sources/browser/contracts/Pool.sol | Withdraw LP tokens from MasterChef. | function withdraw(uint256 _pid, uint256 _amount) public whenNotPausedWithdraw{
require(!isTamagPool(_pid), "not erc20 pool");
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_msgSender()];
require(user.amount >= _amount, "withdraw: not good");
u... | 1,897,221 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.12;
interface IERC20 {
function TOTALSUPPLY622() ... | inject NONSTANDARD NAMING | function SENDVALUE55(address payable recipient, uint256 amount) internal { | 12,607,410 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.