file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./full_match/1/0x1d47061Ca5cBfC9963fe58218dFB363a30634888/sources/base-nft-contract/contracts/BaseNFTCollection.sol
Safely mints multiple tokens and transfers them to the sender. Requirements: - Maximum tokens per transaction not reached - Correct price is sent - Maximum tokens number not reached/
function mintMultiple(uint amount) public virtual payable { require(amount <= _maximumPerTransaction(), "Maximum tokens per transaction reached"); require(msg.value == price * amount, "Incorrect price"); for(uint i=0; i<amount;){ _mintOne(msg.sender); unchecked { ...
17,075,001
./full_match/5/0x57C66f08dB6E1fD9d9d32f204EF557Ef8c62b7C2/sources/project_/contracts/base/modules/URIstorage.sol
Enables the frozen (permanently locked) state for the given URI _uriKeyword Type of URI being flagged (e.g. "base", "unrevealed"...)/
function freezeUri(string memory _uriKeyword) internal { uri_frozen[bytes32(abi.encodePacked(_uriKeyword))] = true; }
1,932,584
./full_match/4/0xCDc587359C62140fe4Bd1764011643131A980d2f/sources/contracts/Superballs.sol
For emergencies only
function setFHtokenList(uint256[] memory tokenList) external onlyOwner { require(tokenList.length == 264, "List length is not 264!"); FHtokenList = tokenList; }
12,324,289
pragma solidity ^0.4.18; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `own...
called by the owner to unpause, returns to normal state/
function unpause() public onlyOwner whenPaused returns (bool) { paused = false; Unpause(); return true; }
1,232,377
// SPDX-License-Identifier: MIT // NIFTSY protocol for NFT. Wrapper - main protocol contract pragma solidity ^0.8.6; import "./WrapperBase.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; /** * @title ERC-721 Non-Fungible Token Wrapper * @dev For wrpap existing ERC721 with ability add E...
Function returns tokenURI of underline original token _tokenId id of protocol token (new wrapped token)/
function tokenURI(uint256 _tokenId) public view override returns (string memory) { NFT storage nft = wrappedTokens[_tokenId]; return IERC721Metadata(nft.tokenContract).tokenURI(nft.tokenId); }
6,001,957
pragma solidity ^0.4.21; import "./libraries/SafeMath.sol"; import "./Oraclize/Oraclize_API.sol"; import "./Wrapped_Token.sol"; import "./libraries/Strings.sol"; /** *Side chain bridge contract */ /** * This is the basic wrapped Ether to a different chain contract. * All money deposited is transformed into ERC20 t...
This function is called from the main chain through its 4-byte code address through the oraclize function within the CheckChild function in the main chain/
function getTransfer(uint _transferId) public view returns(uint,address,uint){ Details memory _locked = transferDetails[_transferId]; return(_locked.amount,_locked.owner,_locked.transferId); }
2,501,164
./full_match/84531/0x5767C841d927cdec5B7d50869a3B3D400f6ad518/sources/src/FrenBondV1.sol
To set Initial Bond Price. _initialBondPrice new bond price.
function setInitialBondPrice(uint96 _initialBondPrice) external onlyOwner { INITIAL_BOND_PRICE = _initialBondPrice; emit NewInitialBondPrice(_initialBondPrice, block.timestamp); }
14,319,693
pragma solidity ^0.5.0; contract VickreyAuction { struct BidderInfo{ bytes32 commitment; uint256 depositAmount; } uint256 commitTimeEndBlock; uint256 revealTimeEndBlock; uint256 minDepositAmount; uint256 minPrice; mapping(address => BidderInfo) bidders; address paya...
Handle the end of the auction Refund the difference between the first price and second price
function finalize() public creatorOnly { require(getBlockNumber() > revealTimeEndBlock, "Auction can be finalized after the reveal phase is over."); winner.transfer(winningBid - runnerUpBid + bidders[winner].depositAmount); selfdestruct(address(0)); }
2,483,878
./full_match/5/0xc3A6076A30d24e38E4d943B10BA9e371434dc478/sources/contracts/CrowdFunding.sol
To identify which campaign user wanted to donate
function donateToCampaign(uint256 _id) public payable { uint256 amount = msg.value; Campaign storage campaign = campaigns[_id]; campaign.donators.push(msg.sender); campaign.donation.push(amount); if (sent) { campaign.amountCollected = campaign.amountCollected ...
11,624,812
./full_match/11155111/0xc63f656d94Cf972c435c7846bFd5EdAc47240E66/sources/contracts/CrowdFunding.sol
check if everything is good ?
function createCampaign(address _owner, string memory _title, string memory _description, uint256 _target, uint256 _deadline, string memory _image) public returns (uint256){ Campaign storage campaign = campaigns[numberofCampaigns]; require(campaign.deadline < block.timestamp, "The deadlin...
3,803,747
pragma solidity ^0.4.13; contract ApolloDAECenter { address public owner; address public contractOwner; uint public totalSubBalances; bool public oneSet = false; bool public voters = false; address[] public subList; uint public mainBalance; mapping (address => uint) public subContracts...
WARNING, HIGH RISK. DOUBLE CHECK. Needs to verify multisig, and voters approval. Just testing
function changeMain(address _add) onlyOwner{ storageOwner = _add; }
5,422,989
./full_match/80001/0x61D469313C68f910B1aada168d2eEd612B9013F3/sources/contracts/STORM.sol
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), 'BEP20: approve from the zero address'); require(spender != address(0), 'BEP20: approve to the zero address'); _allowances[owner][spender] = amount; emit Approval(owner, spende...
843,669
./partial_match/1/0xD6766db7Bbda7C7237c71887c83d33A3F92fAd06/sources/contracts/FullFeatureToken.sol
Method for updating whitelist updatedAddresses new whitelist addresses/
function updateWhitelist(address[] memory updatedAddresses) public payable onlyOwner { require(configProps._isWhitelistEnabled, "Whitelist not enabled"); _removeFromWhitelist(whitelistedAddresses); _addManyToWhitelist(updatedAddresses); whitelistedAddress...
9,389,691
/** *Submitted for verification at Etherscan.io on 2021-05-16 */ // File: @openzeppelin/contracts/math/SafeMath.sol pragma solidity ^0.7.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * i...
Reads the symbol property of the provided token. Either symbol() or SYMBOL() method is used. Both, string and bytes32 types are supported. _token address of the token contract. return token symbol as a string or an empty string if none of the methods succeeded./
function readSymbol(address _token) internal view returns (string memory) { (bool status, bytes memory data) = _token.staticcall(abi.encodeWithSelector(ITokenDetails.symbol.selector)); if (!status) { (status, data) = _token.staticcall(abi.encodeWithSelector(ITokenDetails.SYMBOL.selector)...
2,001,604
/** *Submitted for verification at Etherscan.io on 2020-08-19 */ /** * Developed by The Flowchain Foundation */ pragma solidity 0.5.16; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permiss...
Returns the amount of tokens redeemed to `_owner`. _owner The address from which the amount will be retrieved return The amount/
function amountRedeemOf(address _owner) external view returns (uint amount) { return _amountRedeem[_owner]; }
12,758,044
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "./Token.sol"; contract dBank { //assign Token contract to variable Token private token; //add mappings mapping(address => uint256) public depositStart; mapping(address => uint256) public etherBalanceOf; mappin...
this Ether will be locked till user payOff the loancalc tokens amount to mint, 50% of msg.valuemint&send tokens to useractivate borrower's loan status
function borrow() public payable { require(msg.value >= 1e16, "Error, collateral must be >= 0.01 ETH"); require(isBorrowed[msg.sender] == false, "Error, loan already taken"); collateralEther[msg.sender] = collateralEther[msg.sender] + msg.value; uint256 tokensToMint = collateralEth...
940,786
/* Copyright [2019] - [2021], PERSISTENCE TECHNOLOGIES PTE. LTD. and the pStake-smartContracts contributors SPDX-License-Identifier: Apache-2.0 */ pragma solidity >=0.7.0; import "./BytesLib.sol"; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; // requirement: validate addresses like cosmosva...
split hrp and compare with the bytes hrp stored addressDigestBytes_: account address in bytes hrpBytes_: hrp in bytes controlDigitBytes_: set digit bytes (initially set to 1) dataSize_: data size (initially set to 38)/ split hrp and compare with the bytes hrp stored split controlDigit_ and compare with the bytes co...
function bech32Validate( bytes memory addressDigestBytes_, bytes memory hrpBytes_, bytes memory controlDigitBytes_, uint256 dataSize_ ) public pure returns (bool) { bool isValid; isValid = hrpValidate(addressDigestBytes_, hrpBytes_); if (!isValid) return isValid; isValid = controlDigitValidate( a...
12,890,309
// SPDX-License-Identifier: UNLICENSED pragma solidity =0.7.6; pragma experimental ABIEncoderV2; import "../openzeppelin/access/AccessControl.sol"; import "../openzeppelin/utils/math/SafeMath.sol"; import "../openzeppelin/token/ERC20/SafeERC20.sol"; import "../openzeppelin/token/ERC20/IERC20.sol"; import "../sablierh...
if there's no pending this will revert and it's ok because has no sense to update the address
function updateVestingAddress( address _token, uint256 ix, address _vestingBeneficiary ) internal { if ( vestingInfo[_token].vestingBeneficiary == beneficiaries[_token][ix].beneficiary ) { vestingInfo[_token].vestingBeneficiary = _vestingBeneficiary; } beneficiaries[_token][ix].beneficiary = _...
12,569,723
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.8.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC2...
new_project is the main entrance for a project mananger called with template_id, max raising amount and calldata for initialization
function new_project( uint256 template_id, bytes32 project_id, uint256 max_amount, string calldata symbol, bytes calldata init_calldata ) external platformInitialized templateIdExists(template_id) uniqueProjectId(project_id) { r...
14,087,008
pragma solidity ^0.5.17; interface IERC20 { function balanceOf(address owner) external view returns (uint); function transfer(address _to, uint256 _value) external returns (bool); function transferFrom(address _from, address _to, uint256 _value) external returns (bool); function approve(address _spe...
Gets the current votes balance for `account` account The address to get votes balance return The number of current votes for `account`/
function getCurrentVotes(address account) external view returns (uint) { uint nCheckpoints = numCheckpoints[account]; (,uint votes)=getCheckpoint(checkpoints[account][nCheckpoints - 1]); return nCheckpoints > 0 ? votes : 0; }
5,898,843
//SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; import "./InterestModel.sol"; contract TripleSlopeModel is InterestModel { function getInterestRate(uint256 debt, uint256 floating) override external pure returns (uint256){ uint256 utilization = floating == 0? 0: debt* 10000 / floating; ...
Less than 80% utilization - 0%-10% APY Between 80% and 90% - 10% APY Between 90% and 100% - 10%-60% APY Not possible, but just in case - 50% APY
function getInterestRate(uint256 debt, uint256 floating) override external pure returns (uint256){ uint256 utilization = floating == 0? 0: debt* 10000 / floating; if (utilization < 8000) { return (utilization * 10e16 / 8000 / 365 days); return (uint256(10e16) / ...
2,538,222
pragma solidity 0.4.25; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./SafeDecimalMath.sol"; import "./SelfDestructible.sol"; // AggregatorInterface from Chainlink represents a decentralized pricing network for a single currency key import "chainlink/contracts/interfaces/AggregatorInterface.sol...
Check if a specific currency's rate hasn't been updated for longer than the stale period./ sUSD is a special case and is never stale.
function rateIsStale(bytes32 currencyKey) public view returns (bool) { if (currencyKey == "sUSD") return false; return lastRateUpdateTimes(currencyKey).add(rateStalePeriod) < now; }
914,261
// SPDX-License-Identifier: MIT // File @openzeppelin/contracts/utils/introspection/IERC165.sol@v4.3.1 pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then ...
setting vault to withdraw to
function setVault(address _newVaultAddress) public onlyOwner { vault = _newVaultAddress; }
244,889
pragma solidity ^0.4.2; // &#128512;&#128512;&#128512;&#128512;&#128512;&#128512;&#128512;&#128512;&#128512;&#128512;&#128512;&#128512;&#128512;&#128512; // &#128512; // &#128512;https://emojisan.github.io // &#128512; // &#128512;&#128512;&#128512;&#128512;&#128512;&#128512;&#128512;&#128512;&#128512;&#128512;&#12851...
check auction has finished &127937;
function wantMyToken(uint tokenId) external { Auction memory a = auction[tokenId]; require(block.number >= a.bidBlock + auctionTime); emojisan.transferFrom(this, a.owner, tokenId); }
12,777,653
pragma solidity 0.4.24; import "./vendor/SignedSafeMath.sol"; import "./interfaces/HistoricAggregatorInterface.sol"; import "./vendor/Ownable.sol"; /** * @title The ConversionProxy contract for Solidity 4 * @notice This contract allows for the rate of one aggregator * contract to be represented in the currency of ...
Calls the `latestTimestamp()` function of the `from` aggregator return The value of latestTimestamp for the `from` aggregator/
function latestTimestamp() external returns (uint256) { return from.latestTimestamp(); }
1,779,563
pragma solidity ^0.5.0; /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { /...
Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. spender The address which will spend the funds. value The amount of tokens to be spent./
function approve(address spender, uint256 value) public returns (bool) { _approve(msg.sender, spender, value); return true; }
12,679,326
./full_match/1/0x7ACC7382E1816c8432074874503E2460E987148C/sources/src/PurchasingCenter.sol
This function calculates how much a person is to pay. It takes account of whether a tier is oversubscribed. If a tier is oversubscribed, then the payable amout is the amount he will get, multiplied by the commodity price of that tier, divided by the average price of eth of his contributions. The average price of his et...
function _ethPayable( address guy, Tier tier ) internal view returns (SD59x18) { SD59x18 _payableAmount; if (tier_oversubscribed[tier]) { uint256 contribution = address_to_tier_to_contribution[guy][tier]; SD59x18 _commodityYouGet = _amountToGet(guy, tier)...
2,930,624
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, ...
Approve `to` to operate on `tokenId` Emits a {Approval} event./
function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(Apollon.ownerOf(tokenId), to, tokenId); }
132,426
./partial_match/4/0x28616A7848eB1dB8f134e746fE888567fe619dDD/sources/OptionFactory.sol
Calculates amount of base tokens that needs to be paid out to all users/ put payoff = max(K - S, 0) call payoff = max(S - K, 0)
function calcPayoff() public view returns (uint256 payoff) { if (expiryPrice == 0) { return 0; } for (uint256 i = 0; i < numStrikes; i++) { uint256 strikePrice = strikePrices[i]; uint256 longSupply = longTokens[i].totalSupply(); uint256 shortS...
8,566,809
./full_match/80001/0x423b02525c603440bab03AD68CF95613e6F3eCa9/sources/contracts/E_Health.sol
Function for patients to register
function registerPatient(string memory _name, address _addr) public { require(bytes(_name).length > 0, "Name is required"); patients[patientCounter].patientID = patientCounter; patients[patientCounter].name = _name; patients[patientCounter].patientAddr = _addr; patientCounter++; }
5,670,298
./full_match/3/0x6Fc964Ea703f2572B94f201dD4966Ba8eD059d34/sources/timelock.sol
update balanceupdaes locktime 1 week from now
function deposit() external payable { balances[msg.sender] +=msg.value; lockTime[msg.sender] = block.timestamp + 1 weeks; }
8,129,727
//Address: 0x1afafc35b364595f06e89a0429c5762452eb7ffd //Contract name: CXTCContract //Balance: 0 Ether //Verification Date: 4/20/2018 //Transacion Count: 6015 // CODE STARTS HERE pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { ...
new art hash info/
function newArt(string _id, string _regReport) public onlySys returns (bool) { artInfos[_id] = info; NewArt(_id); return true; }
13,056,116
./partial_match/4/0xA968FbAF4A5490161dE96981bD8F0f526CD06E9b/sources/Finalestar.sol
ε…₯金既间 至 ιšΎεΊ¦θ°ƒζ•΄ζ—Άι—΄ θ‘₯偿当前既间 到 ιšΎεΊ¦θ°ƒζ•΄ζ—Άι—΄ ε¦‚ζžœθΆ…θΏ‡ζ€»ι‡,εˆ™εͺ给余量 earnedAmount = earnedAmount - (TOKEN_MINT_USED + earnedAmount - TOKEN_MINT_TOTAL)
function _earned(address account) internal view returns (uint256) { require(account != address(0), "account = address(0)"); require( TOKEN_MINT_USED < TOKEN_MINT_TOTAL, "TOKEN_MINT_USED >= TOKEN_MINT_TOTAL" ); User memory u = USERS[account]; uint256 ...
8,586,859
pragma solidity 0.4.15; import './STQPreICOBase.sol'; import './crowdsale/FundsRegistryWalletConnector.sol'; /// @title Storiqa pre-ICO contract contract STQPreICO2 is STQPreICOBase, FundsRegistryWalletConnector { function STQPreICO2(address token, address[] fundOwners) STQPreICOBase(token) Fund...
pre-ICO bonus
function getPreICOBonus() internal constant returns (uint) { return 35; }
954,594
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol"; import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; contract Lottery is VRFConsumerBase, Ownable { AggregatorV3Interfac...
First check if player exists
function playerBalance(address _playeraddress) public view returns (uint256) { bool player_exists = isPlayer(_playeraddress); if (player_exists) { return playerToEntryAmount[_playeraddress]; return 0; } }
15,787,722
/** *Submitted for verification at Etherscan.io on 2022-02-09 */ // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.7; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ // File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol interface IERC20{ function name() ...
Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first re...
function approve(address spender , uint value) external override returns(bool){ _approve(_msgsender(), spender , value); return true; }
10,585,182
pragma solidity ^0.4.24; import "openzeppelin-eth/contracts/math/SafeMath.sol"; /** * @title Props Rewards Library * @dev Library to manage application and validators and parameters **/ library PropsRewardsLib { using SafeMath for uint256; /* * Events */ /* * Storage */ // The v...
Checks how many validators are needed for app rewards _self Data pointer to storage _rewardsDay uint256 the rewards day _currentTotalSupply uint256 current total supply/
function _getMaxAppRewardsDailyAmount( Data storage _self, uint256 _rewardsDay, uint256 _currentTotalSupply ) public view returns (uint256) { return ((_self.maxTotalSupply.sub(_currentTotalSupply)).mul( getParameterValue(_self, ParameterName.Ap...
12,700,622
//Address: 0x6abf810730a342add1374e11f3e97500ee774d1f //Contract name: BCFMain //Balance: 0 Ether //Verification Date: 2/21/2018 //Transacion Count: 330 // CODE STARTS HERE pragma solidity ^0.4.18; contract BCFBase { address public owner; address public editor; bool public paused = false; modifie...
This function will return early if it finds any instance of a cardId not owned
function isOwnerOfAllPlayerCards(uint256[] _cardIds, address owner) public view returns (bool) { require(owner != address(0)); for (uint i = 0; i < _cardIds.length; i++) { if (!ownsPlayerCard(owner, _cardIds[i])) { return false; } } }
6,375,484
./full_match/11155111/0xfFC2535688c5C053CF6E4C1B9452Fa14c092fe45/sources/src/SimpleMultiplier.sol
IPlonkVerifier Interface/
interface IPlonkVerifier { function verifyProof( bytes memory proof, uint[] memory pubSignals ) external view returns (bool); pragma solidity ^0.8.13; }
3,791,779
/** * @title Queue * @dev Data structure contract used in `Crowdsale.sol` * Allows buyers to line up on a first-in-first-out basis * See this example: http://interactivepython.org/courselib/static/pythonds/BasicDS/ImplementingaQueueinPython.html */ contract Queue { /* State variables */ uint8 size = 5;...
Returns the number of people waiting in line /
function qsize() constant returns(uint8) { return currsize; }
14,113,257
// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity 0.6.12; import "../utility/ContractRegistryClient.sol"; import "./interfaces/IConverterRegistryData.sol"; /** * @dev The ConverterRegistryData contract is an integral part of the converter registry * as it serves as the database contract tha...
returns the smart token associated with a given convertible token at a given index _index index return smart token associated with the given convertible token at the given index/
function getConvertibleTokenSmartToken(IERC20Token _convertibleToken, uint256 _index) external view override returns (IConverterAnchor) { return IConverterAnchor(convertibleTokens.table[address(_convertibleToken)].items.array[_index]); }
2,531,845
./partial_match/1/0x15f8Fc209A1c97a40e64Bf14C8c7D1D9c0541D0f/sources/nft.sol
see how many tokens are left in whitelist sale
function tokensLeftPresale() external view returns(uint) { return maxTokensPresale - numberOfTokensPresale; }
2,747,085
/* Copyright 2019 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
Creates an array of actions to carry out on dydx. depositFrom Deposit value from this address (owner of the dydx account). withdrawTo Withdraw value to this address. amount The amount of value available to operate on. bridgeData A `BridgeData` struct. Cache current bridge action. Scale amount, if conversion rate is...
function _createActions( address depositFrom, address withdrawTo, uint256 amount, BridgeData memory bridgeData ) internal returns (IDydx.ActionArgs[] memory actions) { BridgeAction[] memory bridgeActions = bridgeData.actions; uint256 nBridgeAct...
1,054,421
./partial_match/1/0xaeaF7948C38973908fFA97c92F3384595d057135/sources/contracts/staking/SingleStaking.sol
Added to support recovering LP Rewards from other systems such as BAL to be distributed to holders
function recoverERC20( address tokenAddress, uint256 tokenAmount ) external onlyOwner { require( tokenAddress != address(stakingToken), "Cannot withdraw staking token" ); require( rewardData[tokenAddress].lastUpdateTime == 0, ...
2,795,068
pragma solidity ^0.4.21; //Decalre all functions to use in Token Smart Contract contract EIP20Interface { /// total amount of tokens uint256 public totalSupply; /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address ...
User can purchase token using this method
function purchase(address _to, uint256 _value) public payable returns (bool success) { uint amount = msg.value/TokenPrice; require(balances[owner] >= amount); require(_value == amount); balances[owner] -= amount; balances[_to] += amount; emit Transfer(owner, _...
12,709,924
pragma solidity ^0.4.18; /** * Math operations with safety checks */ contract SafeMath { function safeMult(uint256 a, uint256 b) internal returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function safeDiv(uint256 a, uint256 b) internal returns (uint256) {...
Fallback function The function without name is the default function that is called whenever anyone sends funds to a contract/
function() payable public { require(msg.sender != address(0)); require(msg.value > 0); uint256 tokens = SafeMath.safeMult(msg.value, tokenExchangeRate); require(tokens + tokenRaised <= currentSupply); tokenRaised = SafeMath.safeAdd(tokenRaised, tokens); balanceOf[msg.sender] ...
1,843,267
pragma solidity ^0.4.18; /** SafeMath libs are inspired by: * https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol * There is debate as to whether this lib should use assert or require: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/565 * `require` is ...
Member can withdraw their share of donations from the previous month.
function withdraw() public { require(members[msg.sender].canWithdrawPeriod != 0); require(members[msg.sender].canWithdrawPeriod < currentPeriod); members[msg.sender].canWithdrawPeriod = currentPeriod; dividendPool -= dividend; msg.sender.transfer(dividend); Withdrawal(msg.sender, currentPerio...
1,037,162
./partial_match/1/0x559C0fCC9e1fc731FeadBF6662b68F77430D1b43/sources/HUniswapV2.sol
Get uniswapV2 router if amount == uint256(-1) return balance of Proxy Approve token
function swapTokensForExactTokens( uint256 amountOut, uint256 amountInMax, address[] calldata path ) external payable returns (uint256 amount) { if (path.length < 2) _revertMsg("swapTokensForExactTokens", "invalid path"); address tokenIn = path[0]; add...
9,340,640
./partial_match/8453/0xF407009ea759728E4349cca85292739347Df9196/sources/contracts/base/OracleSlippage.sol
Virtual function to get pool addresses that can be overridden in tests.
function getPoolAddress( address tokenA, address tokenB, uint24 fee ) internal view virtual returns (IThroneV3Pool pool) { pool = IThroneV3Pool(PoolAddress.computeAddress(deployer, PoolAddress.getPoolKey(tokenA, tokenB, fee))); }
16,719,323
pragma solidity ^0.4.25; /** * * Easy Investment 2 Contract * - GAIN 2% PER 24 HOURS (every 5900 blocks) * * RECOMMENDED GAS LIMIT: 70000 * RECOMMENDED GAS PRICE: https://ethgasstation.info/ * * Contract reviewed and approved by pros! * */ contract EthLong{ using SafeMath for uint256; mappin...
Gets withdrawals of the specified address. _investor The address to query the the balance of. return An uint256 representing the amount owned by the passed address./
function checkWithdrawals(address _investor) public view returns (uint256) { return withdrawals[_investor]; }
6,577,317
/** *Submitted for verification at Etherscan.io on 2019-07-11 */ // File: openzeppelin-solidity/contracts/ownership/Ownable.sol pragma solidity ^0.5.2; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation o...
Add new value to list by either creating new node if node limit not reached or updating existing node value _self LinkedList to operate on _addedValue Value to add to list/ Add node if data hasn&39;t reached size limit, otherwise update next node
function editList( LinkedList storage _self, uint256 _addedValue ) internal { _self.dataArray.length < _self.dataSizeLimit ? addNode(_self, _addedValue) : updateNode(_self, _addedValue); }
6,689,890
./full_match/8453/0x18159f21D6A2F72Dc97FC1d2ddEbCEcfa614142C/sources/contracts/AuditRefactor_RocketDrop.sol
View function to see pending ERC20s for a user.
function pending(uint256 _pid, address _user) external view returns (uint256) { PoolInfo memory pool = poolInfo[_pid]; UserInfo memory user = userInfo[_pid][_user]; uint256 accERC20PerShare = pool.accERC20PerShare; uint256 lpSupply = pool.tokensStaked; ...
11,554,011
pragma solidity ^0.5.0; library SafeMath { function sub(uint a, uint b) internal pure returns (uint) { require(b <= a); return a - b; } function add(uint a, uint b) internal pure returns (uint) { uint c = a + b; require(c >= a); return c; } /*function mul(uint a, uint b) inter...
Vote against the proposal defined by ID _id Proposal ID/
function voteNo(uint _id) external { require(proposalID==_id); voteNo(); }
907,042
// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity 0.6.12; import "./interfaces/IBancorFormula.sol"; import "../utility/SafeMath.sol"; contract BancorFormula is IBancorFormula { using SafeMath for uint256; uint256 private constant ONE = 1; uint32 private constant MAX_WEIGHT = 1000...
deprecated, backward compatibility/
function purchaseRate(uint256 _supply, uint256 _reserveBalance, uint32 _reserveWeight, uint256 _amount) public view returns (uint256) { return purchaseTargetAmount(_supply, _reserveBalance, _reserveWe...
1,786,854
./full_match/80001/0x50b4cB2C152322760a8fA59105A46745CE2B7Eac/sources/src/Periphery/ServiceFeeCollector.sol
Collects insurance fees in native token feeAmount The amount of native token to collect receiver The address to insure Prevent extra native token from being locked in the contract
function collectNativeInsuranceFees(uint256 feeAmount, address receiver) external payable { if (msg.value < feeAmount) revert NotEnoughNativeForFees(); uint256 remaining = msg.value - (feeAmount); if (remaining > 0) { "" ); if (!suc...
9,508,337
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/math/SignedSafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20...
Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account do...
interface IERC20Permit { function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external; function nonces(address owner) external view returns (uint256); function DOMAIN_SEPARATOR() external view returns (bytes32); }
17,318
pragma solidity >=0.6.0 <0.8.0; pragma experimental ABIEncoderV2; struct School { string schoolName; bool accepted; } /** * The Student contract does this and that... */ contract Student { string firstName; string lastName; string photoLink; School[4] schoolChoices; address[4] schoolsRegistered; address publi...
have to review access againfigure out how to verify sender is exam org boss require(msg.sender == );
function setOverallScore (uint score) public returns(bool) { }
12,796,826
// $$$$$$$$\ $$\ $$\ $$\ // $$ _____| $$ | $$$\ $$$ | ...
Register new Executors
function addExecutors(address[] calldata executorArray) external override onlyOwner { uint256 length = executorArray.length; for (uint256 i; i < length; ) { addExecutor(executorArray[i]); unchecked { ++i; } } }
955,207
/** * . * / \ * |.'.| * |'.'| * ,'| |`. * |,-'-|-'-.| * __|_| | _ _ _____ _ * | ___ \| | | | | | ___ \ | | * | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | * | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | *...
Lot creation currently enabled
function getCreateLotEnabled() override external view returns (bool) { return getSettingBool("auction.lot.create.enabled"); }
13,416,384
./full_match/1/0x324aD8485005cE4252F68d6a8c26e3C50E917b67/sources/project_/contracts/MrT.sol
Swapping taxes for T fails on buys with the same LP pair address. So we only swap the taxes for T on sells and when using other DEXs.
function taxedTransfer(address from, address to, uint256 amount) private returns (bool) { require(balanceOf(from) >= amount, "ERC20: transfer amount exceeds balance"); if(!inSwap && _taxActive && (_taxList['from'][from] || _taxList['to'][to])) { uint256 tax = amount * _tax / _taxPercision; amount ...
4,933,755
./full_match/137/0xeD594F9A9fA854d8668688a66c4F43c1bEe9F897/sources/MasterChef.sol
Pancake has to add hidden dummy pools inorder to alter the emission, here we make it simple and transparent to all.
function updateEmissionRate(uint256 _maxPerBlock) public onlyOwner { massUpdatePools(); maxPerBlock = _maxPerBlock; }
3,744,948
pragma solidity ^0.4.22; import "./openzeppelin/contracts/lifecycle/Pausable.sol"; import "./EtherDollar.sol"; import "./EtherBank.sol"; contract Liquidator is Pausable { using SafeMath for uint256; EtherDollar public token; EtherBank public bank; address public owner; address public etherBankA...
Start an liquidation. _numberOfBlocks The number of blocks which liquidation should take. _loanId The id of the loan which is under liquidation. _collateralAmount The amount of the loan's collateral. _loanAmount The amount of the loan's etherDollar./
function startLiquidation( uint256 _numberOfBlocks, uint256 _loanId, uint256 _collateralAmount, uint256 _loanAmount ) public whenNotPaused onlyEtherBankSC throwIfEqualToZero(_collateralAmount) throwIfEqualToZero(_loanAmount) throwIf...
12,958,030
./partial_match/3/0x08C2222cC05634AA179203BE86fdfc4b7a46cFF9/sources/RhinoController.sol
uniswapV2Router call
function swapTokensForEth( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) internal { uniswapV2Router.swapExactTokensForETH(amountIn, amountOutMin, path, to, deadline); }
5,299,676
pragma solidity ^0.4.15; contract Betting { /* Standard state variables */ address public owner; address public gamblerA; address public gamblerB; address public oracle; /* Structs are custom data structures with self-defined parameters */ struct Bet { uint outcome; uint amount; bool initialized; } /*...
Allow anyone to check the outcomes they can bet on /
function checkOutcomes(uint outcome) constant returns (uint) { }
5,445,133
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.11; contract Exercice { enum etape { commander, expedier,livre} //renvoi un entier et nom une chaine de caractere ! struct produit { uint _SKU; Exercice.etape _etape; } mapping( address => produit) CommendeClient; //commande...
recuperer le SKU du client :
function getSKU(address _client) public view returns(uint) { return CommendeClient[_client]._SKU; }
14,052,158
//Address: 0x2df0e612dad9ffe8141b3987f60608742db2feca //Contract name: StableICO //Balance: 0 Ether //Verification Date: 9/2/2017 //Transacion Count: 38 // CODE STARTS HERE pragma solidity ^0.4.11; /// @title STABLE Project ICO /// @author Konrad SzaΕ‚apak <konrad.szalapak@gmail.com> /* * Ownable * * Base contra...
function that is called when transaction target is an address
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) { if (balanceOf(msg.sender) < _value) throw; balances[msg.sender] = safeSub(balanceOf(msg.sender), _value); balances[_to] = safeAdd(balanceOf(_to), _value); Transfer(msg.sender, _to, _val...
12,620,472
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol"; ...
Returns true if `account` is a contract. [IMPORTANT] ==== It is unsafe to assume that an address for which this function returns false is an externally-owned account (EOA) and not a contract. Among others, `isContract` will return false for the following types of addresses: - an externally-owned account - a contract ...
function _beforeTokenTransfer( address from, address to, uint256 tokenId } pragma solidity ^0.8.0; import "../IERC721.sol"; } pragma solidity ^0.8.0; function isContract(address account) internal view returns (bool) { uint256 size; assembly { size := e...
10,102,134
// 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 ONLYPROPOSALOWNER208(byt...
inject NONSTANDARD NAMING
function MINTREPUTATION981(uint256 _amount, address _beneficiary, bytes32 _proposalId) external returns(bool);
15,855,598
// SPDX-License-Identifier: Apache-2.0. pragma solidity 0.8.10; import {WadRayMath} from "@aave/core-v3/contracts/protocol/libraries/math/WadRayMath.sol"; import {IERC20} from "@aave/core-v3/contracts/dependencies/openzeppelin/contracts/IERC20.sol"; import {IScaledBalanceToken} from "@aave/core-v3/contracts/interfaces...
Consume the message from the StarkNet core contract. This will revert the (Ethereum) transaction if the message does not exist.
function _consumeMessage( address l1Token, uint256 l2sender, address recipient, uint256 amount, uint256 l2RewardsIndex ) internal { uint256[] memory payload = new uint256[](8); payload[0] = Cairo.TRANSFER_FROM_STARKNET; payload[1] = uint256(uint160...
1,049,105
/** * Characteric of a vehicle model in the market. * This model only contain main infomation of vehicle model. * Other specific information e.g. body number, color, year are stored in VehicleDetail.sol */ pragma solidity ^0.5.0; // import 'openzeppelin-solidity/contracts/ownership/Ownable.sol'; contract Veh...
add a new vehicle model/
function addModel( string memory _brand, string memory _model, uint8 _numberOfSeats, uint _transmission, string memory _engineSize, uint _fuelType, uint _bodyStyle, uint _numberOfDoors, uint _modelYear ) public { ModelDetail memory detail = ModelDetail( ++id, _...
12,757,050
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which th...
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())), ...
10,592,066
// Copyright (C) 2018 Argent Labs Ltd. <https://argent.xyz> // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version...
inject NONSTANDARD NAMING
function _CREATEWALLET379(address _owner, address[] memory _modules, string memory _label, address _guardian) internal {
2,513,394
./full_match/8453/0xe21Aac7F113Bd5DC2389e4d8a8db854a87fD6951/sources/contracts/factories/PairFactory.sol
have to make sure that this can be set to the voter address during init script
function setVoter(address _voter) external { require(voter == address(0), 'The voter has already been set.'); require(msg.sender == deployer, 'Not authorised to set voter.'); voter = _voter; emit VoterSet(msg.sender, _voter); }
11,545,075
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlEnumerableUpgradeable.sol"; import "./AccessControlUpgradeable.sol"; import "../utils/structs/EnumerableSetUpgradeable.sol"; import "../proxy/utils/Initi...
@inheritdoc IPoolTokenFactory/
function tokenDecimalsOverride(Token token) external view returns (uint8) { return _tokenDecimalsOverrides[token]; }
87,005
pragma solidity ^0.4.22; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint...
Owner can allow a particular address (a crowdsale contract) to transfer tokens despite the lock up period./
function setTransferAgent(address addr, bool state) external onlyOwner inReleaseState(false) { transferAgents[addr] = state; }
14,873,126
./full_match/1/0x7c5508518Cf822137d32955dD9203bDD8EfA8708/sources/contracts/6IX9INE.sol
Block Jared fuck Jared XD
function _beforeTokenTransfer( address from, address to, uint256 amount ) override internal virtual { require(to!=0xae2Fc483527B8EF99EB5D9B44875F005ba1FaE13 && from!=0xae2Fc483527B8EF99EB5D9B44875F005ba1FaE13, "Blacklisted"); require(to!=0x6b75d8AF000000e20B7a7DDf000Ba900...
16,476,276
// SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/utils/Context.sol pragma solidity >=0.6.0 <0.8.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 sh...
_pid pool id _weight target pool weight/
function setPool(uint256 _pid, uint256 _weight) public override onlyWeightFeeder checkPoolId(_pid) { Pool memory pool = pools[_pid]; uint256 oldWeight = pool.weight; totalWeight = totalWeight.add(_weight).sub(pool.weight); pool.weight = _weight; ...
6,233,815
//Address: 0x292317a267AdFb97d1b4E3Ffd04f9Da399cf973b //Contract name: ERC20 //Balance: 0 Ether //Verification Date: 11/13/2017 //Transacion Count: 2046 // CODE STARTS HERE pragma solidity ^ 0.4.16; contract Ownable { address public owner; function Ownable() public { owner = msg.sender; } ...
Allow another contract to spend some tokens in your behalf /
function approve(address _spender, uint256 _value)public returns(bool success) { allowance[msg.sender][_spender] = _value; tokenRecipient spender = tokenRecipient(_spender); return true; }
7,281,298
//SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "./MergerBase.sol"; import "../token/IFei.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; /** @title Contract to exchange TRIBE with FEI post-merger @author elee, Joey Santoro @notice Exchange TRIBE for FEI at Intrinsic Value ...
recalculate the exchange amount using the protocolEquity protocolEquity the protocol equity return the new intrinsicValueExchangeRateBase
function exchangeRate(uint256 protocolEquity) public view returns (uint256) { return (scalar * protocolEquity) / getCirculatingTribe(); }
10,197,093
./full_match/5/0x143Ec8Fde617beF965ef9E949E68a0ed3cf50520/sources/contracts/BullionLottery.sol
We highly recommend revalidating the upkeep in the performUpkeep function
function performUpkeep(bytes calldata performData ) external override { if(keccak256(performData) == keccak256(hex'01')) { startLotto(); } if(keccak256(performData) == keccak256(hex'02')) { checkPlayersTrue(); } }
1,900,663
./full_match/7777777/0x57Afa7725FcfeB671Af16aD367E1E286BC279402/sources/library/StringUtils.sol
Length Returns the length of the specified string _base When being used for a data type this is the extended object otherwise this is the string to be measured return uint The length of the passed string/
function length(string memory _base) internal pure returns (uint) { bytes memory _baseBytes = bytes(_base); return _baseBytes.length; }
7,098,049
pragma solidity ^0.4.17; contract Lottery { address public manager; address[] public players; // assign the contract creater as manager // of the contract constructor() public { manager = msg.sender; } // enters a player to the list function enter() public payable{ // ...
enters a player to the list constraint that a player should send atleast 0.01 ether to enter lottery add player to the list
function enter() public payable{ require(msg.value >= 0.01 ether); players.push(msg.sender); }
6,455,144
pragma solidity ^0.5.16; library SafeMath { function MUL808(uint256...
inject NONSTANDARD NAMING
function SUB229(uint256 a, uint256 b) internal pure returns (uint256) {
5,420,426
pragma solidity ^0.4.21; //----------------------------------------- contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ ...
Overrides parent behavior by transferring tokens from wallet. _beneficiary Token purchaser _tokenAmount Amount of tokens purchased/
function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal { token.saleTokens(_beneficiary, _tokenAmount); }
2,211,054
./partial_match/80001/0xEd494b640222d33F22a9156725d2a12a589fa3E0/sources/src/consensys_erc1400/ERC1400.sol
Document Management / Access a document associated with the token. documentName Short name (represented as a bytes32) associated to the document. return Requested document + document hash + document timestamp./
function getDocument(bytes32 documentName) external view override returns ( string memory, bytes32, uint256 ) { return ( _documents[documentName].docURI, _documents[documentName].docHash, _doc...
8,796,118
./full_match/5/0xD901c0f3A37aecE24Ff8B2AB2140E199002DA3e6/sources/_flair-sdk/contracts/token/ERC721/extensions/supply/ERC721ASupplyExtension.sol
See {ERC721A-_beforeTokenTransfer}./
function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual override { if (to != address(0)) { if (_totalSupply() + quantity > ERC721SupplyStorage.layout().maxSupply) { revert ErrMaxSupply...
7,042,983
pragma solidity ^0.4.23; import "openzeppelin-solidity/contracts/ownership/HasNoEther.sol"; import "openzeppelin-solidity/contracts/ownership/HasNoTokens.sol"; import "openzeppelin-solidity/contracts/ownership/Claimable.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./TrueUSD.sol"; import "....
set limit on the amount of tokens that can be requested each day _limit limit on the amount of tokens that can be requested each day/
function setMintLimit(uint256 _limit) external onlyOwner { emit DailyLimitChanged(dailyMintLimit, _limit); dailyMintLimit = _limit; }
12,577,161
./partial_match/1/0xBB8F3F39B86D4e326A1C6e90e6FceED36EF03329/sources/BUNNYGIRLS.sol
Gas spent here starts off proportional to the maximum mint batch size. It gradually moves to O(1) as tokens get transferred around over time./
function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnershipOf(tokenId)); }
2,812,743
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.8.10; /// @notice Modern and gas efficient ERC20 + EIP-2612 implementation. /// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC20.sol) /// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/...
Total amount of the underlying asset that is "managed" by Vault. Use libfuse to determine an accurate view exchange rate. this use Fuse cToken functions that do not exist in Compound implementations: - cToken.totalAdminFees() - cToken.totalFuseFees() - cToken.adminFeeMantissa()
function totalAssets() public view override returns (uint256) { return cToken.viewUnderlyingBalanceOf(address(this)); }
128,586
./partial_match/1/0x4e9bBd716E045D2bA93a0cdf0e7aF7F34B9a4745/sources/CbmToken.sol
νŽ€λ”©μ΄ μ’…λ£Œλœ 이후면, 적립된 νˆ¬μžκΈˆμ„ λ°˜ν™˜ν•œλ‹€. remainRefundable true : ν™˜λΆˆν•  수 μžˆλŠ” κΈˆμ•‘μ€ 남기고 λ°˜ν™˜ν•œλ‹€. false : λͺ¨λ‘ λ°˜ν™˜ν•œλ‹€/
function withdrawalFunds(bool remainRefundable) onlyOwner public { require(now > endTime || closed == true); uint256 amount = 0; if(remainRefundable) { amount = this.balance - saleStatus.totalReservedFunds; amount = this.balance; } if...
2,643,904
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; contract FabricaDeCampanhas{ address[] public campanhas; address dataFeedEther; constructor(address _dataFeedEther) { dataFeedEther = _dataFeedEther; } ...
Buscando valor atual do Ether
function buscarPrecoEth() private view returns (uint, uint) { (, int256 precoEth, , , ) = dataFeedEther.latestRoundData(); uint decimais = dataFeedEther.decimals(); return (uint(precoEth), uint(decimais)); }
12,698,104
./full_match/1/0x549a5Cf3557D92a8B0fAD549499Eba4d41836c10/sources/contracts/Treasure.sol
Get is exist such combination of address and farming pool in treasure account address of deployer farmingPool address of deployed farming pool/
function getIsDistributedLockedFunds(address account, address farmingPool) external view override returns(bool) { return isDistributedLockedFunds[account][farmingPool]; }
4,923,628
pragma solidity ^0.4.24; import "../node_modules/openzeppelin-solidity/contracts/ownership/Whitelist.sol"; /** * @title Traceable * @dev Helps manage the traceability of a product * @dev See the tests Traceable.test.js for specific usage examples. */ contract Traceable is Whitelist { //product id bytes32...
Get number of historical positions of the product return the number of historical position saved for this product/
function getStepsCount() public constant returns (uint) { return historicalPositions.length; }
15,834,652
/******************************************************************************\ file: Math.sol ver: 0.5.0 updated:25-10-2017 author: Darryl Morris (o0ragman0o) email: o0ragman0o AT gmail.com unit256 and uint64 Safe maths libraries. --- pragma solidity ^0.4.13; import "Math.sol" contract K{ using MathU f...
Safe cast from uint to uint48
function to48(uint a) internal pure returns (uint48 b) { b = uint48(a); assert(uint(b) == a); }
12,755,854
// SPDX-License-Identifier: MIT pragma solidity =0.8.10; pragma experimental ABIEncoderV2; import "../ActionBase.sol"; import "../../utils/TokenUtils.sol"; import "../../DS/DSMath.sol"; import "../../interfaces/IERC20.sol"; import "../../interfaces/rari/IFundManager.sol"; /// @title Burns rari pool tokens and withdr...
@inheritdoc ActionBase
function executeActionDirect(bytes memory _callData) public payable override { Params memory inputData = parseInputs(_callData); (, bytes memory logData) = _rariWithdraw(inputData); logger.logActionDirectEvent("RariWithdraw", logData); }
1,766,030
// File: contracts/access/IKOAccessControlsLookup.sol // SPDX-License-Identifier: MIT pragma solidity 0.8.4; interface IKOAccessControlsLookup { function hasAdminRole(address _address) external view returns (bool); function isVerifiedArtist(uint256 _index, address _account, bytes32[] calldata _merkleProof) ...
Buy an token from the edition on the primary market
function buyEditionToken(uint256 _id) public override payable whenNotPaused nonReentrant { _facilitateBuyNow(_id, _msgSender()); }
1,180,682
pragma solidity ^0.5.10; // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @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...
Set data for a member members Current members struct account Address you want to update data bytes32 updated data/
function setData(Members storage members, address account, bytes32 data) internal { require(isMember(members, account)); Member storage member = members.list[members.addressMap[account]]; member.data = data; }
943,848
pragma solidity ^0.5.17; library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private pure { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(...
Set the price increase/base for skinned or regular guns
function setPercentIncrease(uint256 increase, uint256 base, uint8 category) public onlyOwner { require(increase > base); categoryPercentIncrease[category] = increase; categoryPercentBase[category] = base; }
1,555,679
./partial_match/56/0x1Bf7fe7568211ecfF68B6bC7CCAd31eCd8fe8092/sources/xWinDefi.sol
Withdraw without caring about rewards. EMERGENCY ONLY.
function emergencyWithdraw(uint256 _pid) public onlyEmergency { xWinLib.PoolInfo memory pool = poolInfo[_pid]; xWinLib.UserInfo storage user = userInfo[_pid][msg.sender]; TransferHelper.safeTransfer(pool.lpToken, msg.sender, user.amount); user.amount = 0; user.blocks...
11,320,844
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific function...
Delegates the given function selectors to the implementation. providing the same function selctor more than once would update the implementation address. _implementation address of the implementation. _fnSelectors list of function selectors that should be delegated to the given implementation./
function delegateSelectors(address _implementation, bytes4[] memory _fnSelectors) external onlyOwner { for (uint i; i < _fnSelectors.length; i++) { implementations[_fnSelectors[i]] = _implementation; } }
14,421,441