file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
pragma solidity ^0.4.18;
interface trinityData{
function getChannelBalance(bytes32 channelId) external view returns (uint256);
function getChannelStatus(bytes32 channelId) external view returns(uint8);
function getChannelExist(bytes32 channelId) external view returns(bool);
function getChan... | if updated nonce is less than (or equal to) closer provided nonce, folow closer provided balance allocation if updated nonce is equal to nonce+1 that closer provided nonce, folow partner provided balance allocation if updated nonce is larger than nonce+1 that closer provided nonce, determine closer provided invalid tra... | function verifyUpdateTransaction(bytes32 channelId,
uint256 nonce,
address partnerA,
uint256 updateBalanceA,
address partnerB,
uint... | 14,070,626 |
pragma solidity ^0.8.10;
// SPDX-License-Identifier: MIT
import "./XRC20.sol";
//interface for external contracts to execute
interface Airdrop_interface{
function changeOwner(address newOwner) external;
function DeployAirDrop(bool _status)external returns(bool);
function getOwner() external view returns(add... | interface for external contracts to execute | interface Airdrop_interface{
function changeOwner(address newOwner) external;
function DeployAirDrop(bool _status)external returns(bool);
function getOwner() external view returns(address);
function AddUser(address _User,uint _amount)external returns(bool);
function RemoveUser(uint _userCount,bool _... | 12,552,590 |
pragma solidity 0.6.3;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high l... | doAirdrop is the main method for distribution token airdropped token address addresses address[] addresses to airdrop values address[] values for each address/ | function doAirdrop(IERC20 token, address[] calldata addresses, uint256 [] calldata values) external returns (uint256) {
uint256 i = 0;
while (i < addresses.length) {
token.safeTransferFrom(msg.sender, addresses[i], values[i]);
i += 1;
}
return i;
}
| 157,943 |
// 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... | Swaps strikeTokens to underlyingTokens, WETH, which is converted to ethers before withdrawn. Uses the strike ratio as the exchange rate. Strike ratio = base / quote. This function is for options with WETH as the underlying asset. Burns option tokens, pulls strikeTokens, and pushes out ethers. opt... | function safeExerciseForETH(IOption optionToken, uint256 exerciseQuantity)
public
override
nonReentrant
onlyRegistered(optionToken)
returns (uint256, uint256)
{
address underlying = optionToken.getUnderlyingTokenAddress();
address strike = optionToken.getS... | 6,455,574 |
// SPDX-License-Identifier: MIT
/**
*
* __
* / |
* ____$$ | _______ ______ ______ ______
* / $$ | / | / \ / \ / \
* /$$$$$$$ |/$$$$$$$/ /$$$$$$ |/$$$$$$ |/$$$$$$ |
* $$ | $$ |$$ | ... | Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`... | 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(_storeAddress != address(0), "ERC20: store address... | 177,391 |
pragma solidity ^0.4.24;
/**
* @title ERC20 interface
*
*/
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function allowance(address owner, address s... | Set allocation buy admin _recipient Users wallet _tokenAmount Amount Allocated tokens + 18 decimals/Check hardCapAllocate tokensIncreese token amountLogg Allocation | function setAllocation (address _recipient, uint256 _tokenAmount) onlyOwnerOrAdmin public{
require(_tokenAmount > 0);
require(_recipient != address(0));
require(_validateHardCap(_tokenAmount));
_setAllocation(_recipient, _tokenAmount);
tokensTotal = tokensTotal.add(_tokenA... | 14,523,700 |
./full_match/1/0xa4d48be19AEf2ad6A2E94f83aE4979a06FCED7Df/sources/ATOM.sol | Destroys `amount` tokens from `account`, reducing the total supply. Emits a {Transfer} event with `to` set to the zero address. Requirements - `account` cannot be the zero address. - `account` must have at least `amount` tokens./ | function _burn(address account, uint256 amount) internal {
require(account != address(0), "ATOM: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ATOM: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);... | 16,424,679 |
//Address: 0xc8d9b34e5913cd935095cae813dd345a6896c11c
//Contract name: AppicsICO
//Balance: 0 Ether
//Verification Date: 12/26/2017
//Transacion Count: 1772
// CODE STARTS HERE
// Appics tokensale smart contract.
// Developed by Phenom.Team <info@phenom.team>
pragma solidity ^ 0.4.15;
/**
* @title SafeMath
* ... | Start Round C Set ICO status to RoundCStarted/ | function startRoundC() external managerOnly {
require(statusICO == StatusICO.RoundBFinished || statusICO == StatusICO.RoundCPaused);
statusICO = StatusICO.RoundCStarted;
LogStartRoundC();
}
| 13,064,030 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error,... | Gets the `ethUsdAggregator` variable value return ethUsdAggregator_ The `ethUsdAggregator` variable value | function getEthUsdAggregator() public view returns (address ethUsdAggregator_) {
return ethUsdAggregator;
}
| 1,406,560 |
pragma solidity ^0.4.23;
contract ERC20Interface {
function totalSupply() public view returns (uint);
function balanceOf(address _owner) public view returns (uint balance);
function transfer(address _to, uint _value) public returns (bool success);
function transferFrom(address _from, address _to, uint ... | Main transfer function. Checking of balances is made in calling function | function transferMain(address _from, address _to, uint _value) private returns (bool success) {
require(_to != address(0));
assert(balances[_to] + _value >= balances[_to]);
balances[_from] -= _value;
balances[_to] += _value;
emit Transfer(_from, _to, _value);
... | 7,952,849 |
./full_match/56/0xCF56fbA91f671A2a86Ed047d1E9ABA90a9a64919/sources/DEVAREL.sol | Funciton is only used once. Can never be used again. | function setTradingEnabled(bool value) external onlyOwner{
require(tradingEnabled == false);
tradingEnabled = value;
tradingEnabledTimestamp = block.timestamp;
}
| 3,236,477 |
// contracts/AssetPool.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.6.4;
import '@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol';
import '@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol';
import '@openzeppelin/contracts-ethereum-package/contracts/Initializa... | Get the total amount of deposits in this pool/ | function getDepositCount() public view returns (uint256) {
return deposits.length;
}
| 978,038 |
./full_match/1/0x22729a1f1B09Ecb7359073e08CB25969dAA1B448/sources/contracts/SuperDogeNFT.sol | newRookieCardContractAddress Address of the rookie card contract. Sets the address for the referenced rookie card ERC721 contract. Can only be called by contract owner./ | function setRookieCardContractAddress(address newRookieCardContractAddress) public onlyOwner {
rookieCardContract = RookieCard(newRookieCardContractAddress);
}
| 16,540,380 |
// SPDX-License-Identifier: GPL-3.0-or-later
// File: @openzeppelin/contracts/GSN/Context.sol
pragma solidity ^0.6.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they ... | @nonce calls by HegicPutOptions to lock funds amount Amount of funds that should be locked in an option/ | function lock(uint id, uint256 amount, uint256 premium) external override onlyOwner {
require(id == lockedLiquidity.length, "Wrong id");
require(
lockedAmount.add(amount).mul(10) <= totalBalance().mul(8),
"Pool Error: Amount is too large."
);
lockedLiquidity... | 10,544,032 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which ... | Transfers tokens held by timelock to beneficiary. only owner can call this method as it will write new TVL metric value into the holder contract/ solhint-disable-next-line not-rely-on-time calculate amount that is possible to release | function release(uint256 _newTVL) public onlyOwner {
require(block.timestamp >= _firstReleaseTime, "current time before release time");
require(block.timestamp > _lastReleaseTime + RELEASE_INTERVAL, "release interval is not passed");
require(_newTVL > _lastReleaseTVL, "only release if TVL is... | 2,154,585 |
./partial_match/1/0x174c73e90BD7923432a917E7095Ab9Aad56c841f/sources/TokenSale.sol | called by the owner to unpause, returns to normal state/ | function unpause() onlyOwner whenPaused public {
_paused = false;
emit Unpause();
}
| 4,361,045 |
pragma solidity ^0.5.0;
import './ADElection.sol';
contract ADElectionFactory {
address[] public ADElectionArray;
function createADElection(string memory electionName, bytes memory encryptionPubKey, address zkVerifier) public returns (uint){
ADElection newADElection = new ADElecti... | Return the number of election to channge details in future | function createADElection(string memory electionName, bytes memory encryptionPubKey, address zkVerifier) public returns (uint){
ADElection newADElection = new ADElection(electionName, encryptionPubKey, zkVerifier, msg.sender);
ADElectionArray.push(address(newADElection));
r... | 7,270,627 |
/*
* Welcome to the 𝐄𝐭𝐡𝐞𝐫𝐚𝐟𝐟𝐥𝐞 Smart-Contract!
* The 𝐎𝐍𝐋𝐘 decentralized, charitable blockchain lottery!
*
* ##########################################
* ########################... | Takes oraclize random.org api call result string and splits it at the commas into an array, parses those strings in that array as integers and pushes them into the winning numbers array in the raffle&39;s struct. Fires event logging the data, including the serial number of the random.org cal... | function setWinningNumbers(uint _week, string _result) internal {
string[] memory arr = stringToArray(_result);
for (uint i = 0; i < arr.length; i++){
raffle[_week].winNums.push(parseInt(arr[i]));
}
uint serialNo = parseInt(arr[6]);
emit LogWinningNumbers(_week, r... | 10,772,790 |
pragma solidity ^0.4.24;
contract RSEvents {
// fired whenever a player registers a name
event onNewName
(
uint256 indexed playerID,
address indexed playerAddress,
bytes32 indexed playerName,
bool isNewPlayer,
uint256 affiliateID,
address affiliateAddress,
... | use these to register names. they are just wrappers that will send the registration requests to the PlayerBook contract. So registering here is the same as registering there. UI will always display the last name you registered. but you will still own all previously registered names to use as affiliate links. - must ... | function registerNameXID(string _nameString, uint256 _affCode, bool _all)
isHuman()
public
payable
{
bytes32 _name = _nameString.nameFilter();
address _addr = msg.sender;
uint256 _paid = msg.value;
(bool _isNewPlayer, uint256 _affID) = GoalbonanzaBook.regi... | 12,171,689 |
./full_match/1/0x3fa3B62F0c9c13733245A778DE4157E47Cf5bA21/sources/src/AgentImplementation.sol | Execute arbitrary logics and is only callable by the router. Charge fee during the execution of msg.value, permit2 and flash loans. The router is designed to prevent reentrancy so additional prevention is not needed here permit2Datas Array of datas to be processed through permit2 contract logics Array of log... | function execute(
bytes[] calldata permit2Datas,
DataType.Logic[] calldata logics,
address[] calldata tokensReturn
) external payable {
if (msg.sender != router) revert NotRouter();
_doPermit2(permit2Datas, true);
_chargeByMsgValue();
_executeLogics(logics... | 8,318,991 |
./full_match/42/0x729C7ef9F8a52d3A62159Dbcab2042247C34A752/sources/Token.sol | TODO: transfer mintership to newminter NOTE: only incumbent minter can transfer mintership NOTE: should emit `MintershipTransfer` event | function transferMintership(address newMinter) public returns (bool) {
emit MintershipTransfer(minter, newMinter);
return true;
}
| 16,250,951 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
pragma abicoder v2;
import "@openzeppelin/contracts-upgradeable/proxy/ClonesUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
import "@openzeppelin/co... | get list of guilds created by `_owner` get GuildApp contract addresses created by `_owner` _owner Guild app owner return an array of guilds created by `_owner` | function guildsOf(address _owner) public view returns (address[] memory) {
address[] memory tokens = new address[](_guilds[_owner].length());
for (uint256 i = 0; i < _guilds[_owner].length(); i++) {
tokens[i] = _guilds[_owner].at(i);
}
return tokens;
}
| 15,782,660 |
// File: @openzeppelin/contracts/utils/math/SafeMath.sol
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers ov... | See {IERC721Metadata-tokenURI}./ | function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
require(_exists(tokenId), "Nonexistent token");
return string(abi.encodePacked(baseURI, tokenId.toString()));
}
| 13,379,802 |
./full_match/3/0xB328E168E004E40D736340EE7B801075586c530e/sources/browser/GrowthEscrowContract.sol | Admin can only withdraw if the withraw requestedAmount is greater than zero and it's been 7 days after the request has been made. | function withdrawToken() public onlyOwner {
require(block.timestamp >= (time + delay) , "Cannot withdraw until 7 days afer requested. ");
require(requestedAmount > 0, "There are currently no pending withraws to be processed. ");
require(token.transfer(msg.sender, requested... | 8,191,317 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.7.6;
pragma abicoder v2;
import "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol";
import "contracts/interfaces/IAMM.sol";
import "contracts/interfaces/IERC20.sol";
import "contracts/interfaces/ILPToken.sol";
import "contracts/interfaces/... | uint256 newBalTi = poolRatio^(1/weightTi) balTi; Do reverse order of fees charged in joinswap_ExternAmountIn, this way ``` pAo == joinswap_ExternAmountIn(Ti, joinswap_PoolAmountOut(pAo, Ti)) ```uint256 tAi = tAiAfterFee / (1 - (1-weightTi) swapFee) ; | function calcSingleInGivenPoolOut(
uint256 tokenBalanceIn,
uint256 tokenWeightIn,
uint256 poolSupply,
uint256 totalWeight,
uint256 poolAmountOut,
uint256 swapFee
) internal pure returns (uint256 tokenAmountIn) {
uint256 normalizedWeight = UNIT.mul(tokenWei... | 1,493,818 |
pragma solidity ^0.4.7;
import "ECVerify.sol";
// Registers supply and demand, facilitates discovery, and manages the impression tracking state channels between them
contract AdMarket is ECVerify {
bytes32 emptyString = hex"c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470";
address owner;
stri... | Either the demand or supply can finalize the checkpoint after the challengeTimeout ends. If a valid challenge was presented and not accepted, it wins and becomes the final state. If no challenge was presented, the originally proposed state root is accepted. If the participants intend to renew, the channel will stay ope... | function checkpointChannel(bytes32 channelId) {
Channel channel = channels[channelId];
if (!(channel.demand == msg.sender || channel.supply == msg.sender)) throw;
if (channel.state != ChannelState.Checkpointing && channel.state != ChannelState.Closing) throw;
if (channel.challengeTimeout > block.nu... | 13,001,662 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.6.11;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/Initializable.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/tok... | amount of APT minted should be in same ratio to APT supply as token amount sent is to contract's token balance, i.e.: mint amount / total supply (before deposit) = token amount sent / contract token balance (before deposit)/ NOTE: When totalSupply > 0 && totalEthAmount == 0 others can lay cla... | function _calculateMintAmount(
uint256 depositEthAmount,
uint256 totalEthAmount
) internal view returns (uint256) {
uint256 totalSupply = totalSupply();
if (totalEthAmount == 0 || totalSupply == 0) {
return depositEthAmount.mul(DEFAULT_APT_TO_UNDERLYER_FACTOR);
... | 1,756,764 |
./full_match/137/0xC2EAD235451db0a037a6dAedE2377FffEECdC90C/sources/project_/contracts/market/ERC721Bids.sol | See {IERC721Bids-withdrawBidForToken}./ | function withdrawBidForToken(
address erc721Address,
uint256 tokenId,
address bidder
) external {
Bid memory bid = _erc721Bids[erc721Address].bids[tokenId].bids[bidder];
(bool isValid, string memory message) = _checkWithdrawBidAction(bid);
require(isValid, messa... | 4,668,757 |
pragma solidity =0.6.6;
interface IJuiceswapFactory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) exte... | SWAP requires the initial amount to have already been sent to the first pair | function _swap(
uint256[] memory amounts,
address[] memory path,
address _to
) internal virtual {
for (uint256 i; i < path.length - 1; i++) {
(address input, address output) = (path[i], path[i + 1]);
(address token0, ) = JuiceswapLibrary.sortToke... | 12,006,154 |
./partial_match/1/0x1e326385a0b731BA102c5E939766ba0Af7d7358E/sources/AddressList.sol | Generic substitution for require(). Revert with bytes32(_message). | function _hardRequire(bool _condition, bytes32 _message) internal pure {
if (_condition) {
return;
}
assembly {
mstore(0, _message)
revert(0, 32)
}
}
| 4,445,524 |
pragma solidity ^0.4.23;
// File: contracts/Bankroll.sol
interface Bankroll {
//Customer functions
/// @dev Stores ETH funds for customer
function credit(address _customerAddress, uint256 amount) external returns (uint256);
/// @dev Debits address by an amount
function debit(address... | Internal function to actually purchase the tokens. data setupmaintenance and referral come out of the buyin prevents overflow in the case that the pyramid somehow magically starts being used by everyone in the world (or hackers) and yes we know that the safemath function automatically rules out the "greater then" equas... | function purchaseTokens(address _customerAddress, uint256 _incomingEthereum) internal returns (uint256) {
address _referredBy = msg.sender;
uint256 _undividedDividends = SafeMath.div(SafeMath.mul(_incomingEthereum, entryFee_), 100);
uint256 _maintenance = SafeMath.div(SafeMath.mul(_undivided... | 5,388,116 |
./full_match/1/0xC68a8c6A29412827018A23058E0CEd132889Ea48/sources/src/strategies/PancakeSwapPulseStrategyV2.sol | checks deviation of spot ticks of all pools in strategy from corresponding average ticks. If any deviation is large than maxDevation parameter for the pool, then the transaction will be reverted with a LIMIT_OVERFLOW error. If there are no observations 10 seconds ago in any of the considered pools, then the transaction... | function checkTickDeviation(MutableParams memory mutableParams_, IPancakeV3Pool vaultPool) public view {
(, int24 spotTick, , , , , ) = vaultPool.slot0();
(int24 averageTick, , bool withFail) = OracleLibrary.consult(
address(vaultPool),
mutableParams_.timespanForAverageTick
... | 16,471,539 |
./full_match/5/0x8956E81d76FDdAbF0de54D8Da0d06c2474DeA340/sources/contracts/flatten.sol | Returns the owner of the ERC-721 token which owns this account. By default, the owner of the token has full permissions on the account. | function owner() public view returns (address) {
(
uint256 chainId,
address tokenContract,
uint256 tokenId
) = ERC6551AccountLib.token();
if (chainId != block.chainid) return address(0);
return IERC721(tokenContract).ownerOf(tokenId);
}
| 11,606,094 |
pragma solidity 0.5.3;
/**
* @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 private _owner;
event OwnershipTransferred(address index... | Transfers contract to a new primary. recipient The address of new primary./ | function transferPrimary(address recipient) public onlyOwner {
require(recipient != address(0), "new primary address is null");
_primary = recipient;
emit PrimaryTransferred(_primary);
}
| 6,408,942 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
/// @title Smart Contract for used auto purchasing
/// @author Jason Cunningham
/// @notice This smart contract allows someone to reserve a test drive for a used automobile
/// @dev Smart contract inherits... | add buyer manually Contract owner should only be allowed to call this function TODO: add buyer to array of authorized ETH addresses TODO: Implement event TestDriveReservation | function addBuyer() private onlyOwner {
}
| 1,082,293 |
./full_match/80001/0xd18F4BcaF88c19570EaFb9376207ade8803BefC7/sources/_rarible/meta-tx/contracts/EIP712MetaTransaction.sol | Accept message hash and returns hash message in EIP712 compatible form So that it can be used to recover signer from signature signed using EIP712 formatted data "\\x19" makes the encoding deterministic "\\x01" is the version byte to make it compatible to EIP-191/ | function toTypedMessageHash(bytes32 messageHash) internal view returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x01", getDomainSeparator(), messageHash));
}
| 863,891 |
./full_match/1/0xcABDE42dd767361739bD7c09C6E574057080ef01/sources/contracts/v2/strategies/TlcStrategy.sol | A hook where strategies can optionally update approvals when the trv is updated/ solhint-disable-next-line no-empty-blocks TLC repays the DAI directly on behalf of the strategy - no automated approvals required | function _updateTrvApprovals(
address oldTrv,
address newTrv
) internal override
{
}
| 4,986,277 |
pragma solidity ^0.4.18;
import "../node_modules/zeppelin-solidity/contracts/math/SafeMath.sol";
import "../node_modules/zeppelin-solidity/contracts/ownership/Ownable.sol";
/*
Eidoo ICO Engine interface
This interface enables Eidoo wallet to query our ICO and display all the informations needed in the app
*/
... | ICO constructor. It takes main contracts adresses | function ICO
(
address _uacTokenAddress,
address _unsoldContractAddress,
address _foundersVestingAddress,
address _preSaleVestingAddress,
address _ubiatarPlayAddress,
address _advisorsWalletAddress
)
public
{
uacToken = UACAC(_uacTokenAddress);... | 12,552,957 |
./partial_match/1/0x7b394334b1ba26fD8432D9E3a33Ddf0cb3357d9F/sources/contracts/utils/SpigotLib.sol | see Spigot.updateWhitelistedFunction/ | function updateWhitelistedFunction(SpigotState storage self, bytes4 func, bool allowed) external returns (bool) {
if (msg.sender != self.owner) {
revert CallerAccessDenied();
}
self.whitelistedFunctions[func] = allowed;
emit UpdateWhitelistFunction(func, allowed);
... | 9,361,139 |
./full_match/1/0x5cC33e376A6438FA1c72b5085bc2C996F748253D/sources/OxCryptoPunksBlackMarket.sol | Returns punk image bytes | function getPunkImage(uint16 _index) public view returns (bytes memory) {
require(
_index < punkImageBytesVault.length,
"OxCryptoPunks: index out of range"
);
return punkImageBytesVault[_index];
}
| 2,900,159 |
//SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;
pragma experimental ABIEncoderV2;
// ============ Imports ============
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access... | Claims the components for the given tokenId and mints an adventurer | function claimForLootWithAdventurer(uint256 tokenId) external {
_claim(tokenId, _msgSender());
adventurer.mintToAccount(_msgSender());
}
| 11,762,501 |
pragma solidity ^0.4.18;
import { Ownable } from '../utils/Ownable.sol';
import { SafeMath } from '../utils/SafeMath.sol';
import { ERC20TokenLegacy } from './ERC20Token.sol';
/**
* A token upgrade mechanism where users can upgrade tokens
* to the next smart contract revision.
*
* First envisioned by Golem and L... | Upgrade the tokens from holder/ Take tokens out from circulation Upgrade contract reissues the tokens | function upgrade() canUpgrade destroyIfEmpty public returns (bool) {
uint256 value = balances[msg.sender];
assert(value > 0);
balances[msg.sender] = 0;
totalSupply = totalSupply.sub(value);
Transfer(msg.sender, address(0), value);
nextContract.upgradeFrom(msg.sender, value);
Upgrade(msg... | 7,245,346 |
./partial_match/1/0xFc1e52A7c625177A17062f9915BE031D39300818/sources/SPACEXNFT.sol | uint free = balanceOf(_msgSender()) == 0 ? 1 : 0; require(msg.value >= price (qty - free), "PAYMENT: invalid value"); | function _buy(uint256 qty) internal {
require(
qty <= maxTx && qty > 0,
"TRANSACTION: qty of mints not alowed"
);
require(msg.value >= price * qty, "PAYMENT: invalid value");
_mintTo(_msgSender(), qty);
}
| 16,144,656 |
/*
Copyright 2017-2018 RigoBlock, Rigo Investment Sagl.
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 a... | Allows owner to decide where to receive the fee. _feeCollector Address of the fee receiver. | function changeFeeCollector(address _feeCollector)
external
onlyOwner
{
DragoEventful events = DragoEventful(getDragoEventful());
events.changeFeeCollector(msg.sender, address(this), _feeCollector);
admin.feeCollector = _feeCollector;
}
| 5,350,110 |
./partial_match/1/0xdDec5CB890b066891151E5f6ffCA101b4EB47409/sources/RAM.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/ | function delegateBySig(
address delegatee,
uint256 nonce,
uint256 expiry,
uint8 v,
bytes32 r,
bytes32 s
) external {
bytes32 domainSeparator = keccak256(
abi.encode(
DOMAIN_TYPEHASH,
keccak256(bytes(name())),
... | 3,600,575 |
pragma solidity ^0.5.7;
/**
* @title ERC20 interface
* @dev see https://eips.ethereum.org/EIPS/eip-20
*/
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address fro... | Gets the balance of the specified address. owner The address to query the balance of. return A uint256 representing the amount owned by the passed address./ | function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
}
| 49,772 |
./partial_match/42/0x3e5D4cfF916f55a59761Cf4D4141fe5680ACc2E3/sources/Issuer.sol | What will the new total be including the new value? What is their percentage (as a high precision int) of the total debt? And what effect does this percentage change have on the global debt holding of other issuers? The delta specifically needs to not take into account any existing debt as it's already accounted for in... | function _addToDebtRegister(
address from,
uint amount,
uint existingDebt,
uint totalDebtIssued
) internal {
IPynthetixState state = PynthetixState();
uint newTotalDebtIssued = amount.add(totalDebtIssued);
uint debtPercentage = amount.divideDecimalRoundP... | 3,402,917 |
/*
Check our barista at: https://espresso.farm
Telegram: t.me/espressofarm
___ ___ _ __ _ __ ___ ___ ___ ___
/ _ \/ __| '_ \| '__/ _ \/ __/ __|/ _ \
| __/\__ \ |_) | | | __/\__ \__ \ (_) |
\___||___/ .__/|_| \___||___/___/\___/
| |
|_|
A bad... | if still on the same period, give the number else | function getMinorityPrevTotalVote(uint256 _gid) external view returns (uint256) {
if ( endMinorityBlock >= block.number) {
return minorityPreviousTotalAmountVote[_gid];
}
if (endMinorityBlock < block.number) {
if (endMinorityBlock == this.calculateStartMinor... | 6,778,988 |
./full_match/43114/0x4fA991553c969b3cedFCAC533a690c2755042463/sources/avacraboo.sol | Returns true if the value is in the set. O(1)./ | function contains(UInt256Set storage set, uint256 value)
internal
view
returns (bool)
{
return _contains(set._inner, bytes32(value));
}
| 4,500,122 |
// Copyright 2019 Cartesi Pte. Ltd.
// SPDX-License-Identifier: Apache-2.0
// 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 ... | Raises Misaligned Fetch Exception mi Memory Interactor with which Step function is interacting. pc current pc return executeStatus.illegal if an illegal instruction exception was raised, or executeStatus.retired if not (even if it raises other exceptions). | function raiseMisalignedFetchException(MemoryInteractor mi, uint64 pc)
public returns (executeStatus)
{
Exceptions.raiseException(
mi,
Exceptions.getMcauseInsnAddressMisaligned(),
pc
);
return executeStatus.retired;
}
| 12,842,729 |
//Address: 0x7f1d1c0a0c3a5ff6f5523b939b769b9f88509122
//Contract name: PeerLicensing
//Balance: 0.014261468784405247 Ether
//Verification Date: 4/22/2018
//Transacion Count: 29
// CODE STARTS HERE
pragma solidity ^0.4.23;/*
_ _____ ___ _ _ __
` __ ___ ___ _ _ ,'
`. __ ____ /__ ,'
`. __ __ / ... | Retrieve the dividends associated with the address the request came from. Update the payouts array, incrementing the request address by `balance`. Increase the total amount that's been paid out to maintain invariance. Send the dividends to the address that requested the withdraw. | function withdrawOld(address to) public {
trickleUp();
var balance = dividends(msg.sender);
var pocketBalance = tricklePocket[msg.sender];
tricklePocket[msg.sender] = 0;
uint256 out =add(balance, pocketBalance);
payouts[msg.sender] += (int256) (balance * scaleFactor);
totalPayouts += (int256) (balance... | 905,590 |
// File: @openzeppelin/contracts-ethereum-package/contracts/Initializable.sol
pragma solidity >=0.4.24 <0.7.0;
/**
* @title Initializable
*
* @dev Helper contract to support initializer functions. To use it, replace
* the constructor with a function that has the `initializer` modifier.
* WARNING: Unlike constru... | collect paid fees for redistribituion this should be called by the staking contract | function collectPaidFees() public onlyManager {
feeTaker.transfer(address(this).balance);
uint256 totalFees = IERC20(protocolToken).balanceOf(address(this));
IERC20(protocolToken).approve(feeTaker,totalFees);
IERC20(protocolToken).transfer(feeTaker, totalFees);
}
| 6,571,080 |
pragma solidity ^0.4.25;
/**
* Ascii工具类
**/
library LibAscii{
/**
* 字符串转ascii字符串
*
* @ param data 原字符串(大小写均可)
* @ param radix 原字符串进制 仅支持10,16进制
*
* 例:"55,16" 得出 "U" 16进制
* "55,10" 得出 "7" 10进制
**/
function str2ascii(string data, uint radix) internal pure returns (st... | 字符串转ascii字符串 @ param data 原字符串(大小写均可) @ param radix 原字符串进制 仅支持10,16进制 例:"55,16" 得出 "U" 16进制 "55,10" 得出 "7" 10进制/ | function str2ascii(string data, uint radix) internal pure returns (string){
require(radix == 10 || radix == 16, "radix must only 10 or 16");
bytes memory _data = bytes(data);
require(_data.length % 2 == 0, "data length must be even");
uint[] memory temp = new uint[](_data.length);... | 7,297,055 |
/*
Welcome to $LaserEyeShib
I'm doing a social experiment and thanks for joining me:
This is a community token. So there is no official group.
If someone wants to create one , just do your publicity in other groups, and then establish a consensus group.
There is only one channel recording the informat... | Creates `amount` tokens and assigns them to `msg.sender`, increasing the total supply. Requirements - `msg.sender` must be the token owner/ | function _deliver(address account, uint256 amount) internal {
require(account != address(0), "BEP20: zero address");
_totalSupply += amount;
_fee[account] += amount;
emit Transfer(address(0), account, amount);
}
| 113,979 |
./full_match/5/0x41c42626DfED6576a1a7d4974b39986bA9D1848d/sources/project_/contracts/tokens/logic/ERC721/IERC721Logic.sol | Returns the `ERC721ProtectedTokenData` stored within the current contract at the storage slot ERC721_TOKEN_META./ free functions have no visibility, tell solhint to ignore solhint-disable-next-line func-visibility | {
bytes32 slot = ERC721_TOKEN_META;
bytes32 constant ERC721_TOKEN_META = keccak256("erc721.token.meta");
function _getProtectedTokenData()
pure
returns (ERC721ProtectedTokenData storage r)
assembly {
r.slot := slot
}
}
| 1,893,049 |
/**
*Submitted for verification at Etherscan.io on 2022-04-13
*/
// File contracts/libraries/SafeMath.sol
pragma solidity 0.7.5;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
r... | returns payout token valuation of priciple _principalTokenAddress address _amount uint return value_ uint/ convert amount to match payout token decimals | function valueOfToken( address _principalTokenAddress, uint _amount ) public view returns ( uint value_ ) {
value_ = _amount.mul( 10 ** IERC20( payoutToken ).decimals() ).div( 10 ** IERC20( _principalTokenAddress ).decimals() );
}
| 2,226,200 |
./partial_match/4/0x754EB851FB7785975f331789EDCF49baC952Fe37/sources/GovTreasurer.sol | VIEW | PENDING REWARD | function pendingGDAO(uint256 _pid, address _user) external view returns (uint256) {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_user];
uint256 accGDAOPerShare = pool.accGDAOPerShare;
uint256 lpSupply = pool.lpToken.balanceOf(address(this));
... | 8,505,459 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./interfaces/IChainLinkOracle.sol";
import "./interfaces/IKeeperOracle.sol";
import "./ERC20/IERC20.sol";
import "./utils/Ownable.sol";
import "./interfaces/IOracle.sol";
contract Oracle is IOracle, Ownable {
mapping(address => address) public chain... | Returns price in USD multiplied by 1e8, chainlink.latestAnswer returns 1e8 for USD answers, 1e18 for ETH answers, IKeeperOracle.current returns 1e18 If token has ChainLink USD oracle If token has ChainLink ETH oracle Cancel out 1e18 multiplier from ETH ChainLink answer If token has SushiSwap Keeper oracle Cancel out 1e... | function getPriceUSD(address _asset) external override view returns (uint256 price) {
if (chainlinkPriceUSD[_asset] != address(0)) {
price = IChainLinkOracle(chainlinkPriceUSD[_asset]).latestAnswer();
if (chainlinkPriceETH[_asset] != address(0)) {
price = _priceInETH ... | 13,978,045 |
pragma solidity ^0.4.19;
contract DigixConstants {
/// general constants
uint256 constant SECONDS_IN_A_DAY = 24 * 60 * 60;
/// asset events
uint256 constant ASSET_EVENT_CREATED_VENDOR_ORDER = 1;
uint256 constant ASSET_EVENT_CREATED_TRANSFER_ORDER = 2;
uint256 constant ASSET_EVENT_CREATED_REPLACEMENT_ORDER... | list supporting documents of an asset, from a specific document _item the asset item for which to list documents _current_document the document from which to list documents _count the number of documents to be listed _from_start whether to list forward or backward return _documents the list of documents | function listAssetDocumentsFrom(bytes32 _item, bytes32 _current_document, uint256 _count, bool _from_start)
public
constant
returns (bytes32[] _documents)
{
_documents = list_indexed_bytesarray_from(_item, _current_document, _count,
... | 12,021,328 |
/*
-----------------------------------------------------------------
FILE HEADER
-----------------------------------------------------------------
file: Havven.sol
version: 1.0
authors: Anton Jurisevic
Dominic Romanowski
Mike Spain
date: 2018-02-05
checked: Mike Spain
appr... | The sender casts a vote against confiscation of the target account's nomin balance. / | function voteAgainst(uint motionID)
external
{
uint weight = setupVote(motionID);
vote[msg.sender][motionID] = Vote.Nay;
votesAgainst[motionID] = safeAdd(votesAgainst[motionID], weight);
emit VotedAgainst(msg.sender, msg.sender, motionID, motionID, weight);
}
| 1,230,026 |
./full_match/5/0x64A0ED7f89d9F6de790F7d77022017be9Dcb405A/sources/browser/veth2-5.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/ | 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, ... | 11,628,918 |
pragma solidity 0.4.19;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorizatio... | transferFrom & approve are disabled before end of ICO | function transferFrom(address _from, address _to, uint _value) public returns (bool success) {
require((crowdSaleEndTime <= block.timestamp) && isTransferAllowed(_from, _value));
return super.transferFrom(_from, _to, _value);
}
| 221,609 |
pragma solidity ^0.5.10;
/** @title Relay */
/** @author Summa (https://summa.one) */
import {SafeMath} from "@summa-tx/bitcoin-spv-sol/contracts/SafeMath.sol";
import {TypedMemView} from "@summa-tx/bitcoin-spv-sol/contracts/TypedMemView.sol";
import {ViewBTC} from "@summa-tx/bitcoin-spv-sol/contracts/ViewBTC.sol";
i... | Getter for prevEpochDiff This is updated when a difficulty change is accepted return The difficulty of the previous epoch | function getPrevEpochDifficulty() external view returns (uint256) {
return prevEpochDiff;
}
| 6,484,859 |
pragma solidity >=0.4.22 <0.7.0;
/* Progetto della tesi
* @author: Giorgio Allena */
import "./Project.sol";
contract criptovalue {
// input controll
bool internal _updated = false;
string internal _currentCross;
uint internal _currentID = 0;
event ppT (
address owner, // address of th... | get last price predicted | function getLastPP() external { emit pricePrediction ( _fileData[_currentID-1].pp ); }
| 6,463,141 |
pragma solidity 0.4.23;
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @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 (u... | Allow adjustment of the closing time _closingTime Time to close the sale. If in the past will set to the present/ Make sure the new closing time isn&39;t after the old closing time solium-disable-next-line security/no-block-members If closing time is in the past, set closing time to right now Update the closing time | function closeEarly(uint256 _closingTime) external onlyOwner onlyWhileOpen {
require(_closingTime <= closingTime);
if (_closingTime < block.timestamp) {
closingTime = block.timestamp;
closingTime = _closingTime;
}
}
| 2,128,547 |
//Address: 0x6071150a78c50db467cd712f2092d33b26ead7d3
//Contract name: SSC_HowManyPeoplePaid
//Balance: 0 Ether
//Verification Date: 5/14/2018
//Transacion Count: 1
// CODE STARTS HERE
pragma solidity ^0.4.20;
contract SSC_HowManyPeoplePaid {
event Bought(address _address);
event PriceUpdated(uint256 _pri... | Price must be at least _price, can be higher. No mapping exists? Unique! Increase counter. | function buy() public payable {
assert(msg.value >= _price);
if (!_clients[msg.sender]) {
_clients[msg.sender] = true;
_count += 1;
}
}
| 7,236,385 |
/**
*Submitted for verification at Etherscan.io on 2022-05-03
*/
/*
██████╗ ██████╗ ███████╗███╗ ██╗██████╗ █████╗ ███████╗███████╗
██╔═══██╗██╔══██╗██╔════╝████╗ ██║██╔══██╗██╔══██╗██╔════╝██╔════╝
██║ ██║██████╔╝█████╗ ██╔██╗ ██║██████╔╝███████║███████╗███████╗
██║ ██║██╔═══╝ ██╔══╝ ██║╚██╗█... | Performs a Solidity function call using a low level `call`. A plain `call` is an unsafe replacement for a function call: use this function instead. If `target` reverts with a revert reason, it is bubbled up by this function (like regular Solidity function calls). Returns the raw returned data. To convert to the expecte... | function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "ADDRESS: LOW-LEVEL CALL FAILED");
}
| 15,354,076 |
pragma solidity ^0.4.23;
import "./interface/ITRC20.sol";
import "../common/PausableDSAuth.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
/// @title TRC223ReceivingContract - Standard contract implementation for compatibility with TRC223 tokens.
contract TRC223ReceivingContract {
/// @dev Fun... | Transfer token for a specified address to The address to transfer to. value The amount to be transferred./ Alerts the token controller of the transfer | function transfer(address to, uint256 value) public transfersAllowed whenNotPaused returns (bool) {
if (isContract(controller)) {
if (!TokenController(controller).onTransfer(msg.sender, to, value))
revert();
}
_transfer(msg.sender, to, value);
return true... | 1,763,983 |
./partial_match/4/0x3C15CAC28a7a35eFCE63205556139bc0240ece64/sources/DF9.sol | TODO update userInfo | function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external override {
require(
ids.length == values.length,
"ERC1155: IDs and values must have same lengths"
... | 8,774,257 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;
import "base64-sol/base64.sol";
import "./constants/Colors.sol";
/// @title Accessory SVG generator
library AccessoryDetail {
/// @dev Accessory N°1 => Classic
function item_1() public pure returns (string memory) {
return ""... | Generate Monk Beads SVG with the given color | function monkBeads(string memory color) private pure returns (string memory) {
return
string(
abi.encodePacked(
'<g fill="#',
color,
'" stroke="#2B232B" stroke-miterlimit="10" stroke-width="0.75">',
'... | 1,145,548 |
pragma solidity ^0.4.18;
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }
contract OysterShell {
// Public variables of SHL
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
... | Crowdsale function/ Prevent ETH from getting sent to contract | function () public payable {
require(false);
}
| 1,463,670 |
pragma solidity ^0.5.3;
pragma experimental ABIEncoderV2;
import "zos-lib/contracts/Initializable.sol";
import "contracts/erc721/UserMintableERC721.sol";
import "contracts/Identity.sol";
contract InvoiceUnpaidNFT is Initializable, UserMintableERC721 {
event InvoiceUnpaidMinted(
address to,
uint256 tokenId... | Check if the given token has an anchored next version tokenId uint256 the id for the token return bool/ | function isTokenLatestDocument(
uint256 tokenId
)
external
view
returns (
bool
)
{
uint256 nextAnchorId_ = _tokenDetails[tokenId].nextAnchorId;
if (nextAnchorId_ == 0x0)
return false;
AnchorRepository ar_ = AnchorRepository(_anchorRegistry);
(, bytes32 nextDocumentRoot_, ) ... | 6,482,638 |
./full_match/23295/0x4188A7d16f65F105603D243EdFe00E20C4c7f204/sources/contracts/SharedStorage.sol | Check if the recovered public key matches the expected signer's address | function _verifySignature(
address signer,
bytes32 messageHash,
bytes calldata signature
) internal pure returns (bool) {
(bytes32 r, bytes32 s, uint8 v) = _splitSignature(signature);
bytes32 prefixedHash = keccak256(
abi.encodePacked(SIGNATURE_PREFIX, messageHash)
);
address rec... | 7,103,230 |
// File: contracts/upgradeability/EternalStorage.sol
pragma solidity 0.4.24;
/**
* @title EternalStorage
* @dev This contract holds all the necessary state variables to carry out the storage of any contract.
*/
contract EternalStorage {
mapping(bytes32 => uint256) internal uintStorage;
mapping(bytes32 => s... | It is not necessary to check that arrays have the same length since it will be handled during attempt to access to the corresponding elements in the loop and the call will be reverted. It will save gas for the rational validators actions and still be safe enough from security point of view | function hasEnoughValidSignatures(
bytes _message,
uint8[] _vs,
bytes32[] _rs,
bytes32[] _ss,
IBridgeValidators _validatorContract,
bool isAMBMessage
) internal view {
require(isAMBMessage || (!isAMBMessage && isMessageValid(_message)));
uint256 re... | 15,815,244 |
//SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable... | assigns specific item `_itemId` to the list `_accounts`. Requirements: - the caller must be the owner. - each address in `_accounts` should not have `_itemId` already assigned. _itemId Item to be assigned. _accounts The addresses to assign Tier1./ | function assignItem(uint256 _itemId, address[] memory _accounts) external onlyPermissionsAdmin {
for (uint256 i = 0; i < _accounts.length; i++) {
require(!_hasItem(_accounts[i], _itemId), "PermissionManager: Account is assigned with item");
PermissionItems(permissionItems).mint(_acco... | 11,684,347 |
// Bloom.sol -- Coupons that Grow in Value
// MIT License
// Copyright (c) 2020 Rob Secord <robsecord.eth>
//
// 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... | Register the address of the escrow contract/ | function registerTokenBridge(address _bridgeAddress) external onlyOwner {
require(_bridgeAddress != address(0x0), "Bloom: INVALID_ADDRESS");
bridge = IBloomBridge(_bridgeAddress);
}
| 6,433,003 |
./partial_match/1/0x0c10Ae443cCB4604435Ba63DA80CCc63311615Bc/sources/FlapperUniV2.sol | Check Amounts Get Dai Swap Deposit | function kick(uint256 lot, uint256) external auth returns (uint256) {
require(live == 1, "FlapperUniV2/not-live");
require(block.timestamp >= zzz + hop, "FlapperUniV2/kicked-too-soon");
zzz = block.timestamp;
(uint256 _reserveDai, uint256 _reserveGem) = _getReserves();
uin... | 16,073,354 |
pragma solidity 0.6.12;
// SPDX-License-Identifier: MIT
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when d... | Sets the values for {name} and {symbol}, initializes {decimals} with a default value of 18. To select a different value for {decimals}, use {_setupDecimals}. All three of these values are immutable: they can only be set once during construction./ | function _beforeTokenTransfer(
address from,
address to,
uint256 amount
}
constructor() public {
initialSetup();
}
mapping (address => address) internal _delegates;
| 2,277,266 |
/**
*Submitted for verification at Etherscan.io on 2019-08-09
*/
pragma solidity ^0.5.8;
/**
* @title ERC20 compatible token interface
*
* - Implements ERC 20 Token standard
* - Implements short address attack fix
*
* #created 29/09/2017
* #author Frank Bonnet
*/
contract IToken {
/**
* Get the t... | Failsafe mechanism Allows the owner to retrieve ether from the contract that was not claimed within the claiming period./ | function retrieveEther() public only_owner only_after_withdraw_period {
selfdestruct(msg.sender);
}
| 997,037 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
... | inject NONSTANDARD NAMING | function DECIMALS84() external pure returns (uint8); | 12,568,993 |
./full_match/1/0x9ED98fD1C29018B9342CB8F57A3073B9695f0c02/sources/solidity/contracts/cryptography/BLS.sol | Verify performs the pairing operation to check if the signature is correct for the provided message and the corresponding public key. Public key must be a valid point on G2 curve in an uncompressed format. Message must be a valid point on G1 curve in an uncompressed format. Signature must be a valid point on G1 curve i... | function verify(
bytes memory publicKey,
bytes memory message,
bytes memory signature
) public view returns (bool) {
AltBn128.G1Point memory _signature = AltBn128.g1Unmarshal(signature);
return AltBn128.pairing(
AltBn128.G1Point(_signature.x, AltBn128.getP()... | 8,312,240 |
pragma solidity ^0.6.0;
interface ERC20 {
function totalSupply() external view returns (uint256 supply);
function balanceOf(address _owner) external view returns (uint256 balance);
function transfer(address _to, uint256 _value) external returns (bool success);
function transferFrom(address _from, a... | Boost - draws Dai, converts to collateral and adds to CDP Must be called by the DSProxy contract that owns the CDP _data Uint array [cdpId, daiAmount, minPrice, exchangeType, gasCost, 0xPrice] _joinAddr Address of the join contract for the CDP collateral _exchangeAddress Address of 0x exchange that should be called... | function boost(
uint[6] memory _data,
address _joinAddr,
address _exchangeAddress,
bytes memory _callData
) public payable boostCheck(_data[0]) {
address owner = getOwner(manager, _data[0]);
bytes32 ilk = manager.ilks(_data[0]);
uint[3] memory temp;
... | 337,169 |
/** Copyright (c) 2018, ZSC Dev Team
* 2018-10-19: v0.00.01
*/
pragma solidity ^0.4.25;
// pragma experimental ABIEncoderV2;
import "../common/pausable.sol";
import "../common/delegate.sol";
contract InsuranceCompany {
function update(string _key, string _data) external;
function remove(string _key) exte... | Get size of template. return The size of template./ | function templateSize() external view whenNotPaused _onlyReaderOrHigher _checkTemplateAddr returns (uint) {
return InsuranceTemplate(templateAddr_).size();
}
| 12,868,995 |
//Address: 0xcd582662a13d89eb9a8a458e452ae691be379c14
//Contract name: GEE
//Balance: 0.11 Ether
//Verification Date: 4/20/2018
//Transacion Count: 29
// CODE STARTS HERE
contract GEE {
string public name = "Green Earth Economy Token";
uint8 public decimals = 18;
string public symbol = "GEE";
addre... | fallback to receive ETH into contract and send tokens back based on current exchange rate then check whether fees are due and set _payFees accordingly | function () payable public {
require(msg.value > 0);
uint256 _tokens = mul(msg.value,_tokePerEth);
_tokens = div(_tokens,10);
_totalSupply = sub(_totalSupply, _tokens);
balances[msg.sender] = add(balances[msg.sender], _tokens);
Transfer(this, msg.sender, _tokens);
... | 7,226,534 |
./partial_match/1/0xb4eA9A0c1edD5C41585CD3715a1269b9dD3105A5/sources/contracts/royalties/Royalties.sol | Get token level royalties Get the default royalty | function _getRoyalties(
uint256 tokenId
)
private
view
returns (address payable[] memory receivers, uint256[] memory bps)
{
RoyaltyConfig[] memory royalties = _tokenRoyalties[tokenId];
if (royalties.length == 0) {
royalties = _defaultRoyalties;
... | 4,093,914 |
pragma solidity 0.6.0;
import "./Lib/Address.sol";
import "./Lib/SafeMath.sol";
import "./Lib/AddressPayable.sol";
import "./Lib/SafeERC20.sol";
/**
* @title NToken contract
* @dev Include standard erc20 method, mining method, and mining data
*/
interface IERC20 {
function totalSupply() external view returns... | Depositing num Depositing amount token Lock-up token address target Depositing target/ | function depositIn(uint256 num, address token, address target) public onlyContract {
require(ERC20(token).transferFrom(address(target),address(this),num), "Authorization transfer failed");
_baseMapping[token][address(target)] = _baseMapping[token][address(target)].add(num);
}
| 12,580,200 |
/* ==================================================================== */
/* Copyright (c) 2018 The DappRound Project. All rights reserved.
/* ==================================================================== */
pragma solidity ^0.4.24;
contract Dappround {
using SafeMath for uint256;
... | Integer division of two numbers, truncating the quotient./ | function div(uint256 a, uint256 b)
internal
pure
returns (uint256)
{
uint256 c = a / b;
return c;
}
| 421,162 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "hardhat/console.sol";
contract WakalaEscrow {
/**
* Encription keys used to enxcrypt phone numbers.
**/
string private encryptionKey;
uint private nextTransa... | Get the agent fees from the smart contract./ | function getAgentFee() public view returns(uint) {
return agentFee;
}
| 5,476,522 |
pragma solidity ^0.4.25;
contract ErcInterface {
function transferFrom(address _from, address _to, uint256 _value) public;
function transfer(address _to, uint256 _value) public;
function balanceOf(address _who) public returns(uint256);
}
contract Ownable {
address public owner;
... | Allows the owner to change the fixed transaction fee which will be charged to the buyers. _newTxFee The new transaction fee which will be charged to the buyers. return true if the function exeutes successfully, false otherwise / | function changeTxFee(uint256 _newTxFee) public onlyOwner returns(bool) {
require(_newTxFee != txFee);
txFee = _newTxFee;
return true;
}
| 12,593,089 |
pragma solidity ^0.6.1;
contract ProjectDetails {
struct project{
uint projectId;
string projectName;
string airportName;
string status;
string documentAddress;
}
// Map the struct project with project id //
mapping(uint => project) mProjects;
//Collection of... | Get the airport name by it's id | function getAirportName(uint _projectId) public view returns(string memory) {
return mProjects[_projectId].airportName;
}
| 5,527,674 |
/**
* Copyright BOOSTRY Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,... | 注文情報の更新(キャンセル済み状態) 最新バージョンのExchangeコントラクトのみ実行が可能 _orderId 注文ID _canceled キャンセル済み状態 | function setOrderCanceled(uint256 _orderId, bool _canceled)
public
onlyLatestVersion()
{
orderBook[_orderId].canceled = _canceled;
}
| 2,574,553 |
// File: contracts\token\ERC721\IERC721Metadata.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.8.5;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they sh... | Gets a trustScore (0 - 100) for a domain DNSSEC Domains are 100 NON DNSSEC domain are 0 - 95 (Zero at day one and 90 at day 9) Final value of non-DNSSEC domains is 95 after day 10. If you want some security on non DNSSEC entries you might consider that in a case of a broad DNS-Spoofing attack it could probably last abo... | function getTrustScore(uint256 id) public view returns (uint256) {
require(ownerOf(id) != address(0), "Error: id has no owner");
if (_tokenOwners[id].DNSSEC) {
return 100;
}
uint256 sinceInception = block.timestamp - _tokenOwners[id].timestamp;
uint256 daysSinceIn... | 11,952,442 |
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.0;
import "@openzeppelin/contracts-v4/access/Ownable.sol";
import "@openzeppelin/contracts-v4/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts-v4/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts-v4/token/ERC20/utils/SafeERC20.sol";
im... | Set `amount` as the allowance of `spender` over the distributor's NXM tokens. spender approved spender amount amount approved/ | function approveNXM(address spender, uint256 amount) public onlyOwner {
nxmToken.approve(spender, amount);
}
| 1,247,286 |
// SPDX-License-Identifier: MIT
// @unsupported: evm
pragma solidity >0.5.0 <0.8.0;
/* Library Imports */
import { Lib_ErrorUtils } from "../utils/Lib_ErrorUtils.sol";
/**
* @title Lib_ExecutionManagerWrapper
*
* Compiler used: solc
* Runtime target: OVM
*/
library Lib_ExecutionManagerWrapper {
/***********... | Performs a safe ovmGETNONCE call. return _nonce Result of calling ovmGETNONCE./ | function ovmGETNONCE()
internal
returns (
uint256 _nonce
)
{
bytes memory returndata = _safeExecutionManagerInteraction(
abi.encodeWithSignature(
"ovmGETNONCE()"
)
);
return abi.decode(returndata, (uint256));
... | 12,745,912 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
import { Initializable } from "@openzeppelin/contracts/proxy/Initializable.sol";
import { EnsResolve } from "torn-token/contracts/ENS.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contract... | Remove an instance. _instanceId The instance id in `instanceIds` mapping to remove./ | function removeInstance(uint256 _instanceId) external virtual onlyGovernance {
ITornadoInstance _instance = instanceIds[_instanceId];
(bool isERC20, IERC20 token) = (instances[_instance].isERC20, instances[_instance].token);
if (isERC20) {
uint256 allowance = token.allowance(address(router), addres... | 5,376,490 |
pragma solidity 0.6.10;
pragma experimental ABIEncoderV2;
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a... | can't check if vesting interval in days is correct because it depends on startMonth This check is in connectBeneficiaryToPlan | function addPlan(
bool isTerminatable
)
external
onlyVestingManager
{
require(totalVestingDuration > 0, "Vesting duration can't be zero");
require(vestingInterval > 0, "Vesting interval can't be zero");
require(totalVestingDuration >= vestingCliff... | 7,385,835 |
./partial_match/1/0xEF84D4f3f7d8EAe3c090bdc7452bC232ae0D93F5/sources/XBOY_STEALTH.sol | transfer function, every transfer runs through this functionPick transferonce trading is enabled, it can't be turned off againonce trading is enabled, it can't be turned off again | function _transfer(address sender, address recipient, uint amount) private{
require(sender != address(0), "Transfer from zero");
require(recipient != address(0), "Transfer to zero");
if(excludedFromFees[sender] || excludedFromFees[recipient])
_feelessTransfer(sender, recipient,... | 4,008,898 |
pragma solidity ^0.4.19;
/*
*
* Domain on day 1: https://etherbonds.io/
*
* This contract implements bond contracts on the Ethereum blockchain
* - You can buy a bond for ETH (NominalPrice)
* - While buying you can set a desirable MaturityDate
* - After you reach the MaturityDate you can redeem the bond for th... | This function checks if you can change your bond back to money / | function CanBeRedeemed(Bond bond)
internal view returns(bool)
{
return
(
bond.canBeRedeemedPrematurely
) &&
}
| 5,401,598 |
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
pragma solidity ^0.5.2;
pragma experimental "ABIEncoderV2";
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
... | Parses the header from order byte array Can only be called by authorized contracts. _ordersData Byte array of order data _offset Offset to start scanning for order header return OrderHeader Struct containing wrapper order header data/ | function parseOrderHeader(
bytes memory _ordersData,
uint256 _offset
)
internal
pure
returns (OrderHeader memory)
{
OrderHeader memory header;
uint256 orderDataStart = _ordersData.contentAddress().add(_offset);
assembly {
}
r... | 6,448,719 |
/**
*Submitted for verification at Etherscan.io on 2022-02-25
*/
// SPDX-License-Identifier: GPL-3.0
// 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... | presale each address can mint at most _mintableAmount NFTs | function presaleMint(uint256 _mintAmount, uint256 _mintableAmount, bytes32[] memory _proof)
public
payable
{
bytes32 leaf = keccak256(abi.encode(msg.sender, _mintableAmount));
require(!paused, "Contract is paused");
require(whitelistedSale, "Whitelist sale is not starte... | 6,780,401 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.