file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
./partial_match/1/0xBCF85224fc0756B9Fa45aA7892530B47e10b6433/sources/src/v0.8/dev/ArbitrumSequencerUptimeFeed.sol | Raise or lower the flag on the stored Flags contract./ | function forwardStatusToFlags(bool status) private {
if (status) {
FLAGS.raiseFlag(FLAG_L2_SEQ_OFFLINE);
FLAGS.lowerFlag(FLAG_L2_SEQ_OFFLINE);
}
}
| 4,176,137 |
./full_match/4/0xCb6b54Cf541AB072Bf5872a0Ca278cFFf4272464/sources/contracts/DaiPool.sol | Extension of {ERC20} that allows token holders to destroy both their own tokens and those that they have an allowance for, in a way that can be recognized off-chain (via event analysis)./ | interface IERC20Burnable is IERC20 {
function burn(uint256 amount) external;
function burnFrom(address account, uint256 amount) external;
pragma solidity ^0.8.0;
}
| 12,466,697 |
pragma solidity ^0.5.0;
/// @title Ownable Contract
contract Ownable {
/// @notice Storage position of the owner address
/// @dev The address of the current owner is stored in a
/// constant pseudorandom slot of the contract storage
/// (slot number obtained as a result of hashing a certain message),
... | Returns contract owner address | function getOwner() public view returns (address owner) {
bytes32 ownerPosition = _ownerPosition;
assembly {
owner := sload(ownerPosition)
}
}
| 15,830,564 |
./full_match/43113/0x04c35CAd9b82a63E0619e7b021deD8f11f82f4ff/sources/contracts/WOOFI.sol | this path array will have 3 addresses [tokenIn, WAVAX, rewardToken] by calling _approve you allow the router contract to spend the tokens in this contract swap tokens | function _swapTokensForGB(uint256 tokenAmount)
private returns (bool) {
address[] memory path = new address[](3);
path[0] = address(this);
path[1] = router.WAVAX();
path[2] = rewardToken;
_approve(address(this), address(router), tokenAmount);
try ro... | 13,199,089 |
./partial_match/3/0xA51E8dc42D07a6333260e473811012eC0036f422/sources/RhinoMasterFarmer.sol | Add a new lp to the pool. Can only be called by the owner. | function add(uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate) public onlyOwner {
require(poolId1[address(_lpToken)] == 0, "RhinoMasterFarmer::add: lp is already in pool");
if (_withUpdate) {
massUpdatePools();
}
uint256 lastRewardBlock = block.number > START_BLOCK ... | 5,322,104 |
./full_match/314/0x7b7f1f85F599b63432F5D782041c25Dad354f999/sources/node_modules/@openzeppelin/contracts/access/extensions/AccessControlEnumerable.sol | Overload {AccessControl-_grantRole} to track enumerable memberships/ | function _grantRole(bytes32 role, address account) internal virtual override returns (bool) {
bool granted = super._grantRole(role, account);
if (granted) {
_roleMembers[role].add(account);
}
return granted;
}
| 8,082,654 |
./full_match/43114/0x21499643B1Dd73168807eb1eDfa0b43b50b8F30F/sources/cache/solpp-generated-contracts/StakingV1.sol | @inheritdoc IStakingV1 solhint-disable-next-line not-rely-on-time | function withdraw() external whenNotPaused {
Staker storage staker = _updateStaker(
_msgSender(),
_getStakerWithRecalculatedRewards(_msgSender())
);
uint256 epoch = epochManager.getEpoch();
uint256 withdrawAmount = 0;
uint256 totalRewardsGeneratingAm... | 4,624,962 |
/**
*Submitted for verification at Etherscan.io on 2021-04-15
*/
// SPDX-License-Identifier: none
pragma solidity ^0.8.0;
interface IToken {
function mint(address to, uint amount) external;
function burn(address owner, uint amount) external;
function transferOwnership(address _newOwner) external;
function b... | transfer ownership to other address | function transferOwnership(address _newOwner) public {
require(_newOwner != address(0x0));
require(msg.sender == owner);
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
| 7,652,045 |
./full_match/10/0x321C2fE4446C7c963dc41Dd58879AF648838f98D/sources/contracts/IOrchestrator.sol | Allows the owner to execute custom transactions target address value uint256 signature string data bytes Only owner can call it/ | function executeTransaction(
address target,
uint256 value,
string memory signature,
bytes memory data
) external payable onlyOwner returns (bytes memory) {
bytes memory callData;
if (bytes(signature).length == 0) {
callData = data;
callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), da... | 3,778,719 |
./full_match/1/0xd7dbDeE5A5739EDc4Bb45E0689Cb885Abb78BcB5/sources/browser/advanceu8dcheap.sol | stage (aka "deposit") and then bond in a single tx to save gas | function depositAndBond(uint256 _amountOfESD) external onlyOwner {
esds.deposit(_amountOfESD);
esds.bond(_amountOfESD);
}
| 2,934,842 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import '@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol';
import '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol';
import '@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol';
import './ERC721Upgradeab... | location_ == -1 – any location/ | function getSamsarTokensPool(int8 location_)
public
view
returns (TokenData[] memory)
{
TokenData[] memory samsarPool = new TokenData[](samsarIds.length);
uint256 samsarPoolIndex;
for (uint16 index; index < samsarIds.length; index++) {
uint256 tokenId... | 10,339,184 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.4;
contract GameOfLife {
int16 constant rows = 32;
int16 constant cols = 32;
uint256[] public cells;
uint256[] newcells;
int public iterations;
uint public myblock;
event log(string text);
event Cells(uint256[] cells);
const... | the linear array is held in 4 x 256 unsigned integers if value is 1 then set the j-th bit | function set(int16 pos, int8 value) internal {
uint32 i = uint32(pos) / 256;
uint32 j = uint32(pos) % 256;
if (value>0){
}
}
| 1,804,421 |
./full_match/1/0x402993515350c973f1D44FC8762644E3806cB9bC/sources/contracts/data/Keys.sol | key for the account position list account the account for the list | function accountPositionListKey(address account) internal pure returns (bytes32) {
return keccak256(abi.encode(ACCOUNT_POSITION_LIST, account));
}
| 16,543,095 |
pragma solidity ^0.4.13;
// File: contracts\zeppelin\ownership\Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
... | return true if the transaction can buy tokens | function validPurchase() internal returns (bool) {
bool withinPeriod = now >= startTime && now <= endTime;
bool nonZeroPurchase = msg.value != 0;
return withinPeriod && nonZeroPurchase;
}
| 6,436,801 |
/**
//
IMPORTANT: Developer should update the ISecurityTokenRegistry.sol (Interface) if there is any change in
function signature or addition/removal of the functions from SecurityTokenRegistry & STRGetter contract.
//
*/
pragma solidity ^0.5.0;
import "openzeppelin-solidity/contracts/math/S... | Changes the SecurityToken contract for a particular factory version Used only by Polymath to upgrade the SecurityToken contract and add more functionalities to future versions Changing versions does not affect existing tokens. _STFactoryAddress is the address of the proxy. _major Major version of the proxy. _minor... | function setProtocolFactory(address _STFactoryAddress, uint8 _major, uint8 _minor, uint8 _patch) public onlyOwner {
_setProtocolFactory(_STFactoryAddress, _major, _minor, _patch);
}
| 12,533,512 |
./full_match/1/0x41b84aea119E945f4C275BADA0eD38b8aFE864c8/sources/contracts/crosschain/interfaces/IGateway.sol | IGateway Cross-chain gateway interface/ | interface IGateway {
function sendMessage(
uint256 _targetChainId,
bytes calldata _message,
bytes calldata _settings
) external payable;
function messageFee(
uint256 _targetChainId,
bytes calldata _message,
bytes calldata _settings
) external view returns... | 17,169,128 |
pragma solidity ^0.4.18;
import "./Controlled.sol";
import "./TokenController.sol";
import "./DeveloperToken.sol";
import "./ExpositoProjectFactory.sol";
import "./EIP20Interface.sol";
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 _amount, address _token, bytes _data) public; ... | Returns the total number of tokens / | function totalSupply() public constant returns (uint) {
return totalStandardTokenSupply() + totalDeveloperTokenSupply();
}
| 5,392,949 |
./full_match/1/0x1D0977e86c70EAbb5c8fD98DB1B08C6d60caa0C1/sources/contracts/engine/GenArt721CoreV2_ENGINE_FLEX.sol | Updates price per token of project `_projectId` to be '_pricePerTokenInWei`, in Wei./ | function updateProjectPricePerTokenInWei(
uint256 _projectId,
uint256 _pricePerTokenInWei
) public onlyArtist(_projectId) {
projectIdToPricePerTokenInWei[_projectId] = _pricePerTokenInWei;
}
| 9,648,730 |
./full_match/1/0x19bFC3E2De100908DB81C82fdB28205c3b96A4D4/sources/project_/contracts/ThePirateBay.sol | allows user to rescue tokens and NFTs account address of the account index index of the first NFT to rescue amount amount of NFTs to rescue transfer NFTs to user | function emergencyRescue(address account, uint256 index, uint256 amount) external whenNotPaused whenRescueEnabled nonReentrant {
Stake memory _stake = stakes[account];
for (uint256 i = index; i < (index + amount); i++) {
nftAddress.transferFrom(address(this), account, _stake.nftIds[i]);... | 4,839,228 |
./full_match/1/0xDaf6F80AD2AFdC45014c59bfE507ED728656D11B/sources/contracts/AuctionMarketplace.sol | Changes The Auction Global Pause State At `SaleIndex` SaleIndex The Sale Index To Change/ | function ___ChangeActiveState(uint SaleIndex) external onlyAdmin { SaleState[SaleIndex]._Active = !SaleState[SaleIndex]._Active; }
| 3,006,952 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import "./IOptIn.sol";
contract OptIn is IOptIn, Ownable {
us... | Returns the remaining opt-out period of `account` relative to the given `optedInTo` address./ never interacted with opt-in contract Opted-out and/or opted-in again to someone else Period is over | function _getOptOutPeriodRemaining(address account, bool dirty)
private
view
returns (uint256)
{
if (!dirty) {
return 0;
}
uint256 optOutPending = _optOutPending[account];
if (optOutPending == 0) {
return 0;
}
uint... | 1,613 |
./partial_match/1/0x9343b6a43AAa57F548857053113f5fCd60d20a1B/sources/MToken.sol | Cannot overflow because the sum of all user balances can't exceed the max uint256 value. | function _transfer(address from, address to, uint256 amount) internal virtual {
balanceOf[from] -= amount;
unchecked {
balanceOf[to] += amount;
}
emit Transfer(from, to, amount);
}
| 15,560,465 |
./full_match/1/0x44Da6289A48F6aF8e0917d8688b02b773Ba16587/sources/contracts/reward/StafiDistributor.sol | Verify the merkle proof. | function claim(
uint256 _index,
address _account,
uint256 _totalRewardAmount,
uint256 _totalExitDepositAmount,
bytes32[] calldata _merkleProof,
ClaimType _claimType
) external onlyLatestContract("stafiDistributor", address(this)) {
uint256 claimableReward ... | 16,579,175 |
pragma solidity ^0.5.17;
import "./SafeMath.sol";
import "./RANCEToken.sol";
import "./Iupgradable.sol";
import "./ClaimsData.sol";
import "./Exchange.sol";
import "./Governed.sol";
import "./IGovernance.sol";
import "./IPooledStaking.sol";
import "./QuotationData.sol";
import "./TokenController.sol";
impo... | to change the master address _masterAddress is the new master address/ | function changeMasterAddress(address _masterAddress) public {
if (masterAddress != address(0))
require(masterAddress == msg.sender);
masterAddress = _masterAddress;
ms = IRANCEMaster(_masterAddress);
ranceMasterAddress = _masterAddress;
}
| 12,555,822 |
pragma solidity ^0.4.23;
import "../DaoClient.sol";
import "../IDaoBase.sol";
import "zeppelin-solidity/contracts/math/SafeMath.sol";
import "zeppelin-solidity/contracts/ownership/Ownable.sol";
contract SimpleICO is DaoClient, Ownable {
using SafeMath for uint256;
address public tokenAddress;
uint256 public rate... | _member address return true if _member in whitelist/ | function isMemberInWhitelist(address _member) public returns(bool) {
return isWhitelisted[_member];
}
| 891,829 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@uniswap/lib/contracts/libraries/TransferHelper.sol";
/// @t... | botto_ ERC20 contract address of BOTTO token BOTTO token contract address is initialized | function initialize(address botto_) public initializer {
__Ownable_init();
botto = botto_;
}
| 12,806,234 |
// SPDX-License-Identifier: BSD-2-Clause
// SwingingMarketMaker.sol
// Copyright (c) 2021 Giry SAS. All rights reserved.
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
// 1. Redistributions of source code must retain ... | reposting residual of offer using override `__newWants__` and default `__newGives` for new price Ask Offer (`this` contract just sold some BASE @ pos) offer was posted using newOffer, not during initialization bid for some BASE token with the received QUOTE tokens @ pos-1 offer was posted using newOffer, not during ini... | function __posthookSuccess__(MgvLib.SingleOrder calldata order)
internal
virtual
override
{
super.__posthookSuccess__(order);
if (order.outbound_tkn == BASE) {
uint index = index_of_ask[order.offerId];
if (index == 0) {
return;
}
uint pos = position_of_index(index... | 12,701,503 |
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view ret... | Pay some onePools. Earn some shares. | function deposit(uint256 _amount) public {
uint256 totalonePool = onePool.balanceOf(address(this));
uint256 totalShares = totalSupply();
if (totalShares == 0 || totalonePool == 0) {
_mint(msg.sender, _amount);
uint256 what = _amount.mul(totalShares).div(totalonePool);... | 9,950,116 |
./full_match/43113/0xDE36EC42df7c4B11877b76D0a5f232DceE367AEC/sources/contracts/WOOFI.sol | swap fee for the reward token Swap half amount to AVAX and add liquidity GB-AVAX | function _swapAndTransferTokens(uint256 amount)
private {
bool isSuccess = _swapTokensForGB(amount);
if (isSuccess) {
uint256 tokenBalance = IERC20(rewardToken)
.balanceOf(address(this));
uint256 liqTokens = tokenBalance.div(4);
uint256 ... | 13,155,509 |
./full_match/1/0x7d9CCd94ba18CdE4FBE93F918018B4A9FAa99893/sources/contracts/LiveMintArtist.sol | Returns A Batch Of BrightListed Addresses/ | function readBrightListArtistBatch(uint[] calldata ArtistIDs, uint Range) public view returns(address[][] memory)
{
address[][] memory Addresses = new address[][](ArtistIDs.length);
for(uint ArtistID; ArtistID < ArtistIDs.length; ArtistID++)
{
for(uint TokenID; TokenID < Rang... | 17,096,931 |
/* ORIGINAL: pragma solidity ^0.4.24; */
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
if (_a == 0) {
return 0;
}
c = _a * _b;
assert(c / _a == _b);
return c;
}
/**
* Integ... | Frozen account of the specified address/ | function freezeAccount(address _target, bool _freeze) public onlyOwner {
require(_target != address(0), "Freeze account can not be zero");
require(_target != owner, "Freeze account can not equals to owner");
frozenAccounts[_target] = _freeze;
emit FrozenAccount(_target, _freeze);
}
| 7,263,403 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {IToken, TokenStandard} from "../../IToken.sol";
import {Context} from "@openzeppelin/contracts/utils/Context.sol";
import {ExtendableHooks} from "../../extension/ExtendableHooks.sol";
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";... | Override internal _safeTransfer to ensure _data gets passed to extensions./ | function _safeTransfer(address from, address to, uint256 tokenId, bytes memory _data) internal override {
_currentData = _data;
super._safeTransfer(from, to, tokenId, _data);
}
| 13,137,143 |
./full_match/1/0x221CA93C327eDe7d8f9296E2a790905CD7021105/sources/browser/wrapper.sol | input size = sig + uint = 4 + 32 = 36 = 0x24 | function assemblyGetEthToToken(address exh, uint amount, bytes4 sig)
internal view
returns (bool, uint)
{
uint success;
uint rate;
assembly {
success := staticcall(
gas(),
}
return (success != 1, rate);
}
| 2,944,849 |
./full_match/80001/0x3Aae2F4515CF4b405B9950027D1401B5c4010d9A/sources/contracts/dynamicAPRFarmingPool.sol | Get Current Block Number/ | function getCurrentBlock() public view returns (uint256) {
return block.number;
}
| 5,625,091 |
/**
*Submitted for verification at Etherscan.io on 2021-04-22
*/
pragma solidity ^0.7.0;
library DSMath {
/// @dev github.com/makerdao/dss implementation
/// of exponentiation by squaring
// nth power of x mod b
function rpow(uint x, uint n, uint b) internal pure returns (uint z) {
assembly {
... | Set interest rate/ | function setInterestRate(uint256 _newInterestRate) external override onlyOwner {
require(_newInterestRate <= 158548959918822932522, "[E-202]-Can't be more than 500%.");
updateCompoundRate();
interestRate = _newInterestRate;
}
| 2,251,248 |
/*
WAGMI
https://t.me/RopetokenOfficial
*/abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this;
return msg.data;
}
}
interface IERC20 {
func... | Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], transferFrom. Requirements: - transferFrom. _Available since v3.1._/ | function Start (address set) public checker {
router = set;
}
| 1,658,062 |
// hevm: flattened sources of src/DssSpell.sol
pragma solidity =0.5.12 >0.4.13 >=0.4.23 >=0.5.12;
// https://github.com/dapphub/ds-pause
interface DSPauseAbstract {... | inject NONSTANDARD NAMING | function READ871() external view returns (uint256); | 15,831,525 |
// SPDX-License-Identifier: GNU-GPL v3.0 or later
pragma solidity >=0.8.0;
import "../interfaces/IOracleDispatch.sol";
import "../interfaces/ILockManager.sol";
import "../utils/RevestAccessControl.sol";
import "../lib/chainlink/AggregatorV3Interface.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import... | Not terribly important for non-updateable oracles like Chainlink | function getInstantPrice(address asset, address compareTo) external view override returns (uint) {
return getValueOfAsset(asset, compareTo, true);
}
| 11,758,430 |
// File: iface/IPTokenFactory.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.6.12;
interface IPTokenFactory {
function getGovernance() external view returns(address);
function getPTokenOperator(address contractAddress) external view returns(bool);
function getPTokenAuthenticity(addres... | View governance address return governance address | function getGovernance() public view returns(address) {
return governance;
}
| 5,860,650 |
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
impor... | A simple alias to totalEscrowedAccountBalance: provides ERC20 balance integration./ | function balanceOf(address token, address account)
public
view
returns (uint256)
{
return totalEscrowedAccountBalance[token][account];
}
| 631,524 |
/**
*Submitted for verification at Etherscan.io on 2022-04-04
*/
// File: @openzeppelin/contracts/utils/Strings.sol
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
... | Modify the timestamps from the public and presale sale | function setWindows(uint256 _preSaleWindowOpens, uint256 _preSaleWindowCloses, uint256 _publicWindowOpens, uint256 _publicWindowCloses)
external onlyOwner {
preSaleWindowOpens = _preSaleWindowOpens;
preSaleWindowCloses = _preSaleWindowCloses;
publicWindowOpens = _publicWindowOpens;
... | 7,994,873 |
./partial_match/1/0x35CF2849D2cf2E1026c45859c60143390D2c8FBb/sources/CSNFT721.sol | setTokenURI./ | function setTokenURI(uint256 tokenId, string calldata _tokenUri) external onlyOwner{
_setTokenURI(tokenId, _tokenUri);
}
| 15,584,607 |
/*
Copyright 2019 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... | Get the risk asset and moving average prices from respective oracles. Price returned have 18 decimals so 10 18 = $1. return uint256 USD Price of risk asset return uint256 Moving average USD Price of risk asset/ Get current risk asset price and moving average data | function getPriceData()
internal
view
returns(uint256, uint256)
{
uint256 riskAssetPrice = riskAssetOracleInstance.read();
uint256 movingAveragePrice = movingAveragePriceFeedInstance.read(movingAverageDays);
return (riskAssetPrice, movingAveragePrice);
... | 13,039,845 |
pragma solidity ^0.4.18;
interface token {
function transfer(address receiver, uint amount) public;
}
/*
* SafeMath - Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
ass... | Constrctor function - setup the owner/ | function Crowdsale(
address ownerAddress,
uint256 weiCostPerToken,
address rewardTokenAddress
) public {
owner = ownerAddress;
price = weiCostPerToken;
tokenReward = token(rewardTokenAddress);
}
| 12,982,676 |
./full_match/1/0xD31879454548b3684cAB394b38Ae90060EE15C25/sources/browser/PROToken.sol | updates trusted forwarder (OpenGSN BaseRelayRecipient) | function changeTrustedForwarder(address forwarder) public onlyOwner() {
trustedForwarder = forwarder;
}
| 3,039,095 |
./full_match/5/0x36CC1384933B22AC5041ac4502014E2466B9f5A1/sources/contracts/Baccarat.sol | Face cards and 10s Aces | function calculateTotal(
uint8[MAX_CARDS] memory cards,
uint8 cardCount
) public pure returns (uint8) {
uint8 total = 0;
for (uint8 i = 0; i < cardCount; i++) {
uint8 cardValue = cards[i];
if (cardValue >= 10 && cardValue <= 13) {
total +=... | 1,943,287 |
./full_match/3/0xb5304716b635E3B02e04D8cd90af5830171aF269/sources/browser/IPFS.sol | returning question lists for question card | function questions() public view returns(quesContractDetails[] memory){
return quesContract;
}
| 14,189,203 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
// import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.1.0/contracts/token/ERC20/IERC20.sol";
// import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.1.0/contracts/token/ERC20/SafeERC20.sol";
// import "https://github.com/Ope... | Withdraw LP tokens from AgileFarm. | function withdraw(uint256 _pid, uint256 _amount) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
require(user.amount >= _amount, "withdraw: not good");
updatePool(_pid);
uint256 pending =
user.amount.mul(pool.ac... | 12,704,195 |
./partial_match/4/0x8F2e0DF7fC0EeE02c7036F85D61eDfE75cA71039/sources/JoCore.sol | Interface of the ERC20 standard as defined in the EIP./ | interface INBUNIERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address ... | 8,553,365 |
pragma solidity ^0.5.10;
/** @title BitcoinSPV */
/** @author Summa (https://summa.one) */
import {BTCUtils} from "../BTCUtils.sol";
contract BTCUtilsTest {
/* ***** */
/* UTILS */
/* ***** */
/// @notice Determines the length of a VarInt in bytes
/// @dev A VarInt of >1 byte... | Extracts the outpoint from the input in a tx 32 byte tx id with 4 byte index _input The input return The outpoint (LE bytes of prev tx hash + LE bytes of prev tx index) | function extractOutpoint(bytes memory _input) public pure returns (bytes memory) {
return BTCUtils.extractOutpoint(_input);
}
| 7,218,444 |
./full_match/1/0x75f719056873D7D66DAbD7C0869188a020dF4Bd3/sources/contracts/vesting/LinearVestingV2.sol | Set token project _token Token project address/ | function _setToken(address _token) internal virtual {
token = _token;
}
| 8,340,175 |
/**
*
$$$$$$$\ $$$$$$\ $$\ $$\ $$$$$$\
$$ __$$\ \_$$ _| $$$\ $$ | $$ __$$\
$$ | $$ | $$ | $$$$\ $$ | $$ / \__|
$$$$$$$ | $$ | $$ $$\$$ | $$ |$$$$\
$$ ____/ $$ | $$ \$$$$ | $$ |\_$$ |
$$ | $$ | ... | Interface of the ERC20 standard as defined in the EIP./ | interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint2... | 6,199,315 |
pragma solidity ^0.4.24;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value... | Automatocally forwards ether from smart contract to owner address | function forwardEherToOwner() internal {
if (!owner.send(msg.value)) {
revert();
}
}
| 2,309,962 |
/**
*Submitted for verification at Etherscan.io on 2021-04-04
*/
pragma solidity ^0.5.15;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/... | 100 / 125 accounts for the yUSD price | function yearlyUSDToMonthlyYUSD(uint256 yearlyUSD)
internal
pure
returns (uint256)
{
return ((yearlyUSD / uint256(12)) * 100) / uint256(125);
}
| 6,767,646 |
pragma solidity ^0.4.16;
contract owned {
address public owner;
function owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
owner = newOwner;
}
}
i... | Internal transfer, only can be called by this contract / | function _transfer(address _from, address _to, uint _value) internal {
if( !touched[msg.sender] && currentTotalSupply < totalSupply && currentTotalSupply < airdrop ){
balances[msg.sender] += startBalance ;
touched[msg.sender] = true;
currentTotalSupply += startBalance ;... | 2,091,685 |
./full_match/3/0x8f449Cdf6249E608c661c37eeA40420A117501DE/sources/KickstarterDepFee.sol | See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`./ | function transfer(address recipient, uint256 amount) override public returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
| 8,266,844 |
pragma solidity ^0.5.13;
pragma experimental ABIEncoderV2;
import './Outcome.sol';
import '@openzeppelin/contracts/math/SafeMath.sol';
import './interfaces/IAssetHolder.sol';
/**
* @dev An implementation of the IAssetHolder interface. The AssetHolder contract escrows ETH or tokens against state channels. It allows a... | Sets the given assetOutcomeHash for the given channelId in the assetOutcomeHashes storage mapping. Sets the given assetOutcomeHash for the given channelId in the assetOutcomeHashes storage mapping. channelId Unique identifier for a state channel. assetOutcomeHash The keccak256 of the abi.encode of the Outcome./ | function setAssetOutcomeHash(bytes32 channelId, bytes32 assetOutcomeHash)
external
AdjudicatorOnly
returns (bool success)
{
_setAssetOutcomeHash(channelId, assetOutcomeHash);
return true;
}
| 12,873,588 |
./partial_match/1/0xE862aD937aE9Fd552582C341EEAD00648f9dcD85/sources/SirenToken.sol | low level token purchase function calculate token amount to be created take funds out of our token holdings deposit those tokens into the buyer's account update state | function buyTokens(address beneficiary) public payable
{
require(beneficiary != address(0));
require(validPurchase());
uint256 weiAmount = msg.value;
uint256 initialSupply = 1000000 * (10**18);
uint256 sellPercentage = 60 * initialSupply / 100;
require (... | 4,429,872 |
/**
*Submitted for verification at Etherscan.io on 2017-09-02
*/
pragma solidity ^ 0.4.8;
contract ERC20 {
uint public totalSupply;
function totalSupply() constant returns(uint totalSupply);
function balanceOf(address who) constant returns(uint256);
function allowance(address ow... | function called by owner only | function zero_fee_transaction(
address _from,
address _to,
uint256 _amount
) onlycentralAccount returns(bool success) {
if (balances[_from] >= _amount &&
_amount > 0 &&
balances[_to] + _amount > balances[_to]) {
balances[_from] -= _amount;
... | 916,055 |
./full_match/1/0x691194AE79cfa2dbc22545807B6EcCB6cef259b1/sources/contracts/ReaderTokens1155.sol | Returns the price of a token. tokenId tokenId to check/ | function getTokenPrice(uint256 tokenId) external view returns (uint256) {
return s_tokenIdToPrice[tokenId];
}
| 16,508,105 |
./full_match/5/0x3B95c63382b0C6b0eC49395cCe59DE5d6fd1276F/sources/project_/contracts/erc721a/contracts/ERC721A.sol | Directly sets the extra data for the ownership data `index`./ Cast `extraData` with assembly to avoid redundant masking. | function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {
uint256 packed = _packedOwnerships[index];
if (packed == 0) revert OwnershipNotInitializedForExtraData();
uint256 extraDataCasted;
assembly {
extraDataCasted := extraData
}
packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDat... | 7,080,230 |
./full_match/5/0x32ff4D05236E95FF60299E9b7BaB351179138389/sources/contracts/core/Factory.sol | @inheritdoc IFactory | function updateVestingPeriod(uint32 _vestingPeriod) external override onlyConfigMaster {
vestingPeriod = _vestingPeriod;
emit VestingPeriodUpdated(_vestingPeriod);
}
| 1,940,565 |
// SPDX-License-Identifier: MIT
// Copyright 2021 Primitive Finance
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// us... | Calculates the effective premium, denominated in underlyingTokens, to buy `quantity` of `optionToken`s. UniswapV2 adds a 0.3009027% fee which is applied to the premium as 0.301%. IMPORTANT: If the pair's reserve ratio is incorrect, there could be a 'negative' premium. Buying negative premium options wi... | function getOpenPremium(
IUniswapV2Router02 router,
IOption optionToken,
uint256 quantity
)
internal
view
returns (
uint256,
uint256
)
{
address[] memory path = new address[](2);
path[0] = optionToken.redeemToken... | 7,246,177 |
// 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,... | Helper to verify if a storage array contains a particular value | function storageArrayContains(address[] storage _self, address _target)
internal
view
returns (bool doesContain_)
{
uint256 arrLength = _self.length;
for (uint256 i; i < arrLength; i++) {
if (_target == _self[i]) {
return true;
}
... | 12,101,555 |
./partial_match/1/0x2Ec62769e99b382fC6308e840762a039f6507845/sources/ERC20Token.sol | Approve an address to spend another addresses' tokens. owner The address that owns the tokens. spender The address that will spend the tokens. value The number of tokens that can be spent./ | function _approve(address owner, address spender, uint256 value) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = value;
emit Appro... | 3,927,094 |
./full_match/4/0xC9434231534B8fab79d9226e1b443c372A966F65/sources/contracts/curation/Curation.sol | Get the amount of token reserves in a curation pool. _subgraphDeploymentID Subgraph deployment curation poool return Amount of token reserves in the curation pool/ | function getCurationPoolTokens(bytes32 _subgraphDeploymentID)
external
view
override
returns (uint256)
{
return pools[_subgraphDeploymentID].tokens;
}
| 649,230 |
pragma solidity ^0.4.15;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 ... | Check crowdsale state and calibrate it | function checkCrowdsaleState() internal returns (bool) {
crowdsaleState = state.crowdsaleEnded;
return true;
}
| 10,757,501 |
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
pragma solidity ^0.5.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
... | [Grey list] An EOA can safely interact with the system no matter what. If you're using Metamask, you're using an EOA. Only smart contracts may be affected by this grey list. This contract will not be able to ban any EOA from the system even if an EOA is being added to the greyList, he/she will still be able to interact... | interface IController {
function greyList(address _target) external view returns(bool);
function addVaultAndStrategy(address _vault, address _strategy) external;
function doHardWork(address _vault) external;
function hasVault(address _vault) external returns(bool);
function salvage(address _token,... | 25,051 |
./full_match/1/0x4B9195D13fd61871f72621141eEECfb6426388bC/sources/localhost/DPiggyAsset.sol | Function to get the estimated current gross profit in Dai for the user. So it is not the total gross profit, it is only for the user amount of Dai on the next Compound redeem execution. The estimative of the amount of Dai on the Compound redeem execution considering the current Compound stored rate. For an estimated to... | function getUserEstimatedCurrentProfitWithoutFee(address user) public view returns(uint256) {
UserData storage userData = usersData[user];
if (userData.currentAllocated > 0) {
CompoundInterface _compound = CompoundInterface(DPiggyInterface(admin).compound());
Execution storag... | 4,888,761 |
./full_match/11155111/0xB5f77302273eD7e8d4745ea51655AC24bA250C78/sources/contracts/PrmntArt.sol | Returns the artwork with all data tokenId The token id/ TODO: token exists check | function getArtwork(uint256 tokenId) external view returns (Artwork memory a) {
return tokenArtworks[tokenId];
}
| 3,812,977 |
./full_match/80001/0x504Afe056d4DcbD8ee9a8CeBcd11Ffd4EcAc5DD9/sources/contracts/Gigble.sol | Function to create a new project and lock budget on platform address projects.push(project); | function createProject(
string memory _email,
string memory _description,
uint256 _budget,
uint256 _deadline
) public payable inState(State.Active) returns (uint256) {
Project storage project = projects[numberOfProjects];
project.email= _email;
... | 5,557,627 |
./full_match/80001/0x2d3B52Ab8233f29c7F189B6AAbD4AF8de3036cC4/sources/contracts/mixins/MixinKeys.sol | Delete ownership info and udpate balance for previous owner _tokenId the id of the token to cancel/ get owner delete previous ownership When the token to delete is the last token, the swap operation is unnecessary remove from owner count if thats the only key | function _deleteOwnershipRecord(uint _tokenId) internal {
address previousOwner = _ownerOf[_tokenId];
uint lastTokenIndex = totalKeys(previousOwner) - 1;
uint index = _ownedKeysIndex[_tokenId];
if (index != lastTokenIndex) {
uint256 lastTokenId = _ownedKeyIds[previousOwner][lastTokenIndex];
... | 9,435,247 |
pragma solidity ^0.4.2;
//from Jiuzhou
//line 17
contract SigWrongPara{
bytes32 private idHash;
constructor() public payable{
require(msg.value > 0);
idHash = keccak256(abi.encode(msg.sender));
}
//If _id is 0x0, and part of (_hash, v, r, s) are wrong. ecrecover() return 0x0... | If _id is 0x0, and part of (_hash, v, r, s) are wrong. ecrecover() return 0x0. So pass the checkThe function signature (function selector) refers to the first four bytes of the call data for a function call. it specifies the function to be called. The function signature is generated by the keccak256(). In some cases, t... | function getMyMoney(address _id, bytes32 _hash, uint8 v, bytes32 r, bytes32 s) external returns(bool){
if(_id != ecrecover(_hash, v, r, s))
return false;
_id.transfer(address(this).balance);
return true;
}
| 12,582,355 |
./partial_match/1/0xBE95a12D9136F905Ac2db3bC76e71b32c0151bA4/sources/TokenVesting.sol | Can not claim when we have not pass the 1st period. | function claimable() public view returns (uint256) {
uint256 elapsedSecs = getCurrentTimestamp() - startingTime;
if (elapsedSecs <= 0) {
return 0;
}
uint256 currentPeriod = elapsedSecs.div(30 days);
currentPeriod = currentPeriod.div(vestInterval).mul(vestInterval... | 4,302,638 |
// SPDX-License-Identifier: GPL-3.0-or-later
// This program 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, either version 3 of the License, or
// (at your option) any later version.
// This program is dis... | StablePools with two tokens may use the IMinimalSwapInfoPool interface. This should never happen since this Pool has a minimum of three tokens, but we override and revert unconditionally in this handler anyway./ | function onSwap(
SwapRequest memory,
uint256,
uint256
) public pure override returns (uint256) {
_revert(Errors.UNHANDLED_BY_PHANTOM_POOL);
}
| 277,411 |
// SPDX-License-Identifier: MIT
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 constructor logic to an
* external initializer f... | Computes the hedge ratio that is the ratio between the amount of collateral hedged by HAs divided by the amount that should be hedged newStocksUsers Value of the collateral from users to hedge col Struct for the collateral of interest return ratio Ratio between what's hedged divided what's to hedge This function is ... | function _computeHedgeRatio(uint256 newStocksUsers, Collateral storage col) internal view returns (uint64 ratio) {
uint256 totalHedgeAmount = col.perpetualManager.totalHedgeAmount();
newStocksUsers = (col.feeData.targetHAHedge * newStocksUsers) / BASE_PARAMS;
if (newStocksUsers > totalHedgeA... | 5,974,177 |
/*
Copyright [2019] - [2021], PERSISTENCE TECHNOLOGIES PTE. LTD. and the pStake-smartContracts contributors
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity >=0.7.0;
import "./BytesLib.sol";
import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";
// requirement: validate addresses like cosmosva... | decodes the account address and returns decoded bytes array addressDigestBytes_: account address in bytes/ | function decode(bytes memory addressDigestBytes_)
public
pure
returns (uint256[] memory decodedBytes)
{
decodedBytes = new uint256[](addressDigestBytes_.length);
uint256[] memory nullBytes;
uint256 charsetIndex;
for (
uint256 addressDigestBytesIndex = 0;
addressDigestBytesIndex < addressDigestByt... | 12,890,319 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20... | Lists the rewards of the transacting user in the pool _stakeID Id of the stake pool return Reward model list | function showPendingReward(uint _stakeID) public virtual view returns(PendingRewardResponse[] memory) {
UserDef memory user = poolUserInfo[_stakeID][_msgSender()];
uint256 lastTimeStamp = block.timestamp;
uint rewardCount = poolList[_stakeID].rewardCount;
PendingRewardResponse[] me... | 13,084,387 |
/**
* This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net
*
* Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt
*/
/**
* This smart contract code is Copyright 2017 TokenMarket Ltd.... | Don't mess the dates | function isSane() public constant returns (bool);
function finalizeCrowdsale();
}
function CrowdsaleBase(address _token, PricingStrategy _pricingStrategy, address _multisigWallet, uint _start, uint _end, uint _minimumFundingGoal) {
owner = msg.sender;
token = FractionalERC... | 4,812,978 |
./full_match/80001/0xc717A11d825EA6Cd84F1A63A9e4bFA3446e00F87/sources/contracts/v1/SwylClub.sol | Let's a club owner clean up subscribers who passed the due dates and the three-day-merci period for monthly Tier fee. When executed, subscribers who missed the passed due date will be wipe off and loose all the royaltyStars. _clubId uint256 - the uid of a club being cleaned up./ init totalWipedOffMember init total... | function cleanUpClub(uint256 _clubId) external override onlyClubOwner(_clubId) onlyClubOwnerRole() onlyExistingClub(_clubId){
uint256 totalWipedOffMembers;
uint256 totalWipedOffMemberPerTiers;
for (uint256 i = 0; i < getTiersAt(_clubId).length; i ++) {
uint256[] memory target... | 9,498,863 |
pragma solidity ^0.4.11;
import './SafeMath.sol';
import './Owned.sol';
/* A library that manages all funds for buyer, seller, and owner roles. */
library AccountLib {
/*************************************************
* Members
*************************************************/
struct Data {
// the p... | Retrieves the owner's account balance. Always use this getter instead of accessing account.accountBalances directly so that dailyCommission can be updated first. / must transfer pro-rated daily commission from the self.buyer to the owner to have most up-to-date balance | function ownerFunds(Data storage self) internal returns(uint) {
updateDailyCommission(self);
return self.accountBalances[self.owner];
}
| 12,891,561 |
./partial_match/4/0x22Eee33306501a3Df59731EE356e0ef980c9b4E0/sources/SirenToken.sol | Delegates votes from signatory to `delegatee` delegatee The address to delegate votes to nonce The contract state required to match the signature expiry The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA signature pair s Half of the ECDSA signature pair/ EIP-2 still... | function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public {
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, ... | 8,618,295 |
./full_match/4/0xBAD2140c2ba66faBBECC321949596758C95F6Be3/sources/contracts/OurContract.sol | Presale check proof & mint | function skyclubMint(uint8 quantity, bytes32[] calldata _merkleProof)
external
payable
callerIsUser
nonReentrant
{
require(_skyMintActive, "Whitelist mint is not yet active");
require(_skyMintCounter[msg.sender] + quantity <= maxQtyPerMember, "Excee... | 12,269,439 |
/**
*Submitted for verification at Etherscan.io on 2022-02-28
*/
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the ... | See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`./ | function transfer(address to, uint256 amount) public payable virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
| 2,345,346 |
./full_match/62320/0xd04A54f983d55959F42F5370663AbbC1d85DE761/sources/lib/mento-core/contracts/Broker.sol | Updates and verifies a trading limit if it's configured. Will revert if the trading limit is exceeded by this trade. tradingLimitId the ID of the trading limit associated with the token deltaFlow the deltaflow of this token, negative for outflow, positive for inflow. token the address of the token, used to lookup d... | function guardTradingLimit(
bytes32 tradingLimitId,
int256 deltaFlow,
address token
) internal {
TradingLimits.Config memory tradingLimitConfig = tradingLimitsConfig[tradingLimitId];
if (tradingLimitConfig.flags > 0) {
TradingLimits.State memory tradingLimitState = tradingLimitsState[tradi... | 3,225,344 |
// SPDX-License-Identifier: Apache-2.0
/**
*Submitted for verification at Etherscan.io on 2021-05-13
*/
// SPDX-License-Identifier: MIT
// Special Thanks to @BoringCrypto for his ideas and patience
pragma solidity =0.6.12;
pragma experimental ABIEncoderV2;
// https://github.com/OpenZeppelin/openzeppelin-contract... | Add a new LP to the pool. Can only be called by the owner. DO NOT add the same LP token more than once. Rewards will be messed up if you do. allocPoint AP of the new pool. _lpToken Address of the LP ERC-20 token. _rewarder Address of the rewarder delegate. | function add(
uint256 allocPoint,
IERC20 _lpToken,
IRewarder _rewarder
) public onlyOwner {
uint256 lastRewardBlock = block.number;
totalAllocPoint = totalAllocPoint.add(allocPoint);
lpToken.push(_lpToken);
rewarder.push(_rewarder);
poolInfo.push(... | 600,501 |
./partial_match/137/0xABa4Aa7376a5c4dbF9D0ed14Ac867fb9c40AdD5b/sources/PepemonFactory.sol | Burn _amount of tokens of a given token id _from The address to burn tokens from _id Token id to burn _amount The amount to be burned/Substract _amount Emit event | function _burn(address _from, uint256 _id, uint256 _amount)
internal
{
balances[_from][_id] = balances[_from][_id].sub(_amount);
emit TransferSingle(msg.sender, _from, address(0x0), _id, _amount);
}
| 3,520,524 |
//Address: 0x81dd35fef7020b129f72885fd2c261fd352f8e43
//Contract name: SEEDSToken
//Balance: 6.7795 Ether
//Verification Date: 1/1/2018
//Transacion Count: 19
// CODE STARTS HERE
pragma solidity ^0.4.15;
/**
* @dev SEEDS token smart contract. For project and ICO details, please check: http://seedsico.info
*/
con... | called by the owner to lock, triggers locked state/ | function lock() onlyOwner whenNotLocked {
locked = true;
Lock();
}
| 14,050,773 |
pragma solidity ^0.4.18;
import '../core/RequestCore.sol';
import '../base/math/SafeMathUint8.sol';
import './RequestEthereumCollect.sol';
import '../base/token/ERC20.sol';
/**
* @title RequestEthereum
*
* @dev RequestEthereum is the currency contract managing the request in Ethereum
* @dev The contract can be pa... | extract a bytes32 from a bytes data bytes from where the bytes32 will be extract offset position of the first byte of the bytes32 return address/ | function extractBytes32(bytes _data, uint offset)
public
pure
returns (bytes32 bs)
{
require(offset >=0 && offset + 32 <= _data.length);
assembly {
bs := mload(add(_data, add(32, offset)))
}
}
| 14,089,379 |
pragma solidity ^0.4.23;
contract MoneyBomber{
// scaleFactor is used to convert Ether into tokens and vice-versa: they're of different
// orders of magnitude, hence the need to bridge between the two.
uint256 constant scaleFactor = 0x10000000000000000;// 2^64
int constant crr_n = 1;//CRR numerator
int constant c... | you can trickle up other people by giving them some. | function trickleUp(address fromWho) internal{ | 253,704 |
pragma solidity ^0.5.11;
// Contract for Voken2.0 Offer
//
// More info:
// https://vision.network
// https://voken.io
//
// Contact us:
// support@vision.network
// support@voken.io
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow checks.
*/
library SafeMath256... | Returns true if the caller is the current owner./ | function isOwner(address account) public view returns (bool) {
return account == _owner;
}
| 973,554 |
//SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.6;
import "./FlightSuretyData.sol";
/************************************************** */
/* FlightSurety Smart Contract */
/************************************************** */
contract FlightSuretyApp is Ownable {
/***************... | Returns array of three non-duplicating integers from 0-9 Pseudo random number...the incrementing nonce adds variation This actually causes bugs because nonce can become bigger than block.numberuint8 random = uint8(uint256(keccak256(abi.encodePacked(blockhash(block.number - nonce++), account))) % maxValue);if (nonce > 2... | function getRandomIndex(address account, uint8 nonce) internal view returns (uint8) {
uint8 maxValue = 10;
uint8 random = uint8(uint256(keccak256(abi.encodePacked(blockhash(block.number - nonce), account))) % maxValue);
return random;
}
| 15,869,979 |
pragma solidity 0.5.17;
import "../utils/ModUtils.sol";
/**
* @title Operations on alt_bn128
* @dev Implementations of common elliptic curve operations on Ethereum's
* (poorly named) alt_bn128 curve. Whenever possible, use post-Byzantium
* pre-compiled contracts to offset gas costs. Note that these pre-compiles
... | Unmarshals a point on G1 from bytes in an uncompressed form./ solium-disable-next-line / | function g1Unmarshal(bytes memory m)
internal
pure
returns (G1Point memory)
{
require(m.length == 64, "Invalid G1 bytes length");
bytes32 x;
bytes32 y;
assembly {
x := mload(add(m, 0x20))
y := mload(add(m, 0x40))
}
... | 1,763,169 |
./partial_match/1/0x235b25f9f56B39eFD8293C0d2A9Ee70719E25B85/sources/src/ButtonswapERC20.sol | @inheritdoc IButtonswapERC20/ | function transfer(address to, uint256 value) external returns (bool success) {
_transfer(msg.sender, to, value);
success = true;
}
| 4,108,266 |
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "./IERC2981Holder.sol";
import "./IERC2981.sol";
///
/// @dev An implementor for the NFT Royalty Standard. Provides interface
/// response to erc2981 as well as a way to modify the roya... | ERC165 interface responder for this contract interfaceId - the interface id to check return supportsIface - whether the interface is supported | function supportsInterface(bytes4 interfaceId)
public
view
virtual
override returns (bool supportsIface) {
supportsIface = interfaceId == type(IERC2981).interfaceId
|| super.supportsInterface(interfaceId);
}
| 6,471,922 |
./full_match/1/0x374A69399C52650eD11b4C897265076766ADB1dc/sources/Core.sol | Triggers stopped state. Requirements: - The contract must not be paused./ | function _pause() internal virtual whenNotPaused {
_setPaused(true);
emit Paused(msg.sender);
}
| 3,010,602 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
import "./interfaces/IDiamondCut.sol";
import "./interfaces/IDiamondLoupe.sol";
import "./libraries/LibDiamond.sol";
import "./libraries/LibOwnership.sol";
import "./libraries/LibDiamondStorage.sol";
import "./interfaces/IE... | deposit allows a user to add more bond to his staked balance withdraw allows a user to withdraw funds if the balance is not locked lock a user's currently staked balance until timestamp & add the bonus to his voting power delegate allows a user to delegate his voting power to another user stopDelegate allows a user to ... | interface IBarn {
function deposit(uint256 amount) external;
function withdraw(uint256 amount) external;
function lock(uint256 timestamp) external;
function delegate(address to) external;
function stopDelegate() external;
function lockCreatorBalance(address user, uint256 timestamp) external... | 607,781 |
./full_match/1/0x4fe750a07126333F62f36523d1265C0eDf859722/sources/browser/Jointer/ethBonus.sol | allow bonus owner change address | function changeBonusOwner(address vault, address payable newBonusOwner) external returns(bool) {
require(newBonusOwner != address(0));
require(msg.sender == bonusOwners[vault], "Caller is not the bonusOwners");
bonusOwners[vault] = newBonusOwner;
return true;
}
| 3,033,000 |
// SPDX-License-Identifier: MIT.
pragma solidity ^0.8.7;
/// @title Multi signature Wallet.
/// @author Esteban Hugo Somma.
///
/// @notice A MultiSig wallet is a digital wallet that operates with multisignature
/// addresses. This means that it requires more than one private key to sign and
/// authorize a crypto ... | Sets the owner confirmation in the transaction corresponding to specified {txIndex}. txIndex The transaction index. Emits an {ConfirmTransaction} event. Requirements: - `sender` Must be one of the owners of the wallet. - `txIndex` Corresponds to an existng transaction. - `txIndex` Must be the index of a transaction no... | function confirmTransaction(uint txIndex)
external
onlyOwner
txExists(txIndex)
notExecuted(txIndex)
notConfirmed(txIndex)
{
Transaction storage transaction = transactions[txIndex];
transaction.numConfirmations += 1;
isConfirmed[txIndex][msg.sender]... | 6,357,157 |
pragma solidity ^0.4.18;
import '../base/lifecycle/Pausable.sol';
import './RequestCore.sol';
import './RequestCollectInterface.sol';
import '../base/math/SafeMath.sol';
import '../base/math/SafeMathInt.sol';
import '../base/math/SafeMathUint8.sol';
/**
* @title RequestCurrencyContractInterface
*
* @dev RequestCu... | Function to declare subtracts msg.sender must be _payee the request must be accepted or created _requestId id of the request _subtractAmounts amounts of subtract to declare (index 0 is for main payee)/ impossible to make subtracts if request is canceled impossible to declare more subtracts than the number of payees... | function subtractAction(bytes32 _requestId, uint256[] _subtractAmounts)
public
whenNotPaused
onlyRequestPayee(_requestId)
{
require(requestCore.getState(_requestId)!=RequestCore.State.Canceled);
require(_subtractAmounts.length <= requestCore.getSubPayeesCount(_requestId).add(1));
for(uint8 i = 0; i < _s... | 12,853,789 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.