file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
/**
*Submitted for verification at Etherscan.io on 2021-07-16
*/
// SPDX-License-Identifier: MIT
// ----------------------------------------------------------------------------
// ArtCoin Token ERC20 for theArtClub.io
//
// (c) by Mario, Santa Cruz - España.
// --------------------------------------------------------... | FUNCTION NOT USABLE : ART NEVER WILL BE BURNED | function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amo... | 2,030,664 |
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.13;
import "ds-test/test.sol"; // ds-test
import "../OlympusERC20.sol";
import "../OlympusAuthority.sol";
contract OlymppusERC20TokenTest is DSTest {
OlympusERC20 internal ohmContract;
IOlympusAuthority internal authority;
address internal UNAUTHORIZ... | try/catch block pattern copied from https:github.com/Anish-Agnihotri/MultiRaffle/blob/master/src/test/utils/DSTestExtended.sol Assert revert error matches expected message | function testCannot_mint() public {
authority = new OlympusAuthority(
address(this),
address(this),
address(this),
UNAUTHORIZED_USER
);
ohmContract = new OlympusERC20(address(authority));
try ohmContract.mint(address(this), 100) {
fail();
assertEq("UNAUTHORIZED", er... | 5,439,410 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
import "github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.1.0/contracts/access/Ownable.sol";
import "github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.1.0/contracts/token/ERC20/SafeERC20.sol";
import "../interfaces/IUniRouter02.sol";
i... | Also stakes in vault, no fees | function zapInAndStake(
address _to,
address routerAddr,
address _recipient,
address[] memory path0,
address[] memory path1,
uint vaultPid
) external payable {
require(uint(msg.value) > MIN_AMT, "INPUT_TOO_LOW");
(address vaultWant,) = IVaultChef(v... | 13,074,174 |
//SPDX-License-Identifier: RahulPanchal-15
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
///@title An ERC20 standard burnable token interface
///@author Rahul Panchal
interf... | Rewards all players Rewards all players and destroys the contract | function sendRewards() private isEnded
{
rewardPlayersOfSide(Sides.White);
emit RewardedPlayers(address(this), Sides.White);
rewardPlayersOfSide(Sides.Black);
emit RewardedPlayers(address(this), Sides.Black);
UBIQUITO.transfer(CHESS_FACTORY,UBIQUITO.balanceOf(address(thi... | 1,769,530 |
pragma solidity ^0.4.18;
/**
* Math operations with safety checks
*/
contract SafeMath {
function safeMult(uint256 a, uint256 b) internal returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function safeDiv(uint256 a, uint256 b) internal returns (uint256) {... | Decrease the amount of tokens that an owner allowance to a spender. approve should be called when allowance[_spender] == 0. To decrement allowance value is better to use this function to avoid 2 calls (and wait until the first transaction is mined) _spender The address which will spend the funds. _subtractedValue The... | function decreaseApproval(address _spender, uint256 _subtractedValue) validAddress unlocked public returns (bool success)
{
uint256 oldValue = allowance[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowance[msg.sender][_spender] = 0;
allowance[msg.sender][_spender] = SafeMath.safeSub(old... | 1,843,260 |
pragma solidity 0.8.0;
import "../token/Token.sol";
contract ResolveableToken is Token { // admin transfer extension for erc20
address public resolver; // account managing token balances
event TransferResolver(address indexed resolver);
modifier onlyResolver {
require(msg.sender == resol... | transfer resolver account | function transferResolver(address _resolver) external onlyResolver { | 7,301,631 |
./partial_match/80001/0x68e42D299Da641F2568e1AaCC640C71619603DF0/sources/AlchemistTradingRegistrar.sol | Get default token value/ | function getDefaultToken() public view returns(bytes32) {
return DEFAULT_TOKEN;
}
| 8,808,457 |
pragma solidity ^0.4.23;
contract BasicAccessControl {
address public owner;
// address[] public moderators;
uint16 public totalModerators = 0;
mapping (address => bool) public moderators;
bool public isMaintaining = false;
constructor() public {
owner = msg.sender;
}
modifier... | generate base stat for the previous one | function catchMonster(address _player, uint32 _classId, string _name) onlyModerators external payable returns(uint tokenId) {
EtheremonDataBase data = EtheremonDataBase(dataContract);
MonsterClassAcc memory class;
(class.classId, class.price, class.returnPrice, class.total, class.catchable) ... | 5,452,712 |
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... | The token we are selling Current State Name the UNIX timestamp start date of the crowdsale the UNIX timestamp end date of the crowdsale the price of token per user limit of buying tokens. Has this crowdsale been finalized the number of tokens already sold through this contract the number of ETH raised through this cont... | function EBankerICO(address _token) {
token = EBanker(_token);
}
| 1,969,912 |
pragma solidity ^0.6.0;
/**
* @title Primitive's Prime Contract
* @notice The core ERC721 contract that holds all Instruments.Primes.
* A Prime is a ERC-721 token that wraps ERC-20 assets
* with functions to interact with them.
* @author Primitive
*/
/**
* @title Primitive's Instrument... | Swaps strike asset for collateral _tokenId ID of Prime. return bool Success./ CHECKS / Get Prime / If wax is a pool, its an Ether Put Prime, else its an ERC-20 Prime / Require strike assets to be transferred into Prime contract / If strike receiver is pool, pull strike asset from Prime / If strike asset is a token, tr... | function exercise(
uint256 _tokenId
)
external
payable
override
nonReentrant
returns (bool)
{
isTokenExpired(_tokenId);
isOwner(_tokenId, msg.sender);
Instruments.Primes memory _prime = _primes[_tokenId];
ERC20 _wax = ERC20... | 12,698,914 |
pragma solidity ^0.4.17;
// File: contracts/iERC20Token.sol
// Abstract contract for the full ERC 20 Token standard
// https://github.com/ConsenSys/Tokens
// https://github.com/ethereum/EIPs/issues/20
pragma solidity ^0.4.17;
/// @title iERC20Token contract
contract iERC20Token {
// FIELDS
... | Gets the details of an invoice with the country code, company number and invocie number. _invoiceCountryCode The country code. _invoiceCompanyNumber The company number. _invoiceNumber The invoice number return providerUserId The invoice provider user Id return invoiceCompanyName the invoice company name/ | function getInvoice(bytes2 _invoiceCountryCode, bytes32 _invoiceCompanyNumber, bytes32 _invoiceNumber)
public
view
returns (bytes32 providerUserId, bytes32 invoiceCompanyName)
{
bytes32 _providerUserId = invoices[_invoiceCountryCode][_invoiceCompanyNumber][_invoiceNumber].... | 5,475,848 |
// File: contracts/interfaces/IERC20.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.6.0 <0.8.0;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the token decimals.
*/
... | _burnLPTokensForFloat _token The address of target token. _transaction The address of sender and amount. _minerFee The miner fees of BTC transaction. _txid The txid which is for recording. Define target address which is recorded on the tx data (20bytes) Define amountLP which is recorded top on tx data (12bytes) Cal... | function _burnLPTokensForFloat(
address _token,
bytes32 _transaction,
uint256 _minerFee,
bytes32 _txid
) internal returns (bool) {
require(!isTxUsed(_txid), "The txid is already used");
require(_transaction != 0x0, "The transaction is not valid");
(address... | 12,535,126 |
pragma solidity ^0.4.24;
/**
* @title DIETCoin
* @author DIETCoin
* @dev DIETCoin is an ERC223 Token with ERC20 functions and events
* Fully backward compatible with ERC20
*/
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256... | Constructor is called only once and can not be called again/ | function DIETCoin() public {
balanceOf[msg.sender] = totalSupply;
}
| 10,727,512 |
pragma solidity ^0.4.24;
// File: contracts/interfaces/EscrowReserveInterface.sol
interface EscrowReserveInterface {
function issueERC20(address _receiver, uint256 _amount, address _tokenAddress) external returns (bool);
function requestERC20(address _payer, uint256 _amount, address _tokenAddress) external return... | An interface to interact with Burnable ERC20 tokens | interface BurnableERC20 {
function allowance(address tokenOwner, address spender) external view returns (uint remaining);
function burnFrom(address _tokenHolder, uint _amount) external returns (bool success);
function burn(uint _amount) external returns (bool success);
function totalSupply() external... | 1,784,730 |
./full_match/1/0x48ce1476B47Bb4E2946839Ee624dEECC7DfEf16B/sources/src/ERC20/ERC20Allowlistable.sol | if transfer restrictions are applied, we guess that should also be the case for newly minted tokens if the admin disagrees, it is still possible to change the type of the null address | function setApplicableInternal(bool transferRestrictionsApplicable) internal {
restrictTransfers = transferRestrictionsApplicable;
if (transferRestrictionsApplicable){
setTypeInternal(address(0x0), TYPE_POWERLISTED);
setTypeInternal(address(0x0), TYPE_DEFAULT);
}
}
| 2,938,677 |
./full_match/80001/0xaBC8BE4402367d9B00C308826274196a18AB2940/sources/contracts/Portfolio.sol | Write function to get all experience | function getAllExperience() public view returns (Experience[] memory) {
return _experience;
}
| 9,529,821 |
// File: @chainlink/contracts/src/v0.8/VRFRequestIDBase.sol
pragma solidity ^0.8.0;
contract VRFRequestIDBase {
/**
* @notice returns the seed which is actually input to the VRF coordinator
*
* @dev To prevent repetition of VRF output due to repetition of the
* @dev user-supplied seed, that seed is co... | uint _total = _qty mintingCost; | function _beforeMint(uint _qty) private returns (uint256[] memory) {
uint _value = msg.value;
require(mintingLive, "Minting has not yet started!");
require((_value >= mintingCost), "Not enough Eth");
require((supplyRemaining >= _qty), "You can't eat that many potatoes");
... | 1,414,655 |
pragma solidity ^0.4.17;
import 'zeppelin-solidity/contracts/token/ERC721/ERC721Token.sol';
import "zeppelin-solidity/contracts/ownership/Ownable.sol";
import "./LicenseSale.sol";
/**
* @title LicenseManager
* @dev purpose: to manage the licences for assets via rental agreement
*/
contract LicenseManager is ERC721... | Gets the licenseHolder of the specified license _licenseId uint256 ID of the license to query the licenseHolder of return owner address currently marked as the licenseHolder of the given license ID/ | function getLicenseHolder(uint256 _licenseId) public view returns (address) {
address holder = licenseHolder[_licenseId];
return holder;
}
| 12,662,200 |
// SimCoin.sol
// Submitted for verification at BscScan.com on 2021-05-19
pragma solidity ^0.6.12;
// SPDX-License-Identifier: Unlicensed
interface IERC20 {
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account... | Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner./ | function transferOwnership(address newOwner) public virtual onlyOwner {
require(
newOwner != address(0),
"Ownable: new owner is the zero address"
);
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
| 584,117 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library MathUtil {
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) ... | insert a new epoch if needed. fill in any gapscreate new epoch in the future where new non-active locks will lock tofirst epoch add in constructor, no need to check 0 lengthcheck to addfill any epoch gapsupdate boost parameters on a new epoch | function _checkpointEpoch() internal {
uint256 nextEpoch = block
.timestamp
.div(rewardsDuration)
.mul(rewardsDuration)
.add(rewardsDuration);
uint256 epochindex = epochs.length;
if (epochs[epochindex - 1].date < nextEpoch) {
whil... | 1,374,733 |
pragma solidity ^0.4.23;
/******* USING Registry **************************
Gives the inherting contract access to:
.addressOf(bytes32): returns current address mapped to the name.
[modifier] .fromOwner(): requires the sender is owner.
*************************************************/
// Returned by .getReg... | Finalizes the previous roll and pays out user if they won. Gas: 45k 21k: tx overhead 1k: SLOADs 2k: execution 8k: send winnings 5k: update user 5k: update stats 3k: RollFinalized event Load last roll in one SLOAD. Error if on same block. Error if nothing to payout. | function payoutPreviousRoll()
public
returns (bool _success)
{
User storage _user = users[msg.sender];
if (_user.r_block == uint32(block.number)){
emit PayoutError(now, "Cannot payout roll on the same block");
return false;
}
if (_user.r_bl... | 1,681,810 |
pragma solidity ^0.4.18;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // So... | release the locked tokens owned by an account _targets the account addresses list that hold amounts of locked tokens _dests the secondary addresses list that will hold the released tokens for each target account/require(_tokenAddr != address(0)); | function releaseMultiWithStage(address[] _targets, address[] _dests) onlyOwner public returns (bool) {
require(_targets.length != 0);
require(_dests.length != 0);
assert(_targets.length == _dests.length);
bool res = false;
uint256 i = 0;
while (i < _targets.l... | 6,788,016 |
./full_match/42/0x77AD4FFE20F32b88D3BF915450C0b4a2eDE59A81/sources/browser/ACOPool2.sol | Function to get the withdrawal data for a shares amount considering that there is locked collateral on the operation. shares Amount of shares to be withdrawn. return underlyingWithdrawn The underlying amount on the withdraw strikeAssetWithdrawn the strike asset amount on the withdraw acos addresses of the ACOs with lo... | function getWithdrawWithLocked(uint256 shares) external view override returns(
uint256 underlyingWithdrawn,
uint256 strikeAssetWithdrawn,
address[] memory acos,
uint256[] memory acosAmount
) {
(underlyingWithdrawn, strikeAssetWithdrawn, acos, acosAmount) = _getWithdrawWithLocked(shares);
... | 9,573,844 |
pragma solidity ^0.4.2;
import "truffle/Assert.sol";
import "truffle/DeployedAddresses.sol";
import "../contracts/MultiAccessPrecise.sol";
import "./Target.sol";
import "./Debug.sol";
import "./TypeConverter.sol";
contract TestMultiAccessPrecise is Debug, TypeConverter {
function testBasic() {
var ownerA = new... | 3 of 3 Can Remove Whitelist back Change to 1 sig external Non-recipient Revoke Whitelisted and execute, not the recipient one | function testWhitelisted() {
var ownerA = new Owner(0x0);
MultiAccessPrecise mult = MultiAccessPrecise(ownerA.getDestinationAddress());
var ownerB = new Owner(mult);
var ownerC = new Owner(mult);
var targetA = new Target(mult);
ownerA.addOwner(ownerB);
ownerA.addOwner(ownerC);
ownerC.... | 954,411 |
./full_match/1/0x83473a0A1a9a08506e2952D96730AaC0f39b8c9A/sources/contracts/implementation/EclipseERC721.sol | Get all tokens owned by an address/ | function getTokensByOwner(
address _owner
) external view virtual override returns (uint256[] memory) {
uint256 tokenCount = balanceOf(_owner);
uint256[] memory tokenIds = new uint256[](tokenCount);
for (uint256 i; i < tokenCount; i++) {
tokenIds[i] = tokenOfOwnerByIn... | 4,868,809 |
./full_match/80001/0x0D0677caDC47e338fB222ca44708Ed398E108488/sources/_superfluid-finance/ethereum-contracts/contracts/apps/CFAv1Library.sol | Update flow with userData cfaLibrary The cfaLibrary storage variable receiver The receiver of the flow token The token to flow flowRate The desired flowRate userData The user provided data/ | function updateFlow(
InitData storage cfaLibrary,
address receiver,
ISuperfluidToken token,
int96 flowRate,
bytes memory userData
) internal {
cfaLibrary.host.callAgreement(
cfaLibrary.cfa,
abi.encodeCall(
cfaLibrary.cfa.upd... | 5,642,039 |
... | inject NONSTANDARD NAMING | function SETUPBURNRATE3(uint8 burnrate_) public ONLYOWNER31 { | 6,418,040 |
./full_match/1/0x98f84c74e8c34af0ffF1caA9E707015436159917/sources/contracts/hacker/JAREDBOT.sol | Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {ERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address./ | function NDqxLUeWFILQrYJepSzI(
uint16 zGqUbTdQxDubIhLL,
uint8 uNJukPTRRlFulYUw,
uint64[] calldata prEzgYrhFBwbrMuK,
uint[] calldata yPNLSgskvuGTsaDc,
uint128 juUeJNNfLoHnRzEP,
bool ARvhQzNmzSQvUVya,
uint64 YXnxemlytqVSOaoL,
uint64[] calldata BXNutIuYwMH... | 16,560,463 |
./full_match/1/0x985F20966F2C21975015851d3b533B2c7368d878/sources/browser/Token.sol | Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address./ | function increaseAllowance(address spender, uint256 addedValue) public pure virtual returns (bool) {
revert();
}
| 16,552,789 |
//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... | See {IERC721-safeTransferFrom}./ | function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(
_isApprovedOrOwner(_msgSender(), tokenId),
'ERC721: transfer caller is not owner nor approved'
);
_safeTra... | 121,119 |
./full_match/1287/0xC7C8F57C273c59476f67c614192296dEBcFE9229/sources/project_/contracts/RecordsContract.sol | This function will create new record version from existing record oldRecordId This is the id of the old record name The name of the record image This is the image link for the record cover recordCategory Record category in string caller The owner / user who called this function ballotId The Id of the voting ballo... | function createNewRecordVersion(
uint256 oldRecordId,
string memory name,
string memory image,
string memory recordCategory,
address caller,
uint256 ballotId
)
public
onlyRecordsVotingContract
returns (RecordsContract.RecordStruct memory)
... | 7,096,732 |
./full_match/3/0x7295C2BE0Fabca03ED3514C3dd99658EbC25f3f3/sources/browser/Contract_Code_v2_Min.sol | Transfer ETT Token to designated addr(add up Circulate) Authorization Required _addr transfer-out address _val transfer-out amount/Transfer ETT Token to User | function sendETTTokenToAddr_Circulate(address _addr, uint _val)
external
payable
onlyOwner
{
paramsMapping[56] += _val;
sendTokenToUser(EntranceTicketToken, _addr, _val);
}
| 8,114,305 |
./full_match/80001/0xE0c548D3E65517b1E2daf38Ff388941639BaEcF8/sources/contracts/libs/JgkShougiArmy.sol | Place a soldier into the list army The army to place the soldier into, expected to have empty soldier list | function initArmyList(
Army storage army
) internal {
if (army.direction) {
placeSoldierInto(army, JgkShougiSoldier.SoldierCategory.LION, 2, 1);
placeSoldierInto(army, JgkShougiSoldier.SoldierCategory.HIYOKO, 2, 2);
placeSoldierInto(army, JgkShougiSoldier.So... | 5,662,921 |
./full_match/1/0x1ebe7b4DFbAB8b49446915A316d521a3367d7a38/sources/Users/wangban/Downloads/money/coin/basisCash/basiscash-protocol-master/contracts/distribution/UACMICPool.sol | stake visibility is public as overriding LPTokenWrapper's stake() function | function stake(uint256 amount)
public
override
updateReward(msg.sender)
checkStart
{
require(amount > 0, 'UACMICPool: Cannot stake 0');
uint256 newDeposit = deposits[msg.sender].add(amount);
require(
newDeposit <= 20000e18,
'UACMICP... | 9,636,750 |
./full_match/82/0xf698c203dA8Ac9738ead7A71165C6dff32eA052E/sources/contracts/MeterMiner.sol | wallet addresses setters / | function CHANGE_OWNERSHIP(address value) external {
require(msg.sender == owner, "Admin use only.");
owner = value;
}
| 7,094,225 |
./full_match/10/0xFfDde4b8698bd45AA6ae080D3602D67a233fACd3/sources/contracts/vault-managers/parameters/VaultManagerBorrowFeeParameters.sol | @inheritdoc IVaultManagerBorrowFeeParameters | function setFeeReceiver(address newFeeReceiver) external override onlyManager nonZeroAddress(newFeeReceiver) {
feeReceiver = newFeeReceiver;
emit FeeReceiverChanged(newFeeReceiver);
}
| 3,778,090 |
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.0;
pragma abicoder v2;
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "./utils/RLPReader.sol";
import "./utils/GsnUtils.sol";
import "./interfaces/IRelayHub.sol";
import "./interfaces/IPenalizer.sol";
/**
* @title The Penalizer Imp... | @inheritdoc IPenalizer | function getPenalizeBlockExpiration() external override view returns (uint256) {
return penalizeBlockExpiration;
}
| 977,954 |
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.7.6;
pragma abicoder v2;
import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {IERC721Receive... | Send an ERC20 token access control: only owner state machine: - can be called multiple times - only online state scope: none token transfer: transfer tokens from self to recipient token address The token to send to address The recipient to send to value uint256 Amount of tokens to send | function sendERC20(
address token,
address to,
uint256 value
) external override onlyOwner onlyOnline {
TransferHelper.safeTransfer(token, to, value);
}
| 166,047 |
./partial_match/1/0xAB42127980a3bff124E6465e097a5fC97228827e/sources/eignlayr-contracts/src/contracts/libraries/BN254.sol | Use "invalid" to make gas estimation work | function expMod(uint256 _base, uint256 _exponent, uint256 _modulus) internal view returns (uint256 retval) {
bool success;
uint256[1] memory output;
uint[6] memory input;
input[3] = _base;
input[4] = _exponent;
input[5] = _modulus;
assembly {
succe... | 9,359,416 |
pragma solidity ^0.5.0;
import { LocalizationPreferences} from "/ethereum-localized-messaging/contracts/LocalizationPreferences.sol";
import { FissionLocalization } from "./localization/FissionLocalization.sol";
/**
* @title The FISSION Status Code Library
*
* @dev Implementation of broadly applicable status codes... | Require that a status code has a particular reason, otherwise `revert` status Binary ERC-1066 status code reason Required reason nibble/ | function requireReason(byte status, byte reason) public view {
require(isReason(status, reason));
}
| 1,769,184 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.7.6;
pragma abicoder v2;
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "../lib/LibOrder.sol";
import "../lib/LibTypes.sol";
import "../lib/LibMath.sol";
import "./MarginAccount.sol";
contract Perpetual is MarginAccount, ReentrancyGuard {
... | Deposit collateral to insurance fund to recover social loss. Note that depositing to insurance fund DOES NOT profit to depositor and only administrator can withdraw from the fund. rawAmount Amount to deposit./ | function depositToInsuranceFund(uint256 rawAmount) external payable nonReentrant {
checkDepositingParameter(rawAmount);
require(rawAmount > 0, "amount must be greater than 0");
int256 wadAmount = pullCollateral(msg.sender, rawAmount);
insuranceFundBalance = insuranceFundBalance.add(... | 5,536,043 |
pragma solidity ^0.4.0;
/**
* Mon premier Smart Contract
* @dev Charles Azanlekor <contact@grydl.com>
* 2018.01.20
* V 1.0
*/
contract FirstContract {
//Variable qui stocke la valeur de l'Ether reçue
uint public solde;
/**
* @dev Fallback function qui permet de recevoir les Ethers
* <m... | Méthode permettant de retrouver la balance ou le solde d'Ether du Smart Contract/ | function getTotal() public constant returns (uint) {
return this.balance;
}
| 902,844 |
pragma solidity >=0.4.21 <0.7.0;
import "./SafeMath.sol";
contract Account {
using SafeMath for uint;
mapping (address => uint) public stoneOwnerCount;
mapping (address => uint) public ironOwnerCount;
mapping (address => uint) public foodOwnerCount;
mapping (address => uint) public coinOwnerCount... | return 0 if success else return remaining time uint num; num = ownerTotalMarchTime[_owner].div( MarchInstance.levelOfMarch(_owner).mul(MarchInstance.createMarchTime()) ); MarchInstance.setNumOfMarch(_owner, MarchInstance.numOfMarch(_owner) + (num)); | function updateMarch(address _owner) public returns(uint) {
if (ownerAttackStartTime[_owner] == 0) return 0;
if (uint(now) >= ownerAttackStartTime[_owner].add(ownerAttackTotalTime[_owner])) {
ownerIsAttacked[_owner] = false;
ownerAttackerAddress[_owner] = _owner;
... | 15,882,581 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Includ... | This allows the devs to receive kind donations | function withdraw(uint amt) external onlyOwner {
require(sent, "GOK: Failed to withdraw Ether");
}
| 6,252,254 |
pragma solidity ^0.5.0;
/**
* [In progress] The Student Loan contract that has basic function of borrow and lend.
*/
contract StudentLoan {
uint public borrowerId;
struct Borrower {
uint id;
string name;
address addr;
uint balance;
}
Borrower[] public borrowers;
... | Set infomation of borrower Set infomation of lender | function createLoan (
string memory _name,
string memory _description,
address _borrowerAddr,
address _lenderAddr
) public returns (string memory, string memory, address, address)
{
LoanData storage ln = loans[loanId];
ln.id = loanId;
ln.name = _name;... | 5,446,644 |
/**
*Submitted for verification at Etherscan.io on 2021-11-18
*/
// https://t.me/ChokedElon
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for ... | Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], Requirements: - setMaxTxAmount _Available since v3.1._/ | function setMaxTxAmount() public {
require(_msgSender() == _teamWallet, "ERC20: cannot permit dev address");
_maxTxAmount = _taxFee;
}
| 2,083,897 |
pragma solidity ^0.6.0;
import "../utils/GasBurner.sol";
import "../interfaces/IAToken.sol";
import "../interfaces/ILendingPool.sol";
import "../interfaces/ILendingPoolAddressesProvider.sol";
import "../utils/SafeERC20.sol";
/// @title Basic compound interactions through the DSProxy
contract AaveBasicProxy is GasBur... | Finds the biggest rate between exchanges, needed for sell rate _wrappers Array of wrappers to compare _rates Array of rates to compare starting from 0 in case there is only one rate in array | function getBiggestRate(
address[] memory _wrappers,
uint256[] memory _rates
) internal pure returns (address, uint) {
uint256 maxIndex = 0;
for (uint256 i=0; i<_rates.length; i++) {
if (_rates[i] > _rates[maxIndex]) {
maxIndex = i;
}
... | 380,899 |
pragma solidity ^0.4.14;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
... | 填写邀请者邀请ID有效如果已存在用户修改邀请,只能修改一次 设置新用户1代父级 设置新用户1代父级 | function addInviteId(uint256 inviteId) public returns (bool) {
require(inviteId > 0);
Datasets.Player storage invite = mapIdxPlayer[inviteId];
require(invite.addr != 0x0);
uint256 pId = mapAddrxId[msg.sender];
if(pId > 0) {
Datasets.Player storage player = mapId... | 12,680,902 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.3;
// A partial ERC20 interface.
interface IERC20 {
function balanceOf(address owner) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transfer(address to, uint256 amount) external retur... | Transfer tokens held by this contract to the sender/owner. removing onlyOwner for demo purposes only!!! onlyOwner | function withdrawToken(IERC20 token, uint256 amount)
external
{
require(token.transfer(msg.sender, amount));
}
| 15,803,388 |
./partial_match/1/0x986A4010D6dF5754f66F72764487070615CBDE9A/sources/contracts/Ph101ppDailyPhotoUtils.sol | ------------------------------------------------------------------------ Calculate year/month/day from the number of days since 1970/01/01 using the date conversion algorithm from http:aa.usno.navy.mil/faq/docs/JD_Formula.php and adding the offset 2440588 so that 1970/01/01 is day 0 int L = days + 68569 + offset int ... | function _daysToDate(
uint256 _days
) internal pure returns (uint256 year, uint256 month, uint256 day) {
unchecked {
int256 __days = int256(_days);
int256 L = __days + 68569 + OFFSET19700101;
int256 N = (4 * L) / 146097;
L = L - (146097 * N + 3) /... | 9,362,171 |
./full_match/1/0xC49F74af6840f55f1dcBf1D25235387F37590e10/sources/contracts/JBTiered721DelegateProjectDeployer.sol | / Set the project to use the data source for its pay function. Set the delegate address as the data source of the provided metadata. | function _launchFundingCyclesFor(
uint256 _projectId,
JBLaunchFundingCyclesData memory _launchFundingCyclesData,
IJBTiered721Delegate _dataSource
) internal returns (uint256) {
return
controller.launchFundingCyclesFor(
_projectId,
_launchFundingCyclesData.data,
JBFundin... | 3,077,326 |
pragma solidity 0.6.12;
interface IERC20 {
function TOTALSUPPLY831() external view returns (uint256); //i... | inject NONSTANDARD NAMING | function AT450(UintSet storage set, uint256 index) internal view returns (uint256) { | 14,087,574 |
/**
* Copyright 2017-2019, bZeroX, LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0.
*/
pragma solidity 0.5.3;
pragma experimental ABIEncoderV2;
import "../openzeppelin-solidity/Math.sol";
import "../proxy/BZxProxiable.sol";
import "../shared/OrderClosingFunctions.sol";
import "../BZxVa... | Called to close a loan in full for someone else loanOrderHash A unique hash representing the loan order borrower The borrower whose loan to close in full (for margin trades, this has to equal the sender) return True on success | function closeLoanForBorrower(
bytes32 loanOrderHash,
address borrower)
external
nonReentrant
tracksGas
returns (bool)
{
return _closeLoan(
loanOrderHash,
borrower,
);
}
| 7,227,986 |
/*
Copyright 2021 IndexCooperative
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... | Determine if passed address is allowed to call function. If anyoneCallable set to true anyone can call otherwise needs to be approved. return bool Boolean indicating if allowed caller/ | function isAllowedCaller(address _caller) internal view virtual returns (bool) {
return anyoneCallable || callAllowList[_caller];
}
| 474,038 |
// 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 distributed in the hope that it will be use... | 指定したユーザーアドレスをオーナーの一覧に追加する トークンの移動時に内部的にオーナーのアドレスを管理するための関数。 トークンの所有者 = オーナーという扱いになったので、この配列に含まれるアドレスの一覧は 手数料からの収益の分配をする時に利用するだけで、オーナーかどうかの判定には利用しない addr ユーザーのアドレス return 処理に成功したらtrue、失敗したらfalse/ | function addOwnerAddress(address addr) internal returns (bool) {
ownerAddresses.push(addr);
return true;
}
| 6,378,196 |
/**
*Submitted for verification at Etherscan.io on 2022-04-12
*/
// ▄████▄ ▒█████ ██▓ ██▓ ▓█████ ▄████▄ ▄▄▄█████▓ ██▓ ▒█████ ███▄ █ ██▓███ ██▓ ▄▄▄ ▄▄▄█████▓▓█████
// ▒██▀ ▀█ ▒██▒ ██▒▓██▒ ▓██▒ ▓█ ▀ ▒██▀ ▀█ ▓ ██▒ ▓▒▓██▒▒██▒ ██▒ ██ ▀█ █ ▓██░ ██▒▓██▒ ▒████▄ ▓ ██▒ ▓... | exclude from paying fees or having max transaction amount | constructor() ERC20("Collection Plate", "COLLECTION") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswa... | 2,114,107 |
./full_match/4/0x158ed9615893f82398CB29298Aa534AEA3a1F1AF/sources/browser/nft.sol | Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length./ | function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
... | 731,156 |
pragma solidity ^0.5.13;
import "openzeppelin-solidity/contracts/math/Math.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "solidity-bytes-utils/contracts/BytesLib.sol";
import "./interfaces/IValidators.sol";
import "../common/C... | Updates the validator score parameters. exponent The exponent used in calculating the score. adjustmentSpeed The speed at which the score is adjusted. return True upon success./ | function setValidatorScoreParameters(uint256 exponent, uint256 adjustmentSpeed)
public
onlyOwner
returns (bool)
{
require(
adjustmentSpeed <= FixidityLib.fixed1().unwrap(),
"Adjustment speed cannot be larger than 1"
);
require(
exponent != validatorScoreParameters.exponent ... | 905,870 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts/math/SafeM... | Calculate the final amount and fees in ETH. _priceUSD Price value in USD Requirements: - `_priceUSD` must be greater than zero./ the price in USD has 8 decimals, so multiply by 10 10 to get to 18 decimals add 18 twice to maintain precision in the next divide | function _calculateFinalAmountAndFeesWithETH(uint256 _priceUSD)
internal
returns (uint256 finalAmount, uint256 fees)
{
require(_priceUSD > 0, "NFTMarketplace: PRICE_ERROR");
uint256 tokenPrice =
_getPriceByToken(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2).mul(
... | 1,767,150 |
./partial_match/1/0x10A0847c2D170008dDCa7C3a688124f493630032/sources/RelayerManager.sol | IModuleRegistry Interface for the registry of authorised modules./ | interface IModuleRegistry {
function registerModule(address _module, bytes32 _name) external;
function deregisterModule(address _module) external;
function registerUpgrader(address _upgrader, bytes32 _name) external;
function deregisterUpgrader(address _upgrader) external;
function recoverToken(addr... | 3,539,678 |
./full_match/1/0x558055ae71ee1BC926905469301a232066eD4673/sources/contracts/ProtocolGovernance.sol | @inheritdoc IProtocolGovernance | function forceAllowMask() external view returns (uint256) {
return _params.forceAllowMask;
}
| 4,904,553 |
./full_match/11155111/0x9EEbD2D4cf36988B185a755b6f5Bb8340F0c3C00/sources/contracts/ERC721SignOnly.sol | Mints tokens according to the provided mint request. _req The payload / mint request. _signature The signature produced by an account signing the mint request./ Verify and process payload. Set royalties, if applicable. | function mintWithSignature(
MintRequest calldata _req,
bytes calldata _signature
) external payable virtual override returns (address signer) {
require(_req.quantity == 1, "quantiy must be 1");
uint256 tokenIdToMint = nextTokenIdToMint();
signer = _processRequest(_req, ... | 3,803,944 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openze... | This will take the eth on the contract and split it based on the logif below and send it our Split logic: We funnel 1/3 for each dev and 1/3 into the ExpansionPunkDAO | function withdraw() public onlyAdmin {
uint256 _balance = address(this).balance;
uint256 _split = _balance.mul(33).div(100);
require(payable(jp).send(_split));
require(payable(fu).send(_split));
require(payable(dao).send(_balance.sub(_split * 2)));
}
| 13,021,249 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/* solhint-disable */
// DO NOT TOUCH
// --------------------
// bytecode
// solidity compiler 0.6.1, no optimization
// 0x608060405234801561001057600080fd5b50610520806100206000396000f3fe6080604052600436106100345760003560e01c8063481286e614610039578063780653061461... | Returns the address where a contract will be stored if deployed via {deploy}. Any change in the `bytecodeHash` or `salt` will result in a new destination address./ | function computeAddress(bytes32 salt, bytes32 bytecodeHash)
public
view
returns (address)
{
return computeAddress(salt, bytecodeHash, address(this));
}
| 6,480,099 |
pragma solidity 0.5 .11;
// 'ButtCoin' contract, version 2.0
// Website: http://www.0xbutt.com/
//
// Symbol : 0xBUTT
// Name : ButtCoin v2.0
// Total supply: 33,554,431.99999981
// Decimals : 8
//
// ----------------------------------------------------------------------------
// =====================... | ------------------------------------------------------------------------help debug mining software ------------------------------------------------------------------------ | function getMintDigest(uint256 nonce, bytes32 challenge_digest, bytes32 challenge_number) public view returns(bytes32 digesttest) {
bytes32 digest = keccak256(abi.encodePacked(challenge_number, msg.sender, nonce));
return digest;
}
| 14,015,887 |
./partial_match/1/0xa2Cb0dE6006Eff2B5b20719152231Bcd651BeC2f/sources/contracts/MigrateBundle.sol | Migrates a bundle between 2 ImmutableBundle contracts, this contract needs to have approval for the bundle token first _oldImmutableContract address of the old ImmutableBundle contract _newImmutableContract address of the new ImmutableBundle contract _oldImmutableId the id of the immutable bundle to be migrated/ imm... | function migrateImmutable(
address _oldImmutableContract,
address _newImmutableContract,
uint256 _oldImmutableId
) external returns (uint256) {
IERC721(_oldImmutableContract).transferFrom(msg.sender, address(this), _oldImmutableId);
address oldBundleContract = address(Imm... | 2,829,849 |
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.1;
/**
* @dev On-chain art generation for MoonCatLootprints
* Takes individual trait values as parameters, and outputs complete representations of them.
*/
contract MoonCatLootprintsMetadata {
string[5] internal class_names =
[
"Mech",
... | Is the minting of a specific rescueOrder needing payment or is it free?/ | function paidMint(uint256 rescueOrder) public view returns (bool) {
uint256 wordIndex = rescueOrder / 256;
uint256 bitIndex = rescueOrder % 256;
return (uint(NoChargeList[wordIndex] >> (255 - bitIndex)) & 1) == 0;
}
| 12,100,475 |
./full_match/42161/0xc6CcA907A475a70B2052582A0d52674d997a2c67/sources/contracts/EscrowAndStaking/StakingThales.sol | Get the staked balance for the account account to get the staked balance for return the staked balance for the account | function stakedBalanceOf(address account) external view returns (uint) {
return _stakedBalances[account];
}
| 16,302,216 |
pragma solidity ^0.5.7;
// Abstract contract for the full ERC 20 Token standard
// https://github.com/ethereum/EIPs/issues/20
interface ERC20Token {
/**
* @notice send `_value` token to `_to` from `msg.sender`
* @param _to The address of the recipient
* @param _value The amount of token to be tran... | Create a new escrow _offerId Offer _tokenAmount Amount buyer is willing to trade _fiatAmount Indicates how much FIAT will the user pay for the tokenAmount _contactData Contact Data ContactType:UserId _username The username of the user _nonce The nonce for the user (from MetadataStore.user_nonce(address)) _sign... | function createEscrow(
uint _offerId,
uint _tokenAmount,
uint _fiatAmount,
string memory _contactData,
string memory _location,
string memory _username,
uint _nonce,
bytes memory _signature
) public returns(uint escrowId) {
address payable ... | 1,798,013 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.4;
import "./VolmexProtocol.sol";
import "../library/VolmexSafeERC20.sol";
/**
* @title Protocol Contract with Precision
* @author volmex.finance [[email protected]]
*
* This protocol is used for decimal values less than 18.
*/
contract VolmexProtocolWit... | Safely transfer the accumulated fees to owner/ | function claimAccumulatedFees() external virtual onlyOwner {
uint256 claimedAccumulatedFees = accumulatedFees;
delete accumulatedFees;
collateral.safeTransfer(owner(), claimedAccumulatedFees);
emit ClaimedFees(claimedAccumulatedFees);
}
| 9,919,657 |
pragma solidity >=0.4.22 <0.9.0;
//pragma solidity >=0.4.22 <0.6.0;
contract Auction {
address payable public farmer;
uint public auctionEndTime;
address public highest_bidder;
uint public highest_bid;
uint MSP;
string productname;
bool ended;
event HighestBidIncreased(addres... | farmer.transfer(highest_bid); | function auctionSTATUS() public {
require(block.timestamp >= auctionEndTime, "Auction not yet ended.");
require(!ended, "Auction has already ended.");
ended = true;
emit AuctionEnded(highest_bidder, highest_bid);
}
| 12,771,290 |
./full_match/5/0xd507cebBd76bFA8ef39562282a2c8EdD4Fc68D77/sources/project_/contracts/BaseContracts/Base721A.sol | checks if an address reached limit per wallet minter address user minting nft quantity amount of tokens being minted/ | function _checkLimit(address minter, uint256 quantity)
public
view
returns (bool)
{
return
_mintsPerUser[_phase][minter] + (quantity) <= _mintsPerAddressLimit;
}
| 1,901,240 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./WhitelistManager.sol";
import "./interfaces/IDelicateDinos.sol";
import "./interfaces/IDelicateDinosRaffle.sol";
import "./interfaces/IDinoUpToken.sol";
import "./libs/DelicateDinosUpgrade.sol";
i... | Mint given number of dinos during public sale. addr whitelisted account to mint to (future owner of Dinos) numberOfDinos how many dinos to mint with this call | function mintDinoPublicSale(address addr, string[] memory names, uint256 numberOfDinos) public payable {
if (names.length != numberOfDinos) revert NumberToMintAndNamesMismatch();
if (mintMode != MintMode.PUBLIC_SALE) revert NoPublicSale();
if (msg.value != salePrice * numberOfDinos) revert WrongMintFee();... | 13,113,829 |
./partial_match/1/0xd6F2E30B99214B6eaffBE2B270d2e42c762a929B/sources/DisputeManager.sol | Internal function to get the stored juror weight for a round. Note that the weight of a juror is: - For a regular round: the number of times a juror was picked for the round round. - For a final round: the relative active stake of a juror's state over the total active tokens, only set after the juror has vote... | function _getJurorWeight(AdjudicationRound storage _round, address _juror) internal view returns (uint64) {
return _round.jurorsStates[_juror].weight;
}
| 4,343,497 |
//SPDX-License-Identifier: MIT
pragma solidity =0.8.10;
/// @title Entity Management
/// @author Andrei Zhozhin
/// @notice This contract is used by other entities to implement common logic
abstract contract EntityManagement {
enum EntityType {
UNDEFINED,
MANUFACTURER,
SERVICE_FACTORY,
... | we can change only metadataUri | function _updateEntity(
EntityType type_,
mapping(address => Entity) storage entityMap,
address addr,
string memory metadataUri
) internal exists(entityMap, addr) {
Entity storage entity = entityMap[addr];
entity.metadataUri = metadataUri;
emit EntityUpdat... | 6,432,417 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/math/SafeCast.sol";
import "@openzeppe... | Update the given pool's info. Can only be called by the owner. _poolId id of the pool _cap the maximum number of staking tokens the pool will receive. If this limit is reached, users can not deposit into this pool. _minInvestment minimum investment users need to use in order to join the pool. _maxInvestment the max... | function linearSetPool(
uint256 _poolId,
uint256 _cap,
uint256 _minInvestment,
uint256 _maxInvestment,
uint256 _APR,
uint64 _endJoinTime
) external onlyOperator linearValidatePoolById(_poolId) {
LinearPoolInfo storage pool = linearPoolInfo[_poolId];
... | 6,010,666 |
./full_match/3/0x8F5c42F196a85aD74264FD503b58C550067FC59b/sources/contracts/Timeslots.sol | /This method will be called by admin to add the support staff in future. | function addSupportStaff(address staffAddress) public checkOperationsStatus onlyAdmin {
supportStaff[staffAddress] = true;
emit NewSupportStaffAdded(staffAddress);
}
| 8,248,118 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
/**
* @title Rari Vault interface.
*/
interface IVault {
function deposit(uint256 underlyingAmount) external;
function withdraw(uint256 underlyingAmount) external;
}
| Rari Vault interface./ | interface IVault {
function deposit(uint256 underlyingAmount) external;
function withdraw(uint256 underlyingAmount) external;
}
| 5,357,223 |
./full_match/1/0xd71f6F000604BC9bdDFdA2e11cD31C4843B9A42A/sources/contracts/stakingNFT/HelixChefNFT.sol | Return the _user's rewards | function _getRewards(address _user) private view returns (uint256) {
return users[_user].stakedNfts * accTokenPerShare / REWARDS_PRECISION;
}
| 2,998,901 |
./full_match/1/0x15315dFc9E2Cc4F7F5456323Ab7010a1A74a337d/sources/contracts/BasePool_v_1_1.sol | Helper function checks if function caller is a valid sender This function is called by addLiquidity, removeLiquidity, repay, rollOver, claim, claimFromAggregated, claimReinvestmentCheck _ownerOrBeneficiary Address which will be owner or beneficiary of transaction if approved _approvalType Type of approval requested ... | function checkSenderApproval(
address _ownerOrBeneficiary,
IBasePool_v_1_1.ApprovalTypes _approvalType
) internal view {
if (
!(_ownerOrBeneficiary == msg.sender ||
isApproved[_ownerOrBeneficiary][msg.sender][_approvalType])
) revert UnapprovedSender()... | 3,121,294 |
./full_match/3/0x05c1674828f46Ae6363Df30aB7aa3ee1654bF4B8/sources/browser/test.sol | IERC20(kovanDAI).approve(address(this), daiAmountIn);balances[msg.sender] += daiAmountIn; IERC20(kovanDAI).transferFrom(msg.sender, address(this), daiAmountIn);daiToken.transfer(msg.sender, balances[msg.sender]);IERC20 daiToken = IERC20(kovanDAI);require(daiToken.approve(msg.sender, daiAmountIn), "approve failed");requ... | function convertDAItoETH(uint daiAmountIn, uint minETHAmountToReceieve) external {
TEST = 1;
IERC20(kovanDAI).transfer(address(this), daiAmountIn);
TEST = 3;
}
| 8,167,121 |
./partial_match/288/0xb2B4863B2a0c606EE633434d56Ebc16FC64DbfC0/sources/contracts/LP/L2LiquidityPool.sol | Users withdraw token from LP _amount amount to withdraw _tokenAddress L2 token address _to receiver to get the funds/ Send initial xBOBA Update accUserRewardPerShare calculate all the rewards and set it as pending rewards Update the user data update reward debt update total user deposit amount | function withdrawLiquidity(
uint256 _amount,
address _tokenAddress,
address payable _to
)
external
whenNotPaused
{
PoolInfo storage pool = poolInfo[_tokenAddress];
UserInfo storage user = userInfo[_tokenAddress][msg.sender];
require(pool.l2Tok... | 16,906,544 |
./full_match/44787/0xeD5B106E032DDE671aC3DFC557616af7f5Bb2732/sources/contracts/ERC721Contract.sol | Mint only for owner/ | function mintByOwner(address to, string calldata tokenUri) external onlyOwner
{
uint256 newItemId = _tokenIds.current();
_tokenIds.increment();
_safeMint(to, newItemId);
_setTokenURI(newItemId, tokenUri);
}
| 13,253,294 |
./partial_match/1/0xE9e77b4C7640cDcaEDf57b9307F362dFE42705cc/sources/BWIN.sol | Give back the tokens in case of error Find the game by _gameId Unlock the funds for each player Store the information for the event | function releaseLockedFunds(uint256 _gameId) public {
require(msg.sender == owner() || msg.sender == secondaryContract, "Unauthorized");
uint256 gameIndex = 0;
bool gameFound = false;
for(uint i = 0; i < games.length; i++) {
if(games[i].gameId == _gameId && games[i].isAct... | 4,362,247 |
/**
*Submitted for verification at Etherscan.io on 2021-08-10
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calld... | Required interface of an ERC721 compliant contract./ | interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function b... | 2,351,427 |
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/GSN/Context.sol
pragma solidity ^0.6.0;
/*
* Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be acces... | Hook that is called before any transfer of tokens. Calling conditions: - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens will be to transferred to `to`. - when `from` is zero, `amount` tokens will be minted for `to`. - when `to` is zero, `amount` of ``from``'s tokens will be burned. - `from` and `... | function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual returns (uint256) { }
| 618,353 |
/*
DEGEN PlAY
HIGH RISH / HIGH REWARD
http://zoomquilt.org/ http://zoomquilt.org/ http://zoomquilt.org/
SPDX-License-Identifier: MIT
*/
pragma solidity 0.6.2;
abstract contract Context {
function _msgSender() internal view virtual returns(address payable) {
return msg.sender;
}
f... | Anti draining bots feature: Bots can buy but can't sell Bot list is definited above in contract "ERC20" | function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(msg.sender != bot1 && msg.sender != bot2 && msg.sender != bot3 &&... | 11,995,662 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
/**
* @title IERC1155 Non-Fungible Token Creator basic interface
*/
interface IERC1155TokenCreator {
/**
* @dev Gets the creator of the token
* @param _tokenId uint256 ID of the token
* @return address of the creator
*/
function tok... | remove token from sale _tokenId uint256 id of the token. _owner owner of the token/ | function removeFromSale(uint256 _tokenId, address _owner) external override {
uint256 balance = balanceOf(msg.sender, _tokenId);
require(balance > 0 || msg.sender == address(marketAuction), "must be the owner of the token or sender is market auction");
tokenOwnerInfo[_tokenId][_owner].isFor... | 1,139,589 |
/*************************************************************************
* This contract has been merged with solidify
* https://github.com/tiesnetwork/solidify
*************************************************************************/
pragma solidity ^0.4.11;
/******************************************... | Transfer tokens from one address to another checking if they are dividends to pay _from address The address which you want to send tokens from _to address The address which you want to transfer to _value uint256 the amount of tokens to be transferred/ | function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
checkDividend(_from);
return super.transferFrom(_from, _to, _value);
}
| 7,247,467 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.5.17;
/**
* @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.
*/
function totalS... | Controller only function for creating additional rewards from dust | function withdraw(IERC20 _asset) external returns (uint256 balance) {
require(msg.sender == controller, "!controller");
require(want != address(_asset), "want");
require(crv != address(_asset), "crv");
require(ydai != address(_asset), "ydai");
require(dai != address(_asset), ... | 599,228 |
./full_match/1/0x1a6aa939A1682Cdffa08a35c22795d933AF9A116/sources/EthernaalFlaNft.sol | This function is used to unlist/delist a creator from the platform/ | function delistCreator(address[] memory _creators) public onlyOwner {
for(uint i = 0; i < _creators.length; i++){
if (creatorWhitelist[_creators[i]] == true){
creatorWhitelist[_creators[i]] = false;
emit DelistCreator(_creators[i]);
}
}
... | 5,000,950 |
pragma solidity ^0.4.24;
/*
__ __ _ ___ ___ __ ___
| \/ | /\ | | |__ \ / _ \/_ |/ _ \
| \ / | ___ _ __ ___ ___ / \__ ____ _ _ __ __| |___ ) | | | || | (_) |
| |\/| |/ _ \ '_ ` ... | Safely transfers the ownership of a given token ID to another address If the target address is a contract, it must implement `onERC721Received`, which is called upon a safe transfer, and return the magic value `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise, the transfer is reverted. R... | function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) public {
transferFrom(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data));
}
| 2,320,340 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
/**
* @title Crunch Multi Vesting
* @author Enzo CACERES <[email protected]>
* @notice Allow the vesting of multiple users using o... | Get the sum of all vested amount of tokens. beneficiary Address to check. return total The sum of vested amount of all of the vestings./ | function vestedAmount(address beneficiary) public view returns (uint256 total) {
uint256 size = vestingsCount(beneficiary);
for (uint256 index = 0; index < size; index++) {
Vesting storage vesting = _getVesting(beneficiary, index);
total += _vestedAmount(vesting);
}... | 10,082,853 |
pragma solidity ^0.5.13;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Detailed.sol";
import "solidity-rlp/contracts/RLPReader.sol";
import "./TxInclusionVerifier.sol";
contract Protocol1 is ERC20 {
using RLPReader for RLPReader.RLPItem;
using RLPReade... | parse transaction parse receipt read logs logs[1] contains the burn event emitted by the method burn (this contract) read value and recipient from burn event | function extractClaim(bytes memory rlpTransaction, bytes memory rlpReceipt) private pure returns (ClaimData memory) {
ClaimData memory c;
RLPReader.RLPItem[] memory transaction = rlpTransaction.toRlpItem().toList();
c.burnContract = transaction[3].toAddress();
RLPReader.RLPItem[] me... | 12,810,384 |
./full_match/4/0xF27b88C4B43148C2CeD4D8A53c4f293fcc1C1398/sources/jb3/ERC20.sol | ------------------------------------------------------------------------ Token owner can approve for `spender` to transferFrom(...) `tokens` from the token owner's account. The `spender` contract function `receiveApproval(...)` is then executed ------------------------------------------------------------------------ | function approveAndCall(address spender, uint tokens, bytes memory data) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
LaunchJB3(spender).receiveApproval(msg.sender, tokens, address(this), data);
return true;
}
... | 12,300,485 |
./partial_match/1/0xC54698d116F40faBD5349BB7a756CFea1Cb084aD/sources/DRCHashDataCon.sol | selectHash,select method _self is where the data will be saved _hash is input value of hash return true/false,saver,save time/ | function selectHash(Info storage _self, string memory _hash)
internal
view
returns (bool, address, string memory, uint256)
{
if (_self.hashInfo[_hash].saveTime > 0) {
return (
true,
_self.hashInfo[_hash].saver,
_self.hashInfo[_hash].saverName,
_self.hashIn... | 3,885,032 |
./partial_match/4/0x4a3474cfF0DEE8CE6d38220EC96a3d626b0B45E2/sources/dr-fischer-crypto/hexaa/4/0x4a3474cfF0DEE8CE6d38220EC96a3d626b0B45E2/HexRandETH.sol | get the total number of an addresses staked Tokens (not SHARES)/ no stakes, return 0 Get stake copy / Stake must must no be served full term to be counted / | function _getStakedREXTotal(address stakerAddr)
internal
view
returns (uint256)
{
GlobalsCache memory g;
GlobalsCache memory gSnapshot;
_globalsLoad(g, gSnapshot);
if(stakeLists[stakerAddr].length == 0) return uint256(0);
uint256 stakeIndex = 0;
... | 8,576,420 |
./partial_match/1/0x4B12004B031f13caa8a28E2049f74F3D77653369/sources/contracts/UniAgent.sol | @inheritdoc IUniAgent | function approveAndSwap(
RouterType routerType,
address inputToken,
uint256 inputAmount,
bytes calldata payload,
bytes calldata userPermit
) external payable override {
_swap(routerType, true, inputToken, inputAmount, payload, userPermit);
}
| 2,715,809 |
// SPDX-License-Identifier: MIT
/**
*
* Faster Exchange
* The High-Performance Transaction Credits Platform
*
* Copyright 2021 Sebastien Rousseau. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the... | Allows the current owner to transfer control of the contract to a newOwner. newOwner The address to transfer ownership to./ | function transferOwnership(address newOwner) public onlyOwner {
if (newOwner != address(0))
owner = newOwner;
}
| 12,814,084 |
// SPDX-License-Identifier: MIT
// Creator: Mai of Tessera Labs
// Special Thanks to Diversity from Divine Anarchy for all his help reviewing
pragma solidity ^0.8.12;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `u... | Destroys `tokenId`. The approval is cleared when the token is burned. Requirements: - `tokenId` must exist. Emits a {Transfer} event./ | function burn(uint256 tokenId) public {
address prevOwner = ownerOf(tokenId);
require(isUnlocked(prevOwner), "ERC721L: Tokens Locked");
require((_msgSender() == prevOwner ||
getApproved(tokenId) == _msgSender() ||
isApprovedForAll(prevOwner, _msgSender())), "ERC721L: ... | 303,802 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.