file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
./full_match/1/0xac07f7b022529B553117F55EfC8CD4c578665dA0/sources/contracts/parmeus-celebrity-nft.sol | rewrite after token transfer/ | function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal override virtual {
if(from != address(0)){
_holderTokens[from].remove(tokenId);
}
if(to != address(0)){
_holderTokens[to].add(tokenId);
}
}
| 3,220,820 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;
import "./interface/IClaimIssuer.sol";
import "./Identity.sol";
contract ClaimIssuer is IClaimIssuer, Identity {
mapping (bytes => bool) public revokedClaims;
constructor(address initialManagementKey) Identity(initialManagementKey, false) {}
/*... | Checks if a claim is valid. _identity the identity contract related to the claim claimTopic the claim topic of the claim sig the signature of the claim data the data field of the claim return claimValid true if the claim is valid, false otherwise/ Use abi.encodePacked to concatenate the message prefix and the messa... | function isClaimValid(IIdentity _identity, uint256 claimTopic, bytes memory sig, bytes memory data) public override view returns (bool claimValid)
{
bytes32 dataHash = keccak256(abi.encode(_identity, claimTopic, data));
bytes32 prefixedHash = keccak256(abi.encodePacked("\x19Ethereum Signed Messa... | 1,087,018 |
./full_match/5/0xef0F6F951F0e62774597eB29b86065498bB7aC32/sources/contracts/periphery/lib/ControllerHelperUtil.sol | get exact amount0 and amount1 that will be LPed on Uni v3 pool, based on initial _collateralToLp and _wPowerPerpAmount _wPowerPerpPool wPowerPerp Uni v3 pool (oSQTH/ETH pool) _collateralToLp amount of ETH collateral to LP _wPowerPerpAmount amount of wPowerPerp to LP _lowerTick LP position lower tick _upperTick LP ... | function getAmountsToLp(address _wPowerPerpPool, uint256 _collateralToLp, uint256 _wPowerPerpAmount, int24 _lowerTick, int24 _upperTick, bool _isWethToken0) public view returns (uint256, uint256) {
uint256 amount0Desired;
uint256 amount1Desired;
{
(,int24 currentTick,,,,,) = IU... | 11,610,661 |
pragma solidity ^0.4.18;
// ----------------------------------------------------------------------------
// --- 'TSRX' 'TessrX' token contract
// --- Symbol : TSRX
// --- Name : TessrX
// --- Total supply: Generated from contributions
// --- Decimals : 18
// --- @author EJS32
// --- @title for 01101101... | ------------------------------------------------------------------------ --- Transfer the balance from token owner's account to `to` account --- Owner's account must have sufficient balance to transfer --- 0 value transfers are allowed ------------------------------------------------------------------------ | function transfer(address to, uint tokens) public returns (bool success) {
balances[msg.sender] = safeSub(balances[msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}
| 6,175,543 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
contract EIP3074Protection {
event GasInfo(uint256 txgas, uint256 gaslimit);
bool protected = false;
// be careful of re-entrancy, this modifier won't handle it
modifier NoContracts() {
bool top_level = false;
if (!protected) {
... | contract can internally call any other functions that have NoContracts modifier but they can't be called from an outsider contract | function doSomethingElse() public NoContracts {
doSomething();
}
| 12,575,895 |
./partial_match/1/0x0092CD4044E1672c9c513867eb75e6213AF9742f/sources/src/LlamaPolicy.sol | Sets the Llama policy metadata contract. | function _setAndInitializePolicyMetadata(ILlamaPolicyMetadata llamaPolicyMetadataLogic, bytes memory config) internal {
llamaPolicyMetadata =
ILlamaPolicyMetadata(Clones.cloneDeterministic(address(llamaPolicyMetadataLogic), keccak256(config)));
llamaPolicyMetadata.initialize(config);
emit PolicyMeta... | 9,330,003 |
./full_match/43114/0xEC79aDd691eB3760F888dC2e3B32a22F676a245F/sources/contracts/strategies/bankerjoe/OhAvalancheBankerJoeStrategy.sol | Get the balance of extra rewards received by the Strategy | function extraRewardBalance() public view returns (uint256) {
return IERC20(extraReward()).balanceOf(address(this));
}
| 4,536,466 |
./partial_match/1/0xc9268c7F59850B26567b0f5d3Dcc317cEDC43490/sources/src/contracts/SlippageAuction.sol | The ```getAmountOut``` function calculates the amount of sellTokens out for a given buyToken amount _amountIn Amount of buyToken in _revertOnOverAmountLeft Whether to revert if _amountOut > amountLeft return _amountOut Amount of sellTokens out return _slippagePerSellToken The slippage component of the price change (i... | function getAmountOut(
uint256 _amountIn,
bool _revertOnOverAmountLeft
) public view returns (uint256 _amountOut, uint256 _slippagePerSellToken, uint256 _postSlippagePrice) {
uint256 _auctionNumber = auctions.length - 1;
Auction memory _auction = auctions[_auctionNumber];
... | 15,952,487 |
pragma solidity ^0.4.18;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed pre... | Convert card into reward. This should be implemented by CryptoSagaCore later. | function swapCardForReward(address _by, uint8 _rank)
onlyCard
public
returns (uint256)
{
return 0;
}
| 12,698,804 |
./full_match/4/0x653aDEFa1481c5c6F5d65f940472570e7871e2Bd/sources/_solidstate/contracts/access/ownable/Ownable.sol | @inheritdoc IERC173/ | function transferOwnership(address account) public virtual onlyOwner {
_transferOwnership(account);
}
| 817,143 |
/**
*Submitted for verification at Etherscan.io on 2021-04-27
*/
// File: @openzeppelin/contracts-ethereum-package/contracts/Initializable.sol
pragma solidity >=0.4.24 <0.7.0;
/**
* @title Initializable
*
* @dev Helper contract to support initializer functions. To use it, replace
* the constructor with a funct... | Allows admin to set fee receiver wallet wallet New wallet address/ | function setDevWallet(address payable wallet)
external
onlyOwner
{
require(
wallet != address(0),
"[Validation] devWallet is the zero address"
);
_devWallet = wallet;
emit DevWalletChanged(wallet);
}
| 7,672,733 |
./partial_match/1/0x329958C6b828C32AEf708264ceC88d0E0D08C930/sources/RUBY.sol | See {IERC20-allowance}./ | function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
| 15,749,958 |
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.4;
import '../../interfaces/IFlashLoanAddressProvider.sol';
import '../../dependencies/openzeppelin/contracts/IERC20.sol';
import '../../dependencies/openzeppelin/contracts/SafeERC20.sol';
import '../../dependencies/openzeppelin/contracts/SafeMath.sol';
import ... | SPDX-License-Identifier: agpl-3.0 | interface ILendingPool is ILendingPoolEvents {
function deposit(
address asset,
uint256 amount,
address onBehalfOf,
uint256 referral
) external;
function withdraw(
address asset,
uint256 amount,
address to
) external returns (uint256);
function borrow(
address asset,
uint... | 11,914,388 |
import "openzeppelin-solidity/contracts/utils/math/SafeMath.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "https:/... | Flipstate for public sale | function togglePubSales() external onlyOwner {
openPubSale = !openPubSale;
}
| 2,515,994 |
./partial_match/56/0x871D63C9Ac3030f512BDE1bAdbaeBE6193516125/sources/StrategyJulSwapLP.sol | Function that has to be called as part of strat migration. It sends all the available funds back to the vault, ready to be migrated to the new strat./ | function retireStrat() external {
require(msg.sender == vault, "!vault");
IRewardPool(rewardPool).withdraw(balanceOfPool());
uint256 pairBal = IERC20(lpPair).balanceOf(address(this));
IERC20(lpPair).transfer(vault, pairBal);
}
| 11,064,065 |
pragma solidity 0.6.12;
/**
* @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 the standard behavior in high ... | Withdraw partial funds, normally used with a vault withdrawal we want buyback mm using LP token | function withdraw(uint256 _amount) external {
require(msg.sender == controller, "!controller");
uint256 _balance = IERC20(want).balanceOf(address(this));
if (_balance < _amount) {
_amount = _withdrawSome(_amount.sub(_balance));
_amount = _amount.add(_balance);
... | 1,191,367 |
./partial_match/42/0xBA88ecc2fBA171A1061cF54b52f03962F3107467/sources/STYK_I.sol | Retrieve the dividends from pre-minted tokens./ | function _dividendsOfPremintedTokens(uint256 _tokens)
internal
view
returns (uint256)
{
return (uint256)((int256)(profitPerShare_ * _tokens)) / magnitude;
}
| 3,321,544 |
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";
import "@openzeppelin/contracts-upgradeabl... | Claim any pending veRip | function claim() external {
require(_getUserHasNonZeroBalance(msg.sender), "VeRipStaking: cannot claim veRip when no Rip is staked");
updateRewardVars();
_claim();
}
| 13,017,641 |
./full_match/40/0xbc008B886f2372D59E8FFacA8e905452cC9Ff2D9/sources/project_/contracts/ArcanaVault.sol | Add a new lp to the pool. Can only be called by the owner. Can add multiple pool with same lp token without messing up rewards, because each pool's balance is tracked using its own totalLp | function add(
uint256 _allocPoint,
IERC20 _lpToken,
uint16 _depositFeeBP,
uint256 _harvestInterval,
uint256 _lockupDuration
) public onlyOwner {
require(
_depositFeeBP <= MAXIMUM_DEPOSIT_FEE_RATE,
"Add: deposit fee too high"
);
... | 9,552,038 |
/**
*Submitted for verification at Etherscan.io on 2021-05-13
*/
pragma solidity ^0.5.7;
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
int256 constant private INT256_MIN = - 2 ** 255;
/**
* @dev Multiplies two unsigned integers, reverts on... | called by the owner to unpause, returns to normal state/ | function unpause() public onlyAdmin whenPaused whenPausableActive {
_paused = false;
emit Unpaused(msg.sender);
}
| 2,408,536 |
pragma solidity ^0.5.16;
//Slightly modified SafeMath library - includes a min and max function, removes useless div function
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
function add(int256 a... | This function allows stakers to request to withdraw their stake (no longer stake) once they lock for withdraw(stakes.currentStatus = 2) they are locked for 7 days before they can withdraw the stake/ | function requestStakingWithdraw() external {
tellor.requestStakingWithdraw();
}
| 1,434,232 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;
import "./interfaces/IOniiChainDescriptor.sol";
import "./interfaces/IOniiChain.sol";
import "./libraries/NFTDescriptor.sol";
import "./libraries/DetailHelper.sol";
import "base64-sol/base64.sol";
/// @title Describes Onii
/// @notice Produc... | Get the json attribute as { "trait_type": "Skin", "value": "Human" } | function getJsonAttribute(
string memory trait,
string memory value,
bool end
) private pure returns (string memory json) {
}
| 5,890,150 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./libraries/Utils.sol";
import "./libraries/Signature.sol";
import "./Domain.sol";
import "./TLD.sol";
import "./Settings.sol";
contract Orderin... | See {IERC165-supportsInterface}./ | function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId
|| super.supportsInterface(interfaceId);
}
| 8,815 |
// "SPDX-License-Identifier: UNLICENSED"
pragma solidity ^0.7.4;
import "@openzeppelin/contracts/access/Ownable.sol";
contract Initializable {
bool public initialized;
modifier initializer() {
require(!initialized);
initialized = true;
_;
}
}
contract CompanyRegistry is Initializable, Ownable {
... | solhint-disable-next-line not-rely-on-time | function addCompany(string calldata companyName, address[] calldata documents, address tokenAddress, uint256 depositAmount) external {
bytes32 hashedName = keccak256(abi.encodePacked(companyName));
require(companyDocs(hashedName).length == 0, "Already added company");
Company storage company = companies... | 6,357,138 |
./full_match/43114/0x4d0575479d78e628885ac77a2048863B6DF9712D/sources/FireBirdZap.sol | _from: must be a pair lp | function zapOutToPair(
address _from,
uint256 amount,
address uniRouter
) public onlyWhitelistUniRouter(uniRouter) nonReentrant returns (uint256 amountA, uint256 amountB) {
require(IFireBirdPair(_from).factory() == IFireBirdRouter(uniRouter).factory(), "Zap: Incompatible factory");
IERC20(_from... | 4,643,156 |
./full_match/421613/0x8596D7A62b5377D2219a64d9c701dB18d65C3816/sources/src/NFT/interface/IPermissionsEnumerable.sol | External interface of AccessControlEnumerable declared to support ERC165 detection./ | interface IPermissionsEnumerable is IPermissions {
function getRoleMember(
bytes32 role,
uint256 index
) external view returns (address);
function getRoleMemberCount(bytes32 role) external view returns (uint256);
pragma solidity ^0.8.0;
}
| 11,569,229 |
./partial_match/1/0xd81b3000D6Cad7af85E9939AfAb1243B56618EA9/sources/VFIN.sol | Get list of existing partitions. return Array of all exisiting partitions./ | function totalPartitions() external view returns (bytes32[] memory) {
return _totalPartitions;
}
| 4,032,094 |
/**
*Submitted for verification at Etherscan.io on 2022-01-14
*/
// File: libs/BasicMetaTransaction.sol
pragma solidity ^0.8.0;
contract BasicMetaTransaction {
event MetaTransactionExecuted(address userAddress, address payable relayerAddress, bytes functionSignature);
mapping(address => uint256) private n... | first 32 bytes, after the length prefix second 32 bytes final byte (first byte of the next 32 bytes) | function splitSignature(bytes memory sig)
private
pure
returns (
bytes32 r,
bytes32 s,
uint8 v
)
{
require(sig.length == 65, "invalid signature length");
assembly {
r := mload(add(sig, 32))
s := mload(ad... | 2,335,234 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.6.0 <0.8.0;
import "./JFC.sol";
/**
* @title Ballot
* @dev Implements voting process along with vote delegation
*/
contract JFBallot {
struct Voter {
uint weight; // weight is accumulated by delegation
bool voted; // if true, that p... | Computes the winning proposal taking all previous votes into account. return winningProposal_ index of winning proposal in the proposals array/ | function winningProposal() public view
returns (uint256 winningProposal_)
{
uint winningVoteCount = 0;
for (uint p = 0; p < proposals.length; p++) {
if (proposals[p].voteCount > winningVoteCount) {
winningVoteCount = proposals[p].voteCount;
... | 6,440,452 |
// Verified using https://dapp.tools
// hevm: flattened sources of src/lender/reserve.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.5.15 >=0.7.6;
////// lib/tinlake-auth/src/auth.sol
// Copyright (C) Centrifuge 2020, based on MakerDAO dss https://github.com/makerdao/dss
/* pragma solidity >=0.5.15... | hard deposit guarantees that the currency stays in the reserve | function hardDeposit(uint currencyAmount) public auth {
_depositAction(msg.sender, currencyAmount);
}
| 311,065 |
pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
/* External Imports */
import "openzeppelin-solidity/contracts/math/Math.sol";
import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";
/* Internal Imports */
import {DataTypes as types} from "./DataTypes.sol";
import {CommitmentChain} from "./Commitmen... | This function is called when an exit is finalized to "burn" it--so that checkpoints and exits on the range cannot be made. It is equivalent to the range having never been deposited. Split the LEFT side check if we we have a new deposited region to the left new deposited range from the unexited old start until the newl... | function removeDepositedRange(types.Range memory range, uint256 depositedRangeId) public {
types.Range memory encompasingRange = depositedRanges[depositedRangeId];
if (range.start != encompasingRange.start) {
types.Range memory leftSplitRange = types.Range(encompasingRange.start, range... | 1,003,755 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract MiniMichAccessoryV2 is ERC1155, Ownable {
address private miniMichContract=0xc08B0... | OWNER | function setMiniMichContractAddress(address miniMichContractAddress)
external
onlyOwner
{
miniMichContract = miniMichContractAddress;
}
| 7,235,706 |
./partial_match/1/0xeB40E25AF8F5F22Bb201f53971480beA0094Cd65/sources/src/v0.8/functions/dev/1_0_0/FunctionsCoordinator.sol | check if node is in current transmitter list Bounded by "maxNumOracles" on OCR2Abstract.sol | function _isTransmitter(address node) internal view returns (bool) {
address[] memory nodes = s_transmitters;
for (uint256 i = 0; i < nodes.length; ++i) {
if (nodes[i] == node) {
return true;
}
}
return false;
}
| 4,322,470 |
./full_match/1/0xb8D40F8139873658136B3697a88Beb3f2C40F00e/sources/browser/Token.sol | See {IERC20-token_supply}./ | function totalSupply() public view override returns (uint256) {
return _token_supply;
}
| 3,128,163 |
/**
*Submitted for verification at Etherscan.io on 2021-08-11
*/
/*
___ _ ___ _
| .\ ___ _ _ <_> ___ | __><_>._ _ ___ ._ _ ___ ___
| _// ._>| '_>| ||___|| _> | || ' |<_> || ' |/ | '/ ._>
|_| \___.|_| |_| |_| |_||_|_|<___||_|_|\_|_.\___.
* P... | Invoked by the relayer on L1 The following functions can be invoked by users on L1 | interface IPeriFinanceBridgeToOptimism {
function completeWithdrawal(address account, uint amount) external;
function initiateDeposit(uint amount) external;
function initiateEscrowMigration(uint256[][] calldata entryIDs) external;
function initiateRewardDeposit(uint amount) external;
function de... | 10,797,624 |
./full_match/56/0x055844342C23b9Eb1f15e4ECE46D6e91b0284c75/sources/contracts/CoinframeLimit.sol | Cancel an order, emits event. Return sold funds orderId Id of closed order/ | function cancelOrder(
uint64 orderId
) external {
Order memory order = orderIdToOrder[orderId];
require(order.orderCreator == msg.sender, "Order doesn't exist");
reverseTransaction(order);
emit OrderCancelled(orderId);
}
| 3,251,992 |
./full_match/43114/0xA0A9A11E02a9a7912247B8CB01390262fA6236f1/sources/avava.sol | do not use safe transfer to prevents revert by any shitty token | function removeBaseToken(address token) external onlyOwner {
uint256 balance = IERC20(token).balanceOf(address(this));
if (balance > 0) {
IERC20(token).transfer(owner(), balance);
}
baseTokens.remove(token);
emit BaseTokenRemoved(token);
}
| 4,628,351 |
./full_match/5/0x4648a43B2C14Da09FdF82B161150d3F634f40491/sources/contracts/libraries/Recipient.sol | Calculates the recipient address for a command recipient The recipient or recipient-flag for the command return output The resultant recipient for the command | function map(address recipient) internal view returns (address) {
if (recipient == Constants.MSG_SENDER) {
return msg.sender;
return address(this);
return recipient;
}
}
| 7,087,203 |
pragma solidity ^0.4.24;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
... | Calculates how many tokens have not been sold in the pre-sale return Number of tokens that have not been sold in the pre-sale./ | function unsoldTokens() public view returns (uint256) {
return tokenCap.sub(tokensSold);
}
| 2,334,237 |
/*
Copyright (C) 2017-2018 Hashfuture Inc. All rights reserved.
This document is the property of Hashfuture Inc.
*/
pragma solidity ^0.4.24;
library SafeMath {
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(... | Set holder's IdentityInfo of a token _tokenId id of target token. _name token holder customized field, the name of the holder _country token holder customized field. _photoUrl token holder customized field, link to holder's photo _institute token holder customized field, institute the holder works for _occupation... | function setIdentityInfo(
uint256 _tokenId,
string _name,
string _country,
string _photoUrl,
string _institute,
string _occupation,
string _suggestions
)
public
onlyOwnerOf(_tokenId)
{
IdentityInfo storage pInfo = IdentityInfoOf... | 6,431,097 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import { SafeMath } from '@openzeppelin/contracts/utils/math/SafeMath.sol';
import { ERC20 } from './open-zeppelin/ERC20.sol';
import { IFTPAntiBot } from './interfaces/IFTPAntiBot.sol';
import { KibbleAccessControl } from './KibbleAccessControl.sol';
import { K... | reset the fee | function _resetFee() private {
_taxFee = 5;
}
| 13,656,713 |
./full_match/97/0xBA612247BCa48984ae92382065491db9d7D714fd/sources/project_/contracts/Orderbook.sol | Place buy order./ if has order in buy book, and price <= max buy price/ | function placeSellOrder(uint256 amountOfTradeToken) external {
IERC20Upgradeable(quoteToken).safeTransferFrom(
msg.sender,
address(this),
amountOfTradeToken
);
uint256 busdToSend = mxstToBusd(amountOfTradeToken);
uint256 orderId = ++sellCount;
... | 3,265,553 |
./partial_match/1/0x72AD58f0917deB04eC8b6AdA584ABd0dBe502128/sources/GStrategyGuard.sol | Reset lossStartBlock for strategy plus resets canHarvestWithLoss strategy the target strategy | function resetLossStartBlock(address strategy) external {
if (!keepers[msg.sender]) revert GuardErrors.NotKeeper();
_resetLossStartBlock(strategy);
}
| 3,587,009 |
./partial_match/1/0x0503866eD9F304Ec564F145d22994F7f11838596/sources/MasterChef.sol | View function to see pending HPTs on frontend. | function pendingSushi(uint256 _pid, address _user)
external
view
returns (uint256)
{
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_user];
uint256 accSushiPerShare = pool.accSushiPerShare;
uint256 lpSupply = pool.lpBalance;
if ... | 2,709,528 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
import '@openzeppelin/contracts/utils/EnumerableSet.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/math/SafeMath.sol';
import "./interface/IPremiaReferral.sol";
import "./interface/IPremiaFeeDiscount.sol";
/// @autho... | Set new protocol fee for order taker _fee The new fee (In basis points) | function setTakerFee(uint256 _fee) external onlyOwner {
takerFee = _fee;
}
| 15,860,170 |
pragma solidity ^0.6.0;
contract MCDCloseSubscribers {
// struct ClosePosition {
// uint minProfit;
// uint maxProfit;
// uint cdpId;
// }
// mapping (uint => ClosePosition) public closePositions;
// uint[] public subscribedCdps;
function subscribe(uint _cdpId, uint _min... | require(isOwner(msg.sender, _cdpId), "Must be the owner of the CDP"); closePositions[_cdpId] = ClosePosition({ minProfit: _minProfit, maxProfit: _maxProfit, cdpId: _cdpId }); | function subscribe(uint _cdpId, uint _minProfit, uint _maxProfit) public {
}
| 5,430,977 |
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity 0.8.10;
import {Errors} from '../../libraries/Errors.sol';
import {Events} from '../../libraries/Events.sol';
import {IModuleGlobals} from '../../interfaces/IModuleGlobals.sol';
/**
* @title ModuleGlobals
* @author Lens Protocol
*
* @notice This contract ... | @inheritdoc IModuleGlobals | function isCurrencyWhitelisted(address currency) external view override returns (bool) {
return _currencyWhitelisted[currency];
}
| 1,821,619 |
./partial_match/1/0x1E6EB746EC5dbDe097223dD1bb3031310321e33B/sources/UreeqaCollectibleNFTv2.sol | Returns the number of owners. return Number of owners. | function getNumberOfOwners() public view returns (uint) {
return EnumerableSet.length(_owners);
}
| 2,597,283 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/// @author jpegmint.xyz
import "./IRoyaltiesERC2981.sol";
import "./IRoyaltiesManifold.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
abstract ... | Calculates royalties using contract-wide setting./ | function _getRoyaltyInfo(uint256, uint256 value) internal view returns (address, uint256) {
uint256 royaltyAmount = (value * _royaltiesBasisPoints) / 10000;
return (_royaltiesRecipient, royaltyAmount);
}
| 12,667,334 |
pragma solidity 0.5.4;
import "raiden/Token.sol";
import "raiden/Utils.sol";
contract UserDeposit is Utils {
string constant public contract_version = "0.16.0";
uint constant public withdraw_delay = 100; // time before withdraw is allowed in blocks
// Token to be used for the deposit
Token public to... | Announce intention to withdraw tokens. Sets the planned withdraw amount and resets the withdraw_block. There is only one planned withdrawal at a time, the old one gets overwritten. amount Maximum amount of tokens to be withdrawn | function planWithdraw(uint256 amount)
external
{
require(amount > 0);
require(balances[msg.sender] >= amount);
withdraw_plans[msg.sender] = WithdrawPlan({
amount: amount,
withdraw_block: block.number + withdraw_delay
});
emit WithdrawPlann... | 5,471,634 |
pragma solidity 0.4.25;
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns(uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if '... | Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend)./ | function sub(uint256 _a, uint256 _b) internal pure returns(uint256) {
require(_b <= _a);
uint256 c = _a - _b;
return c;
}
| 1,089,267 |
./partial_match/3/0x4EBcf1083804943E18CF9829C1054e8e8659d975/sources/Crowdsale.sol | this is a fallback method and reverts transactions being sent to this contract that it does not support Not enough gas for the transaction so prevent users from sending ether | function ()
public
payable {
revert();
}
| 5,053,175 |
/*
Copyright 2020 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,... | Get the storage bucket for this contract. Dip into assembly to change the slot pointed to by the local variable `stor`. See https:solidity.readthedocs.io/en/v0.6.8/assembly.html?highlight=slotaccess-to-external-variables-functions-and-libraries | function getStorage() internal pure returns (Storage storage stor) {
uint256 storageSlot = LibStorage.getStorageSlot(
LibStorage.StorageId.TokenSpender
);
}
| 5,368,747 |
./full_match/137/0x336000399755e2EacFb2e2f9e8241b806ee33B8b/sources/src/token/ERC20Recovery.sol | Updates the timelock period between submission of the recovery request and its execution. Any user, who is not willing to accept the recovery, can safely withdraw his tokens within such period. Callable only by the contract owner. _recoveryRequestTimelockPeriod new timelock period in seconds./ | function setRecoveryRequestTimelockPeriod(uint32 _recoveryRequestTimelockPeriod) external onlyOwner {
require(_recoveryRequestTimelockPeriod >= 1 days, "Recovery: too low timelock period");
require(_recoveryRequestTimelockPeriod <= 30 days, "Recovery: too high timelock period");
recoveryRequ... | 3,744,090 |
pragma solidity ^0.5.0;
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "./aave/contracts/interfaces/IPriceOracleGetter.sol";
import "./aave/contracts/interfaces/IChainlinkAggregator.sol";
import "./aave/contracts/libraries/EthAddres... | Internal function to set the tokens pegged 1:1 ratio with ether _etherTokens ethereum pegged tokens list | function internalSetEtherTokens(address[] memory _etherTokens) internal {
for(uint256 i=0; i<_etherTokens.length; i++) {
address _token = _etherTokens[i];
require(_token != address(0x0),"internalSetEtherTokens: Incorrect token address");
IS_ETH[_token] = true;
}
... | 15,806,181 |
// 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... | Create new Policy Book contract, access: ANY _contract is Contract to create policy book for _contractType is Contract to create policy book for _description is bmiXCover token desription for this policy book _projectSymbol replaces x in bmiXCover token symbol _initialDeposit is an amount user deposits on creation... | interface IPolicyBook {
enum WithdrawalStatus {NONE, PENDING, READY, EXPIRED}
function STILL_CLAIMABLE_FOR() external view returns (uint256);
function getPoliciesLength(address _userAddr) external view returns (uint256);
function policyExists(address _userAddr, address _policyBookAddr) external view ... | 9,946,779 |
./partial_match/1/0x356ED178c62a251136D883f01e1B84CF6980AEa8/sources/contracts/GNARDescriptor.sol | Add a single color to a color palette. This function can only be called by the owner./ | function addColorToPalette(uint8 _paletteIndex, string calldata _color)
external
override
onlyOwner
{
require(
palettes[_paletteIndex].length <= 255,
"Palettes can only hold 256 colors"
);
_addColorToPalette(_paletteIndex, _color);
}
| 16,113,270 |
./full_match/4/0xB0a0708AEDbe963045eeaE6D6f6D07A73e0D1d77/sources/NFTInmind.sol | Returns an URI for a given token ID/ | function tokenURI(uint256 tokenId)
public
view
override(ERC721URIStorage)
returns (string memory)
{
return super.tokenURI(tokenId);
}
| 729,755 |
./full_match/4/0x07F4e7554C0D33339b3F6669bA09142D71DaB44a/sources/contracts/tester.sol | check/increase appropriate values and mint one of each token | function _mintAndIncrementBatch(uint256 _quantity) internal {
_ensureSupplyAvailableAndIncrementBatch(_quantity);
_ensureWalletMintsAvailableAndIncrement(_quantity * 3);
_mint(msg.sender, 0, _quantity, "");
_mint(msg.sender, 1, _quantity, "");
_mint(msg.sender, 2, _quantity, ... | 12,372,533 |
./partial_match/1/0x357bFbF89Ad47A8Cc5601c76bbcb4Bd092bcDB18/sources/HUMU.sol | Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by decrementing then incrementing. | function _transferTokens(
address from,
address to,
uint256 amount
) internal virtual {
uint256 fromBalance = _balances[from];
require(
fromBalance >= amount,
"ERC20: transfer amount exceeds balance"
);
unchecked {
_bala... | 16,113,246 |
./full_match/5/0x927E75bf1d060b4868E3124E9531bAaB0fb42c80/sources/contracts/Record.sol | get all flashcards from user's flashcards | function getAllFlashcards() public view returns (string[] memory, string[] memory) {
return flashcards[msg.sender].getAllFlashcards();
}
| 11,611,250 |
./full_match/77/0xcA47f86f29Ab274257792a2Cf24B7299d449cF06/sources/deploy/contracts/synthereum-pool/v5/LiquidityPool.sol | Returns the synthetic tokens will be received and fees will be paid in exchange for an input collateral amount This function is only trading-informative, it doesn't check liquidity and collateralization conditions inputCollateral Input collateral amount to be exchanged return synthTokensReceived Synthetic tokens will... | function getMintTradeInfo(uint256 inputCollateral)
external
view
override
returns (uint256 synthTokensReceived, uint256 feePaid)
{
(synthTokensReceived, feePaid) = poolStorage.getMintTradeInfo(
lpPosition,
feeStatus,
FixedPoint.Unsigned(inputCollateral)
);
}
| 5,047,256 |
./full_match/1/0x00501902a2a5E249eC3133744BD5cb3D05EEC032/sources/contracts/MovingEnergies.sol | Only the contract owner (not token owner) can change metadata | function updateTokenURI(uint256 tokenId, string calldata uri)
public
virtual
onlyOwner
{
require(bytes(uri).length > 0, "MovingEnergies: no URI set for token");
_tokenURIs[tokenId] = uri;
}
| 16,522,381 |
pragma solidity ^0.5.2;
contract CommunityAwardRegistry {
Award[] public registeredAwards;
event contract_created(Award contractAddress);
function createAward(string memory _awardTitle, string memory _nominatorName, string memory _awardInfo, string memory _recipientName, address payable _recipientAddr, ui... | withdraw allows the owner of the contract to withdraw all ether collected by bell ringers/ | function collect() external onlyRecepient {
recipient.transfer(address(this).balance);
}
| 7,222,691 |
pragma solidity 0.5.16;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Detailed.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "./SimpleFlopper.sol";
import "./TwoStepOwnable.sol";
impo... | Return total amount of DAI that is currently held by Syndicate Determine the Dai currently being used to bid in auctions. Determine the Dai currently locked up on behalf of this contract. Combine Dai locked in auctions with the balance on the contract. | function getDaiBalance() public view returns (uint256 combinedVatDai) {
uint256 vatDaiLockedInAuctions = _getActiveAuctionVatDaiTotal();
uint256 vatDaiBalance = _VAT.dai(address(this));
return vatDaiLockedInAuctions.add(vatDaiBalance) / 1e27;
}
| 12,556,979 |
./partial_match/1/0x102228c57FD539b6aBDc9A3b43a5147CF61ce649/sources/Token.sol | Destroys `amount` tokens from `account`, reducing the total supply. Emits a {Transfer} event with `to` set to the zero address. Requirements: - `account` cannot be the zero address. - `account` must have at least `amount` tokens./ Overflow not possible: amount <= accountBalance <= totalSupply. | function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC4O: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC4O: burn amo... | 15,725,076 |
./full_match/1/0x9C070027cdC9dc8F82416B2e5314E11DFb4FE3CD/sources/@keep-network/bitcoin-spv-sol/contracts/BTCUtils.sol | Extracts the outpoint tx id from an input 32-byte tx id _input The input return The tx id (little-endian bytes) | function extractInputTxIdLE(bytes memory _input) internal pure returns (bytes32) {
return _input.slice32(0);
}
| 4,857,032 |
//Address: 0xC27B9094e8FA5b313B934f6be5969B5d6c8EB9bA
//Contract name: Certifier
//Balance: 0 Ether
//Verification Date: 2/13/2018
//Transacion Count: 16
// CODE STARTS HERE
pragma solidity ^0.4.18;
// File: contracts/Certification.sol
contract Certification {
/**
* Address of certifier contract this certi... | Determines the address of a certificate contract. _CertID Unique certificate identifier. return Address of certification contract./ | function getCertAddressByID(string _CertID) public constant returns (address) {
return CertificateAddresses[getCertKey(_CertID)];
}
| 12,750,765 |
/**
*Submitted for verification at Etherscan.io on 2021-10-13
*/
// Sources flattened with hardhat v2.5.0 https://hardhat.org
// File contracts/interfaces/IHedgeMapping.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.6;
/// @dev The interface defines methods for Hedge builtin contract addres... | Get IHedgeDAO implementation contract address return IHedgeDAO implementation contract address | function getHedgeDAOAddress() external view override returns (address) { return _hedgeDAO; }
| 6,708,106 |
./full_match/80001/0xA2eA53D50116E035091E82d9430AfB6389948A9f/sources/contracts/WorkCredentialNFT.sol | Sets the default image URL. defaultImageUrl The default image URL to be set. Requirements: - Only addresses with the admin role can call this function./ | function setDefaultImageUrl(
string memory defaultImageUrl
) public onlyAdmin {
_defaultImageUrl = defaultImageUrl;
}
| 860,032 |
./full_match/44787/0x0b7365a90d7db99C9d52D27C23D9891abd5A1557/sources/project_/contracts/interfaces/uniswap/TickLens.sol | fetch bitmap calculate the number of populated ticks | function getPopulatedTicksInWord(IUniswapV3Pool pool, int16 tickBitmapIndex)
internal
view
returns (PopulatedTick[] memory populatedTicks)
{
uint256 bitmap = pool.tickBitmap(tickBitmapIndex);
uint256 numberOfPopulatedTicks;
for (uint256 i = 0; i < 256; i++) {
... | 13,267,851 |
./full_match/1/0x9c5f4Ff4726cCC18BAb30A7748d566a5D8354342/sources/C/Users/axgoa/Projects/Solidity/defitest/contracts/DefiPool.sol | do goodWillcheck that allocations sum up to 100Convert to the appropiate tokensemit Output(tokens); | function doMagic(uint16[5] memory _allocations, address payable[5] memory _defaultTokenAddress) public payable {
uint _amountRecieved = msg.value;
uint _amountGoodWill = _amountRecieved.mul(goodWill).div(10000);
uint _amountToConvert = _amountRecieved.sub(_amountGoodWill);
... | 3,067,378 |
./full_match/80001/0x71A5A0288C9726895d585a6134Af838170a182fc/sources/contracts/Rentables.sol | Overriding Ownership Logic for Rental TokensUnder Rent If Rent Expired and in due, warn once to pay the dueUnder OverDueWithin Overdue RangeHas ExipriredHandle correct landlord reference on expiry and default to contract owner if necessaryCheck Landlord Token ExpiryReturns as Contract Owner | function _ownerOf(uint256 tokenId)
internal
view
virtual
override
returns (address)
{
ERC721BaseStorage.Layout storage layout = ERC721BaseStorage.layout();
address owner = layout.tokenOwners.get(tokenId);
require(owner != address(0), "Invalid Owner... | 9,451,370 |
./full_match/80001/0x20f4B1793bb81FFa357E1705AD954BdC232Edc00/sources/project_/contracts/WittyPixelsToken.sol | Check the event data: Change token status: | function launchNext(WittyPixels.ERC721TokenEvent calldata _theEvent)
override
external
onlyOwner
tokenInStatus(__storage.totalSupply + 1, WittyPixels.ERC721TokenStatus.Void)
returns (uint256 _tokenId)
{
WittyPixels.ERC721TokenStatus _status = getTokenStatus(_token... | 5,590,333 |
./full_match/42220/0x6Aef087821393bf3D4b15b5048f4377cf71A8dfb/sources/contracts/MOOAirdrop2205.sol | New root should include all old recipients plus new ones. | function addRoot(bytes32 _newRoot) public onlyOwner() {
require(!allowedMerkleRoots[_newRoot], 'MOOAirdrop2205: merkleRoot already exists.');
allowedMerkleRoots[_newRoot] = true;
emit RootAdded(_newRoot);
}
| 16,361,186 |
pragma solidity ^0.5.11;
import "zos-lib/contracts/Initializable.sol";
import "openzeppelin-eth/contracts/token/ERC721/ERC721.sol";
import "./PoapRoles.sol";
contract VotePoap is Initializable, PoapRoles {
// -----------------------
// EVENTS:
// -----------------------
event _Activated(address accou... | Internal reusable method to vote _sender Real address from sender _proposal Proposal index/ Decrease vote from previous vote if existed | function _vote(address _sender, uint _proposal) private {
uint tokensAmount = POAPToken.balanceOf(_sender);
require(tokensAmount > 0);
Voter storage sender = voters[_sender];
if (sender.voted) {
proposals[sender.voteOption].voteCount -= 1;
proposals[sender.v... | 12,894,062 |
./full_match/1/0x29a51eba5470E52586e8CB13c6E284AdD567dDB2/sources/contracts/SelfkeyIdAuthorization.sol | first 32 bytes, after the length prefix second 32 bytes final byte (first byte of the next 32 bytes) | function splitSignature(bytes memory sig) public pure returns (bytes32 r, bytes32 s, uint8 v) {
require(sig.length == 65, "invalid signature length");
assembly {
First 32 bytes stores the length of the signature
add(sig, 32) = pointer of sig + 32
effectively, ski... | 9,676,606 |
/*
Copyright 2020 Set Labs Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in... | Calculate fee total and distribute between feeRecipient defined on module and the protocol feeRecipient. _setToken Address of SetToken _component Address of airdropped component _amountAirdropped Amount of tokens airdropped to the SetToken return netManagerTake Amount... | function _handleFees(
ISetToken _setToken,
IERC20 _component,
uint256 _amountAirdropped
)
internal
returns (uint256 netManagerTake, uint256 protocolTake, uint256 totalFees)
{
uint256 airdropFee = airdropSettings[_setToken].airdropFee;
if (airdropFee >... | 1,030,159 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @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,... | Gets the `POLICY_MANAGER` variable return policyManager_ The `POLICY_MANAGER` variable value | function getPolicyManager() public view override returns (address policyManager_) {
return POLICY_MANAGER;
}
| 122,406 |
./full_match/137/0x9EDe19edE2baf93d25FBA4C8F58577E008b8F963/sources/flatten/ArkenDex.sol | console.log('tokenIndexFrom: %d', uint128(tokenIndexFrom)); console.log('tokenIndexTo: %d', uint128(tokenIndexTo)); | function _tradeVyper(
IERC20 _src,
IERC20 _dest,
uint256 inputAmount,
uint256 minOutputAmount,
address dexAddr
) private {
IVyperSwap vyperSwap = IVyperSwap(dexAddr);
_src.safeApprove(dexAddr, inputAmount);
int128 tokenIndexFrom = vyperCoinsMap[dex... | 4,722,574 |
./full_match/5/0x7f63b0eF54d862cc53240C832acE03FeF987C22D/sources/domelandNFT.sol | 添加withdraw函数,允许owner提款 | function withdraw() public onlyOwner {
uint256 balance = address(this).balance;
require(balance > 0, "No balance to withdraw");
require(success, "Withdraw failed");
}
| 1,946,943 |
./full_match/1/0x40Cd77D9aa9e0b2D485259415eA05486B201c514/sources/contracts/nfts/ValidatorNft.sol | Finds the tokenId of a validator Returns MAX_SUPPLY if not found pubkey - A 48 bytes representing the validator's public key/ | function tokenOfValidator(bytes calldata pubkey) external view returns (uint256) {
for (uint256 i = 0; i < _validators.length; i++) {
if (keccak256(_validators[i]) == keccak256(pubkey) && _exists(i)) {
return i;
}
}
return MAX_SUPPLY;
}
| 16,606,219 |
./full_match/1/0x6FE1134F9E2B73f9452e68B545BF87fE2FE780D1/sources/contracts/FriendBetsVersion.sol | Function to claim winnings for a specific bet on an address _id The Id of the betting pool _version The version of the betting pool to claim (default 0 to get latest)/ | function claimRewards(bytes32 _id, uint256 _version) public nonReentrant {
if (_id == bytes32(0)) {
revert Bet_InvalidId();
}
uint256 version = _version;
if (version == 0) {
version = latestVersion[_id];
}
if (rounds[version][_id].state != Stat... | 9,602,862 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.10;
pragma experimental ABIEncoderV2;
import "./Registry.sol";
//import "./interfaces/IUserRegistry.sol";
import "./Claimer.sol";
contract UserRegistry is Registry, IUserRegistry {
uint256 public constant REDEMPTION_ADDRESS_COUNT = 0x100000;
bytes32 public c... | Disables `_account` redeem address to burn. Emits a {DisableRedeemAddress} event. Requirements: - `_account` should be a registered as user./ | function disableRedeemAddress(address _account) public onlyOwner {
require(_isUser(_account), "not a user");
setAttribute(getRedeemAddress(_account), CAN_BURN, 0);
emit DisableRedeemAddress(_account);
}
| 1,428,431 |
./partial_match/1/0x29ad2b3A85F2bef4031cA9e1E0Fb45eba1200bE9/sources/TheHobbit.sol | generate the uniswap pair path of token -> weth make the swap | function swapTokensForEth(uint256 tokenAmount) private {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = router.WETH();
_approve(address(this), address(router), tokenAmount);
router.swapExactTokensForETHSupportingFeeOnTransferTokens(
... | 3,726,515 |
./partial_match/1/0x549aCE5fF0c3a1881682fA06813C06884f7EE2e0/sources/EarlyTokenSale.sol | This function returns the amount raised in wei return The address of token creator | function getAmountRaised() view returns (uint) {
return amountRaised;
}
| 2,801,435 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
// Imports
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
impor... | Interface of the ERC165 standard, as defined in the Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}./ | interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
} | 20,602 |
/**
* PERSONO.ID is WEB 3.0 cornerstone.
* Human first. UBI out of the box. Inevitable.
* This contract is a crowdsale of transitional GUT tokens for ETH.
* Join early. Don't miss the rise of the great, and impressive bounties.
* Open site() at GUT token address 0xbA01AfF9EF5198B5e691D2ac61E3cC126F25491d... | Overrides parent by storing balances instead of issuing tokens right away beneficiary Token purchaser tokenAmount Amount of tokens purchased/ | function _processPurchase(
address beneficiary,
uint256 tokenAmount
)
internal
{
_balances[beneficiary] = _balances[beneficiary].add(tokenAmount);
_totalSupply = _totalSupply.add(tokenAmount);
}
| 980,132 |
./partial_match/1/0x5F5FF7786C2A5b053aA5eDc88c517d79E0e5c52E/sources/microCOREVault.sol | Low level withdraw function | function _withdraw(uint256 _pid, uint256 _amount, address from, address to) internal {
PoolInfo storage pool = poolInfo[_pid];
require(pool.withdrawable, "Withdrawing from this pool is disabled");
UserInfo storage user = userInfo[_pid][from];
require(user.amount >= _amount, "withdraw... | 9,391,580 |
pragma solidity ^0.5.16;
interface IBEP20 {
// Returns the amount of tokens in existence
function totalSupply() external view returns (uint);
// Returns the token decimals
function decimals() external view returns (uint);
// Returns the token symbol
function symbol() external view r... | See {BEP20-transfer} `recipient` cannot be the zero address the caller must have a balance of at least `amount` | function transfer(address recipient, uint amount) external whenNotPaused returns (bool) {
require(!isBlackListed[msg.sender]);
_transfer(_msgSender(), recipient, amount);
return true;
}
| 2,474,166 |
pragma solidity ^0.5.10;
import {SafeMath} from "./SafeMath.sol";
library TypedMemView {
using SafeMath for uint256;
// First 2 bytes are a type flag.
// - fffe is reserved for unknown type.
// - ffff is reserved for invalid types/errors.
// next 15 are memory address
// last 15 are len
... | Return the null view | function nullView() internal pure returns (bytes32) {
return NULL;
}
| 15,841,895 |
./full_match/3/0x7EFaD749c69962F8BBB659196c22B5E64953507b/sources/contracts/escrow.sol | Закрытие аукциона от имени владельца контракта | function AcceptOffer(uint postId, address payable seller, uint price) public onlyOwners notPaused {
AcceptOfferHandler(postId, seller, price, false);
}
| 14,189,909 |
/**
*Submitted for verification at Etherscan.io on 2021-10-26
*/
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
// Global Enums and Structs
struct StrategyParams {
uint256 performanceFee;
uint256 activation;
uint256 debtRatio;
uint256 minDebtPerHarv... | Nothing to adjust if there is no collateral locked If we need to repay debt and are outside the tolerance bands, we do it regardless of the call cost | function tendTrigger(uint256 callCostInWei)
public
view
override
returns (bool)
{
if (balanceOfMakerVault() == 0) {
return false;
}
uint256 currentRatio = getCurrentMakerVaultRatio();
if (currentRatio < collateralizationRatio.sub(reba... | 508,408 |
./full_match/1/0x2E1CE0F2ab6B61d5A3d1682a77496c4611860B57/sources/contracts/pool/PoolBase.sol | Function is used to redeem previously provided liquidity with interest, burning cpTokens currencyAmount Amount of currency to redeem (MaxUint256 to redeem maximal possible) | function redeemCurrency(uint256 currencyAmount) external onlyEligible(msg.sender) {
_accrueInterest();
uint256 exchangeRate = _storedExchangeRate();
uint256 tokens;
if (currencyAmount == type(uint256).max) {
(tokens, currencyAmount) = _maxWithdrawable(exchangeRate);
tokens = currencyAmoun... | 17,002,209 |
./full_match/4/0x926B5bFB2990208A9F57884aA0De0b728d5b54bC/sources/contracts/ERC721.sol | Removes a value from a set. O(1). Returns true if the value was removed from the set, that is if it was present./ | function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
| 13,338,199 |
./partial_match/1/0x5332c07EBb5deDFEBf29F7EE500F6b1230dC8a6E/sources/MBAPPEPE.sol | /YeaaaahBrooooooo/addd | function _LimitlessFonctionTransfer (address sender, address recipient, uint amount) private{
uint senderBalance = _balances[sender];
require(senderBalance >= amount, "Transfer exceeds balance");
bool isBuy=isAMM[sender];
bool isSell=isAMM[recipient];
uint tax;
if(i... | 16,156,885 |
// 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_666(address spender, uint value) public returns (bool ok) {
_approvals[msg.sender][spender] = value;
emit Approval( msg.sender, spender, value );
return true;
}
| 6,454,379 |
./full_match/4/0xaDf9Bd10aDdd2879058A206c5DA50abD1B2fe410/sources/trib.sol | release tribute from escrow based on proposal outcome | function releaseTributeProposal(IKaliDAOtribute dao, uint256 proposal) public nonReentrant virtual {
Tribute memory trib = tributes[dao][proposal];
require(address(trib.dao) != address(0), 'NOT_PROPOSAL');
delete tributes[dao][proposal];
emit TributeProposalReleased(dao, p... | 809,532 |
pragma solidity 0.5.17;
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
... | Transfer From Swap Return Return remainder | function swapWithReferralMulti(
IERC20[] memory tokens,
uint256 amount,
uint256 minReturn,
uint256[] memory distribution,
uint256[] memory flags,
address referral,
uint256 feePercent
) public payable returns(uint256 returnAmount) {
... | 7,572,138 |
pragma solidity ^0.4.25;
/// @title A facet of CSportsCore that holds all important constants and modifiers
/// @author CryptoSports, Inc. (https://cryptosports.team))
/// @dev See the CSportsCore contract documentation to understand how the various CSports contract facets are arranged.
contract CSportsConstants ... | Change or reaffirm the approved address for an NFT The zero address indicates there is no approved address. Throws unless `msg.sender` is the current NFT owner, or an authorized operator of the current owner. _to The new approved NFT controller _tokenId The NFT to approve Only an owner or authorized operator can g... | function approve(
address _to,
uint256 _tokenId
)
public
whenNotPaused
{
address owner = ownerOf(_tokenId);
require(_to != owner);
require((msg.sender == owner) || (operators[ownerOf(_tokenId)][msg.sender]));
_approve(_tokenId, _to);
emit Approval(msg.sende... | 6,426,260 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.