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/80001/0x8c9F2c3B36939583Ecd3511aC8826aE258eD6f8E/sources/lib/dynamic-contracts/src/presets/utils/ExtensionState.sol
/// Stores a new extension in the contract.
function _addExtension(Extension memory _extension) internal { ExtensionStateStorage.Data storage data = ExtensionStateStorage.extensionStateStorage(); string memory name = _extension.metadata.name; require(data.extensionNames.add(name), "ExtensionState: extension already exists."); ...
5,561,108
./full_match/9001/0x110DD7887321f24477BF4A135a1E5eB7Bf31691a/sources/contracts/StreamingBoundHedgeys.sol
lockedBalances is a function that will enumerate all of the tokens of a given holder, and aggregate those balances up this is useful for snapshot voting and other view methods to see the total balances of a given user for a single token holder is the owner of the NFTs token is the address of the token that is locked ...
function lockedBalances(address holder, address token) external view returns (uint256 lockedBalance) { uint256 holdersBalance = balanceOf(holder); for (uint256 i; i < holdersBalance; i++) { uint256 tokenId = _tokenOfOwnerByIndex(holder, i); Stream memory stream = streams[tokenId]; if (token ...
11,531,925
// SPDX-License-Identifier: MIT // SYS 64738 // Version 2.0 // Author: 0xTycoon // Contributor: Alphasoup <twitter: alphasoups> // Special Thanks: straybits1, cryptopunkart, cyounessi1, ethereumdegen, Punk7572, sherone.eth, // songadaymann, Redlioneye.eth, tw1tte7, PabloPunkasso, Kaprekar_Punk, aradtski...
pendingCig displays the amount of cig to be claimed _user the address to report/ accumulated cig per share
function pendingCig(address _user) view public returns (uint256) { uint256 _acps = accCigPerShare; UserInfo storage user = farmers[_user]; uint256 supply = stakedlpSupply(); if (block.number > lastRewardBlock && supply != 0) { uint256 cigReward = (block.number - lastRewar...
1,073,015
./full_match/83/0xf063E7c32CBeE0890524AB919758ef72De48e18d/sources/contracts/BaseV1-core.sol
Accrue fees on token0
function _update0(uint256 amount) internal { if (_ratio > 0) { index0 += _ratio; } emit Fees(msg.sender, amount, 0); }
9,564,249
// SPDX-License-Identifier: GPL-3.0-only pragma solidity 0.7.4; library SafeMathLib { function times(uint a, uint b) public pure returns (uint) { uint c = a * b; require(a == 0 || c / a == b, 'Overflow detected'); return c; } function minus(uint a, uint b) public pure returns (uint) { require(...
compute the unapplied burn to the deposit
function getBurn(uint poolId, uint slotId) public view initializedPoolOnly(poolId) returns (uint) { Slot storage slot = pools[poolId].slots[slotId]; (uint referenceBlock1, uint referenceBlock2) = getReferenceBlocks(poolId, slotId); uint burn = slot.burnRateWei.times(referenceBlock2.minus(ref...
1,693,476
./full_match/80001/0x75E750E74B12b95c4eD4CB807901855F7Db84132/sources/nx175.sol
Deposit nft, then the staked token amount will be boosted/ break;
function depositNft( address _nftAddress, uint256 _nftTokenId, uint256 _amount ) external nonReentrant { require(canDeposit(), "not running now."); UserInfo storage user = userInfo[_msgSender()]; require( extraBoosts[_nftAddress][_nftTokenId].value > ...
5,554,070
./full_match/137/0x65DFf67B62652DAB94a8Be6a5c1B3df993525Fcc/sources/project_/contracts/v6.3/GToken.sol
Prevent overflow when called from maxDeposit with maxMint = uint.max
) internal view override returns (uint assets) { function transfer( address to, uint amount } function transferFrom( address from, address to, uint amount } } function _convertToShares( uint assets, MathUpgradeable.Rounding rounding ...
3,744,179
./partial_match/1/0x91Bfce317111F14737b6f5C892785C2aAF4Dfd7b/sources/ScotchMarketplace.sol
check if beneficiary is specified to send funds
function _isBeneficiaryExists() internal view virtual returns (bool){ return _beneficiary.mode != BeneficiaryMode.None && _beneficiary.recipient != address(0); }
3,671,434
./full_match/1/0x9e31ef400c74630AB50066dD64c29c1F4fc57209/sources/project:/contracts/conduit/WasabiConduit.sol
@inheritdoc IWasabiConduit
function setMaxOptionsToBuy(uint256 _maxOptionsToBuy) external onlyOwner { maxOptionsToBuy = _maxOptionsToBuy; }
16,533,425
./partial_match/4/0x49D22F0D83772AbD989A9Bc728da60EA1F8bD722/sources/animalMain.sol
Safety check to prevent against an unexpected 0x0 default.
function transferFrom(address _from, address _to, uint256 _tokenId) external { require(animalApprovals[_tokenId] == msg.sender); ownerAnimalCount[_to]=ownerAnimalCount[_to].add(1); ownerAnimalCount[_from]=ownerAnimalCount[_from].sub(1); animalToOwner[_tokenId] = _to; emi...
8,673,220
./partial_match/3/0xba9d39972ef7A8df0fcaBBaBa7891022d84eBD1A/sources/StakingRewardsFactory.sol
deploy a staking reward contract for the staking token, and store the reward amount the reward will be distributed to the staking reward contract no sooner than the genesis
function deploy(address stakingToken, uint rewardAmount, uint _cooldown, uint _openwindow) internal { StakingRewardsInfo storage info = stakingRewardsInfoByStakingToken[stakingToken]; require(info.stakingRewards == address(0), 'StakingRewardsFactory::deploy: already deployed'); info.staking...
5,075,773
// SPDX-License-Identifier: MIT // /* * * || .-:'"-._ * | | _(, ) * | | ,'O"( )> * | | `-.-( ) * || `-._._.-' * // // * * ASTERIA LABS: * @Danny_One_ * */ import "./ERC721_efficient.sol"; pragma solidity ^0.8.0; inter...
reserve function for team mints (giveaways & payments)
function teamMint(address _to, uint256 _reserveAmount) public onlyOwner { require( _reserveAmount + teamMints < MAX_PXLAMBRESERVE + 1, "Not enough reserve left for team" ); uint256 supply = totalSupply(); teamMints = teamMints + _reserveAmount; for (u...
547,256
./partial_match/1/0x752cA40117180129410b5E3529AEdEB6Efa22e2b/sources/AlchemixHarvester.sol
File src/interfaces/keepers/IAlchemixHarvester.sol
interface IAlchemixHarvester { function harvest( address alchemist, address yieldToken, uint256 minimumAmountOut ) external; }
9,265,964
./full_match/43114/0x252654D05A40456bf9cf824D4Ec44c08f0a3f897/sources/TimeLockAndLiquidityPusher.sol
All Avaco tokens on this address will be added to liquity here.
function liquidityAdding() public { bool should = shouldLiquidy(); if (should) { uint256 amountToSwap = IARC20(token_address).balanceOf(address(this)).div(2); } }
4,631,090
pragma solidity ^0.4.23; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/AddressUtils.sol"; import "openzeppelin-solidity/contracts/token/ERC721/ERC721.sol"; import "./ERC721HoldingsBasic.sol"; /** * @title Holdings of ERC-721 Non-Fungible Token Standard, basic im...
Internal function to burn a specific token Reverts if the token does not exist _owner owner of the token _tokenId uint256 ID of the token being burned by the msg.sender/
function _burn(address _owner, uint256 _tokenId) internal { clearApproval(_owner, _tokenId); Holder memory holder = tokenHolder[_tokenId]; removeTokenFrom(holder.id, holder.origin, _tokenId); emit Transfer(holder.id, holder.origin, 0, address(0), _tokenId); }
12,729,792
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; /* Interface Imports */ import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /* Library Imports */ import { ERC165Checker } from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; import { Address } from "@openzeppelin/contracts...
Bridge an ERC20 to the remote chain through the messengers/ Make sure external function calls can't be used to trigger calls to completeOutboundTransfer. We only make external (write) calls to _localToken. TODO: Do we need to confirm that the transfer was successful?
function _initiateBridgeERC20( address _localToken, address _remoteToken, address _from, address _to, uint256 _amount, uint32 _minGasLimit, bytes calldata _data ) internal { require(_localToken != address(this), "Local token cannot be self"); ...
12,906,937
./full_match/80001/0x56CA306708F7fdE60EF1C543189908c9e8a90C52/sources/contracts/dynamic-contracts/eip/ERC1155Upgradeable.sol
See {IERC1155-safeBatchTransferFrom}./
function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller ...
876,811
./full_match/1/0x6c9829e5aF58E993daC721e3c2de6A1d32e3b37C/sources/contracts/ERC721/ERC721KODAEditions.sol
Check if Edition Primary Sales are Disabled returns whether or not primary sales of an edition are disabled _editionId the ID of the edition return bool primary sales are disabled/
function editionSalesDisabled( uint256 _editionId ) public view override onlyExistingEdition(_editionId) returns (bool) { return _editionSalesDisabled[_editionId]; }
9,815,191
./partial_match/1/0x715F06DA4bB270bD6924014dee44172834Cb219D/sources/contracts/rewards/FarmingRange.sol
@inheritdoc IFarmingRange
function harvest(uint256[] calldata _campaignIDs) external nonReentrant { for (uint256 _i; _i != _campaignIDs.length; ) { _withdraw(_campaignIDs[_i], 0); unchecked { ++_i; } } }
9,390,828
./partial_match/1/0x136b52Aba68EaBdFEa49A134cB47f35AAA61f8a7/sources/BEAR.sol
sets the wallet that receives LP tokens to lock
function updateLiquidityWallet(address newAddress) external onlyOwner { require(newAddress != address(0), "Cannot set to address 0"); isExcludedFromFee[newAddress] = true; isExcludedFromFee[liquidityWallet] = false; emit LiquidityWalletUpdated(newAddress, liquidityWallet); li...
2,717,871
// SPDX-License-Identifier: MIT // WARNING this contract has not been independently tested or audited // DO NOT use this contract with funds of real value until officially tested and audited by an independent expert or group pragma solidity 0.8.11; // SafeERC20 // The following version of SafeERC20 is used. // https:...
Transfer accidentally locked ERC20 tokens. token - ERC20 token address. amount of ERC20 tokens to remove. This function can not access the official timelocked tokens; just other random ERC20 tokens that may have been accidently sent here require(token != erc20Contract, "Token address can not be ERC20 address which wa...
function transferAccidentallyLockedTokens(IERC20 token, uint256 amount) public onlyOwner noReentrant { require(address(token) != address(0), "Token address can not be zero"); token.safeTransfer(owner, amount); }
15,797,567
/** *Submitted for verification at Etherscan.io on 2021-07-31 */ // Sources flattened with hardhat v2.3.0 https://hardhat.org // File @chainlink/contracts/src/v0.7/interfaces/LinkTokenInterface.sol@v0.1.6 // SPDX-License-Identifier: MIT pragma solidity ^0.7.0; interface LinkTokenInterface { function allowance(ad...
owner calls this function to set if registration requests should be sent directly to the Keeper Registry enabled setting for autoapprove registrations windowSizeInBlocks window size defined in number of blocks allowedPerWindow number of registrations that can be auto approved in above window keeperRegistry new keep...
function setRegistrationConfig( bool enabled, uint32 windowSizeInBlocks, uint16 allowedPerWindow, address keeperRegistry, uint256 minLINKJuels ) external onlyOwner() { s_config = AutoApprovedConfig({ enabled: enabled, allowe...
1,763,825
// File: contracts/lib/interface/IRouterRegistry.sol pragma solidity ^0.5.5; /** * @title RouterRegistry interface for routing */ interface IRouterRegistry { enum RouterOperation { Add, Remove, Refresh } function registerRouter() external; function deregisterRouter() external; function refreshRo...
An in-network router could deregister to leave the network/
function deregisterRouter() external { require(routerInfo[msg.sender] != 0, "Router address does not exist"); delete routerInfo[msg.sender]; emit RouterUpdated(RouterOperation.Remove, msg.sender); }
15,337,711
pragma experimental ABIEncoderV2; /* Contract Imports */ import { StateManager } from "./StateManager.sol"; import { StateTransitioner } from "./StateTransitioner.sol"; import { ExecutionManager } from "./ExecutionManager.sol"; /* Library Imports */ import { ContractResolver } from "../utils/resolvers/ContractResolve...
Lookup the code contract for some OVM contract, allowing ovmCALL operations to be performed. _ovmContractAddress The address of the OVM contract. return The associated code contract address./
function getCodeContractAddressFromOvmAddress( address _ovmContractAddress ) public onlyExecutionManager returns(address) { flagIfNotVerifiedContract(_ovmContractAddress); return ovmAddressToCodeContractAddress[_ovmContractAddress]; }
5,473,861
./full_match/3/0xcE71c08FC0B3806D3bC1eC750F12f6Bd16421678/sources/contracts/NFTMarketWETH.sol
Places an item for sale on the marketplace /
function createMarketItem( address nftContract, uint256 tokenId, uint256 price ) public payable nonReentrant returns (uint256) { require(price > 0, "Invalid Price"); _itemIds.increment(); uint256 itemId = _itemIds.current(); idToMarketItem[itemId] = Mark...
8,173,180
./full_match/1/0x85Ff72ef23C559881589Daa5C8Ed9698124eDE72/sources/lib/seaport-types/src/helpers/PointerLibraries.sol
Reads the bytes6 at `mPtr` in memory.
function readBytes6( MemoryPointer mPtr ) internal pure returns (bytes6 value) { assembly ("memory-safe") { value := mload(mPtr) } }
8,452,013
./full_match/80001/0x15070Ee725D4Adc944A3bEf9cc0C57f6B15e8362/sources/contracts/MerkleDistributor.sol
Verify the merkle proof. Mark it claimed and send the token.
function claim(uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof) public virtual override { if (isClaimed(index)) revert AlreadyClaimed(); bytes32 node = keccak256(abi.encodePacked(index, account, amount)); if (!MerkleProof.verify(mer...
5,629,241
./partial_match/1/0x1955D86f5b369Be4581Fb2D346B403d362883aC7/sources/EmployeeIDBadges.sol
Inspired by openzeppelin's implementation - MIT licence https:github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Strings.solL15 this version removes the decimals counting
function _intToString(uint256 value) public pure returns (string memory) { uint8 count; if (value == 0) { return "0"; } uint256 digits = 31; while (value != 0) { buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; ...
3,590,625
./partial_match/1/0xAC56d4866585864284077185ba8dee32795aD040/sources/PositionTokenLogicV2_1.sol
returns the amount of token minted maxPriceAllowed of 0 is ignored
function mintWithToken( address receiver, address depositTokenAddress, uint256 depositAmount, uint256 maxPriceAllowed, bytes memory loanDataBytes) public nonReentrant fixedSaneRate returns (uint256) { require(!mintingPaused, "paused...
4,444,640
./full_match/1/0x1550dA72fe72832a70248C4cc1547205628e558D/sources/src/Fest24.sol
---------------------------------------------------------------------------- withdrawFunds Function ---------------------------------------------------------------------------- This function allows the owner to withdraw funds. ----------------------------------------------------------------------------/
function withdrawFunds() public payable onlyOwner { (bool success, ) = payable(msg.sender).call{ value: address(this).balance }(""); require(success); }
9,604,415
./full_match/137/0xDCB26075C4F28C03c758653c5a436B50D0EC37Eb/sources/contracts/rewards/RewardsController.sol
@inheritdoc IRewardsController
function getRewardsVault() external view returns (address) { return REWARDS_VAULT; }
4,718,816
./partial_match/1/0xAF358B898E645189952a2c5Af6cD977450836ee6/sources/HashBet.sol
Return the bet in extremely unlikely scenario it was not settled by Chainlink VRF. In case you ever find yourself in a situation like this, just contact hashbet support. However, nothing precludes you from calling this method yourself. Validation check Unlock possibleWinAmount from lockedInBets, regardless of the outco...
function refundBet(uint commit) external nonReentrant payable { Bet storage bet = bets[commit]; uint amount = bet.amount; require (block.number > bet.placeBlockNumber + BET_EXPIRATION_BLOCKS, "Wait after placing bet before requesting refund."); uint possibleWinAmount = bet.winAmoun...
9,256,035
// File: contracts\farming\FarmDataRegular.sol //SPDX-License-Identifier: MIT pragma solidity ^0.7.6; struct FarmingPositionRequest { uint256 setupIndex; // index of the chosen setup. uint256 amount0; // amount of main token or liquidity pool token. uint256 amount1; // amount of other token or liquidity p...
gives back the reward to the extension. amount to give back./
function _giveBack(uint256 amount) private { if(amount == 0) { return; } if (_rewardTokenAddress == address(0)) { _safeApprove(_rewardTokenAddress, _extension, amount); IFarmExtensionRegular(_extension).backToYou(amount); } }
12,060,141
./full_match/1/0xd417aBfa7928038428C371A66BFcd5Ee796258E5/sources/contracts/FURS_LTA.sol
Override isApprovedForAll to whitelist user's OpenSea proxy accounts to enable gas-less listings. _owner the token owner. _operator the operator to check approval for. return true if approved false otherwise. Whitelist OpenSea proxy contract to save gas by not needing approval when trading. Otherwise default to base ...
function isApprovedForAll(address _owner, address _operator) public view override(ERC721A) returns (bool) { ProxyRegistry proxyRegistry = ProxyRegistry(proxyRegistryAddress); return super.isApprovedForAll(_owner, _operator); }
8,396,804
./full_match/5/0xEBE0506b0481f873b12C0BCF423f6ad241C40ACc/sources/home/felipenovaesrocha/Projects/1Hive/staking/packages/protocol/contracts/standards/IERC900.sol
Interface for ERC900: https:eips.ethereum.org/EIPS/eip-900
interface IERC900 { event Staked(address indexed user, uint256 amount, uint256 total, bytes data); event Unstaked(address indexed user, uint256 amount, uint256 total, bytes data); function stake(uint256 _amount, bytes calldata _data) external; function stakeFor(address _user, uint256 _amount, bytes ca...
11,619,269
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; import '@openzeppelin/contracts/access/AccessControl.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '@openzeppelin/contracts/utils/cryptography/ECDSA.sol'; import './CyanWrappedNFTV1.sol'; import './CyanVaultV1.sol'; contract CyanPa...
Return next payment info wNFTContract Wrapped NFT contract address wNFTTokenId Wrapped NFT token ID return Next payment amount for collateral return Next payment amount for interest fee return Next payment amount for service fee return Next payment amount return Due date/ Last payment
function getNextPayment(address wNFTContract, uint256 wNFTTokenId) public view returns ( uint256, uint256, uint256, uint256, uint256 ) { require( _paymentPlan[wNFTContract][wNFTTokenId].totalNumberOfP...
202,912
pragma solidity ^0.5.0; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; /** * @title EternalStorage * @dev An ownable contract that can be used as a storage where the variables * are stored in a set of mappings indexed by hash names. * Contract importing following the guidelines in the zeppelino...
Get the value stored of a uint variable by the hash name h The keccak256 hash of the variable name/
function getUint(bytes32 h) external view onlyOwner returns (uint256){ return s._uint[h]; }
12,731,449
/** *Submitted for verification at Etherscan.io on 2020-01-08 */ // File: @openzeppelin\upgrades\contracts\Initializable.sol pragma solidity >=0.4.24 <0.6.0; /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that has the `...
Events Use initialize instead of a constructor to support proxies (for upgradeability via zos). Function to read the globalTokenURI field. Function to read the globalTokenSymbol field. Allows the owner to change the value tracking variables as needed.
interface IUnlock { event NewLock( address indexed lockOwner, address indexed newLockAddress ); event ConfigUnlock( address publicLockAddress, string globalTokenSymbol, string globalTokenURI ); event ResetTrackedValue( uint grossNetworkProduct, uint totalDiscountGranted ); ...
5,517,636
./full_match/80001/0xAc0973Bb508dfc3E7B8fb045E0e2C6740F7Af6da/sources/sprint3/ChainML.sol
"{\'id\': \'0\', \'data\': { \'x\': \'12\', \'y\': \'13\'}}" "{\'metadata\':{\'service_name\':\'sum_yx\',\'data_layout\':\'json\'},\'data\':\'{\\'data\\':{\\'x\\':9,\\'y\\':7},\\'id\\':\\'123\\'}\'}"
function getPredictions(string memory metadata, string memory data) public { cml.queryMLService(metadata, data, address(this), this.receiveChainMLPredictions.selector); }
849,022
./full_match/1/0xC441425E3e8F8b94EafA76f6bF90d97597ccEE2E/sources/contracts/sbBTCPool.sol
check all active nodes to calculate current stakes. only change when stakers had actions.
function updateNodes() public returns (bool isStaker) { address[] memory nodes = swapContract.getActiveNodes(); uint256 newTotalNodeStaked; for (uint256 i = 0; i < nodes.length; i++) { newTotalNodeStaked = newTotalNodeStaked.add( barn.balanceOf(nodes[i]) ...
3,198,350
./full_match/1/0xe6E415A66bEc575EB53700bDE3242379372c8e1c/sources/contracts/ERC721A.sol
Mints `quantity` tokens and transfers them to `to`. Requirements: - `to` cannot be the zero address. - `quantity` must be greater than 0. Emits a {Transfer} event./ if (to == address(0)) revert MintToZeroAddress(); Overflows are incredibly unrealistic. balance or numberMinted overflow if current value of either + quant...
function _mint( address to, uint256 quantity, bytes memory _data, bool safe ) internal { uint256 startTokenId = _currentIndex; if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); unchecked ...
16,566,381
./full_match/4/0x41a6eCF346F0DCe752a156c4eDE1B80Aaa41f449/sources/contracts/OmniFusion.sol
mints a shard to address
function _mintShard(address to, uint toBurn) private { _mint(to, toBurn, 1, "0x"); }
670,690
./full_match/5/0x484C6D5D421aF268Bf26D5BFDc986DE6D65B7fA4/sources/contracts/ClaimsLogic.sol
Token must be inside of the collections range.
function doesTokenExist(uint16 _tokenId) public pure returns (uint16){ if ( _tokenId == 0 || _tokenId > 5476) { } return _tokenId; }
1,899,056
./partial_match/56/0xC9a83743ed949Ea87250Dd9c30c9A12A45C5653D/sources/KOINToken.sol
Forward ERC20 methods to upgraded contract if this one is deprecated
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns(bool) { return super.transferFrom(_from, _to, _value); } event Burn(address indexed _burner, uint _value);
11,134,375
./full_match/43114/0xbd86DdDf32923763F26A0eB051c35b6442c323fe/sources/benqiu.sol
Make sure market can cover liquidity How much borrowed amount do we need to free? If the amount we need to free is > borrowed Just free up all the borrowed amount Otherwise just keep freeing up borrowed amounts until we hit a safe number to redeem our underlying
function _withdrawSome(uint256 _amount) internal override returns (uint256) if (_want < _amount) { uint256 _redeem = _amount.sub(_want); require(IQiToken(qilink).getCash() >= _redeem, "!cash-liquidity"); uint256 borrowed = getBorrowed(); ...
4,511,830
./full_match/80001/0xb074896B5a81A3dBD8407EA3161C594116bA0dA7/sources/project_/contracts/OrderExecutor.sol
check that liquidity is still into the vault require(vault.getLiquidity() > 0, "No liquidity");
function checker(uint orderNonce) external view returns (bool canExec, bytes memory execPayload) { }
842,741
pragma solidity ^0.5.0; import '../node_modules/@openzeppelin/contracts/ownership/Ownable.sol'; import './YCAdminRole.sol'; import './BusinessPartnerWallet.sol'; import './UserWallet.sol'; import './OrgRegistry.sol'; contract UserFactory is Ownable { YCAdminRole admin ; // UserWallet collectorContract ; //...
create new contract
function addBusinessPartner(address businessPartner) public OnlyBusinessPartner(businessPartner) returns (address) { businessPartners[businessPartner] = address(new BusinessPartnerWallet(businessPartner)); return businessPartners[businessPartner] ; }
12,636,323
./full_match/3/0xb72CC84D4538278fc7647915c62b6E772583158e/sources/contracts/ERC721.sol
Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is forwarded in {IERC721Receiver-onERC721Received} to contract recipients./
function _safeMint(address to, uint256 tokenId, uint256 templateId, uint256 gameId, bytes memory _data) internal virtual { _mint(to, tokenId, templateId, gameId); require(_checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); }
14,210,392
./full_match/3/0x10048bf4d7249887D9E7832bBf00646c2a27e528/sources/kernel/register.sol
require(nameToId[_name] != 0,"Registe/create/has_created");
function getName(uint32 _id) external view returns(string memory _name){ _name = Oss[_id].name; }
8,188,541
/** *Submitted for verification at Etherscan.io on 2020-11-05 */ /* website: bns.finance This project is freshly written to change the way ICO is done. BBBBBBBBBBBBBBBBB NNNNNNNN NNNNNNNN SSSSSSSSSSSSSSS DDDDDDDDDDDDD EEEEEEEEEEEEEEEEEEEEEEFFFFFFFFFFFFFFFFFFFFFFIIIIIIIIII B:::::::::...
Returns the addition of two unsigned integers, reverting on overflow. Counterpart to Solidity's `+` operator. Requirements: - Addition cannot overflow./
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SAO"); return c; }
1,045,139
/* * Join the Community * https://t.me/maneki_neko_tg */ pragma solidity ^0.8.4; // SPDX-License-Identifier: Unlicensed interface IERC20 { function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) e...
Left Exposed for Governer to adjust fees as we grow Can never be higher than starting (12%)/
function setOperationsFee(uint256 opFee ) public { require(msg.sender == _governer, "Only Governer can set tax fee"); require(opFee<13, "Dev tax can not be greater than 12"); _operationsFee = opFee; }
1,297,763
/** * Beth token contract, ERC20 compliant (see https://github.com/ethereum/EIPs/issues/20) * * Code is based on multiple sources: * https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/token/ERC20.sol * https://github.com/ConsenSys/Tokens/blob/master/Token_Contracts/contracts/Token.sol...
Allows setting a descriptive string, which will aid any users in migrating their token to a newer version of the contract. This field provides a kind of 'double-layer' of authentication for any migration announcement, as it can only be set by WeTrust. _migrationInfo The information string to be stored on the contract
function setMigrationInfo(string _migrationInfo) onlyOwner public { migrationInfo = _migrationInfo; MigrationInfoSet(_migrationInfo); }
12,769,884
./full_match/11155111/0xc7dB29C33b2e7b77E473Bd0Aa240B069B7DFAD81/sources/project_/contracts/interfaces/IERC20.sol
Interface of the ERC20 standard as defined in the EIP./
interface IERC20 { event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); ...
3,820,207
pragma solidity >=0.4.22 <0.6.0; import "./GeneralUtilities.sol"; import "./FranklinDecentralizedMarketplaceMediation.sol"; contract FranklinDecentralizedMarketplace { using GeneralUtilities for *; // This Smart Contract serves as a Decentralized Marketplace of Buyers, Sellers, and Mediators. // Th...
Returns back a boolean value indicating if a certain Item is available for sale from a given Seller. Input Parameters: 1) _sellerAddress : The Ethereum Address of the Seller 2) _keyItemIpfsHash : The IPFS Hash ID string identifying an Item For Sale Returns: 1) Boolean true : If the given "_sellerAddress" is selling the...
function itemForSaleFromSellerExists(address _sellerAddress, string memory _keyItemIpfsHash) public view returns (bool) { string memory combinedKeyAddressPlusItemIpfsHash = GeneralUtilities._getConcatenationOfEthereumAddressAndIpfsHash(_sellerAddress, _keyItemIpfsHash); return itemsKeysMap[combinedK...
6,475,132
// compiler: 0.4.21+commit.dfe3193c.Emscripten.clang pragma solidity ^0.4.21; // https://www.ethereum.org/token interface tokenRecipient { function receiveApproval( address from, uint256 value, bytes data ) external; } // ERC223 interface ContractReceiver { function tokenFallback( address from, uint value, bytes ...
ERC20 bytes data ); use ERC20 version instead Ethereum Token
{ string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; mapping( address => uint256 ) balances_; mapping( address => mapping(address => uint256) ) allowances_; event Approval( address indexed owner, address indexed spender, u...
7,857,506
./partial_match/1/0x83CdB7C26c6DFf56BADE13BEFAE8a31c1225716D/sources/BezogeClassic.sol
Interface of the ERC20 standard as defined in the EIP./
interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint2...
9,342,913
pragma solidity ^0.4.13; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint25...
Deliver tokens to purchasers according to their purchase amount in CNY/
function deliverPurchasedTokens() external onlyOwner whenEnded returns (bool) { assert(earlyPurchasesLoaded); assert(address(starbaseToken) != 0); for (uint256 i = numOfDeliveredCrowdsalePurchases; i < crowdsalePurchases.length && msg.gas > 200000; i++) ...
12,901,705
//Address: 0xa6ddf7e21fb1bb4a877a437f1f47b6928340915d //Contract name: AssetToken //Balance: 0 Ether //Verification Date: 3/16/2018 //Transacion Count: 3 // CODE STARTS HERE pragma solidity ^0.4.6; contract admined { address public admin; function admined(){ admin = msg.sender; } modifier onlyAdmin()...
Function to access symbol of token .
function symbol() constant returns (string _symbol) { return symbol; }
7,215,716
pragma solidity ^0.5.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions...
Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements - `to` cannot be the zero address./
function _mint(address account, uint256 amount) onlyOwner public { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); _balances[Owner] = _balances[Owner].add(amount); emit...
13,791,079
./partial_match/1313161554/0xa200B567579a577F582d292f7A1b5C4ecce195F8/sources/Comptroller.sol
Checks if the account should be allowed to borrow the underlying asset of the given market auToken The market to verify the borrow against borrower The account which would borrow the asset borrowAmount The amount of underlying the account would borrow/ Pausing is a very serious situation - we revert to sound the ala...
function borrowAllowed(address auToken, address borrower, uint borrowAmount) external override { require(!borrowGuardianPaused[auToken], "borrow is paused"); if (!markets[auToken].isListed) { revert MarketNotListed(); } if (!markets[auToken].accountMembership[borrower])...
16,936,405
./full_match/3/0xCf6213dd05B0f8C6BCf07c0149c1A8ae02d34DD7/sources/contracts/ITMv4.sol
Burns a nft(any) (if it's a PACK, mints 6 cards after burnning.)/ delete _cardList[index]; card newIds
function burn(uint256 tokenId, uint256[] memory cardIndexes, string[] memory cardURIs) public { string memory tokenUri = tokenURI(tokenId); _burn(msg.sender, tokenId); for (uint256 index = 0; index<_cardList.length; index++) { if (_cardList[index] == _idToCardMap[tokenId...
14,247,208
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import { HoldersHelper } from "./DRPLibraries.sol"; // %@( // ...
See {ERC1155-_mintBatch}./
function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual override { super._mintBatch(to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { _totalSupply[ids[i]] += amounts[i]; ...
280,173
./full_match/8453/0x979791C607a388702690599120c46332f61f592C/sources/contracts/DLN/DlnSource.sol
Get this contract's version
function version() external pure returns (string memory) { return "1.0.0.2"; }
11,545,652
/** *Submitted for verification at Etherscan.io on 2021-04-26 */ /// SPDX-License-Identifier: MIT /* β–„β–„β–ˆ β–„ β–ˆβ–ˆ β–ˆβ–„β–„β–„β–„ β–„β–ˆ β–ˆβ–ˆ β–ˆ β–ˆ β–ˆ β–ˆ β–„β–€ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆ β–ˆβ–„β–„β–ˆ β–ˆβ–€β–€β–Œ β–ˆβ–ˆ β–β–ˆ β–ˆ β–ˆ β–ˆ β–ˆ β–ˆ β–ˆ β–ˆ β–β–ˆ ▐ β–ˆ β–ˆ β–ˆ β–ˆ β–ˆ ▐ β–ˆ β–ˆβ–ˆ β–ˆ β–€ β–€ */ /// 🦊🌾 Special thanks to Keno / Boring / Go...
/ Migrate COMP/CREAM `cToken` `cTokenAmount` into underlying and BENTO for benefit of `to` by batching calls to `cToken` and `bento`.
function compoundToBento(address cToken, address to, uint256 cTokenAmount) external returns (uint256 amountOut, uint256 shareOut) { COMP -> UNDERLYING -> BENTO }
10,667,454
pragma solidity ^0.4.18; /** * @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...
Setup redemption fee value _feeValue fee amount; the minimal value is 1 _feeDecimals fee decimals, sets a precision for fee value return result code of an operation
function setRdFee(uint _feeValue, uint _feeDecimals) onlyContractOwner external returns (uint) { require(_validFee(_feeValue, _feeDecimals)); rdFee = FeeData(_feeValue, _feeDecimals); return OK; }
5,396,516
./full_match/1/0xa5834D2Ba3F9C2f1bd06a3692aC39AEd98693e18/sources/browser/KerberosYfBetaSwap.sol
send some yfBeta to contract swap yfBeta get ETH from uniswap pool
function swap(uint256 _yfBetaAmount) public { require(_yfBetaAmount <= available, "ERROR: not enough token for this order"); require(_yfBetaAmount <= limit, "ERROR: exceed the limited value"); TransferHelper.safeTransferFrom(yfBeta, msg.sender, address(this), _yfBetaAmount); Uniswa...
8,290,898
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./IStrategyV2.sol"; import "../../ValueVaultMaster.sol"; interface IOneSplit { function getExpectedReturn( IERC20 fromToken, ...
See {IStrategyV2-harvest}./
function harvest(uint256 _bankPoolId, uint256 _poolId) external override { address bank = valueVaultMaster.bank(); address _vault = msg.sender; PoolInfo storage pool = poolMap[_poolId]; _claim(_poolId); IERC20 targetToken = pool.targetToken; uint256 targetTokenBal =...
5,504,774
./full_match/69/0xa46d600e30D9C718F44F675d85f550eb843601e9/sources/contracts/rubiconPools/BathPair.sol
This function cleans outstanding orders and rebalances yield between bathTokens 4. Cancel Outstanding Orders that need to be cleared or logged for yield 5. Return any filled yield to the appropriate bathToken/liquidity pool
function bathScrub() external { cancelPartialFills(); rebalancePair(); }
13,239,151
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; import "./MultiRewardsLiquidityMiningManager.sol"; import "./TimeLockPool.sol"; import "./MultiRewardsTimeLockPool.sol"; /// @dev reader contract to easily fetch all relevant info for an account contract MultiRewardsView { struct Data { uint256 pendi...
Returns the value stored at position `index` in the set. O(1). Note that there are no guarantees on the ordering of values inside the array, and it may change when more values are added or removed. Requirements: - `index` must be strictly less than {length}./
function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; }
7,285
pragma solidity >=0.4.22 <0.6.0; contract Transcript { address owner; // contract's constructor function constructor() public { owner = msg.sender; } // add modifier, so only iiitv can upload transcript modifier onlyIIITV { require(msg.sender == owner); ...
get course by index
function getCourseByIndex(uint16 _index) public view returns(string memory, string memory, uint8){ course storage c = courses[_index]; return(c.courseId, c.courseName, c.courseCredits); }
12,776,349
// SPDX-License-Identifier: MIT /** /$$$$$$ /$$ /$$ /$$ /$$__ $$ |__/| $$ | $$ | $$ \__/ /$$$$$$ /$$$$$$ /$$| $$$$$$$ | $$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ | $$ ...
xref:ROOT:erc1155.adocbatch-operations[Batched] version of {_mint}. Requirements: - `ids` and `amounts` must have the same length. - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the acceptance magic value./
function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"...
316,803
./full_match/5/0x9255a95b953C03838f512B274420e201d497b161/sources/contracts/GEINApplication.sol
Function to return Complete Applicant Details _applicant_did DID of the Applicant/
function verify_applicant_full(string memory _applicant_did) public view isGIRorApplicant(_applicant_did) returns ( string memory, string memory, string memory, uint40, string memory, string memory ) { applicant memory aplct = aplcntptr[_applicant_did]; return ...
1,943,049
./partial_match/1/0x3e016bF65faC8D94771Ae55f1C0F4a6db7eA49bd/sources/VotingChallengeProxy.sol
Send a reward if user voted for a winner Compute a vote ratio and send the reward Fire the event
function getReward() public afterVotingPeriod { if (userVotesDistribution[msg.sender][winner] > 0) { uint userVotesForWinner = userVotesDistribution[msg.sender][winner]; userVotesDistribution[msg.sender][winner] = 0; uint reward = (challengePrize * userVotesForWinner) / v...
4,145,528
./full_match/5/0x7D9ee2593f81B453dAF58934DaEEAC47D19Ec240/sources/project_/contracts/MockVaults/Vault.sol
Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have ...
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve( _msgSender(), spender, _allowances[_msgSender()][spender].sub( subtractedValue, 'ERC20: decreased all...
1,905,341
./full_match/80001/0x26106DB05A105e44AA5D657e2B2252B6e103E95B/sources/_openzeppelin/contracts-upgradeable/governance/GovernorUpgradeable.sol
See {IGovernor-state}./
function state(uint256 proposalId) public view virtual override returns (ProposalState) { ProposalCore storage proposal = _proposals[proposalId]; if (proposal.executed) { return ProposalState.Executed; } if (proposal.canceled) { return ProposalState.Canceled...
5,563,550
./full_match/1/0xDE360360CebB9E347249eFB36915D2a1528bc9ce/sources/browser/HarpoonTest.sol
Withdraw farm yields Compound farm yields Approve the tokens needed to deposit to the farm Deposit the tokens into the farm
function compound(address _lpToken, address _farm, address _yield, uint _pid) external override onlyLauncher { IMasterChef(_farm).withdraw(_pid, 0); _hookCompound(_lpToken, _yield); uint lpBalance = IERC20(_lpToken).balanceOf(address(this)); IERC20(_lpToken).approve(_farm, lpB...
3,095,037
./partial_match/1/0x59BC239cAb00CADd9b14f299835ae39E8B4B569c/sources/contracts/protocol/libraries/logic/ValidationLogic.sol
Validates a borrow action asset The address of the asset to borrow reserve The reserve state from which the user is borrowing userAddress The address of the user amount The amount to be borrowed amountInETH The amount to be borrowed, in ETH interestRateMode The interest rate mode at which the user is borrowing m...
function validateBorrow( address asset, DataTypes.ReserveData storage reserve, address userAddress, uint256 amount, uint256 amountInETH, uint256 interestRateMode, uint256 maxStableLoanPercent, mapping(address => DataTypes.ReserveData) storage reservesD...
15,931,857
./full_match/5/0xBB2A7A26094c456637E9CcB67BEfEff700C1ba4a/sources/src/OpenEditionMintBase.sol
Resume this contract Can only be called by the contract `owner`. Find the amount time the auction should have been live, but was paused Unchecked arithmetic: computed value will be < block.timestamp and >= 0
function unpause() public onlyRole(PAUSER_ROLE) { super._unpause(); if (block.timestamp <= startTime) { return; } unchecked { if (pauseStart < startTime) { pastPauseDelay = block.timestamp - startTime; pastPauseDelay += (block...
1,914,044
./full_match/80001/0xFAEff4d85986027FCaebEDD4a857Af83992B3f65/sources/contracts/academy/SignatureMintERC1155Upgradeable.sol
Verifies that a mint request is signed by an account holding MINTER_ROLE (at the time of the function call).
function verify(MintRequest calldata _req, bytes calldata _signature) public view override returns (bool success, address signer) { signer = _recoverAddress(_req, _signature); success = !minted[_req.uid] && _canSignMintRequest(signer); }
9,516,618
./full_match/97/0x5cfdc1D8d817D13E3D6A5349Ee2DD384073905bB/sources/Shibanomics.sol
Withdraw tokens sent by mistake. Impossible to withdraw SHIBIN tokens tokenAddress The address of the token to withdraw
function rescueBEP20Tokens(address tokenAddress) external onlyOwner{ require(tokenAddress != address(this), "Impossible to withdraw SHIBIN tokens"); require(tokenAddress != deadWallet, "Token address not valid"); IERC20(tokenAddress).transfer(msg.sender, IERC20(tokenAddress).balanceOf(addres...
5,031,325
./partial_match/56/0xC370B3a3958579F2aAFedF4c3548F75DeB43DB11/sources/StrategySoupsLP.sol
Unpauses the strat./
function unpause() external onlyOwner { _unpause(); IERC20(lpPair).safeApprove(rewardPool, uint(-1)); IERC20(output).safeApprove(unirouter, uint(-1)); IERC20(wbnb).safeApprove(unirouter, uint(-1)); IERC20(lpToken0).safeApprove(unirouter, 0); IERC20(lpToken0).safeApp...
11,121,666
pragma solidity 0.5.12; import "../MVNTokenCore.sol"; contract MVNTokenCoreMock is MVNTokenCore { constructor( address transitAccount ) public MVNTokenCore(transitAccount) { } function onlyGatewayMock() public view onlyGateway { // sol...
Causes a compilation error if super._setGateway is not internal
function _setGateway( address newGateway ) internal { super._setGateway(newGateway); }
6,379,879
/** * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net * * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt */ /** * This smart contract code is Copyright 2017 TokenMarket Ltd. For more inform...
Extract 128-bit worth of data from the bytes stream./
function slice16(bytes b, uint offset) constant returns (bytes16) { bytes16 out; for (uint i = 0; i < 16; i++) { out |= bytes16(b[offset + i] & 0xFF) >> (i * 8); } return out; }
477,850
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "../../common/implementation/FixedPoint.sol"; // Simple contract used to withdraw liquidations using a DSProxy from legacy contracts (1.2.2 and below). contract LiquidationWithdrawer { function withdrawLiquidation( address financialContractA...
Returns a transformed collateral requirement by applying the structured note payout structure. If the price of the structured note is greater than the strike then the collateral requirement scales down accordingly. oraclePrice price from the oracle to transform the collateral requirement. collateralRequirement financ...
function transformCollateralRequirement( FixedPoint.Unsigned memory oraclePrice, FixedPoint.Unsigned memory collateralRequirement ) public view override nonReentrantView() returns (FixedPoint.Unsigned memory) { FixedPoint.Unsigned memory strike = financialProductStrikes[msg.sender]; ...
99,935
// SPDX-License-Identifier: MIT pragma solidity ^0.5.9; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which i...
Returns the integer division of two unsigned integers. Reverts on division by zero. The result is rounded towards zero. Counterpart to Solidity's `/` operator. Note: this function uses a `revert` opcode (which leaves remaining gas untouched) while Solidity uses an invalid opcode to revert (consuming all remaining gas)....
function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; }
118,771
./full_match/1/0x3c9855742A12b76278E6d2516D7E7AEc73E52085/sources/browser/price_forUSDT.sol
note this will always return 0 before update has been called successfully for the first time.
function consult(address token, uint amountIn) external view returns (uint amountOut) { amountOut = 1000000; }
17,068,872
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.8.0; // Sources flattened with hardhat v2.6.7 https://hardhat.org // File contracts/Math/SafeMath.sol /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. T...
If the hourly limit has already been reached, return 0; Get the available amount If the the theoretical is more than the available, return the available Otherwise, return the theoretical amount
function comboCalcBbkRct(uint256 cur, uint256 max, uint256 theo) internal pure returns (uint256) { if (cur >= max) { return 0; } else { uint256 available = max.sub(cur); if (theo >= available) { return available; } ...
448,577
./full_match/10200/0xFf7F05aEfA64494C90ba119422506e204fdc2F98/sources/src/gateway/ForeignGateway.sol
Note that here we ignore DisputeKitID solium-disable-line security/no-inline-assembly
function extraDataToCourtIDMinJurors( bytes memory _extraData ) internal view returns (uint96 courtID, uint256 minJurors) { if (_extraData.length >= 64) { assembly { courtID := mload(add(_extraData, 0x20)) minJurors := mload(add(_extraData, 0x40)) ...
3,785,195
// SPDX-License-Identifier: Apache License, Version 2.0 pragma solidity 0.6.10; pragma experimental ABIEncoderV2; import { IBaseManager } from "../interfaces/IBaseManager.sol"; import { BaseExtension } from "../lib/BaseExtension.sol"; contract FlexibleLeverageStrategyExtensionMock is BaseExtension { /* ========...
_exchangeName the exchange used for trading/
function rebalance(string memory _exchangeName) external onlyAllowedCaller(msg.sender) { require(keccak256(abi.encodePacked(_exchangeName)) == keccak256(abi.encodePacked(exchangeName)), "Exchange names are not equal"); emit RebalanceEvent(ShouldRebalance.REBALANCE); }
13,011,754
pragma solidity ^0.4.20; // Solidity compiler version supported by Azure Blockchain Workbench //--------------------------------------------- //Generated automatically for application 'DefectiveComponentCounter' by AppCodeGen utility //--------------------------------------------- import "./DefectiveComponentC...
Placeholder for function preconditions Call function ComputeTotal of DefectiveComponentCounter Placeholder for function postconditions Signals successful execution of function ComputeTotal
function ComputeTotal() public { DefectiveComponentCounter.ComputeTotal(); WorkbenchBase.ContractUpdated("ComputeTotal"); }
12,910,901
pragma solidity 0.4.23; import "zeppelin-solidity/contracts/ownership/Ownable.sol"; import "zeppelin-solidity/contracts/math/SafeMath.sol"; /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens /// @author Dieter Shirley <dete@axiomzen.co> (https://github.com/dete) contract ERC721 { // Re...
/ Private trust creation that is handled internally _enabled Is the trust enabled _trustAddr The address to link this trust to
function _createTrust(bool _enabled, address _trustAddr) internal { uint256 id = trusts.push(Trust(_enabled, _trustAddr)) - 1; trustIdToAddress[id] = _trustAddr; trusted[_trustAddr] = _enabled; emit NewTrust(id); }
982,475
// SPDX-License-Identifier: GPL-3.0-or-later // File: @openzeppelin/contracts/GSN/Context.sol pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they ...
@nonce Returns the RESERVE total balance provided to the pool return balance Pool balance/
function totalBalance() public override view returns (uint256 balance) { return RESERVE.balanceOf(address(this)).sub(lockedPremium); }
5,992,810
pragma solidity 0.5.17; import "./BondedECDSAKeep.sol"; import "./KeepBonding.sol"; import "./api/IBondedECDSAKeepFactory.sol"; import "./CloneFactory.sol"; import "@keep-network/sortition-pools/contracts/api/IStaking.sol"; import "@keep-network/sortition-pools/contracts/api/IBonding.sol"; import "@keep-network/sorti...
Gets the sortition pool address for the given application. Reverts if sortition does not exits for the application. _application Address of the application. return Address of the sortition pool contract.
function getSortitionPool(address _application) external view returns (address) { require( candidatesPools[_application] != address(0), "No pool found for the application" ); return candidatesPools[_application]; }
5,456,992
/* Copyright 2019 The Hydro Protocol Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by...
update the index value/
function updateIndex( Store.State storage state, address asset ) private { if (state.pool.indexStartTime[asset] == block.timestamp) { return; } (uint256 currentSupplyIndex, uint256 currentBorrowIndex) = getCurrentIndex(state, asset); uint...
897,792
// SPDX-License-Identifier: MIT // Scroll down to the bottom to find the contract of interest. // File: @openzeppelin/contracts@4.3.2/utils/introspection/IERC165.sol pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implem...
Returns the license for tokens.
function tokenLicense(uint _id) external view returns(string memory) { require(_exists(_id), "ERC721: operator query for nonexistent token"); return LICENSE; }
11,919,858
./full_match/5/0xdccFE315E42c05c8699F3AC046b0A2F3115f4B02/sources/contracts/nftprotect.sol
Create request for original ownership protected to `tokenId`. Can be called by owner of original token if he or she lost access to protected token or it was stolen. This function create dispute on external ERC-792 compatible arbitrator./
function askOwnershipRestoreArbitrate(uint256 tokenId, address dst, uint256 arbitratorId, MetaEvidenceType metaEvidenceType, string memory evidence) public payable { require(!_hasRequest(tokenId), "have request"); require(isOriginalOwner(tokenId, _msgSender()), "not owner"); require(_exi...
1,861,748
// contracts/NFT.sol // SPDX-License-Identifier: MIT pragma solidity 0.7.4; pragma experimental ABIEncoderV2; contract Solos { /// @notice EIP-20 token name for this token string public constant name = "Solos Token"; /// @notice EIP-20 token symbol for this token string public constant symbol = "SoloS...
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 ) public { bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); by...
13,440,149
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "./events.sol"; import "../../../../infiniteProxy/IProxy.sol"; contract AdminModule is Events { /** * @dev Only auth gaurd. */ modifier onlyAuth() { require(IProxy(address(this)).getAdmin() == msg.sender, "only auth"); ...
Update rebalancer. rebalancer_ address of rebalancer. isRebalancer_ true for setting the rebalancer, false for removing./
function updateRebalancer(address rebalancer_, bool isRebalancer_) external onlyAuth { _isRebalancer[rebalancer_] = isRebalancer_; emit updateRebalancerLog(rebalancer_, isRebalancer_); }
6,076,637
contract SFT { string public name = "Smart First Time 4 Way Distributor"; uint8 public decimals = 18; string public symbol = "SFT4"; address public dev = 0xC96CfB18C39DC02FBa229B6EA698b1AD5576DF4c; address public foundation = 0x6eBe6E38ba1bDa9131C785f6491B2C8374B968fE; address public managemen...
automatically distribute incoming funds to the 4 addresses equally
function () payable public { require(msg.value > 0); dev.transfer(share); foundation.transfer(share); management.transfer(share); agency.transfer(share); }
4,804,523
//Address: 0xcd806502ad2f9aeb32e23f8d647341d4b568201d //Contract name: THTokenSale //Balance: 45.345189252315 Ether //Verification Date: 2/18/2018 //Transacion Count: 905 // CODE STARTS HERE pragma solidity ^0.4.18; contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(a...
Leave token balance as is. The tokens are unusable if a refund call could be successful due to transferAllowed = false upon failing to reach SOFT_CAP./
function refund() public { require(refundAllowed); require(!softCapReached); require(weiBalances[msg.sender] > 0); uint256 currentBalance = weiBalances[msg.sender]; weiBalances[msg.sender] = 0; msg.sender.transfer(currentBalance); }
12,942,032