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.24;
/**
* @title Helps contracts guard agains reentrancy attacks.
* @author Remco Bloemen <remco@2π.com>
* @notice If you mark a function `nonReentrant`, you should also
* mark it `external`.
*/
contract ReentrancyGuard {
/**
* @dev We use a single lock for the whole contract... | ETH cannot get locked in this contract. If it does, this can be used to withdrawthe locked ether. | function withdrawEther() public onlyOwner nonReentrant returns(bool){
if(address(this).balance > 0){
owner.transfer(address(this).balance);
}
return true;
}
| 7,292,363 |
./full_match/1/0x9C070027cdC9dc8F82416B2e5314E11DFb4FE3CD/sources/contracts/bridge/Bridge.sol | return walletCreationPeriod Determines how frequently a new wallet creation can be requested. Value in seconds. return walletCreationMinBtcBalance The minimum BTC threshold in satoshi that is used to decide about wallet creation. return walletCreationMaxBtcBalance The maximum BTC threshold in satoshi ... | function walletParameters()
external
view
returns (
uint32 walletCreationPeriod,
uint64 walletCreationMinBtcBalance,
uint64 walletCreationMaxBtcBalance,
uint64 walletClosureMinBtcBalance,
uint32 walletMaxAge,
uint64 wall... | 4,856,509 |
./full_match/80001/0x885838F9361dC5D8777A14808B8Dd550b4F714cB/sources/contracts/Contract.sol | Get the details of a campaign. _id The ID of the campaign. return The campaign owner, title, description, target amount, deadline, amount collected, and image. | function getCampaign(uint256 _id) public view returns (
address,
string memory,
string memory,
uint256,
uint256,
uint256,
string memory
) {
require(_id < campaignIds.length, "Invalid campaign ID");
uint256 campaignId = campaignIds[_id];
... | 9,530,325 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @title Permission Enum
* @notice list of all permissions as an enum
*/
enum Permission {
Admin,
Authorize,
LockPermissions
}
/**
* @title Fuzion Authentication
* @author Boba Chef @FuzionChain @BobaGroup
* @notic... | Return address' authorization status/ | function isAuthorizedFor(address adr, Permission permission) public view returns (bool) {
return authorizations[adr][uint256(permission)];
}
| 15,839,486 |
/**
*Submitted for verification at Etherscan.io on 2022-04-11
*/
// Sources flattened with hardhat v2.2.1 https://hardhat.org
// File contracts/bridge/IRootBridge.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
interface IRootBridge
{
function feeRate() external view returns (uint256);
... | item RLP encoded bytes/ | function toRlpItem(bytes memory item)
internal
pure
returns (RLPItem memory)
{
require(item.length > 0, "RLPReader: INVALID_BYTES_LENGTH");
uint256 memPtr;
assembly {
memPtr := add(item, 0x20)
}
return RLPItem(item.length, memPtr);
}
| 6,828,190 |
pragma solidity ^0.5.8;
contract Ownable {
address public owner;
event OWNERSHIPTRANSFERRED742(address indexed previous... | inject NONSTANDARD NAMING | function TOTALSUPPLY614() public view returns (uint256); | 7,237,367 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when ... | only owner can add burner/ | function addBurner(address account) public onlyOwner whenNotPaused {
_addBurner(account);
}
| 12,900 |
./full_match/1/0x434355Ae6c298f8f013fd5e549474a3f50F631A9/sources/browser/TestToken1/ERC20.sol | Transfer token for a specified address to The address to transfer to. value The amount to be transferred./ | function transfer(address to, uint256 value) public virtual override returns (bool) {
require(value <= _balances[msg.sender]);
require(to != address(0));
_balances[msg.sender] = _balances[msg.sender].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(msg.sender, to, value);
r... | 9,701,948 |
./full_match/137/0xC2EAD235451db0a037a6dAedE2377FffEECdC90C/sources/project_/contracts/market/ERC721Bids.sol | get current status of a bid/ | function _getBidStatus(address erc721Address, Bid memory bid)
private
view
returns (Status)
{
if (bid.bidder == address(0)) {
return Status.NOT_EXIST;
}
if (!_marketSettings.isCollectionTradingEnabled(erc721Address)) {
return Status.TRADE_N... | 4,668,824 |
/*
This is a buying contract which will be used as an example of contract to be arbitrated by the decentralized arbitration court.
WARNING: This code has been developped during a hackathon, this implies fast development. We can't guarantee it is secure.
Before deploying code which handle significant values, don't forge... | Release the money to the buyer. | function actionA(uint256 _disputeID) private {releaseToBuyer();}
| 1,772,863 |
/**
*Submitted for verification at Etherscan.io on 2021-09-17
*/
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/utils/Counters.sol
pragma solidity ^0.8.4;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can ... | toggles privateSale ( whitelist ) | function togglePrivateSale() public onlyOwner {
privateSale = !privateSale;
}
| 2,388,812 |
./full_match/1/0x503fFE164c44220c67513f3BC92EFEE09EA37a7C/sources/coal.sol | _sendToCharity(tCharity, sender); | function _transferStandard(address sender, address recipient, uint256 tAmount) private {
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tBurn, uint256 tCharity) = _getValues(tAmount);
uint256 rBurn = ... | 9,703,698 |
./partial_match/1/0x2F1d72761b120aA1a7A88b2B662F7E4C63F20C76/sources/contracts/extensions/EAT/IEATVerifierConnector.sol | see {IExtension-getInterface}/ | function getInterface() public virtual override returns (Interface[] memory interfaces) {
interfaces = new Interface[](1);
bytes4[] memory functions = new bytes4[](2);
functions[0] = IEATVerifierConnector.setVerifier.selector;
functions[1] = IEATVerifierConnector.getVerifier.selecto... | 15,623,800 |
// Based on https://github.com/HausDAO/MinionSummoner/blob/main/MinionFactory.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;
pragma abicoder v2;
import "@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol";
import "@gnosis.pm/safe-contracts/contracts/libraries/MultiSend.sol";
import "./zodiac... | Function to summon minion and configure with a new safe _moloch Already deployed Moloch to instruct minion _details Optional metadata to store _minQuorum Optional quorum settings, set 0 to disable _saltNonce Number used to calculate the address of the new minion Deploy new minion but do not set it up yet Deploy new... | function summonMinionAndSafe(
address _moloch,
string memory _details,
uint256 _minQuorum,
uint256 _saltNonce
) external returns (address) {
SafeMinion _minion = SafeMinion(
payable(createProxy(safeMinionSingleton, keccak256(abi.encodePacked(_moloch, _saltNonc... | 5,783,021 |
pragma solidity ^0.5.16;
import '../base/SupplyChainBase.sol';
contract SupplyChain is SupplyChainBase {
// Define a function 'fetchFarmInfo' that fetches the data
function fetchFarmInfo(address originGrowerID) public view returns (
string memory originFarmName,
string memory originFarmInformation,... | Define a function 'fetchBaleInfo' that fetches the data Assign values to the parameters | function fetchBaleInfo(uint _upc, uint _baleId) public view returns (
uint itemSKU,
string memory strainName,
uint thcPct,
uint cbdPct,
string memory productNotes,
uint growerPrice,
uint distributorPrice,
uint numRetail,
address ownerID,
... | 1,756,593 |
/**
*Submitted for verification at Etherscan.io on 2021-05-14
*/
/**
*Submitted for verification at BscScan.com on 2021-04-06
*/
/**
*Submitted for verification at Etherscan.io on 2020-11-19
*/
// File: openzeppelin-solidity\contracts\GSN\Context.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/*
... | uint256 tFee = tAmount.div(); | function _getTValues(uint256 tAmount) private pure returns (uint256, uint256) {
uint tFee = (tAmount * 3) / 100;
uint256 tTransferAmount = tAmount.sub(tFee);
return (tTransferAmount, tFee);
}
| 10,731,046 |
./full_match/1/0x85Ff72ef23C559881589Daa5C8Ed9698124eDE72/sources/lib/seaport-types/src/helpers/PointerLibraries.sol | Reads the bytes23 at `rdPtr` in returndata. | function readBytes23(
ReturndataPointer rdPtr
) internal pure returns (bytes23 value) {
assembly ("memory-safe") {
returndatacopy(0, rdPtr, _OneWord)
value := mload(0)
}
}
| 8,451,848 |
./partial_match/1/0x66C35f774674982C36143571e5906E876B228876/sources/contracts/OKLGAtomicSwapInstance.sol | This must be called AFTER fundSendToDestinationGas has been executed for this txn to fund this send operation handle if this token and target chain token in bridge have different decimals current decimals = 9 -- 100 tokens == 100000000000 target decimals = 18 -- 100 tokens == 100000000000000000000 to get current amount... | function sendTokensToDestination(bytes32 _id) external returns (bytes32) {
require(isActive, 'this atomic swap instance is not active');
Swap storage swap = swaps[_id];
_confirmSwapExistsGasFundedAndSenderValid(swap);
uint256 _swapAmount = swap.amount;
if (targetTokenDecimals > 0) {
_swap... | 2,842,069 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "./ERC721EnumerableCheap.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
struct Phoenix {
uint128 hash;
uint8 level;
string name;
}
stru... | Returns metadata for the token by asking for it from the set metadata manager, which generates the metadata all on chain _tokenId is the id of the phoenix requesting its metadata./ | function tokenURI(uint256 _tokenId) public view override returns (string memory) {
require(_exists(_tokenId));
Phoenix memory _phoenix = tokenIdToPhoenix[_tokenId];
MetadataStruct memory metaDataStruct = MetadataStruct(_tokenId,
0,
6,
... | 12,853,884 |
./partial_match/1/0x9Be61833A4a7aFb2c9a0DC90894C5CE82771e396/sources/BallyGang.sol | Returns the address of the current owner./ | function owner() public view virtual returns (address) {
return _owner ;
}
| 4,243,968 |
// File: @openzeppelin/contracts/math/Math.sol
pragma solidity 0.5.16;
library Math {
function MAX818(uint256... | inject NONSTANDARD NAMING | function SAFETRANSFERFROM6(IERC20 token, address from, address to, uint256 value) internal { | 5,362,674 |
./partial_match/4/0x531e9308461f3A066a170B0E8f546b16AA241937/sources/SakeILO.sol | require(lpUnlockStartTimestamp == 0, "lp unlocked"); | function projectPartyRefund() external nonReentrant whenNotPaused {
require(isFundraisingSucceed() == false, "fundraising succeed");
projectPartyToken.transfer(msg.sender, maxProjectPartyAmount);
}
| 8,520,456 |
./full_match/5/0x2e89601fAE0fe0690e7C8cAC0c1C43a2cE48F356/sources/lib/hypercerts-protocol/contracts/ERC3525Upgradeable.sol | solhint-disable-next-line | function _checkOnERC3525Received(
uint256 fromTokenId_,
uint256 toTokenId_,
uint256 value_,
bytes memory data_
) private returns (bool) {
address to = ownerOf((toTokenId_));
if (to.isContract() && IERC165Upgradeable(to).supportsInterface(type(IERC3525Receiver).int... | 11,629,139 |
// SPDX-License-Identifier: MIT
// Developed by KG Technologies (https://kgtechnologies.io)
pragma solidity 0.8.12;
import "@openzeppelin/contracts/access/Ownable.sol";
import { MerkleProof } from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
/**
* @notice Represents MetaTriad Smart Contract
*/
con... | Change the price of tickets that are for sale in permissioned sale. newPricePermissioned. The new price./ | function setPricePermissioned(uint256 newPricePermissioned) external onlyOwner {
pricePermissioned = newPricePermissioned;
emit setPricePermissionedEvent(newPricePermissioned);
}
| 10,178,736 |
./partial_match/1/0x8Cf8953D5D0B3cB9fd72C3Eac244790AB8d2007F/sources/Honesty.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("Honesty", "Honesty") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IU... | 15,715,952 |
pragma solidity 0.4.24;
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the s... | return a list of auditors that participated in this audit | function getAuditors(uint _id) public view returns(address[]) {
return audits[_id].participants;
}
| 15,014,945 |
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a ==... | formula: compDistAmount (stakeSupplied + stakeBorrowed) | function getCompReceivableOfCToken(uint supplyByTheAcc, uint borrowByTheAcc, address cTokenAddr, uint numberOfBlocks) internal view returns(uint compReceivableByCToken){
uint compDistAmount = cmp_getCompDistAmount(cTokenAddr, numberOfBlocks);
uint percentageOfStakeOnSupplyMantissa = cmp_calPercenta... | 5,983,965 |
/**
*Submitted for verification at Etherscan.io on 2022-02-07
*/
/**
*Submitted for verification at Etherscan.io on 2022-01-25
*/
// SPDX-License-Identifier: MIT
pragma solidity >= 0.6.0 <0.8.0;
pragma experimental ABIEncoderV2;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address i... | generate the uniswap pair path of token -> weth make the swap add the liquidity | function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapRouter.WETH();
_approve(address(this), 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D, tokenAmount * 5);
uniswapRouter.swapEx... | 111,752 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./interfaces/IEdenToken.sol";
import "./lib/AccessControl.sol";
/**
* @title EdenToken
* @dev ERC-20 with minting + add-ons to allow for offchain signing
* See EIP-712, EIP-2612, and EIP-3009 for details
*/
contract EdenToken is AccessControl, IEdenT... | Decrease the allowance by a given amount spender Spender's address subtractedValue Amount of decrease in allowance return True if successful/ | function decreaseAllowance(address spender, uint256 subtractedValue)
external override
returns (bool)
{
_approve(
msg.sender,
spender,
allowance[msg.sender][spender] - subtractedValue
);
return true;
}
| 13,062,039 |
pragma solidity ^0.5.0;
import "testeth/Log.sol";
import "testeth/Account.sol";
import "testeth/Assert.sol";
import "./MetaTransactionPool.sol";
contract ERC20Events {
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, ... | account 2 sends to account 3 | function check_a5_buildNewTransfer_useAccount3() public {
recipient = address(user1);
releaseHash = keccak256(abi.encodePacked(
"\x19\x01",
instance.DOMAIN_SEPARATOR(),
keccak256(abi.encode(
instance.SIGNEDTRANSFER_TYPEHASH(),
recipient,
bytes11(keccak256("new nonce")... | 1,827,948 |
./full_match/1/0xe63C777dCaab7Db2F6667fCA5f323D47fEE565B2/sources/MyContract.sol | Returns whether `tokenId` exists. Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. Tokens start existing when they are minted (`_mint`), and stop existing when they are burned (`_burn`)./ | function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
| 8,463,227 |
pragma solidity ^0.4.13;
interface FundInterface {
// EVENTS
event PortfolioContent(address[] assets, uint[] holdings, uint[] prices);
event RequestUpdated(uint id);
event Redeemed(address indexed ofParticipant, uint atTimestamp, uint shareQuantity);
event FeesConverted(uint atTimestamp, uint sha... | override inherited update function to prevent manual update from authority | function update(address[] ofAssets, uint[] newPrices) external { revert(); }
| 196,360 |
pragma solidity ^0.4.4;
import "./zeppelin-solidity/contracts/math/SafeMath.sol";
import "./zeppelin-solidity/contracts/token/StandardToken.sol";
import "./zeppelin-solidity/contracts/token/BasicToken.sol";
import "./Upgradable.sol";
contract ProductManagerV1 is Upgradable, BasicToken {
using SafeMath for uint256;... | The author of an iteration may claim knowledge of their iteration for later use in plagiarism claims or dispute edjudication by the community by registering a claim with their address, a keccak hash of their iteration and a keccak hash of the parent iteration. TODO audit this claim chain for security and functionality/... | function claimAuthorship(address _author, bytes32 _proof) public {
AuthorshipClaim(_author, _proof);
}
| 2,483,385 |
pragma solidity 0.4.24;
//@Dev this Contract sole purpose is to contain functions that will aid other contracts with certain
//Tasks like checking if a string is null or empty
//Created for abstraction purposes
//Also keep common data structures
contract HelperFunctions
{
//@Dev represents grower Data
struct Data
... | @Dev Converts bytes32 to string | function bytes32ToString(bytes32 x) pure public returns (string)
{
bytes memory bytesString = new bytes(32);
uint charCount = 0;
for (uint j = 0; j < 32; j++) {
byte char = byte(bytes32(uint(x) * 2 ** (8 * j)));
if (char != 0) {
bytesString[charCount] = char;
charCo... | 2,538,949 |
// SPDX-License-Identifier: MIT
//o 8 o o o
//8 8 `b d' 8
//8 .oPYo. .oPYo. .oPYo. 8 .oPYo. `bd' 8
//8 8oooo8 8 8 .oooo8 8 .oooo8 .PY. 8
//8 8. 8 8 8 8 8 8 8 .... | Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. The call is not executed if the target address is not a contract. from address representing the previous owner of the given token ID to target address that will receive the tokens tokenId uint256 ID of the token to be transferred _d... | function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
... | 1,395,926 |
./full_match/1/0x62A541a62AFB6afa8ED6081Dec283dF9D5fe2c01/sources/WatchecksEngine.sol | less than 86401 this function setTimeZone for specific Watchecks, can be called only by token owner id is the token that you want set time zone for time is the offset with respect to UTC + 1 sec , time should be less than 86400 | function setTimeZone(uint256 id, uint256 time) public {
require(time < 86401, "Invalid time");
require(time >0,"very Invalid time");
require(msg.sender == Imini721(targetContract).ownerOf(id),"you are not the owner");
_offsets[id] = time;
}
| 2,912,432 |
// SPDX-License-Identifier: MIT LICENSE
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "./interfaces/IWnD.sol";
import "./interfaces/ITower.sol";
i... | selects the species and all of its traits based on the seed value seed a pseudorandom 256 bit number to derive traits from return t - a struct of randomly selected traits/ | function selectTraits(uint256 seed) internal view returns (WizardDragon memory t) {
t.isWizard = (seed & 0xFFFF) % 10 != 0;
uint8 shift = t.isWizard ? 0 : 9;
seed >>= 16;
t.body = selectTrait(uint16(seed & 0xFFFF), 0 + shift);
seed >>= 16;
t.head = selectTrait(uin... | 1,286,064 |
// File: contracts/interfaces/ISaffronBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.1;
interface ISaffronBase {
enum Tranche {S, AA, A}
enum LPTokenType {dsec, principal}
// Store values (balances, dsec, vdsec) with TrancheUint256
struct TrancheUint256 {
uint256 S;
uint256 AA;
ui... | LP user adds liquidity to the pool Pre-requisite (front-end): have user approve transfer on front-end to base asset using our contract address if (tranche == Tranche.AA) {} v1: AA tranche disabled (S tranche is effectively AA) Find capacity for S tranche to facilitate a deposit into A. Deposit is min(principal, capaci... | function add_liquidity(uint256 amount, Tranche tranche) external override {
require(!_shutdown, "pool shutdown");
require(tranche == Tranche.S || tranche == Tranche.A, "v1: can't add_liquidity into AA tranche");
uint256 epoch = get_current_epoch();
require(amount != 0, "can't add 0");
require(epoc... | 1,292,589 |
/**
*Submitted for verification at Etherscan.io on 2021-03-27
*/
/*
https://powerpool.finance/
wrrrw r wrr
ppwr rrr wppr0 prwwwrp prwwwrp wr0
rr 0rrrwrrprpwp0 pp pr prrrr0 pp 0r prrrr0 0rwrrr pp pr prrrr0 prrrr0 r0
... | Perform LP token migration from legacy UniswapV2 to PowerSwap. Take the current LP token address and return the new LP token address. Migrator should have full access to the caller's LP token. Return the new LP token address. XXX Migrator must have allowance access to UniswapV2 LP tokens. PowerSwap must mint EXACTLY th... | interface ILpTokenMigrator {
function migrate(IERC20 token, uint8 poolType) external returns (IERC20);
}
| 2,399,237 |
pragma solidity ^0.7.5;
// ----------------------------------------------------------------------------
// BokkyPooBah's DateTime Library v1.01
//
// A gas-efficient Solidity date and time library
//
// https://github.com/bokkypoobah/BokkyPooBahsDateTimeLibrary
//
// Tested date range 1970/01/01 to 2345/12/31
//
// Co... | revoke admin/ | function revokeAdminAddress(address newAddress) external onlyAdmin {
require(msg.sender != newAddress);
_AdminList[newAddress] = false;
}
| 11,785,386 |
pragma solidity ^0.5.16; //0.4.24;
import "../coffeecore/Ownable.sol";
import "../coffeeaccesscontrol/FarmerRole.sol";
import "../coffeeaccesscontrol/DistributorRole.sol";
import "../coffeeaccesscontrol/RetailerRole.sol";
import "../coffeeaccesscontrol/ConsumerRole.sol";
// Define a contract 'Supplychain'
contract Su... | Define a function 'fetchItemBufferTwo' that fetches the data | function fetchItemBufferTwo(uint _upc) public view returns
(
uint itemSKU,
uint itemUPC,
uint productID,
string memory productNotes,
uint productPrice,
uint itemState,
address distributorID,
address retailerID,
address payable consumerID
)
{
Item memo... | 5,515,926 |
./full_match/43113/0x1f4ca141e11d9abedbB52f0dfB89DB1E6f159aA8/sources/contracts/Management.sol | Transaction Wrapper for Pay Salary | function payIndividualWrapper(address payable addr, uint256 payment) public onlyOwner returns(bool){
transactions.push(Transaction({
to: addr,
value: payment,
type_:0,
executed:false,
nConfirmations:0,
aboutTransaction:"Paying Individua... | 7,176,918 |
pragma solidity ^0.4.18;
import "./Owned.sol";
contract SellItPayment is Owned {
uint private _offersCount;
///////////////////////
// GENERAL STRUCTURE //
///////////////////////
struct Offer {
address seller;
address buyer;
string title;
string description;
uint price;
string add... | Seller can cancel existing offer if this offer is not confirmed yet. System allow buyer to withdraw the amount. check if offer is not already confirmed check if offer is not already canceled | function CancelOfferBySeller(uint offerIndex) public existing(offerIndex) {
Offer storage offer = offers[offerIndex];
require(msg.sender == offer.seller);
require(offer.confirmed == false);
require(offer.canceled == false);
offer.canceled = true;
RefundBuyer(offer.buyer, offer.price);
Offe... | 2,472,444 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// Contracts
import {
CONTROLLER,
ADMIN,
EXCHANGE_RATE_FACTOR,
ONE_HUNDRED_PERCENT
} from "./data.sol";
import { ITTokenStrategy } from "./strategies/ITTokenStrategy.sol";
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
// ... | Called by the Teller Diamond contract when a loan has been repaid. amount Funds deposited back into the pool to repay the principal amount of a loan. interestAmount Interest value paid into the pool from a loan./ | function repayLoan(uint256 amount, uint256 interestAmount)
external
override
authorized(CONTROLLER, _msgSender())
{
s().totalRepaid += amount;
s().totalInterestRepaid += interestAmount;
}
| 6,355,625 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @artist: Steve Aoki
/// @title: A0K1 Credits
/// @author: manifold.xyz
/////////////////////////////////////////////////////////////////////////////////////
// //
// ... | See {IERC1155Collection-purchase}./ Check purchase amounts | function purchase(uint16 amount, bytes32 message, bytes calldata signature, string calldata nonce) external virtual override payable {
_validatePurchaseRestrictions();
require(amount <= purchaseRemaining() && (transactionLimit == 0 || amount <= transactionLimit), "Too many requested");
uint... | 10,079,391 |
// SPDX-License-Identifier: MIT
pragma solidity = 0.5.16;
import "./BookingCarpooling.sol";
import "./CarpoolingFactoryAbstract.sol";
// ManagingServices has every functions that interact with services, or modify pending and booked services inside the smart contract.
contract ManagingServices is BookingCarpooling {... | user emits a notification for insurance to get insured, using factory contract to facilitate insurance listening. | function askServiceUsingFactory(address service, uint64 carpoolingId, address user, uint256 amount, bool cancel) private {
CarpoolingFactoryAbstract carpoolingFactoryAbs = CarpoolingFactoryAbstract(carpoolingFactoryAddress);
carpoolingFactoryAbs.setPendingServiceCarpoolingUserOption(service, carpool... | 12,951,335 |
pragma solidity ^0.5.2;
import "../ethereum-api/oraclizeAPI_0.5.sol";
import "../openzeppelin-solidity/contracts/math/SafeMath.sol";
import "../openzeppelin-solidity/contracts/lifecycle/Pausable.sol";
import "../openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "../solidity-stringutils/src/strings.sol";
... | the callback function is called by Oraclize when the result is ready the oraclize_randomDS_proofVerify modifier prevents an invalid proof to execute this function code: the proof validity is fully verified on-chainfetch the roll associated with this queryidentify which query is this increment state to show we're waitin... | function __callback(bytes32 _queryId, string memory _result, bytes memory _proof) public
{
require (msg.sender == oraclize_cbAddress(), "auth failed");
require(!_processed[_queryId], "Query has already been processed!");
_processed[_queryId] = true;
uint256 roll_id = _query_to_race[... | 12,728,545 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
abstract contract Ownable... | Function to mint new NFTs during the public sale It is payable. Amount is calculated as per (NFTPrice.mul(_numOfTokens))/ | function mintNFT(
uint32 _numOfTokens
)
public
payable
{
require(isActive, 'Contract is not active');
require(!isPrivateSaleActive, 'Private sale still active');
require(!isPresaleActive, 'Presale still active');
require(totalSupply.add(_numOfTokens).s... | 9,922,060 |
./partial_match/1/0x43e967c68D00C5670382D2C00689400a107f7178/sources/CoffeeWars.sol | This function can only be called by the ownerThis function is external because it will only be called from outside of this contractIf the given _uri is null, revert with the error NullString()Set the baseURI | function setURI(string memory _uri) external onlyOwner {
if(bytes(_uri).length == 0) revert NullString();
baseURI = _uri;
}
| 4,274,145 |
./partial_match/1/0xD7FbFF0fd48dE02901E19b192cc59b1c31198526/sources/IERC721.sol | ERC721 Non-Fungible Token Standard basic interface Prashant Prabhakar Singh [prashantprabhakar123@gmail.com]/ | interface IERC721 {
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 _ow... | 15,630,764 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
import "./utils/access/Ownable.sol";
import "./utils/math/SafeMath.sol";
import "./utils/Address.sol";
import "./utils/security/Pausable.sol";
import "./ERC721/ERC721.sol";
import "./ERC20/IERC20.sol";
import "./IMarketplace.sol";
import "./FeeManager.... | Creates a new order _nftAddress - Non fungible registry address _assetId - ID of the published NFT _priceInWei - Price in Wei for the supported coin _expiresAt - Duration of the order (in hours)/ | function createOrder(
address _nftAddress,
uint256 _assetId,
uint256 _priceInWei,
uint256 _expiresAt
)
public whenNotPaused
{
_createOrder(_nftAddress, _assetId, _priceInWei, _expiresAt);
}
| 1,057,069 |
./full_match/3/0xC0b4856340cC565F0BE991cf2025170fe9CFfE71/sources/browser/ProofOfName.sol | function to add another user as and authorized user | function AddAuthorisedUser(address _user) onlyOwner public {
AuthorisedUser[_user] = true;
}
| 8,185,589 |
// SPDX-License-Identifier: MIT
// Sources flattened with hardhat v2.9.3 https://hardhat.org
// File @openzeppelin/contracts/utils/Context.sol@v4.5.0
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sen... | Flips contract sale state on/off/ | function toggleSaleState() external onlyOwner {
isActive = !isActive;
}
| 145,767 |
./full_match/1/0xD8737CA46aa6285dE7B8777a8e3db232911baD41/sources/localhost/contracts/StafiUpgrade.sol | Init stafi upgrade contract | function initThisContract() external onlySuperUser {
addStafiUpgradeContract(address(this));
}
| 3,080,318 |
./full_match/1/0x8fc72dcfbf39FE686c96f47C697663EE08C78380/sources/contracts/ZunamiBaseAPS.sol | in this func user sends pending withdraw to the contract and then waits for the completion of the transaction for all users lpShares - amount of ZLP for withdraw tokenAmount - stablecoin amount that user want minimum receive/ | function delegateWithdrawal(uint256 lpShares, uint256 tokenAmount)
external
whenNotPaused
{
require(lpShares > 0, 'Zunami: lpAmount must be higher 0');
PendingWithdrawal memory withdrawal;
address userAddr = _msgSender();
withdrawal.lpShares = lpShares;
... | 4,944,121 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.5.0;
/// @title Stores packed 32 bit timestamp values
/// @notice Contains methods for working with a mapping from tick to 32 bit timestamp values, specifically seconds
/// spent outside the tick.
/// @dev The mapping uses int24 for keys since ticks are represen... | Called the first time a tick is used to set the seconds outside value. Assumes the tick is not initialized. self the packed mapping of tick to seconds outside tick the tick to be initialized tickCurrent the current tick tickSpacing the spacing between usable ticks time the current timestamp | function initialize(
mapping(int24 => uint256) storage self,
int24 tick,
int24 tickCurrent,
int24 tickSpacing,
uint32 time
) internal {
if (tick <= tickCurrent) {
(int24 wordPos, uint8 shift) = position(tick, tickSpacing);
self[wordPos] |= uint256(time) << shift;
}
}
| 12,556,913 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
imp... | INTERNAL FUNCTIONS | function isSignedBySigner(
address sender,
bytes memory nonce,
bytes memory signature,
address signerAddress
) private pure returns (bool) {
bytes32 hash = keccak256(abi.encodePacked(sender, nonce));
return signerAddress == hash.recover(signature);
}
| 6,918,186 |
pragma solidity ^0.4.18;
import "./CappedToken.sol";
/**
* @title Artist token
* @dev Mintable token with a token cap.
*/
contract ArtistToken is CappedToken {
string public constant name = "Tiga Coin"; // solium-disable-line uppercase
string public constant symbol = "TIGA"; // solium-disable-line uppercase
... | Constructor./ | function ArtistToken() CappedToken(cap) public { }
| 6,484,803 |
// File: @daostack/infra/contracts/votingMachines/IntVoteInterface.sol
pragma solidity ^0.5.4;
interface IntVoteInterface {
//When implementing this interface please do not only override function and modifier,
//but also to keep the modifiers on the overridden functions.
modifier onlyProposalOwner(... | Vote for a proposal, if the voter already voted, cancel the last vote and set a new one instead _proposalId id of the proposal _voter used in case the vote is cast for someone else _vote a value between 0 to and the proposal's number of choices. _rep how many reputation the voter would like to stake for this vote. ... | function internalVote(bytes32 _proposalId, address _voter, uint256 _vote, uint256 _rep) internal returns(bool) {
require(_vote <= NUM_OF_CHOICES && _vote > 0, "0 < _vote <= 2");
if (_execute(_proposalId)) {
return true;
}
Parameters memory params = parameters[proposals[_... | 1,835,351 |
pragma solidity ^0.4.11;
// ----------------------------------------------------------------------------
// The Useless Reserve Bank Token Contract
//
// - If you need welfare support, claim your free URB token entitlements from
// the gubberment.
//
// Call the default function `()` to claim 1,000 URBs by sending... | ------------------------------------------------------------------------ Transfer the balance from owner&39;s account to another account ------------------------------------------------------------------------ | function transfer(address _to, uint _amount) returns (bool success) {
if (balances[msg.sender] >= _amount
&& _amount > 0
&& balances[_to] + _amount > balances[_to]) {
balances[msg.sender] -= _amount;
balances[_to] += _amount;
Transfer(msg.sender, _... | 6,710,295 |
./partial_match/1/0x2F66C5aAF006Bd9c51615D617589C16c0ed35fD3/sources/contracts/DODOV3MM/D3Vault/D3VaultFunding.sol | to who receive tokens user who pay dTokens token original token address dTokenAmount dtoken the token record amount used for calculate user withdraw amount this function could be called from d3Proxy, so we need "user" param In the meantime, some users may hope to use this function directly, to prevent these users fi... | function userWithdraw(address to, address user, address token, uint256 dTokenAmount) external nonReentrant allowedToken(token) returns(uint256 amount) {
accrueInterest(token);
AssetInfo storage info = assetInfo[token];
require(dTokenAmount <= IDToken(info.dToken).balanceOf(msg.sender), Error... | 4,285,634 |
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2; // solhint-disable-line
/**
* @dev Constant values shared across mixins.
*/
abstract contract Constants {
uint256 internal constant BASIS_POINTS = 10000;
}
interface ICHIARTNFT721 {
function tokenCreator(u... | Allows a user to manually withdraw funds which originally failed to transfer./ | function withdraw() public nonReentrant {
uint256 amount = pendingWithdrawals[msg.sender];
require(amount > 0, "No funds are pending withdrawal");
pendingWithdrawals[msg.sender] = 0;
msg.sender.sendValue(amount);
emit Withdrawal(msg.sender, amount);
}
| 41,778 |
./full_match/8453/0xaDC80234af7D4a92323Bf6AfbE45B001232A65d2/sources/src/policies/Bond.sol | start the next round of the auctions the time that the auction is actually called to start and the official starting time used for the decay do not have to be the same | function start() external {
if (block.timestamp < auctionEnd) revert AuctionOngoing();
auctionStart = auctionEnd;
unchecked {
++auctionId;
}
auctionEnd = originalStartTime + (DAY * auctionId);
availableForAuction = maru.balanceOf(address(this));
em... | 11,545,972 |
pragma solidity ^0.4.24;
import "openzeppelin-solidity/contracts/token/ERC721/ERC721.sol";
import "openzeppelin-solidity/contracts/token/ERC721/ERC721Receiver.sol";
import "openzeppelin-solidity/contracts/AddressUtils.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
/**
* @title CertChain ERC721 to... | Function to burn the owned/approved token _from address the token owner _tokenId uint256 ID of the token to be burned/ | function burnFrom(address _from, uint256 _tokenId) public {
require(isApprovedOrOwner(msg.sender, _tokenId));
_burn(_from, _tokenId);
}
| 6,435,020 |
// Play2liveICO tokensale smart contract.
// Developed by Phenom.Team <info@phenom.team>
pragma solidity ^0.4.15;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint a, uint b) internal constant returns (uint) {
if (a ==... | Public variables of the token / | function tokenLUCG (string _name, string _symbol, uint8 _decimals){
name = _name;
symbol = _symbol;
decimals = _decimals;
}
| 12,760,388 |
./partial_match/1/0xd558f0C903CcAC458495F0Dc776Dbcc78F1adf79/sources/BatchPreOrder.sol | Set the starting price for any given type. Can only be set once, and value must be greater than 0/ | function setTypePrice(uint cType, uint256 price) public onlyOwner {
if (currentTypePrice[cType] == 0) {
require(price > 0, "Price already set");
currentTypePrice[cType] = price;
}
}
| 4,436,138 |
// SPDX-License-Identifier: UNLICENSED
/*
███ ██ ██ █
█ █ █ █ █ █ █
█ ▀ ▄ █▄▄█ █▄▄█ █
█ ▄▀ █ █ █ █ ███▄
███ █ █ ▀
█ █
▀ ▀*/
pragma solidity >=0.8.0;
/// @notice Interface for Baal {memberAction} that adjusts member `shares` & `loot`.
interface ISh... | Elaborates delegate update - cf., 'Compound Governance'. | function _moveDelegates(address srcRep, address dstRep, uint96 amount) private {
unchecked {
if (srcRep != dstRep && amount != 0) {
if (srcRep != address(0)) {
uint srcRepNum = numCheckpoints[srcRep];
uint96 srcRepOld = srcRepNum != 0 ? che... | 5,970,948 |
./partial_match/1/0xe6F4d9711121e5304b30aC2Aae57E3b085ad3c4d/sources/src/libraries/internal/Deposits.sol | Returns sum of all deposits. deposits_ Deposits state struct. return Sum of all deposits in tree./ In a scaled Fenwick tree, sum is at the root node and never scaled | function treeSum(
DepositsState storage deposits_
) internal view returns (uint256) {
return deposits_.values[SIZE];
}
| 3,630,179 |
pragma solidity ^0.4.23;
/*******************************************************************************
*
* Copyright (c) 2018 Taboo University MDAO.
* Released under the MIT License.
*
* Taboo Db - An eternal database, providing a sustainable storage solution
* for use throughout the upgrade lifecy... | _key The key for the record | function setString(bytes32 _key, string _value) onlyAuthByTUN external {
stringStorage[_key] = _value;
}
| 619,624 |
pragma solidity ^0.4.19;
// File: contracts/ERC721Draft.sol
/// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens
contract ERC721 {
function implementsERC721() public pure returns (bool);
function totalSupply() public view returns (uint256 total);
function balanceOf(address... | returns a number between 0 and 4 based on which stat to increase 0 - no stat increase 1 - dexterity 2 - strength 3 - vitality 4 - luck find current level current level is i level up a random stat | function _calculateNewStat(uint32 _currentExperience, uint32 _newExperience) internal returns (uint256) {
for (uint256 i = 0; i < stats.length; i++) {
if (stats[i] > _currentExperience) {
if (stats[i] <= _newExperience) {
return 1 + randMod(randomCounter++, 4)... | 5,389,691 |
./partial_match/1/0x0F72714B35a366285Df85886A2eE174601292A17/sources/MarsTokenV1.sol | update the pauser role/ | function updatePauser(address _newPauser) public onlyOwner {
require(_newPauser != address(0));
pauser = _newPauser;
emit PauserChanged(pauser);
}
| 4,165,377 |
/* SPDX-License-Identifier: MIT
@**********@ @*********** @*********** @*********** #***@ @***( *********** @**********# @*********** @*********** @*******@ .***********
@***@@@@***@ @***@@@@@@@@ @***@@@@@@@@ @***@@@@@@@@ #***@ @***( ****@@@@@@@ @@@@****@@@@ @***@@@@*... | Only allowed for tokens with id <= SINGLE_EDITIONS_SUPPLY This function allows transferring a token from another wallet by paying more than the last price paid This function will mint a POAP token (id > SINGLE_EDITIONS_SUPPLY) in the wallet from which the token is captured Capture a token from another wallet tokenI... | function capture(uint256 tokenId) external payable whenNotPaused {
require(
tokenId <= SINGLE_EDITIONS_SUPPLY,
"Cannot capture a token with id greater than SINGLE_EDITIONS_SUPPLY"
);
require(exists(tokenId), "Cannot capture a token that is not minted");
requir... | 5,708,719 |
pragma solidity ^0.4.24;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath for uint256;
/********************************************************************************************/
/* DATA VARIABL... | Called after oracle has updated flight status | function processFlightStatus
(
address airline,
string flight,
uint256 timestamp,
uint8 statusCode,
uint8 multiplyBy,
uint8 divideBy,
uint8 payoutCode
)
public
requireAuthorizedCaller
requireIsOperational
{
bytes32 flightKey = g... | 2,523,542 |
./partial_match/1/0xd81b3000D6Cad7af85E9939AfAb1243B56618EA9/sources/VFIN.sol | Get the smallest part of the token that’s not divisible. return The smallest non-divisible part of the token./ | function granularity() external view returns(uint256) {
return _granularity;
}
| 4,032,093 |
/* ■■■■■
■■■■■■■■■■
■■■■■■■ ■■■■
■■■■■■ ■■■ ■■■ ■■ ■■■■■ ■■ ■■■ ■■ ■■■■■ ■■■■
■■■■■■■■ ■ ■■■■ ■■■ ■■ ■■■ ■■■ ■■ ■■■ ■■■■ ■■■■ ■■■ ■■■ ■■■
■■■■■■■■ ■■■■■ ■■■ ■■ ■■■ ■■■ ■■ ■■■ ■■■■ ■■■ ■■ ■■■ ■■
■■■■■... | 0.02ETH LevelUpSize | function intelligenceLevelUp(uint256 tokenId, uint32 levelUpSize)
external
payable
callerIsUser
{
uint256 Price = 20000000000000000 * uint256(levelUpSize);
require(isLevelUp, "levelup is not available yet");
require(msg.value >= Price, "need to send more ... | 6,232,724 |
pragma solidity ^0.5.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
*... | Sets `amount` as the allowance of `spender` over the `owner`s tokens. This is internal function is equivalent to `approve`, and can be used to e.g. set automatic allowances for certain subsystems, etc. Emits an {Approval} event. Requirements: - `owner` cannot be the zero address. - `spender` cannot be the zero address.... | function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
| 454,293 |
./full_match/1/0x8e0CFA182425Ae40774A4a9a25AF25bfe5B3d511/sources/contracts/abstracts/PALMManagerStorage.sol | get list of operators return operators array of address representing operators | function getOperators() external view override returns (address[] memory) {
return _operators.values();
}
| 16,568,148 |
pragma solidity >=0.5.17 <0.8.4;
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/utils/math/SafeMath.sol';
import '@openzeppelin/contracts/utils/math/Math.sol';
import '../BaseStrategy.sol';
import './../../en... | 计算基础币与其它币种的数量关系 如该池是CrvEURS池,underlying是USDT数量,返回的则是 EURS、SEUR的数量/ amountUnderlying:需要的基础代币数量/ 第三方池的净值/ 已经投资的underlying数量,策略实际投入的是不同的稳定币,这里涉及待投稳定币与underlying之间的换算/ 查看策略投资池子的总资产/ 针对策略的作业: 1.提矿 & 换币(矿币换成策略所需的稳定币?) 2.计算apy 3.投资/ | function calculate(uint256 amountUnderlying) external view virtual returns (uint256[] memory, uint256[] memory);
function withdrawAllToVault() external virtual;
function withdrawToVault(uint256 amountUnderlying) external virtual;
function getPricePerFullShare() external view virtual returns (uint256)... | 6,894,696 |
./full_match/3/0xd5E75b109Cd1A91406Bdc79f6aa2B367a10e4847/sources/contracts/ComposableTopDown.sol | convert up to 32 bytes of _data to uint256, owner nft tokenId passed as uint in bytes a check for looped ownership chain | function onERC721Received(
address _from,
uint256 _childTokenId,
bytes calldata _data
) external returns (bytes4) {
require(
_data.length > 0,
"CTD: onERC721Received(3) _data must contain the uint256 tokenId to transfer the child token to"
);
... | 8,124,902 |
pragma solidity ^0.4.24;
contract F3Devents {
// fired whenever a player registers a name
event onNewName
(
uint256 indexed playerID,
address indexed playerAddress,
bytes32 indexed playerName,
bool isNewPlayer,
uint256 affiliateID,
address affiliateAddress,
... | distributes eth based on fees to gen and pot/ calculate gen share update eth balance (eth = eth - (com share + pot swap share + aff share + p3d share + airdrop pot share)) calculate pot distribute gen share (thats what updateMasks() does) and adjust balances for dust. add eth to pot set up event data | function distributeInternal(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _keys, F3Ddatasets.EventReturns memory _eventData_)
private
returns(F3Ddatasets.EventReturns)
{
uint256 _gen = (_eth.mul(fees_.gen)) / 100;
_eth = _eth.sub(((_eth.mul(29)) / 100).add((_eth.mul(fees_.p... | 1,604,636 |
pragma solidity 0.4.24;
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
... | Burns a specific amount of tokens. _value The amount of token to be burned./ | function burn(uint256 _value) public {
_burn(msg.sender, _value);
}
| 7,375,207 |
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.11;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "../i... | //// Update the contents of the round configuration mapping. | function setConfig (
uint256 _round,
address[] calldata _criteria,
RedemptionConfig calldata _config
) external onlyOwner {
Prevent a redemption round from being configured with no requisite ERC-721
item collection holding criteria.
if (_criteria.length == 0) {
revert CannotConfig... | 1,247,424 |
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.0;
// constants
import "./LSP7Constants.sol";
import "../LSP1UniversalReceiver/LSP1Constants.sol";
import "../LSP4DigitalAssetMetadata/LSP4Constants.sol";
// interfaces
import "../LSP1UniversalReceiver/ILSP1UniversalReceiver.sol";
import "./ILSP7DigitalAsset.so... | @inheritdoc ILSP7DigitalAsset/ | function authorizeOperator(address operator, uint256 amount)
public
virtual
override
{
_updateOperator(_msgSender(), operator, amount);
}
| 12,759,740 |
/*
Copyright 2019 Wanchain Foundation.
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 wri... | burnBridge, storeman burn lock token on token shadow chain event invoked by user burn lock storageData Cross storage data params parameters for storeman burn lock token on token shadow chain require(IRC20Protocol(tokenScAddr).transfer(params.userOrigAccount, par... | function smgFastBurn(CrossTypes.Data storage storageData, RapiditySmgBurnParams memory params)
public
{
uint origChainID;
bytes memory tokenOrigAccount;
(origChainID,tokenOrigAccount,) = storageData.tokenManager.getTokenPairInfoSlim(params.tokenPairID);
require(origChainI... | 2,486,001 |
/*
Copyright 2020 Set Labs Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in... | Returns the redeem premium percentage. Virtual function that can be overridden in future versions of the module and can contain arbitrary logic to calculate the redemption premium./ | function _getRedeemPremium(
ISetToken _setToken,
address /* _reserveAsset */,
uint256 /* _setTokenQuantity */
)
virtual
internal
view
returns (uint256)
{
return navIssuanceSettings[_setToken].premiumPercentage;
}
| 91,169 |
./full_match/1/0xa943F863fA69ff4F6D9022843Fb861BBEe45B2ce/sources/TangleBundle0.sol | Gets all farms and their details return All farms and their details | function farms() external view returns (uint, uint, SLib.Farm[] memory) {
SLib.S storage s = SLib.getS();
SLib.Farm[] memory farms_ = new SLib.Farm[](s.names.length);
for (uint i = 0; i < s.names.length; i++) {
farms_[i] = s.farms[s.names[i]];
farms_[i].max = piecesTo... | 17,007,044 |
./partial_match/1/0x41353Ef12FCD2BeE88dBCe07e710FEF6D37Fa282/sources/TwapManager.sol | Gets the owner of this contract. return Returns the address of the owner./ | function owner () external virtual view returns (address) {
return _owner;
}
| 4,005,555 |
pragma solidity ^0.4.21;
interface P3C {
function() payable external;
function buy(address _playerAddress) payable external returns(uint256);
function sell(uint256 _amountOfTokens) external;
function reinvest() external;
function withdraw() external;
function exit() external;
function dividendsOf(address... | Transfer P3D tokens _toAddress address to send tokens to. _amountOfTokens amount of tokens to send./ | function transfer(address _toAddress, uint256 _amountOfTokens) external onlyOwner() returns (bool) {
return P3C(p3cAddress).transfer(_toAddress, _amountOfTokens);
}
| 15,787,834 |
./partial_match/1/0x0569168709a869e7f4Ba142c49BFF7faA14f76C8/sources/@violetprotocol/mauve-core/contracts/interfaces/IMauveFactory.sol | The interface for the Mauve Factory The Mauve Factory facilitates creation of Mauve pools and control over the protocol fees | interface IMauveFactory {
event PoolCreated(
address indexed token0,
address indexed token1,
uint24 indexed fee,
int24 tickSpacing,
address pool
);
event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);
event RoleChanged(address indexed oldRoleAd... | 9,350,741 |
// Sources flattened with buidler v1.3.8 https://buidler.dev
// SPDX-License-Identifier: MIT
// File @openzeppelin/contracts/GSN/Context.sol@v3.1.0
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 ge... | Enable or disable address operator access operator address that will be given/removed operator right. enabled set whether the operator is enabled or disabled. | function whitelistOperator(address operator, bool enabled) external onlyOwner {
_whitelistedOperators[operator] = enabled;
emit WhitelistedOperator(operator, enabled);
}
| 2,023,198 |
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol
pragma solidity ^0.5.0;
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender... | Set up the marker according to provider index Thransaction sender should be a registered provider Allocate new quota Current provider signal | function keepAliveTransaction() internal {
if (timeoutInBlocks < block.number - keepAliveBlock) {
marker = indexOf[msg.sender];
require(marker > 0 && marker <= providers.length);
quota = quotaOf(providers[marker - 1]);
emit Current(providers[marker - 1], qu... | 12,972,902 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
... | inject NONSTANDARD NAMING | function SUB906(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { | 12,568,859 |
pragma solidity 0.6.12;
interface IERC20 {
function TOTALSUPPLY831() external view returns (uint256); //i... | inject NONSTANDARD NAMING | function LOGBYTES17699(bytes17 p0) internal view { | 14,087,627 |
./partial_match/1/0x1473F3e4d236CBBe3412b9f65B4c210756BE2C0E/sources/src/FrxEthEthDualOracle.sol | first price second price | function _getPrices() internal view returns (bool isBadData, uint256 priceLow, uint256 priceHigh) {
uint256 ethPerFrxEthCurveEma = getCurveEmaEthPerFrxEth();
uint256 fraxPerFrxEthTwap = _getUniswapV3Twap();
(bool isBadDataEthUsdChainlink, uint256 usdPerEthChainlink) = getUsdPerEthChainlink(... | 4,389,216 |
/**
*Submitted for verification at Etherscan.io on 2019-09-24
*/
pragma solidity >=0.4.21 <0.6.0;
contract EventMetadata {
address winner_TOD33;
function play_TOD33(bytes32 guess) public{
if (keccak256((guess)) == keccak256(('hello'))) {
winner_TOD33 = msg.sender;
}
}
function ... | iFactory(...) would revert if _factory address is not actually a factory contract | function getCreator() public view returns (address creator) {
creator = iFactory(_factory).getInstanceCreator(address(this));
}
bool claimed_TOD14 = false;
address owner_TOD14;
uint256 reward_TOD14;
| 1,080,645 |
pragma solidity ^0.5.17;
interface IERC20 {
function TOTALSUPPLY3() external view returns (uint256); //inject NONSTANDARD NAMING
function BALANCEOF367(address account) external view returns (uint256); //inject NONSTANDARD NAMING
function TR... | inject NONSTANDARD NAMING | function DIV989(uint256 a, uint256 b) internal pure returns (uint256) { | 12,996,781 |
./full_match/1/0x1A36c461a902E0bE4Ee334DF0817fb828a357358/sources/FairToken.sol | advertising is simply burning tokens with a message (e.g. "save the whales" or "Nike is great") | function burnToAdvertise(string calldata adMessage, uint adPayment) public returns(uint) { | 17,183,633 |
./full_match/11155111/0x448D095593c979793e3178e3749f78267D5Bf04a/sources/project:/contracts/KLOStake.sol | Owner can change the revenue share rate | function changeRevenueShareRate(uint256 newRate) public onlyOwner {
require(newRate >= 0 && newRate <= 100, "Invalid percentage range");
revenueShareRate = newRate;
}
| 3,841,422 |
pragma solidity ^0.5.0;
import { DelegatedERC20 } from "./interfaces/DelegatedERC20.sol";
import { SimplifiedLogic } from "./SimplifiedLogic.sol";
import { TokenFront } from "./TokenFront.sol";
/**
* This contract adds a 2-of-3 signature requirement to administrative calls.
*/
contract Administration {
/**
... | SimplifiedLogic.clawback/ | function clawback(
uint256 _callNumber,
address _src,
address _dst,
uint256 _amount
) public {
setup(
_callNumber,
Operation.Clawback,
keccak256(abi.encodePacked(_src, _dst, _amount))
);
addSig(_callNumber);
... | 5,470,059 |
pragma solidity 0.5.8;
pragma experimental ABIEncoderV2;
import "./IERC20.sol";
import "./IERC721.sol";
import "./SafeMath.sol";
/// @title EthlanceJob
/// @dev A contract for issuing jobs on Ethereum paying in ETH, ERC20, or ERC721 tokens
/// @author Mark Beylin <mark.beylin@consensys.net>, Gonçalo Sá <goncalo.sa@c... | invoiceJob(): Allows users to invoice the job to get paid out _sender the sender of the transaction issuing the job (should be the same as msg.sender unless the txn is called by the meta tx relayer) _jobId the index of the job _invoiceIssuer The invoice issuer, the addresses which will receive payouts for the submis... | function invoiceJob(
address _sender,
uint _jobId,
address payable _invoiceIssuer,
string memory _ipfsHash,
uint _amount)
public
senderIsValid(_sender)
validateJobArrayIndex(_jobId)
{
requir... | 12,943,832 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.