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/97/0x346fa0A6f1B77F294Ea799BEdE9473280b3eFFAe/sources/contracts/IERC1155.sol
ERC1155ๆ ‡ๅ‡†็š„ๆŽฅๅฃๅˆ็บฆ๏ผŒๅฎž็Žฐไบ†EIP1155็š„ๅŠŸ่ƒฝ/
interface IERC1155 is IERC165 { event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ...
5,045,515
./partial_match/4/0xB5cf359Ac5Df39D338dA634a9D5a5E8dBf3268AB/sources/ReferenceToken.sol
-- Mint And Burn Functions (not part of the ERC777 standard, only the Events/tokensReceived call are) -- / Generates `_amount` tokens to be assigned to `_tokenHolder` Sample mint function to showcase the use of the `Minted` event and the logic to notify the recipient. _tokenHolder The address that will be assigned t...
function mint( address _tokenHolder, uint256 _amount, bytes calldata _data, bytes calldata _operatorData ) external onlyOwner { doMint(_tokenHolder, _amount, _data, _operatorData); }
8,753,508
/** *Submitted for verification at Etherscan.io on 2020-07-08 */ // File: contracts/IERC165.sol pragma solidity ^0.5.11; /** * @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 ...
inject PUBLIC FUNC TO EXTERNAL
function tokenURI(uint256 tokenId) public view returns (string memory) {
922,019
pragma solidity ^0.5.10; import {SafeMath} from "@summa-tx/bitcoin-spv-sol/contracts/SafeMath.sol"; import {BTCUtils} from "@summa-tx/bitcoin-spv-sol/contracts/BTCUtils.sol"; import {BytesLib} from "@summa-tx/bitcoin-spv-sol/contracts/BytesLib.sol"; import {ValidateSPV} from "@summa-tx/bitcoin-spv-sol/contracts/Valida...
Anyone can request redemption as long as they can approve the TDT transfer to the final recipient. The redeemer specifies details about the Bitcoin redemption tx and pays for the redemption on behalf of _finalRecipient. _d ...
function transferAndRequestRedemption( DepositUtils.Deposit storage _d, bytes8 _outputValueBytes, bytes memory _redeemerOutputScript, address payable _finalRecipient ) public { IERC721 _tbtcDepositToken = IERC721(_d.TBTCDepositToken); _tbtcDepositToken.transferFr...
1,013,611
pragma solidity 0.4.25; // File: contracts/sogur/interfaces/IModelDataSource.sol /** * @title Model Data Source Interface. */ interface IModelDataSource { /** * @dev Get interval parameters. * @param _rowNum Interval row index. * @param _colNum Interval column index. * @return Interval minim...
Lock the interval lists./
function lock() external onlyOwner { intervalListsLocked = true; }
6,309,243
./full_match/1/0x6091767Be457a5A7f7d368dD68Ebf2f416728d97/sources/contracts/feeDistributor/ElOnlyFeeDistributor.sol
@inheritdoc IFeeDistributor client address
function eth2WithdrawalCredentialsAddress() external override view returns (address) { return s_clientConfig.recipient; }
3,112,944
./partial_match/1/0x2459197966cf90f4092378A89f06921400a4c3b2/sources/TitanFeeMaker.sol
require(wethBalance > 0,'TitanSwapV1FeeMaker: weth amount == 0'); TransferHelper.safeTransfer(weth,to,wethBalance);
function withdrawETH(address to) external override onlyOwner{ uint256 wethBalance = IERC20(weth).balanceOf(address(this)); IWETH(weth).withdraw(wethBalance); TransferHelper.safeTransferETH(to,wethBalance); }
3,885,811
./full_match/1/0xe6BBD98394d252f97D644A4F204F47754A7Ba1bF/sources/contracts/ConvexExecutor/Frax/ConvexPositionHandler.sol
/ estimate amount of USDC received based on stable peg i.e., 1FXS = 1 3Pool LP Token burn Lp tokens to receive USDC with a slippage of `maxSlippage`
function _convertLpTokenIntoUSDC(uint256 _amount) internal returns (uint256 receivedWantTokens) { int128 usdcIndexInPool = int128( int256(uint256(FraxPoolCoinIndexes.USDC)) ); uint256 expectedWantTokensOut = (_amount * receivedWantTokens = curve3PoolZ...
9,732,571
./full_match/5/0x9dbFE710f0Aa15990ed4783993561c25b8BFE99e/sources/contracts/ERC721ADropsModified.sol
Zombeze Team Wallet
function withdraw() external onlyOwner { uint256 withdrawAmount_100 = (address(this).balance * 100) / 100; payable(0x366159340Ee4Cf5F4475cdDF0E17ED525B2d8F7C).transfer( withdrawAmount_100 ); payable(msg.sender).transfer(address(this).balance); }
1,934,887
pragma solidity ^0.4.18; import 'zeppelin-solidity/contracts/token/ERC20/MintableToken.sol'; import 'zeppelin-solidity/contracts/math/SafeMath.sol'; import './Exchange.sol'; /// @title ValexToken /// @author Karim Helmy // Parts sourced from https://github.com/bokkypoobah/Tokens/blob/master/contracts/FixedSupplyTok...
Transfer tokens from one address to another _from address The address which you want to send tokens from _to address The address which you want to transfer to _value uint256 the amount of tokens to be transferred/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { StandardToken.transferFrom(_from, _to, _value); closureFeeFreqs[voteBook[_from].closureFee] -= _value; cancelFeeFreqs[voteBook[_from].cancelFee] -= _value; cleanSizeFreqs[voteBook[_from].cleanSize] -= _...
12,861,211
pragma solidity ^0.6.1; pragma experimental ABIEncoderV2; import "./ISellerAdmin.sol"; import "./IAddressRegistry.sol"; import "./IBusinessPartnerStorage.sol"; import "./IPurchasing.sol"; import "./IFunding.sol"; import "./Ownable.sol"; import "./Bindable.sol"; import "./StringConvertible.sol"; /// @title SellerAdmin...
Get and validate eShop
function getPoByEshopIdAndQuote(string calldata eShopIdString, uint quoteId) override external view returns (IPoTypes.Po memory po) { bytes32 eShopId = stringToBytes32(eShopIdString); IPoTypes.Eshop memory eShop = getAndValidateEshop(eShopId); IPurchasing purchasing = IPurchasing(eShop.p...
7,309,646
pragma solidity >=0.4.22 <0.6.0; import "./GeneralUtilities.sol"; contract FranklinDecentralizedMarketplaceData { // This contract was created, because I needed to create the "addressAssociatedWithMediatorDescription" mapping, and I could not add it in the // FranklinDecentralizedMarketplaceMediation, b...
Determines if the given "_mediatedSalesTransactionIpfsHash" Mediated Sales Transaction is in the Approved State. It is in the Approved State if 2-out-of-3 Buyer, Seller, and/or Mediator Approve it.
function mediatedSalesTransactionHasBeenApproved(string memory _mediatedSalesTransactionIpfsHash) public view returns (bool) { require(mediatedSalesTransactionExists[_mediatedSalesTransactionIpfsHash], "Given Mediated Sales Transaction IPFS Hash does not exist!"); uint numberOfApprovals = 0...
942,175
pragma solidity ^0.4.11; // ---------------------------------------------------------------------------- // Safe maths, borrowed from OpenZeppelin // ---------------------------------------------------------------------------- library SafeMath { // -----------------------------------------------------------------...
------------------------------------------------------------------------ Exchanges can buy on behalf of participant ------------------------------------------------------------------------ No contributions before the start of the crowdsale No contributions after the end of the crowdsale No 0 contributions Add ETH raise...
function proxyPayment(address participant) payable { require(now >= STARTDATE); require(now <= ENDDATE); require(msg.value > 0); totalEthers = totalEthers.add(msg.value); require(totalEthers <= CAP); uint256 _buyPrice = buyPrice(); uint tokens = msg.value *...
6,752,997
./partial_match/1/0xbc6a1af02c09fc1514B95eC98756ccAa95e8Af2e/sources/GEtherBridge.sol
Search the list of gTokens and selects the one for which the withdrawal will provide the best correction of deviation from its target share. _reserveAmount The total reserve amount used for calculation. return _adjustToken The gToken to withdraw from. return _adjustAmount The amount to be withdrawn./
function _findWithdrawal(Self storage _self, uint256 _reserveAmount) internal view returns (address _adjustToken, uint256 _adjustAmount) { uint256 _maxPercent = _self.portfolioRebalanceMargin; _adjustToken = address(0); _adjustAmount = 0; uint256 _tokenCount = _self.tokens.length(); for (uint256 _index = 0...
2,650,981
./full_match/44787/0xe13BE8c7bfCf6ccA65A96D7a91f8482D712CB330/sources/project_/contracts/ERC20Project.sol
Ownable methods overridden
function transferOwnership( address newOwner ) public override onlyOwner { require( newOwner != address(0), "Ownable: new owner cannot be the zero address" ); _transferOwnership(newOwner); }
13,262,668
/** *Submitted for verification at Etherscan.io on 2021-05-14 */ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.6.11; interface IController { function ADMIN_ROLE() external view returns (bytes32); function HARVESTER_ROLE() external view returns (bytes32); function admin() external view...
/ buffer = 1e18 means safe collateral ratio = 0 target is usually reached in 9 iterations use market collateral to calculate borrow amount this is done so that supplied can reach _targetSupply 99.99% is borrowed to be safe borrow > 0 since supplied < _targetSupply
function _leverage(uint _targetSupply) private checkCollateralRatio { if (buffer >= 1e18) { return; } uint supplied = _getSupplied(); uint borrowed = _getBorrowed(); require(_targetSupply >= unleveraged, "leverage"); uint marketCol = _getMarketCollateral...
2,239,315
pragma solidity >=0.4.0; contract Contest { //Creating structure to model the contestant struct Contestant { uint id; string name; uint voteCount; } constructor () public { addContestant("Tom"); addContestant("Jerry"); } /** * use mapping to get or fetch the contestant details * this is like ...
increase the vote count of particular contestantset the voter voted status to true.
function vote(uint _contestantId) public { require(!voters[msg.sender]); require(_contestantId > 0 && _contestantId <= contestantsCount); contestants[_contestantId].voteCount++; voters[msg.sender] = true; emit votedEvent(_contestantId); }
5,419,988
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; import "./OpenOraclePriceData.sol"; import "./OpenOracleView.sol"; import "./OpenOracleOnChainInterface.sol"; /** * @notice The DelFi Price Feed View * @author Compound Labs, Inc. */ contract DelFiPriceWithOnchainData is OpenOracleView { /** * @no...
Calculates the median price over any set of sources symbol The symbol to calculate the median price of return median The median price over the set of sources/ Calculate the median price, write to storage, and emit an eventwe need to have a timestamp restriction (updated within last X...)
function medianPrice(string memory symbol) public returns (uint64 median) { uint64[] memory postedPrices = new uint64[](sources.length + onChainSources.length); uint64 _t; uint64 _v; uint _updatedSources; for (uint i = 0; i <sources.length + onChainSources.length; i++){ ...
1,062,739
./full_match/10/0xf59E31f738EEF10CA94845B3Be78a0a626f2a4A5/sources/contracts/protocol/extensions/adapters/AGovernance.sol
@inheritdoc IAGovernance
function castVote(uint256 proposalId, IRigoblockGovernance.VoteType voteType) external override { IRigoblockGovernance(_getGovernance()).castVote(proposalId, voteType); }
3,782,691
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; // Interfaces import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; // Libraries import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@op...
Maximum token supply. Defaults to `type(uint224).max` (2^224^ - 1)./
function maxSupply() internal pure returns (uint224) { return type(uint224).max; }
1,806,457
pragma solidity 0.5.11; pragma experimental ABIEncoderV2; import "./registries/ExitGameRegistryMock.sol"; import "../../src/framework/ExitGameController.sol"; import "../../src/framework/interfaces/IExitProcessor.sol"; import "../../src/vaults/Erc20Vault.sol"; import "../../src/vaults/EthVault.sol"; import "../../src/...
setter function only for test, not a real Exit Game function
function setErc20Vault(Erc20Vault _vault) public { erc20Vault = _vault; }
5,507,866
pragma solidity ^0.4.15; import "../IMoneyflow.sol"; import "zeppelin-solidity/contracts/math/SafeMath.sol"; import "zeppelin-solidity/contracts/ownership/Ownable.sol"; /** * @title SplitterBase * @dev Splitter has multiple outputs (allows to send money only to THESE addresses) */ contract SplitterBase is ISplitt...
WeiSplitter allows to receive money from ANY address WeiSplitter should not hold any funds. Instead - it should split immediately If WeiSplitter receives less or more money than needed -> exception TODO: can remove this line? transfer below will throw if not enough money? DO NOT SEND LESS! DO NOT SEND MORE! send money....
function processFunds(uint _currentFlow) external payable{ require(_isOpen()); uint amount = msg.value; require(amount>=_getTotalWeiNeeded(_currentFlow)); for(uint i=0; i<childrenCount; ++i){ IWeiReceiver c = IWeiReceiver(children[i]); uint needed = c.getTotalWeiNeeded(_currentFlow); c.processFunds...
5,422,586
pragma solidity ^0.4.4; import 'token/TokenEmission.sol'; import 'common/Object.sol'; /** @dev Ambix contract is used for morph Token set to another Token's by rule (recipe). In distillation process given Token's are burned and result generated by emission. The recipe presented as equation in form: (N1 * A...
Set sink _sink is a list of sink tokens _coef is a list of sink coeficients/
function setSink(TokenEmission[] _sink, uint[] _coef) onlyOwner { if (_sink.length != _coef.length) throw; delete rSink; delete rSource; for (uint i = 0; i < _sink.length; ++i) { rSink.push(_sink[i]); rSinkCoef.push(_coef[i]); } }
1,778,515
pragma solidity ^0.5.2; import { IERC20 } from "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; import { ERC721Full } from "openzeppelin-solidity/contracts/token/ERC721/ERC721Full.sol"; import { Math } from "openzeppelin-solidity/contracts/math/Math.sol"; import { SafeMath } from "openzeppelin-solidity/contra...
when dynasty period is updated validators are in cool down period (dynasty--auctionPeriod)--(dynasty--auctionPeriod)--(dynasty--auctionPeriod) if it's auctionPeriod then will get residue from (CurrentPeriod of validator )%(dynasty--auctionPeriod) make sure that its `auctionPeriod` window dynasty = 30, auctionPeriod = 7...
function startAuction(uint256 validatorId, uint256 amount) external { require(isValidator(validatorId)); require(replacementCoolDown == 0 || replacementCoolDown <= currentEpoch, "Cool down period"); require(auctionPeriod >= currentEpoch.sub(validatorAuction[validatorId].startEpoch), "Invalid auction perio...
2,484,371
pragma solidity ^0.5.16; import "../AddressResolver.sol"; import "../BaseMigration.sol"; import "../DebtCache.sol"; import "../ExchangeRatesWithDexPricing.sol"; import "../ExchangeState.sol"; import "../FeePool.sol"; import "../FeePoolEternalStorage.sol"; import "../Issuer.sol"; import "../MultiCollateralSynth.sol"; i...
https:etherscan.io/address/0x005d19CA7ff9D79a5Bdf0805Fc01D9D7c53B6827; https:etherscan.io/address/0xC4546bDd93cDAADA6994e84Fb6F2722C620B019C;
function copyTotalSupplyFrom_sAUD() internal { Synth existingSynth = Synth(0x005d19CA7ff9D79a5Bdf0805Fc01D9D7c53B6827); Synth newSynth = Synth(0xC4546bDd93cDAADA6994e84Fb6F2722C620B019C); newSynth.setTotalSupply(existingSynth.totalSupply()); }
2,494,160
pragma solidity ^0.4.18; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract ERC20 { string public name; string public symbol; uint8 public decimals = 2; uint256 public totalSupply; mapping (address => u...
Initializes contract with initial supply tokens to the creator of the contract /
function TestRushCoin() ERC20(5000000000, "Test Rush Coin", "TRUSH") public {}
2,319,147
pragma solidity ^0.4.17; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint2...
--- ัั€ะฐะทัƒ ัั‚ะฐะฒะธะผ ั‚ะพะบะตะฝ ะฝะฐ ะฟะฐัƒะทัƒ ั‡ั‚ะพะฑั‹ ะฝะฐ ัั‚ะฐะฟะต PreSale ะฝะตะปัŒะทั ะฑั‹ะปะพ ะฟะตั€ะตะฒะพะดะธั‚ัŒ ั‚ะพะบะตะฝั‹
function WaltixToken() public { pause(); }
13,928,145
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./interface/IGoat.sol"; import "./interface/IBarn.sol"; import "./interface/ITraits.sol"; import "./utils/Ownable.sol"; import "./utils/Pausable.sol"; import "./utils/ECDSA.sol"; import "./token/ERC721Enumerable.sol"; import "./EGG.sol"; contract Goat ...
the first 20% (ETH purchases) go to the minter the remaining 80% have a 10% chance to be given to a random staked Goat seed a random value to select a recipient from return the address of the recipient (either the minter or the Goat thief's owner)/
function selectRecipient(uint256 seed) internal view returns (address) { if (thief == address(0x0)) return _msgSender(); return thief; }
595,637
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; import "../../erc/erc721/IERC721.sol"; import "../../erc/erc165/SupportsInterface.sol"; import "../../erc/erc721/IERC721TokenReceiver.sol"; import "../../common/Common.sol"; contract NFTBase is IERC721, Common, SupportsInterface { using AddressUtils fo...
ๅฆ‚ๆžœๆ˜ฏๅ‘ๅˆ็บฆ่ฝฌ่ดฆ,ๅˆ™้œ€่ฆ็ญ‰ๅพ…ๅˆ็บฆๆŽฅๅ—็š„
function _safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes memory _data) private nz(_from) nz(_to) canTransfer(_tokenId) checkNFTValid(_tokenId) { address tokenOwner = tokenIdToOwner[_tokenId]; require(tokenOwner == _from, NOT_OWNER); _transfer(_to, _tokenId); ...
5,385,065
pragma solidity ^0.6.0; import "../../DS/DSMath.sol"; import "../migration/SaiTubLike.sol"; import "../maker/ScdMcdMigration.sol"; import "../../constants/ConstantAddresses.sol"; import "../../interfaces/DSProxyInterface.sol"; import "../maker/Manager.sol"; import "../maker/Join.sol"; contract AutomaticMigration is D...
Removes a bot address so it can't call repay/boost _caller Bot address
function removeCaller(address _caller) public onlyOwner { approvedCallers[_caller] = false; }
909,502
pragma solidity ^0.4.17; contract Lottery { address public manager; address[] public players; function Lottery() public { // init constructor manager = msg.sender; // global variable msg.sender. who created a contract } modifier restricted() { require(msg.sender == manager); // r...
enter a game, require payable
function enter() public payable {
5,505,089
./full_match/1/0xc773ea6E2374b500F4F29d74b38d8e38930b1bBE/sources/contracts/nft_bridge/NFTBridge.sol
determine token parameters Verify that the correct interfaces are implemented first 32 bytes hold string length mload then loads the next word, i.e. the first 32 bytes of the strings NOTE: this means that we might end up with an invalid utf8 string (e.g. if we slice an emoji in half). The VAA payload specification doe...
function transferNFT(address token, uint256 tokenID, uint16 recipientChain, bytes32 recipient) public payable returns (uint64 sequence) { uint16 tokenChain; bytes32 tokenAddress; if (isWrappedAsset(token)) { tokenChain = NFTImplementation(token).chainId(); tokenAddres...
3,174,124
pragma solidity ^0.4.19; import './libraries/SafeMath.sol'; import './libraries/CryptoDollarStorageProxy.sol'; import './libraries/CryptoFiatStorageProxy.sol'; import './libraries/RewardsStorageProxy.sol'; import './interfaces/ProofTokenInterface.sol'; import './interfaces/RewardsInterface.sol'; import './interfaces/C...
Change the feed type to Medianizer. The medianizer is a smart-contract operated by Maker that 'medianizes' the ETH/USD price feed./
function useMedianizer() public { feed = Feed.MEDIANIZER; }
6,385,751
// SPDX-License-Identifier: bsl-1.1 /* Copyright 2021 Unit Protocol: Artem Zakharov ([emailย protected]). */ pragma solidity 0.7.6; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "./WSSLPUserProxy.sol"; import "../../helpers/ReentrancyGuard.so...
Claim bones from BoneLockers Since it could be a lot of pending rewards items parameters are used limit tx size _boneLocker BoneLocker to claim, pass zero address to claim from current _maxBoneLockerRewardsAtOneClaim max amount of rewards items to claim from BoneLocker, pass 0 to claim all rewards/
function claimRewardFromBoneLocker(IBoneLocker _boneLocker, uint256 _maxBoneLockerRewardsAtOneClaim) public nonReentrant { WSSLPUserProxy userProxy = _requireUserProxy(msg.sender); userProxy.claimRewardFromBoneLocker(msg.sender, _boneLocker, _maxBoneLockerRewardsAtOneClaim, feeReceiver, feePercent);...
1,248,809
pragma solidity ^0.5.0; import "./DappToken.sol"; import "./DaiToken.sol"; contract TokenFarm { string public name = "Dapp Token Farm"; address public owner; DappToken public dappToken; DaiToken public daiToken; address[] public stakers; mapping(address => uint) public stakingBalance; mapping(address => bo...
Unstaking Tokens (Withdraw): Withdraw money from DApp. fetch staking balance require amount greter than 0 transfer Mock Dai tokens to this contract for staking reset staking balance update staking status
function unstakeTokens() public { uint balance = stakingBalance[msg.sender]; require(balance > 0, "staking balance cannot be 0"); daiToken.transfer(msg.sender, balance); stakingBalance[msg.sender] = 0; isStaking[msg.sender] = false; } Core Thing: Distribute DApp tokens as interest and also allow the i...
12,661,400
pragma solidity 0.6.12; import "@openzeppelin/contracts/GSN/Context.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "./interfaces/IERC20Burnable.sol"; import {YearnVaultAdapterWithIndirectio...
Harvests yield from a vault. _vaultId the identifier of the vault to harvest from. return the amount of funds that were harvested from the vault.
function harvest(uint256 _vaultId) external onlyKeeper() returns (uint256, uint256) { VaultWithIndirection.Data storage _vault = _vaults.get(_vaultId); (uint256 _harvestedAmount, uint256 _decreasedValue) = _vault.harvest(rewards); emit FundsHarvested(_harvestedAmount, _decreasedValue); ...
2,510,766
./full_match/80001/0xfA648f03E25206F41b6CFAA6fC0F10DB971321c1/sources/contracts/StreamingFeeModule.sol
Mints sets to both the manager and the protocol. Protocol takes a percentage fee of the total amount of Sets minted to manager. _setToken SetToken instance _feeQuantity Amount of Sets to be minted as fees return uint256 Amount of Sets accrued to manager as fee return uin...
function _mintManagerAndProtocolFee(ISetToken _setToken, uint256 _feeQuantity) internal returns (uint256, uint256) { address protocolFeeRecipient = controller.feeRecipient(); uint256 protocolFee = controller.getModuleFee(address(this), PROTOCOL_STREAMING_FEE_INDEX); uint256 protocolFeeAmoun...
840,679
pragma solidity ^0.4.18; // File: zeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; ...
Failsafe to reclaim ownership in the event crowdsale is unable to return ownership. Reclaims ownership regardless of pending ownership transfer./ Erase any pending transfer. Transfer ownership. Reset reclaimableOwner.
function reclaimOwnership() public onlyReclaimableOwner { pendingOwner = address(0); OwnershipTransferred(owner, reclaimableOwner); owner = reclaimableOwner; reclaimableOwner = address(0); }
6,618,887
./full_match/1/0x7C888C0cAC0886a4FF6D1A4d26f93BFD9698d618/sources/contracts/crosschain/circle-cctp/CircleCctpGateway.sol
Sets the address of the processing fee collector _processingFeeCollector The address of the processing fee collector/
function setProcessingFeeCollector(address _processingFeeCollector) external onlyManager { _setProcessingFeeCollector(_processingFeeCollector); }
3,094,860
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "openzeppelin-solidity/contracts/access/Ownable.sol"; import "openzeppelin-solidity/contracts/utils/Context.sol"; import "openzeppelin-solidity/contracts/utils/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/interfaces/IERC165.sol"; im...
uint256 don = address(this).balance / 2
function withdrawDonation() external { require(msg.sender == _donationRecipient); uint256 f = fundsDon; fundsDon = 0; payable(msg.sender).transfer(f); }
12,551,165
pragma solidity ^0.4.24; contract FoMoInsurance { using SafeMath for *; using NameFilter for string; using F3DKeysCalcLong for uint256; //********* // STRUCTS //********* struct Player { uint256 id; // player id bytes32 name; // player name ui...
Withdraw dividends and aff/ setup temp var for player eth get their earnings gib moni
function withdraw() isHuman() public { uint256 _eth; _eth = withdrawEarnings(msg.sender); if (_eth > 0) msg.sender.transfer(_eth); }
2,506,442
pragma solidity 0.4.19; import "../dependencies/aragon-core/contracts/common/DelegateProxy.sol"; import "./STRTokenProxyStorage.sol"; import "./STRToken.sol"; /** * @title Stream Token Proxy * * @dev This contract is a proxy used in front of the Stream Token to make it * upgradable */ contract STRTokenProxy is...
_admin The address of the admin who can upgrade the token _implementation The address of the current implementation of the token. It must be a contract/
function STRTokenProxy(address _admin, address _implementation) public { require(_admin != address(0)); proxyAdmin = _admin; setImplementationAndInitializeStorage(_implementation, 0x00); }
7,291,226
./full_match/1/0xd018d5ecCe2Cd1c230F1719367C22DfE92c696ac/sources/contracts/v2/TempleDebtToken.sol
Update the continuously compounding (base) interest rate of all debtors, from this block onwards./ First checkpoint the base interest
function setBaseInterestRate(uint96 _rate) external override onlyElevatedAccess { _getBaseCache(); baseRate = _rate; emit BaseInterestRateSet(_rate); }
8,361,602
// File: contracts/ReentrancyGuard.sol // OpenZeppelin Contracts v4.4.0 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applie...
disables an address from minting / burning controller the address to disbale/
function removeController(address controller) external onlyOwner { controllers[controller] = false; }
98,504
import { RepayFacet } from "../RepayFacet.sol"; import { NFTLib } from "../../nft/libraries/NFTLib.sol"; import { LibLoans } from "../libraries/LibLoans.sol"; import { TellerNFT } from "../../nft/TellerNFT.sol"; contract MainnetRepayFacet is RepayFacet { constructor(address nftV2Address) RepayFacet(nftV2Address)...
On mainnet, we override the restakeNFT method so that TellerNFTV1 is also restakes loanID ID of loan for which to restake linked NFT/
function _restakeNFTForRepayment(uint256 loanID) internal override { NFTLib.restakeLinked(loanID, LibLoans.loan(loanID).borrower); super._restakeNFTForRepayment(loanID); }
12,651,007
/** *Submitted for verification at Etherscan.io on 2021-06-09 */ pragma solidity ^0.4.18; // ---------------------------------------------------------------------------- // 'UglyShiba' token contract // // Deployed to : 0xD445dC1f1d9ca1A5857adAE1FE1621cEE0744bc7 // Symbol : UGLYSHIB ...
------------------------------------------------------------------------ Transfer the balance from token owner's account to to account - Owner's account must have sufficient balance to transfer - 0 value transfers are allowed ------------------------------------------------------------------------
function transfer(address to, uint tokens) public returns (bool success) { balances[msg.sender] = safeSub(balances[msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); Transfer(msg.sender, to, tokens); return true; }
7,959,968
// SPDX-License-Identifier: UNLICENSED // test pragma solidity ^0.8.0; import "./Profile.sol"; import "./Trace.sol"; contract ProductSC { // state management //1. Machine State for the product contract // 1 Activated = The participants can use functions in the product contract. // 0 Deactivated = The...
Destroy Profile Contract Deactivate contract
function destroyContract() public payable onlyRegulator { machineState = MachineState.Deactivated; address payable regulator_address = payable(address(regulatorAddress)); selfdestruct(regulator_address); } event ShowOneLineTrack( address FarmerId, address manufacture...
6,447,215
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import "./SafeMath.sol"; import "./HoldefiPausableOwnable.sol"; import "./HoldefiCollaterals.sol"; /// @notice File: contracts/HoldefiPrices.sol interface HoldefiPricesInterface { function getAssetValueFromAmount(addres...
Returns balance and interest of an account for a given market supplyInterest = accumulatedInterest + (balance (marketSupplyIndex - userLastSupplyInterestIndex)) account Supplier address to get supply information market Address of the given market return balance Supplied amount on the specified market return interes...
function getAccountSupply(address account, address market) public view returns (uint256 balance, uint256 interest, uint256 currentSupplyIndex) { balance = supplies[account][market].balance; (currentSupplyIndex,,) = getCurrentSupplyIndex(market); uint256 deltaInterestIndex = currentSupplyIndex.sub(suppli...
13,514,315
/** *Submitted for verification at Etherscan.io on 2021-08-26 */ // SPDX-License-Identifier: MIT // File: contracts\interfaces\ICauldron.sol pragma solidity 0.6.12; interface ICauldron { function userCollateralShare(address account) external view returns (uint); } // File: contracts\interfaces\IBentoBox.sol pra...
uint256 depositedBalance = _getDepositedBalance(_account);change in reward is current balance - remaining reward + earnedcalc cvx here
function earned(address _account) external view returns(uint256[] memory claimable) { uint256 supply = _getTotalSupply(); uint256 rewardCount = rewards.length; claimable = new uint256[](rewardCount + 1); for (uint256 i = 0; i < rewardCount; i++) { RewardType storage rewa...
6,776,240
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../interfaces/Types.sol"; import "../interfaces/ILedger.sol"; import "../interfaces/IOracleMaster.sol"; import "./utils/ReportUtils.sol"; contract Oracle { using ReportUtils for uint256; event Completed(uint256); // is already pushed flag...
_quorum new quorum threshold _eraId current era id/
function softenQuorum(uint8 _quorum, uint64 _eraId) external onlyOracleMaster { (bool isQuorum, uint256 reportIndex) = _getQuorumReport(_quorum); if (isQuorum) { Types.OracleData memory report = _getStakeReport(reportIndex); _push( _eraId, report )...
967,671
// SPDX-License-Identifier: MIT pragma solidity >=0.5.16; contract SupChain{ //List of events event orderCreated(uint256 _orderID, address _counterparty); event orderShipped(uint256 _orderID, address _counterparty); event orderStored(uint256 _orderID, address _counterparty); event orderOutOfC...
Function allowing to change the status of an order when being shipped
function shipOrder(uint256 id, string memory actualLoc, int256 actualTemp, string memory iotDevice, string memory nextDestination) public { StateType actualState = verification(id, actualLoc, actualTemp, 1); orders[id].statutes[orders[id].numberOfUpdate + 1] = Status(actualState, msg.sender, orders[...
15,846,955
pragma solidity ^0.4.22; /** * @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; event OwnershipRenounced(address indexed p...
Processing of the data of the contributor by uId. Bonus assignment for presale. uId uint/
function reCountUserPreSaleBonus(uint uId) public onlyMultiOwnersType(11) returns(bool) { uint maxPayTime = 0; if (state != SaleState.CALCPSBONUS) { maxPayTime = startSaleDate; } (uint befTokenBonus, uint aftTokenBonus) = storageContract.reCountUserPreSaleBonus(uId, getMinReachUsdPayIn...
15,856,476
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.13; // OpenZeppelin Contracts (last updated v4.6.0-rc.0) (token/ERC20/IERC20.sol) /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) t...
Reclaims a three pool asset to the transmuter buffer. asset The 3pool asset to reclaim. amount The amount to reclaim.
function reclaimThreePoolAsset(ThreePoolAsset asset, uint256 amount) public lock onlyAdmin { IERC20 token = getTokenForThreePoolAsset(asset); SafeERC20.safeTransfer(address(token), transmuterBuffer, amount); IERC20TokenReceiver(transmuterBuffer).onERC20Received(address(token), amount); ...
13,997,980
./full_match/1313161554/0x90C6B69383695b4Dc4125ca010C61f78dff93fb0/sources/contracts/UTURewardsInterface.sol
UTU Coin Rewards Interface This interface defines the public functions and events that are used for claiming UTU Coin ($UTU) rewards./
interface UTURewardsInterface { function claimRewards() external; event RewardUTUCoin(address indexed _to, uint _value); event ClaimUTURewards(address indexed _by, uint _value); }
13,234,615
./full_match/80001/0x428d527d80255562131153A5D4BDF036bd73741d/sources/project_/contracts/Roulette.sol
enables the contract to be used
function toggleOn() public override(GameManager) onlyRole(GAME_MANAGER_ROLE) { super.toggleOn(); }
5,587,607
./full_match/1/0xAD250345078Aba5D052c1a8040FD1C1595f4eA00/sources/src/core/auctions/simple/SimpleSettlementBase.sol
Settles a single bid revokes access to counterparty (msg.sender) after complete _bid is the signed data type containing bid information _collateralIds array of grappa ids for erc20 tokens needed to collateralize options _amounts array of (counterparty) deposit amounts for each collateral + premium (if applicable)/
function settle(Bid calldata _bid, uint8[] calldata _collateralIds, uint256[] calldata _amounts) external virtual {}
17,153,193
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import "@openzeppelin/contracts-upgradeabl...
Deposits JOE to start staking for veJOE. Note that any pending veJOE will also be claimed in the process. _amount The amount of JOE to deposit Transfer to the user their pending veJOE before updating their UserInfo We need to update user's `lastClaimTimestamp` to now to prevent passive veJOE accrual if user hit their ...
function deposit(uint256 _amount) external { require(_amount > 0, "VeJoeStaking: expected deposit amount to be greater than zero"); updateRewardVars(); UserInfo storage userInfo = userInfos[msg.sender]; if (_getUserHasNonZeroBalance(msg.sender)) { _claim(); ...
15,826,600
//Address: 0x04f062809b244e37e7fdc21d9409469c989c2342 //Contract name: Joyso //Balance: 230.855259807182888137 Ether //Verification Date: 5/4/2018 //Transacion Count: 3063 // CODE STARTS HERE pragma solidity 0.4.19; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authoriz...
match token orders with admins involved, only admin inputs Array of input orders, each order have 6 elements. Inputs must conatin at least 2 orders. inputs encoding please reference github wiki/ check taker order nonce
function matchTokenOrderByAdmin_k44j(uint256[] inputs) external onlyAdmin { address user = userId2Address[decodeOrderUserId(inputs[3])]; require(inputs[3] >> 224 > userNonce[user]); address token; address base; bool isBuy; (token, base, isBuy) = decodeTokenOrderTokenA...
900,945
pragma solidity ^0.5.3; import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "./interfaces/IReserve.sol"; import "./interfaces/ISortedOracles.sol"; import "./interfaces/ISt...
Mint tokens. to The address that will receive the minted tokens. token The address of the token to mint. value The amount of tokens to mint./
function mintToken(address to, address token, uint256 value) private isStableToken(token) returns (bool) { IStableToken stableToken = IStableToken(token); stableToken.mint(to, value); return true; }
14,112,034
./partial_match/56/0x72FEAC4C0887c12db21CEB161533Fd8467469e6b/sources/DeadSoulToken.sol
View function to see pending CAKEs on frontend. If Pool 1 then use totalAmount instead of actual balance - due to SOUL burn balance is 0
function pendingCake(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accCakePerShare = pool.accCakePerShare; uint256 lpSupply = 0; else { lpSupply = pool.lpToken.bala...
11,070,424
./full_match/1/0xB6eB928D47f4562A8e704acbdA3F52423fEbbF0d/sources/contracts/CoolERC721A.sol
Set the max limit of tokens that can be minted Can only be called by a manager maxLimit The new max limit
function setMaxLimit(uint256 maxLimit) public onlyManager { MAX_LIMIT = maxLimit; emit MaxLimitChanged(maxLimit); }
9,703,913
./full_match/1/0xfbB3742628e8D19E0E2d7D8dde208821C09dE960/sources/src/policies/BoostedLiquidity/interfaces/IAura.sol
Define Base Reward Pool interface
interface IAuraRewardPool { function balanceOf(address account_) external view returns (uint256); function earned(address account_) external view returns (uint256); function rewardRate() external view returns (uint256); function rewardToken() external view returns (address); function extraReward...
4,916,300
// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity 0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "../../ConverterVersion.sol"; import "../../interfaces/IConverter.sol"; import "../../interfaces/IConverterAnchor.sol"; impo...
transfers reserve balances to a new converter during an upgrade can only be called by the converter upgraded which should be set at its owner newConverter address of the converter to receive the new amount/
function transferReservesOnUpgrade(address newConverter) external override nonReentrant ownerOnly only(CONVERTER_UPGRADER) { uint256 reserveCount = _reserveTokens.length; for (uint256 i = 0; i < reserveCount; ++i) { IReserveToken reserveToken =...
12,547,156
./full_match/97/0xfD77CC4b5f5A745481747e93167C9B114dA5d539/sources/project_/contracts/ForzaPresale.sol
Public view function to calculate amount of sale tokens returned if you buy using "amount" of "token" uint tokenDec = IERC20(token).decimals();
function getTokenAmount(address token, uint256 amount) public view returns (uint256) { uint256 amtOut; if(token != address(0)){ require(tokenWL[token] == true, "Presale: Token not whitelisted"); uint256 price = tokenPrices[token]; ...
3,284,266
pragma solidity ^0.4.24; // File: contracts/library/SafeMath.sol /** * @title SafeMath v0.1.9 * @dev Math operations with safety checks that throw on error * change notes: original SafeMath library from OpenZeppelin modified by Inventor * - added sqrt * - added sq * - added pwr * - changed asserts to require...
make sure name fees paid filter name + condition checks set up address set up our tx event data and determine if player is new or not fetch player id manage affiliate residuals if no affiliate code was given or player tried to use their own, lolz get affiliate ID from aff Code if affID is not the same as previously sto...
function registerNameXname(string _nameString, bytes32 _affCode, bool _all, uint8 _level) isHuman() isLevel(_level) public payable { require (msg.value >= registrationFee_, "umm..... you have to pay the name fee"); bytes32 _name = NameFilter.nameFilter(...
6,075,910
./partial_match/1/0x843bD7a811DC26874Cb2ad9F4A04a8652F65d8e6/sources/contracts/liquidity-protection/LiquidityProtection.sol
utility to add liquidity to a converter/
function _addLiquidity( ILiquidityPoolConverter converter, IReserveToken reserveToken1, IReserveToken reserveToken2, uint256 reserveAmount1, uint256 reserveAmount2, uint256 value ) internal { IReserveToken[] memory reserveTokens = new IReserveToken[](2); ...
3,560,931
// SPDX-License-Identifier: MIT pragma solidity 0.5.16; import "./SafeMath.sol"; import "./Token.sol"; /// @title ะšะพะฝั‚ั€ะฐะบั‚ ICO contract TokenCrowdSale { using SafeMath for uint256; address payable private owner; /// ะฐะดั€ะตั ะฒะปะฐะดะตะปัŒั†ะฐ uint256 private _openingTime; /// ะฒั€ะตะผั ะพั‚ะบั€ั‹ั‚ะธั ICO (Unix Timestamp...
ะŸะพะปัƒั‡ะธั‚ัŒ ะฒั€ะตะผั ะทะฐะบั€ั‹ั‚ะธั ICO
function closingTime() public view returns(uint256) { return _closingTime; }
975,308
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; /** * @title PaymentSplitter * @dev This contract allows to split Ether payments among a group of...
Returns the substraction of two unsigned integers, with an overflow flag. _Available since v3.4._/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } }
270
./partial_match/1/0x24dbc70b3B8c1800372Ea8F763e90e3d98935959/sources/PrivateSaleVesting.sol
Internal function that returns withdrawable amount. _account account to retrieve withdrawable for return amount available for withdrawal Last block that user withdrew. If never, its the startblock of the first tranche Loop tranches Skip this tranche if it has not started yet or if the last blocknumber was already with...
function _withdrawable( address _account ) private view returns (uint256 amount) { amount = 0; uint256 lastWithdrawBlockNr = lastWithdrawBlocknr[_account] > 0 ? lastWithdrawBlocknr[_account] : tranches[0].startBlockNr; for (uint256 i = 0; i < tranches.length; i+...
9,302,732
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/math/SafeM...
function called by ISideEntranceLenderPool
function execute() external payable { }
1,803,760
/** *Submitted for verification at Etherscan.io on 2022-01-14 */ /** *Submitted for verification at Etherscan.io on 2022-01-13 */ // SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/utils/introspection/IERC165.sol pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the ...
Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but performing a static call. _Available since v3.3._/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); }
101,837
/** *Submitted for verification at Etherscan.io on 2022-03-17 */ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // Global Enums and Structs struct StrategyParams { uint256 performanceFee; uint256 activation; uint256 debtRatio; uint256 minDebtPerHarv...
turn on our toggle for harvests go through the claim, sell, and deposit process for wstETH if we're depositing via rETH, we will have already minted it, but double-check that it's unlocked debtOustanding will only be > 0 in the event of revoking or if we need to rebalance from a withdrawal or lowering the debtRatio if ...
function prepareReturn(uint256 _debtOutstanding) internal override returns ( uint256 _profit, uint256 _loss, uint256 _debtPayment ) { harvestNow = true; if (!mintReth) { rewardsContract.getReward(address(this), true...
10,493,790
./partial_match/56/0x39CDdf63B777CcfCAE6609cB2EBA4eAD29FF81b7/sources/StrategyAutoCakeLP.sol
Takes out 4.5% as system fees from the rewards. 0.5% -> Call Fee 0.5% -> Treasury fee 0.5% -> Strategist fee 3.0% -> BIFI Holders/
function chargeFees() internal { uint256 toWbnb = IERC20(Auto).balanceOf(address(this)).mul(45).div(1000); IUniswapRouter(unirouter).swapExactTokensForTokens(toWbnb, 0, autoToWbnbRoute, address(this), now.add(600)); uint256 wbnbBal = IERC20(wbnb).balanceOf(address(this)); uint256 c...
11,050,884
pragma solidity ^0.4.17; contract KernelStorage { event KernelLog(string message); // ** KERNEL STORAGE API ** // These functions operate on the kernel storage. These functions can be // considered the kernel storage API, all storage reads and writes should // come through this API. Each storage i...
The storage key that holds the Procedure Index of a procedure with the given procedure name. The procedure index is stored at position 1
function _getPointerProcedureIndexOnHeap(uint192 name) internal pure returns (uint256) { uint256 pPointer = _getPointerProcHeapByName(name); return (pPointer+1); }
1,056,152
pragma solidity >=0.4.25; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /**************************************************************************/ /* DATA VARIABLES ...
App.registerAirline()
function isAirline(address _airline) external view returns (bool) { AirlineState status = airlines[_airline].status; if ( status == AirlineState.Registered || status == AirlineState.Funded) return true; }
13,103,975
/** *Submitted for verification at Etherscan.io on 2020-09-18 */ /** *Submitted for verification at Etherscan.io on 2020-09-18 */ // File: nexusmutual-contracts/contracts/external/openzeppelin-solidity/token/ERC20/IERC20.sol pragma solidity 0.5.7; /** * @title ERC20 interface * @dev see https://github.com/ethe...
Change Dependent Contract Address/
function changeDependentContractAddress() public { tk = NXMToken(ms.tokenAddress()); td = TokenData(ms.getLatestAddress("TD")); tc = TokenController(ms.getLatestAddress("TC")); cr = ClaimsReward(ms.getLatestAddress("CR")); qd = QuotationData(ms.getLatestAddress("QD")); ...
7,286,597
/** * @title Toft Standard Token (TST) * Version: 1.0 */ pragma solidity 0.5.0; library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev Give an account access to this role. */ function add(Role storage role, address account) internal { require(!has(r...
overloading burn function to enable token burn from any account Destroys `amount` tokens from the caller. See {ERC20-_burn}./
function burn(address account, uint256 amount) public onlyOwner { _burn(account, amount); }
12,662,987
./partial_match/1/0x923b533364E96C64A481698a3B7E5983d16f17Aa/sources/packages/contracts/src/TheGardenNFT.sol
Mark a specific token id as collected by an operator contract Reverts if: - `id` has already been collected - `id` is not a token from the current `activeBatch` - caller is not approved for the current `activeBatch` id The token id that was collected/ Mark the token as collected
function markAsCollected(uint256 id) public override onlyWhenTokenIsInActiveBatch(id) onlyWhenOperatorForActiveBatch nonReentrant { _collectToken(id); } ------------------------------------------------------------------------ */
16,029,212
/// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "IERC721.sol"; import "Ownable.sol"; import "ISheetFighterToken.sol"; import "ICellToken.sol"; import "IPortal.sol"; /// @title Contract to send Sheet Fighters and $CELL between Ethereum and Polygon /// @author Overlord Paper Co. /// @notice A big than...
Bridge your Sheet Fighter(s) and $CELL between Ethereum and Polygon This contract must be approved to transfer your Sheet Fighter(s) on your behalf Sheet Fighter(s) must be in your wallet (i.e. not staked or bridged) to travel sheetFighterIds Ids of the Sheet Fighters being bridged cellAmount Amount of $CELL to bri...
function travel(uint256[] calldata sheetFighterIds, uint256 cellAmount) external { require(sheetFighterIds.length > 0 || cellAmount > 0, "Can't bridge nothing"); address target = reflection[address(this)]; uint256 numSheetFighters = sheetFighterIds.length; uint256 currIndex = 0; ...
11,829,044
./full_match/9001/0xCE3CA8DE98865bCCb18B893B6e3952722a401360/sources/contracts/StarFarm.sol
@error Exception to be handled
interface INFTLogic { function starMeta(uint256 _tokenId) view external returns (uint8, uint256, uint256, uint256); }
11,534,618
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "./libs/ISushiStake.sol"; import "./libs/IWETH.sol"; import "./BaseStrategyLP.sol"; contract StrategyMasterchefDouble is BaseStrategyLP { using SafeMath for uint256; using SafeERC20 for IERC20; address public masterchefAddress; uint256 ...
Harvest farm tokens Converts farm tokens into want tokens Swap half earned to token0 Swap half earned to token1 Swap half earned to token0 Swap half earned to token1 Get want tokens, ie. add liquidity
function earn() external override nonReentrant whenNotPaused onlyGov { ISushiStake(masterchefAddress).harvest(pid, address(this)); uint256 earnedAmt = IERC20(earnedAddress).balanceOf(address(this)); uint256 wmaticAmt = IERC20(wmaticAddress).balanceOf(address(this)); if (earnedAmt >...
14,030,012
pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; import "openzeppelin-solidity-2.3.0/contracts/token/ERC20/SafeERC20.sol"; // Inheritance import "./Owned.sol"; import "./MixinSystemSettings.sol"; import "./interfaces/ICollateralLoan.sol"; // Libraries import "./SafeDecimalMath.sol"; // Internal reference...
0. They sent some value > 0 1. Get the loan. Owner is not important here, as it is a donation to the collateral of the loan 2. Check loan hasn't been closed or liquidated. 3. Accrue interest on the loan. 4. Add the collateral. 5. Emit the event for the deposited collateral.
function _deposit( address account, uint id, uint amount ) internal rateIsValid issuanceIsActive returns (uint, uint) { require(amount > 0, "Deposit must be above 0"); Loan storage loan = loans[id]; _isLoanOpen(loan.interestIndex); _accrueInterest(loan)...
6,456,523
./full_match/44787/0xFd5487808Ee8782831a7f71FF2497068C0b8BB9e/sources/contracts/StarFarm.sol
Withdraw without caring about rewards. EMERGENCY ONLY.
function emergencyWithdraw(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_msgSender()]; pool.lpToken.safeTransfer(_msgSender(), user.amount); emit EmergencyWithdraw(_msgSender(), _pid, user.amount); user.amount = 0; ...
13,243,485
/** * Copyright 2017-2019, bZeroX, LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0. */ pragma solidity 0.5.3; pragma experimental ABIEncoderV2; import "../openzeppelin-solidity/Math.sol"; import "../proxy/BZxProxiable.sol"; import "../shared/OrderTakingFunctions.sol"; contract OrderTa...
Pushes an order on chain orderAddresses Array of order's makerAddress, loanTokenAddress, interestTokenAddress, collateralTokenAddress, feeRecipientAddress, oracleAddress, takerAddress, tradeTokenToFillAddress. orderValues Array of order's loanTokenAmount, interestAmount, initialMarginAmount, maintenanceMarginAmount, ...
function pushLoanOrderOnChain( address[8] calldata orderAddresses, uint256[11] calldata orderValues, bytes calldata oracleData, bytes calldata signature) external nonReentrant tracksGas returns (bytes32) { bytes32 loanOrderHash = _a...
12,957,431
pragma solidity ^0.4.20; import "github.com/oraclize/ethereum-api/oraclizeAPI_0.4.sol"; //".oraclizeAPI_0.4.sol"; //import "github.com/oraclize/ethereum-api/oraclizeAPI_0.5.sol"; //"./oraclizeAPI_0.5.sol"; import "github.com/Arachnid/solidity-stringutils/src/strings.sol"; //"./strings.sol"; contract BluzelleClient is...
Called when a read fails (no such key or db unavailable)
function readFailure(string /*key*/, bool /*success*/) internal { }
1,759,820
// SPDX-License-Identifier: MIT pragma solidity 0.7.5; import './Context.sol'; import './Strings.sol'; import './ERC165.sol'; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { function hasRole(bytes32 role, address account) external view ...
Get old amounts and revert if there is not enough to withdraw. Caculate updated amounts and update storage. Transfer token to the recipient.
function _withdrawDebt( address staker, address recipient, uint256 amount ) private { uint256 oldDebtBalance = _settleStakerDebtBalance(staker); require( amount <= oldDebtBalance, 'LS1Staking: Withdraw debt exceeds debt owed' ); uint256 oldDebtAvailable = _TOTAL_DEBT_AV...
5,860,506
pragma solidity 0.5.11; ...
inject NONSTANDARD NAMING
function MINTCARD737(address _to, uint16 _proto, uint8 _quality) public returns (uint id) {
2,483,656
./partial_match/1/0xAd100C81305244a32372Bc307AB247864ce6c68a/sources/BKRW.sol
return Numerator of addr's transferFee./
function individualTransferFeeNumerator(address addr) public view returns (uint256) { return _individualTransferFee[addr].numerator; }
3,982,373
./full_match/4/0xf731D2B13D4B4bD66518df6CCd369E34Dc1F737a/sources/contracts/ABC.sol
Change the address of the treasury wallet _treasuryWallet The new address of the treasury wallet
function setTreasuryWallet(address payable _treasuryWallet) external onlyOwner() { treasuryWallet = _treasuryWallet; }
780,926
/* โ–„โ–„โ–„โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–“ โ–ˆโ–ˆโ–‘ โ–ˆโ–ˆ โ–“โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–€โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–“ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–’โ–„โ–„โ–„โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–“ (for Adventurers) โ–“ โ–ˆโ–ˆโ–’ โ–“โ–’โ–“โ–ˆโ–ˆโ–‘ โ–ˆโ–ˆโ–’โ–“โ–ˆ โ–€ โ–“โ–ˆโ–ˆ โ–’ โ–ˆโ–ˆโ–’โ–“โ–ˆโ–ˆโ–’โ–“โ–ˆโ–ˆ โ–’ โ–“ โ–ˆโ–ˆโ–’ โ–“โ–’ โ–’ โ–“โ–ˆโ–ˆโ–‘ โ–’โ–‘โ–’โ–ˆโ–ˆโ–€โ–€โ–ˆโ–ˆโ–‘โ–’โ–ˆโ–ˆโ–ˆ โ–“โ–ˆโ–ˆ โ–‘โ–„โ–ˆ โ–’โ–’โ–ˆโ–ˆโ–’โ–’โ–ˆโ–ˆโ–ˆโ–ˆ โ–‘ โ–’ โ–“โ–ˆโ–ˆโ–‘ โ–’โ–‘ โ–‘ โ–“โ–ˆโ–ˆโ–“ โ–‘ โ–‘โ–“โ–ˆ โ–‘โ–ˆโ–ˆ โ–’โ–“โ–ˆ โ–„ โ–’โ–ˆโ–ˆโ–€โ–€โ–ˆโ–„ โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–“โ–ˆโ–’ โ–‘ โ–‘ โ–“โ–ˆโ–ˆโ–“ โ–‘ โ–’โ–ˆโ–ˆโ–’ โ–‘ โ–‘โ–“โ–ˆโ–’โ–‘โ–ˆโ–ˆโ–“โ–‘โ–’โ–ˆโ–ˆโ–ˆโ–ˆโ–’ โ–‘โ–ˆโ–ˆโ–“ โ–’โ–ˆโ–ˆโ–’โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–’โ–ˆโ–‘ โ–’โ–ˆโ–ˆโ–’ โ–‘ โ–’ โ–‘โ–‘...
disables an address from minting / burning controller the address to disbale/
function removeRiftObject(address controller) external onlyOwner { riftObjects[controller] = false; }
256,597
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.7.1; pragma experimental ABIEncoderV2; import "./interfaces/ICMCWithdraw.sol"; import "./interfaces/WithdrawHelper.sol"; import "./CMCCore.sol"; import "./AssetTransfer.sol"; import "./lib/LibAsset.sol"; import "./lib/LibChannelCrypto.sol"; import "./lib/LibUti...
TODO: include commitment type
function verifySignatures( bytes32 wdHash, bytes calldata aliceSignature, bytes calldata bobSignature ) internal view { require(wdHash.checkSignature(aliceSignature, alice), "CMCWithdraw: INVALID_ALICE_SIG"); require(wdHash.checkSignature(bobSignature, bob), "CMCWithdraw: INVALID_BOB_SIG"); } ...
12,759,917
//Address: 0x70c1d6d067465c09f539de678af013aad2934cdd //Contract name: Crowdsale //Balance: 0 Ether //Verification Date: 3/19/2018 //Transacion Count: 6 // CODE STARTS HERE pragma solidity ^0.4.18; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issue...
fallback function can be used to Procure tokens
function () external payable { procureTokens(msg.sender); }
933,134
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is dis...
Pass a call to BasePool's setAssetManagerPoolConfig through to the underlying pool. This does not need to be permissioned: any pool with asset managers must allow the owner to configure them./
function setAssetManagerPoolConfig(IERC20 token, bytes memory poolConfig) external virtual override onlyManager withBoundPool { IControlledPool(pool).setAssetManagerPoolConfig(token, poolConfig); }
12,760,425
pragma solidity ^0.4.18; // https://github.com/ethereum/EIPs/issues/20 interface ERC20 { function totalSupply() public view returns (uint supply); function decimals() public view returns(uint digits); function balanceOf(address _owner) public view returns (uint balance); function transfer(ad...
check transfer rate and transfer fee to owner
function _transferWithRate(address _from, address _to, uint256 _value) transferAllowed(_from) internal returns (bool success) { require(balances[_from] >= _value); uint256 transferFee = getTransferFee(_from, _value); require(balances[_from] >= _value + transferFee); if(msg.sender!=...
15,862,104
./full_match/1/0x9b2Dc6e830320C48044a555263cBA4CdeB0FB201/sources/contracts/DeHiveTokensale.sol
Updates public sales pool maximum _publicPool New public pool DHV maximum value/
function adminSetPublicPool(uint256 _publicPool) external onlyOwner { PUBLIC_SALE_DHV_POOL = _publicPool; }
3,125,513
/* DVIP Terms of Service The following Terms of Service specify the agreement between Decentralized Capital Ltd. (DC) and the purchaser of DVIP Memberships (customer/member). By purchasing, using, or possessing the DVIP token you agree to be legally bound by these terms, which shall take effect immediately upon purch...
Approve Approves spender `_spender` to transfer `_amount`. _spender Address that receives the cheque _amount Amount on the cheque return result of the method call/
function approve(address _spender, uint256 _amount) returns (bool success) { if (!DVIPBackend(backendContract).approve(msg.sender, _spender, _amount)) throw; Approval(msg.sender, _spender, _amount); return true; }
15,801,746
// SPDX-License-Identifier: GPL-3.0 /* This file is part of the Enzyme Protocol. (c) Enzyme Council <[emailย protected]> For the full license information, please view the LICENSE file that was distributed with this source code. */ pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/E...
Configure the extensions of a fund _feeManagerConfigData Encoded config for fees to enable _policyManagerConfigData Encoded config for policies to enable No need to assert anything beyond FundDeployer access. Called atomically with init(), but after ComptrollerLib has been deployed, giving access to its state and in...
function configureExtensions( bytes calldata _feeManagerConfigData, bytes calldata _policyManagerConfigData ) external override onlyFundDeployer { if (_feeManagerConfigData.length > 0) { IExtension(FEE_MANAGER).setConfigForFund(_feeManagerConfigData); } if (_p...
1,696,827
./partial_match/1/0x8D35372EA3E85C49A60F0A72EdeFF8629dA3999A/sources/TrueFiPool2.sol
Return pool credit line value return pool credit value/
function creditValue() public view returns (uint256) { if (address(creditAgency) == address(0)) { return 0; } return creditAgency.poolCreditValue(ITrueFiPool2(this)); }
2,698,369
//Address: 0x880d6adb5bb4c8a7f578d31a4ddb0c48bc590fa3 //Contract name: Steak //Balance: 0 Ether //Verification Date: 8/25/2017 //Transacion Count: 13 // CODE STARTS HERE pragma solidity ^0.4.15; /** * * STEAK TOKEN (BOV) * * Make bank by eating flank. See https://steaktoken.com. * */ /** * @title SafeMa...
return true if the transaction can invest
function validInvestment() internal constant returns (bool) { bool withinPeriod = saleStarted && !saleEnded; bool nonZeroPurchase = (msg.value > 0); return withinPeriod && nonZeroPurchase; }
14,056,259
./full_match/1/0x75f719056873D7D66DAbD7C0869188a020dF4Bd3/sources/contracts/vesting/LinearVestingV2.sol
Get linear started status/
function isLinearStarted() public view virtual returns (bool) { return startLinearAt < block.timestamp; }
8,340,172