file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
// SPDX-License-Identifier: MIT pragma solidity >=0.4.4 <0.7.0; pragma experimental ABIEncoderV2; import "./ERC20.sol"; contract Disney { // ---------------------------------- DECLARACIONES INICIALES ---------------------------------- // // Instancia del contrato token ERC20Basic private token; ...
Funcion para subirse a una atraccion de disney y pagar en tokens Precio de la atraccion (en tokens) Verifica el estado de la atraccion (si esta disponible para su uso) Verificar el numero de tokens que tiene el cliente para subirse a la atraccion Almacenamiento en el historial de atracciones del cliente Emision del eve...
function SubirseAtraccion (string memory _nombreAtraccion) public { uint tokens_atraccion = MappingAtracciones[_nombreAtraccion].precio_atraccion; require(MappingAtracciones[_nombreAtraccion].estado_atraccion == true, "Atraccion no disponible"); require(tokens_atraccion <= MisTokens(), "Nece...
1,059,589
./full_match/1/0x09e264a2Fdd1Ca72004408680293F5e75A9cADd0/sources/contracts/htmlnft.sol
We set the title of our NFT as the generated word.
function generateDance(string memory _dancedata) public payable{ require(msg.value == 0.01 ether, "Need to send exactly 0.01 ether"); uint256 newItemId = _tokenIds.current(); string memory json = Base64.encode( bytes( string( abi.encodePacked( ...
9,793,266
pragma solidity >=0.4.22 <0.7.0; import "remix_tests.sol"; import "remix_accounts.sol"; import "../github/lawsonpd/will-and-trust-smart-contracts/SimpleWill.sol"; // File name has to end with '_test.sol', this file can contain more than one testSuite contracts contract testSuite { address payable acc0; address...
address[] memory _beneficiaries = will.getBeneficiaries();
function testBeneficiaryExists() public { will.addBeneficiary(acc1); address benef = will.getBeneficiary(0); Assert.equal(benef, acc1, "There should be 1 beneficiary, namely acc1."); }
2,505,096
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.10; import "../../interfaces/IIdleCDOStrategy.sol"; import "../../interfaces/IMAsset.sol"; import "../../interfaces/ISavingsContractV2.sol"; import "../../interfaces/IERC20Detailed.sol"; import "../../interfaces/IVault.sol"; import "../../interfaces/IUniswapV...
Can be called only once Initialize the upgradable contract _strategyToken address of the strategy token. Here imUSD _underlyingToken address of the token deposited. here mUSD _vault address of the of the vault _uniswapV2Router02 address of the uniswap router _routerPath path to swap the gov tokens----- ------- t...
function initialize( address _strategyToken, address _underlyingToken, address _vault, address _uniswapV2Router02, address[] calldata _routerPath, address _owner ) public initializer { OwnableUpgradeable.__Ownable_init(); ReentrancyGuardUpgradeable...
13,879,708
pragma solidity ^0.4.25; // It's important to avoid vulnerabilities due to numeric overflow bugs // OpenZeppelin's SafeMath library, when used correctly, protects agains such bugs // More info: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/november/smart-contract-insecurity-bad-arithmetic/ impo...
Returns array of three non-duplicating integers from 0-9
function generateIndexes ( address account ) internal returns(uint8[3]) { uint8[3] memory indexes; indexes[0] = getRandomIndex(account); indexe...
1,812,323
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @artist: Steve Aoki /// @title: A0K1 Credits /// @author: manifold.xyz ///////////////////////////////////////////////////////////////////////////////////// // // // ...
Converts a `uint256` to its ASCII `string` decimal representation./ Inspired by OraclizeAPI's implementation - MIT licence https:github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
function activate(uint256 startTime_, uint256 duration, uint256 presaleInterval_, uint256 claimStartTime_, uint256 claimEndTime_) external; function deactivate() external; function premint(uint16 amount) external; function premint(uint16[] calldata amounts, address[] calldata addresses) external; ...
10,079,475
./partial_match/3/0xcBCfc2438558C4C508EC9A06C833B4D97BC042B2/sources/MirrorENSRegistrar.sol
This function must be called when the ENS Manager contract is replaced and the address of the new Manager should be provided. _newOwner The address of the new ENS manager that will manage the root node./
function changeRootnodeOwner(address _newOwner) external override onlyOwner { ensRegistry.setOwner(rootNode, _newOwner); emit RootnodeOwnerChange(rootNode, _newOwner); }
5,196,632
./full_match/1/0x467a2B91f231D930F5eeB6B982C7666E81DA8626/sources/contracts/ZkSync.sol
Config gas limit for withdraw nft token _gasLimit withdraw erc20 gas limit
function setWithdrawNFTGasLimit(uint256 _gasLimit) external { governance.requireGovernor(msg.sender); withdrawNFTGasLimit = _gasLimit; }
3,857,491
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC20.sol"; interface ILabrats { function balanceOG(address _user) external view returns(uint256); } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to...
called on transfers
function updateReward(address _from, address _to, uint256 _tokenId) external { require(msg.sender == address(labratsContract)); if (_tokenId < 10001) { uint256 time = min(block.timestamp, END); uint256 timerFrom = lastUpdate[_from]; if (timerFrom > 0) rewards[_from] += labratsContract.balanceOG(_from)...
6,109,767
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since whe...
Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. _Available since v4.2._/
function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; }
5,860,996
./partial_match/1313161554/0x3A67b63D0baA5883A69A4360f56F5b7A8f090dbb/sources/StrategyTriMiniChefLP.sol
returns rewards unharvested
function rewardsAvailable() public view returns (uint256) { return ITriChef(chef).pendingTri(poolId, address(this)); }
16,913,737
//SPDX-License-Identifier: MIT pragma solidity =0.8.11; import "./PeriodicOracle.sol"; import "../interfaces/IAggregatedOracle.sol"; contract AggregatedOracle is IAggregatedOracle, PeriodicOracle { /* * Structs */ struct TokenSpecificOracle { address token; address oracle; } ...
Ensure all underlying oracles are up-to-date We don't want any problematic underlying oracles to prevent this oracle from updating so we put update in a try-catch block
function _update(address token) internal override returns (bool) { bool underlyingUpdated; for (uint256 j = 0; j < 2; ++j) { OracleConfig[] memory _oracles; if (j == 0) _oracles = oracles; else _oracles = tokenSpecificOracles[token]; for (uint256 i ...
14,123,746
// Dependency file: @openzeppelin/contracts/token/ERC20/SafeERC20.sol // pragma solidity ^0.6.0; // import "./IERC20.sol"; // import "../../math/SafeMath.sol"; // import "../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract ret...
SET MANAGER ONLY. Add an allowed reserve asset _setToken Instance of the SetToken _reserveAsset Address of the reserve asset to add/
function addReserveAsset(ISetToken _setToken, address _reserveAsset) external onlyManagerAndValidSet(_setToken) { require(!isReserveAsset[_setToken][_reserveAsset], "Reserve asset already exists"); navIssuanceSettings[_setToken].reserveAssets.push(_reserveAsset); isReserveAsset[_set...
6,802,795
./partial_match/4/0x7f7c0F05779b5115F986fEE9d8996299b253782a/sources/GLY.sol
mint GLY _to The address that will receive the minted tokens _amount The amount of tokens to mint/
function mint(address _to, uint256 _amount) external { require(totalSupply().add(_amount) <= INITIAL_SUPPLY, "Exceed Limit"); require(hasRole(MINTER_ROLE, _msgSender()), "Caller is not a minter"); _mint(_to, _amount); }
8,685,660
pragma solidity ^0.4.16; import "../core/BasicDocument.sol"; import "../core/RevokableDocument.sol"; import "../core/TransfarableDocument.sol"; /** * @title PublicDocument * @dev Anyone who knows the contract address can issue and revoke documents. */ contract PublicDocument is BasicDocument, RevokableDocument, Tr...
Verifies if the document belongs to the given recipient./
function verifyDocument(address recipient, bytes32 document) public constant returns (bool) { return recipient != address(0) && documents[document].recipient == recipient; }
14,104,717
// Sources flattened with hardhat v2.3.3 https://hardhat.org // SPDX-License-Identifier: UNLICENSED // File contracts/core/ArmorToken.sol pragma solidity 0.8.4; /* Copyright 2016, Jordi Baylina This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Pub...
Delete a shield. We use both shield address and index for safety. _shield Address of the shield to delete from array. _idx Index of the shield in the arShields array./
function deleteShield( address _shield, uint256 _idx ) external onlyGov { if (arShields[_idx] == _shield) { arShields[_idx] = arShields[arShields.length - 1]; arTokens[_idx] = arTokens[arTokens.length - 1]; arShields.pop(); ...
7,008,869
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error,...
Helper to set the `ethUsdAggregator` value
function __setEthUsdAggregator(address _nextEthUsdAggregator) internal { address prevEthUsdAggregator = getEthUsdAggregator(); require( _nextEthUsdAggregator != prevEthUsdAggregator, "__setEthUsdAggregator: Value already set" ); __validateAggregator(_nextEthU...
1,406,537
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; pragma experimental ABIEncoderV2; import "contracts/Allocations.sol"; import "contracts/ExactDollarPartition.sol"; import "contracts/Phases.sol"; import "contracts/Proposals.sol"; import "contracts/Zipper.sol"; import "contracts/Token.sol"; import "cont...
provides an externally created partition of the proposals to store on the blockchain part the partition to be stored
function providePartition(uint[][] calldata part) external override authorized(){ Phases.checkPhase(Phases.Phase.Assignment); partition = Zipper.zipMatrix(part,16); }
1,792,852
./partial_match/1/0x98ad9B32dD10f8D8486927D846D4Df8BAf39Abe2/sources/contracts/token/VELO.sol
Transfer tokens to a specified address. to The address to transfer to. value The amount to be transferred. return True on success, false otherwise./ underlying balance is stored in velos, so divide by current scaling factor note, this means as scaling factor grows, dust will be untransferrable. minimum transfer value...
function transfer(address to, uint256 value) external validRecipient(to) returns (bool) { uint256 veloValue = value.mul(internalDecimals).div(velosScalingFactor); _veloBalances[msg.sender] = _veloBalances[msg.sender].sub(veloValue); _veloBalances[to] = _veloBa...
4,282,346
//SPDX-License-Identifier: Unlicense pragma solidity 0.8.4; import "./abstract/HasSecondarySaleFees.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol"; import "@openzeppelin/contracts/token/E...
Initialize the implementation Intialize parent contracts
function initialize( string memory name_, string memory symbol_, address minter ) public initializer { ERC721Upgradeable.__ERC721_init(name_, symbol_); HasSecondarySaleFees._initialize(); AccessControlUpgradeable.__AccessControl_init(); _setupRole(DEFAULT...
1,552,939
./partial_match/1/0x695264D984A5E45C2d89f261C8668d6C1F7D214c/sources/IporProtocolRouter.sol
Unpauses list of functions in IporProtocolRouter Can be called only by Owner of Ipor Protocol Router
function unpause(bytes4[] calldata functionSigs) external onlyOwner { uint256 len = functionSigs.length; for (uint256 i; i < len; ) { StorageLib.getRouterFunctionPaused().value[functionSigs[i]] = 0; unchecked { ++i; } } }
16,153,392
pragma solidity ^0.4.24; import "./DateLib.sol"; import "./OracleInterface.sol"; import "./Ownable.sol"; contract WeatherBets is Ownable { // mappings using DateLib for DateLib.DateTime; mapping(address => bytes32[]) private userToBets; mapping(bytes32 => Bet[]) private cityToBets; //boxing resu...
returns the full data of the specified match _betId the id of the desired match return match data WeatherData weather;
function getCityBet(bytes32 _betId) public view returns ( address userId, uint inzet, int guess, uint quotering, ) { return weatherOracle.getCityBet(_betId); }
5,389,440
pragma solidity ^0.4.15; import "../Markets/Market.sol"; import "../Tokens/Token.sol"; import "../Events/Event.sol"; import "../MarketMakers/MarketMaker.sol"; /// @title Market factory contract - Allows to create market contracts /// @author Stefan George - <stefan@gnosis.pm> contract StandardMarket is Market { u...
Allows market creator to withdraw fees generated by trades return Fee amount Transfer fees
function withdrawFees() public isCreator returns (uint fees) { fees = eventContract.collateralToken().balanceOf(this); require(eventContract.collateralToken().transfer(creator, fees)); FeeWithdrawal(fees); }
7,292,431
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelinUpgrade/contracts/access/OwnableUpgradeable.sol"; import "../interfaces...
Compatible with old version 1
function getBorrowAmount(uint256 _pid, address _account) external override view returns (uint256 value) { value = getBorrowAmountInBaseToken(_pid, _account); }
1,779,154
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; import {ExecutionManager} from "../ExecutionManager.sol"; /** * @title SimpleCall * @notice A simple contract testing the execution manager's CALL. */ contract SimpleCall { address executionManagerAddress; /** * Constructor currently accepts a...
expects _targetContract (address as bytes32), _calldata (variable-length bytes). returns variable-length bytes result. bitwise right shift 28 8 bits so the 4 method ID bytes are in the right-most bytes replace the first 4 bytes with the right methodID overwrite call params
function makeStaticCall() public { bytes32 methodId = keccak256("ovmSTATICCALL()") >> 224; address addr = executionManagerAddress; assembly { let callBytes := mload(0x40) calldatacopy(callBytes, 0, calldatasize) mstore8(callBytes, shr(24, methodId)) ...
5,394,820
pragma solidity ^0.5.0; //Importing openzeppelin-solidity ERC-721 implemented Standard import "@openzeppelin/contracts/token/ERC721/ERC721Full.sol"; import "@openzeppelin/contracts/drafts/Counters.sol"; // StarNotary Contract declaration inheritance the ERC721 openzeppelin implementation contract StarNotary is ERC721...
Passing the name as a parameter
function createStar(string calldata _name) external returns (uint256) {
6,455,793
./full_match/1/0xDd5097FC3f68958649cE70F42B7c1CF0067a3545/sources/cache/solpp-generated-contracts/ZkLink.sol
Saves priority request in storage Calculates expiration block for request, store this request and emit NewPriorityRequest event _opType Rollup operation type _pubData Operation pubdata Expiration block is: current block number + priority expiration delta
function addPriorityRequest(Operations.OpType _opType, bytes memory _pubData) internal { uint64 expirationBlock = SafeCast.toUint64(block.number + PRIORITY_EXPIRATION); uint64 nextPriorityRequestId = firstPriorityRequestId + totalOpenPriorityRequests; bytes20 hashedPubData = Utils.hashByte...
16,530,378
pragma solidity ^0.5.17; interface IERC20 { function TOTALSUPPLY3() external view returns (uint256); //inject NONSTANDARD NAMING function BALANCEOF367(address account) external view returns (uint256); //inject NONSTANDARD NAMING function TR...
inject NONSTANDARD NAMING
function _APPROVEALL294() internal {
12,996,882
// SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; 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); ...
Withdraw stuked tokens
function withdrawStuckedTokens(address tokenAddress, uint256 tokens) external onlyOwner returns (bool success){ return IERC20(tokenAddress).transfer(msg.sender, tokens); }
5,943,328
./full_match/80001/0x89BbdF7639158e02318f801922C2eE3BEFF2Ec73/sources/contracts/GameMarkeplace.sol
Create a new item. _itemId The ID of the item _categoryId The ID of the category/ Cria um novo Item e adiciona ao mapeamento de items
function createItem(uint256 _itemId, uint256 _categoryId) public { require(items[_itemId].owner == address(0), "Item already exists"); items[_itemId] = Item({ owner: msg.sender, categoryId: _categoryId, rentedBy: address(0) }); emit ItemCreated(_...
9,457,641
function tree normalize_phrase_russian( tree root ) { tree nroot = wordform_root(root); int pos0 = wordform_class(root); if( eq( pos0, ПРИЛАГАТЕЛЬНОЕ ) ) then { // Нормализация случаев типа "КОНДИЦИОНЕРЫ СТАРЕНЬКИЕ" // Прилагательное в дереве представляет именное сказуемое и располагается в корне. // Суще...
Нормализация случаев типа "КОНДИЦИОНЕРЫ СТАРЕНЬКИЕ" Прилагательное в дереве представляет именное сказуемое и располагается в корне. Существительное является подлежащим. Теперь атрибутирующее прилагательное. нормализуем существительное
function tree normalize_phrase_russian( tree root ) { int nlink=link_count(root); int i; for i=0 to arith_minus(nlink,1) { if( eq( link_get_type2( root, "", i ), <SUBJECT> ) ) then { tree sbj = link_get( root, "", i ); if( eq( wordform_class( sbj ), СУЩЕСТВИТЕЛЬНОЕ ) ) then { if(...
7,225,508
./full_match/43113/0x3f2Ad500a1fde88DFb64A1bD1fA52a6BA4C6734e/sources/apps/avai/src/contracts/Bank.sol
For liquidation Chainlink price source Token used as collateral Token used as debt Address that corresponds to liquidater address that corresponds to gateway, if there is one Vault that corresponds to the treasury Vault information Events for general vault operations Buying out a vault event Events for collateral opera...
{ bytes32 public constant TREASURY_ROLE = keccak256('TREASURY_ROLE'); using SafeERC20 for IERC20; using SafeERC20 for IStablecoin; using CountersUpgradeable for CountersUpgradeable.Counter; CountersUpgradeable.Counter private _userVaultIds; uint256 public minimumCollateralPercentage; uint256 public debtCe...
7,166,076
pragma solidity ^0.4.23; import "../math/SafeMath.sol"; import "../tokens/Xct.sol"; import "../tokens/Xcert.sol"; import "../tokens/ERC20.sol"; import "./TokenTransferProxy.sol"; import "./XcertMintProxy.sol"; import "../tokens/ERC165implementation.sol"; /* * @dev based on: https://github.com/0xProject/contracts/blo...
Get token balance of an address. The called token contract may attempt to change state, but will not be able to due to an added gas limit. Gas is limited to prevent reentrancy. _token Address of token. _owner Address of owner. return Token balance of owner./
function _getBalance(address _token, address _owner) internal returns (uint) { return ERC20(_token).balanceOf.gas(EXTERNAL_QUERY_GAS_LIMIT)(_owner); }
6,348,313
./full_match/1/0x7381808b80ED29655f8541009f48b8CF681eCADf/sources/contracts/erc721/lib/base/BaseRFOXNFT.sol
Owner withdraw revenue from Sales/
function withdraw() external onlyOwner { uint256 balance; if (address(saleToken) == address(0)) { balance = address(this).balance; "" ); require(succeed, "Failed to withdraw Ether"); balance = saleToken.balanceOf(address(this)); ...
17,052,297
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721BurnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "./interfaces/ICollectionContractInitializer.sol"; import "./inte...
Split into a second function to avoid stack too deep errors/ Call the factory and get the originalPaymentAddress Confirm the original address and swap with the new address Call the factory and get the newPaymentAddress For each token, confirm the expected payment address and then update to the new one
function _adminAccountRecoveryForPaymentAddresses( uint256[] calldata paymentAddressTokenIds, address paymentAddressFactory, bytes memory paymentAddressCallData, uint256 addressLocationInCallData, address originalAddress, address payable newAddress ) private { address payable originalPay...
10,054,920
/* solium-disable security/no-low-level-calls */ pragma solidity ^0.4.21; import "./ERC827.sol"; import "../ERC20/StandardToken.sol"; /** * @title ERC827, an extension of ERC20 token standard * * @dev Implementation the ERC827, following the ERC20 standard with extra * @dev methods to transfer value and data an...
Addition to ERC20 token methods. Transfer tokens to a specified address and execute a call with the sent data on the same transaction _to address The address which you want to transfer to _value uint256 the amout of tokens to be transfered _data ABI-encoded contract call to call `_to` address. return true if the ca...
function transfer(address _to, uint256 _value, bytes _data) public returns (bool) { require(_to != address(this)); super.transfer(_to, _value); require(_to.call(_data)); return true; }
12,885,849
./full_match/80001/0x88517aB345F1e7492227E3515641B8b51019d7dd/sources/src/contracts/SignatureMintWithParamsERC1155.sol
Collects and distributes the primary sale value of tokens being claimed.
function collectPrice(MintRequestWithParams calldata _req) internal virtual { if (_req.pricePerToken == 0) { return; } uint256 totalPrice = _req.pricePerToken * _req.baseMintRequest.quantity; uint256 platformFees = platformFeeType == PlatformFeeType.Flat ? fl...
841,920
./full_match/137/0x26765e2128E92D75323047D8e1cea111E31aA029/sources/eth_machine.sol
transfer this machine to artist
function transferOwnership(address newOwner) public override onlyAdministrator { super.transferOwnership(newOwner); artistAccount = newOwner; }
4,685,827
./full_match/56/0x7a6698c9eC149894C678B43cD370567220A19FC5/sources/contracts/L1/messaging/L1StandardBridge.sol
@inheritdoc IL1StandardBridge/
function depositGCDTo( address _to, uint256 _amount, uint32 _l2Gas, bytes calldata _data ) external virtual { _initiateGCDDeposit(msg.sender, _to, _amount, _l2Gas, _data); }
3,242,106
// SPDX-License-Identifier: BUSL-1.1 // For further clarification please see https://license.premia.legal pragma solidity ^0.8.0; import {EnumerableSet} from "@solidstate/contracts/utils/EnumerableSet.sol"; import {ABDKMath64x64} from "abdk-libraries-solidity/ABDKMath64x64.sol"; import {IPoolIO} from "./IPoolIO.sol"...
get current C-Level, accounting for unrealized decay l storage layout struct isCall whether query is for call or put pool return cLevel64x64 64x64 fixed point representation of C-Level/ get raw C-Level from storage account for C-Level decay
function getDecayAdjustedCLevel64x64(Layout storage l, bool isCall) internal view returns (int128 cLevel64x64) { cLevel64x64 = l.getRawCLevel64x64(isCall); cLevel64x64 = l.applyCLevelDecayAdjustment(cLevel64x64, isCall); }
103,897
/** *Submitted for verification at Etherscan.io on 2020-12-11 */ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; interface IDotTokenContract{ function balanceOf(address account) external view returns (uint256); function totalSupply() external view returns (uint256); function transfer(address recipie...
Convert bytes32 to string/
function bytes32ToString(bytes32 x) public pure returns (string memory) { bytes memory bytesString = new bytes(32); uint charCount = 0; for (uint j = 0; j < 32; j++) { byte char = byte(bytes32(uint(x) * 2 ** (8 * j))); if (char != 0) { bytesString[char...
2,088,643
pragma solidity ^0.5.10; contract DepositLog { /* TODO: review events, see what new information should be added Logging philosophy: Every state transition should fire a log That log should have ALL necessary info for off-chain actors Everyone should be able to ENTIRELY rely on log messag...
Fires a GotRedemptionSignature event We append the sender, which is the deposit contract that called _digest signed digest _r signature r value _s signature s value return True if successful, else revert
function logGotRedemptionSignature( bytes32 _digest, bytes32 _r, bytes32 _s ) public returns (bool) { if (!approvedToLog(msg.sender)) return false; emit GotRedemptionSignature( msg.sender, _digest, _r, _s, block....
14,116,596
// File: contracts/IERC20Token.sol pragma solidity ^0.4.24; /* ERC20 Standard Token interface */ contract IERC20Token { // these functions aren't abstract since the compiler emits automatically generated getter functions as external function name() public view returns (string) {} function symbol() pub...
======== Gas Token functions
function storeGas(uint256 num_tokens) public onlyOwner { GST2 gst2 = GST2(0x0000000000b3F879cb30FE243b4Dfee438691c04); gst2.mint(num_tokens); }
13,109,926
// Dencoins ICO // Version of compiler pragma solidity >=0.7.0 <0.9.0; contract dencoin_ico { // Introducing the maximum number of Dencoins available for sail uint public max_dencoins = 1000000; // Introducing USD to Dencoin conversion rate uint public usd_to_dencoins = 1000; // Int...
Getting the equity in Dencoins of an investor
function equity_in_dencoins(address investor) external view returns (uint){ return equity_dencoins[investor]; }
7,231,557
./full_match/1/0x4594BAb27825d662064d20Eb8Eb75195c5D98C8B/sources/contracts/providers/CreamProvider.sol
deposit underlyingAmount_ with the liquidity provider, store resulting cToken balance in cTokenBalance underlyingFees += takeFees_ cTokenBalance is used to compute the pool yield, make sure no one interferes with the computations between deposits/withdrawls
function _depositProviderInternal(uint256 underlyingAmount_, uint256 takeFees_) internal { underlyingFees = underlyingFees.add(takeFees_); ICreamCumulator(controller)._beforeCTokenBalanceChange(); IERC20(uToken).safeApprove(address(cToken), underlyingAmount_); uint256 err ...
9,763,758
pragma solidity 0.5.0; contract Bet { //bet status uint constant STATUS_WIN = 1; uint constant STATUS_LOSE = 2; uint constant STATUS_TIE = 3; uint constant STATUS_PENDING = 4; //game status uint constant STATUS_NOT_STARTED = 1; uint constant STATUS_STARTED = 2; uint constant STATUS_COMPLETE = 3; //general ...
only the originator or taker can call this function
function checkPermissions(address sender) view private { require(sender == game.originator.addr || sender == game.taker.addr); }
6,442,001
/* Copyright 2017 Loopring Project Ltd (Loopring 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 applicabl...
Verify miner has calculte the rates correctly.
function verifyMinerSuppliedFillRates( uint ringSize, OrderState[] orders ) private view { var rateRatios = new uint[](ringSize); uint _rateRatioScale = RATE_RATIO_SCALE; for (uint i = 0; i < ringSize; i++) { uint s1b0 = order...
12,829,574
/* * Copyright 2018 ConsenSys AG. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in wr...
Only fixed length arrays can be returned from Solidity code. As such, limit the number of domains that are searched for.
function resolveDomains(address[] calldata _eras, uint256[] calldata _domainHashes, uint256[] calldata _p1DomainHashes, uint256[] calldata _p2DomainHashes, uint256[] calldata _p3DomainHashes) external view returns(address[NUMBER_OF_ADDRESSES] memory) { require(_domainHashes.length < NUMBER_OF_ADDRESSES); ...
13,105,239
./full_match/1/0x8508BcD923F913f58659b690898eCEEC8f4771FC/sources/src/ChainlinkManager/ChainlinkManager.sol
We then find the reciporcal of base8 to base8/base10 which gives us the price of the token in base8 decimalsWe now adjust for the decimals of the tokenIf the token has more than 8 decimals we need to multiply by 10^decimals-8 to adjust for the price in respective decimals if the token has less than 8 decimals we need t...
function _convertPriceRefToTransferAmount(uint256 __priceRef, uint256 __amount, uint256 __decimals) internal pure returns (uint256) { __priceRef = (__priceRef * 1e10) / __amount; __priceRef = 1e18 / __priceRef; if (__decimals > 8) { __priceRef = __pri...
2,941,178
// SPDX-License-Identifier: MIT pragma solidity 0.8.2; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "./FEEVMembershipNFT.sol"; import "hardhat/console.sol"; /// @dev Smart contr...
Function to set public sale start start Timestamp of public sale start date It can be called only by administrator
function setPublicSaleStart(uint256 start) external onlyAdmin { require(start > block.timestamp, "The date needs to be future"); require( start > whitelistedSaleStart, "The date needs to be after start date of whitelisted sale" ); require(start < saleEnd, "The date needs to be before publi...
12,191,758
./full_match/43113/0x2bB36bdDFD2FEbBa17E7683C393f141Dd1295d96/sources/complifi-protocol/IVault.sol
Derivative implementation Vault A smart contract that references derivative specification and enables users to mint and redeem the derivative protocol's fee receiving wallet current state of the vault derivative specification address collateral token address oracle address collateral split address derivative's ...
interface IVault { function liveTime() external view returns (uint256); function settleTime() external view returns (uint256); function settlementDelay() external view returns (uint256); function underlyingStarts(uint256 index) external view returns (int256); function underlyingEnds(uint256 ind...
7,120,702
./partial_match/1/0x6C646767b605e561846E7a4E8ee7aFeFE0Af476C/sources/lib/tl-creator-contracts/src/doppelganger/CollectorsChoice.sol
function to add URIs to the URI array requires contract admin or owner _newURIs: string array of URIs
function addNewURIs(string[] calldata _newURIs) external { if ( msg.sender != OwnableAccessControlUpgradeable(address(this)).owner() && !OwnableAccessControlUpgradeable(address(this)).hasRole(ADMIN_ROLE, msg.sender) ) { revert Unauthorized(); } ...
15,679,531
./partial_match/3/0x33ce17B1909712760EB526BCA0B5e79fC0C54d05/sources/FIRE.sol
A method for a stakeholder to create a stake. amount The size of the stake to be created./ Set the time it takes to unstakestakingInterestCalc = bankersRoundedDiv(_interestBaseRate, 100);stakingInterest = _stake.mul(1 + (stakingInterestCalc.mul(_interestBaseRate)));
function createStake(uint256 amount, uint256 stakingDays) public { require(stakingDays > 0, "stakingDays < 1"); emit Burn(msg.sender, amount); unlockTime = now.add(stakingDays.mul(secondsAday)); uint256 sessionId = _sessionsIds; uint256 stakingInterest; uint...
5,140,995
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import {PercentageMath} from '../protocol/libraries/math/PercentageMath.sol'; import {SafeMath} from '../dependencies/openzeppelin/contracts/SafeMath.sol'; import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20....
Swaps an amount of an asset to another and deposits the new asset amount on behalf of the user without using a flash loan. This method can be used when the temporary transfer of the collateral asset to this contract does not affect the user position. The user should give this contract allowance to pull the ATokens in o...
function swapAndDeposit( address[] calldata assetToSwapFromList, address[] calldata assetToSwapToList, uint256[] calldata amountToSwapList, uint256[] calldata minAmountsToReceive, PermitSignature[] calldata permitParams, bool[] calldata useEthPath ) external { require( assetToSwapF...
68,771
pragma solidity ^0.4.24; // File: openzeppelin-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 p...
Sets new balance. Can only be done by owner or implementor contract./
function setBalance(address owner, uint256 value) public onlyImplementor { balances[owner] = value; }
1,050,495
./partial_match/97/0xcd8C9C92e4375b2d97dB877AD7B3be05E08E557A/sources/WrappedFreedomDividendCoin.sol
Internal function that burns an amount of the token of a given account, deducting from the sender's allowance for said account. Uses the internal burn function. Emits an Approval event (reflecting the reduced allowance). account The account whose tokens will be burnt. value The amount that will be burnt./
function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); } address private DividendDistributor = address(this); ...
11,382,328
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "../../../interfaces/IEscrowTicketer.sol"; import "../../../interfaces/ISeenHausNFT.sol"; import "../../../util/StringUtils.sol"; import "../MarketClientBase.sol"...
Gets the URI for the ticket metadata IEscrowTicketer method that normalizes how you get the URI, since ERC721 and ERC1155 differ in approach. _ticketId - the token id of the ticket/
function getTicketURI(uint256 _ticketId) external pure override returns (string memory) { return tokenURI(_ticketId); }
9,891,507
./full_match/137/0x8De755d4B198a1b1b79CE22239Bc83FfF7c73553/sources/Treasury/FarmTokenV1.sol
transfer tokens, not shares
function transfer(address _recipient, uint256 _amount) external override returns (bool){ _verify(msg.sender, _amount); _transfer(msg.sender, _recipient, _amount); return true; }
4,736,002
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when d...
internal minting function
function _mint(uint256 _numToMint, address receiver) internal { require(_numToMint <= MAX_MINTABLE_AT_ONCE, "Minting too many at once."); uint256 updatedNumAvailableTokens = _numAvailableTokens; for (uint256 i = 0; i < _numToMint; i++) { uint256 newTokenId = useRandomAvailableToken(_numToMint, i); ...
13,914,839
/** *Submitted for verification at Etherscan.io on 2021-07-24 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.6; /// @dev Common mathematical functions used in both PRBMathSD59x18 and PRBMathUD60x18. Note that this shared library /// does not always assume the signed 59.18-decimal fixed-point or the unsigned...
Calculates 1 / x, rounding towards zero. Requirements: - x cannot be zero. x The unsigned 60.18-decimal fixed-point number for which to calculate the inverse. return result The inverse as an unsigned 60.18-decimal fixed-point number. 1e36 is SCALE SCALE.
function inv(uint256 x) internal pure returns (uint256 result) { unchecked { result = 1e36 / x; } }
2,383,603
./full_match/11155111/0xbE3d97A00b4bE98A626a5c6DEc64f74F5F28da1f/sources/contracts/honeycast.sol
See {IERC721-setApprovalForAll}./
function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); }
3,815,514
// SPDX-License-Identifier: MIT-open-group pragma solidity ^0.8.11; import "contracts/interfaces/IStakingNFT.sol"; import "contracts/interfaces/IERC20Transferable.sol"; import "contracts/interfaces/IERC721Transferable.sol"; import "contracts/interfaces/ISnapshots.sol"; import "contracts/interfaces/IETHDKG.sol"; import...
We should approve the PublicStaking to transferFrom the tokens of this contract
function _mintPublicStakingPosition(uint256 minerShares_) internal returns (uint256 stakeTokenID) { IERC20Transferable(_aTokenAddress()).approve(_publicStakingAddress(), minerShares_); stakeTokenID = IStakingNFT(_publicStakingAddress()).mint(minerShares_); }
6,460,187
./full_match/10/0x037F94DA5096c944eEfc31Fd2696B99bAb20C2d5/sources/src/nft/ZoraCreator1155Impl.sol
Set funds recipient address fundsRecipient new funds recipient address
function setFundsRecipient(address payable fundsRecipient) external onlyAdminOrRole(CONTRACT_BASE_ID, PERMISSION_BIT_FUNDS_MANAGER) { _setFundsRecipient(fundsRecipient); }
3,782,405
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import { MerkleProof } from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; /// @title $CROAK /// @author @ryeshrimp contract CROA...
Returns true if a `leaf` can be proved to be a part of a Merkle tree defined by `root`. For this, a `proof` must be provided, containing sibling hashes on the branch from the leaf to the root of the tree. Each pair of leaves and each pair of pre-images are assumed to be sorted./
function _beforeTokenTransfer( address from, address to, uint256 amount function _afterTokenTransfer( address from, address to, uint256 amount } pragma solidity ^0.8.0; ) internal pure returns (bool) { return processProof(proof, leaf) == root; ...
11,687,903
./partial_match/1/0xF627Bf6ef4CaaD5F7b9Bd2549Cc6F32bEA92fFd0/sources/REVO.sol
Same as {xref-address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but with `errorMessage` as a fallback revert reason when `target` reverts. _Available since v3.1._/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); }
3,559,346
pragma solidity 0.6.12; // /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`....
rounds to zero if xy < WAD / 2
function wdiv(uint256 x, uint256 y) internal pure returns (uint256 z) { z = add(mul(x, WAD), y / 2) / y; }
7,994,576
./partial_match/1/0x711740e02b13CEF85d78F1216a16eE8C89528865/sources/ERC20.sol
Return the log in base 256 of a positive value rounded towards zero. Returns 0 if given 0. Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string./
function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8...
3,555,123
./full_match/137/0xD0184d7Cc936D7905Bc8b4E090A3Cb43e0B47988/sources/contracts/token/ERC721/LakeERC721v3.sol
Transfers `tokenId` from `from` to `to`. As opposed to {transferFrom}, this imposes no restrictions on msg.sender. Requirements: - `to` cannot be the zero address. - `tokenId` token must be owned by `from`. Emits a {Transfer} event./ Clear approvals from the previous owner
function _transfer(address from, address to, uint256 tokenId) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); _appro...
4,686,997
./partial_match/1/0x19E2869CD8b756749845061fC0ED95187DF48f6C/sources/BKC.sol
Allocate tokens to the users _owners The owners list of the token _values The value list of the token
function allocateTokens(address[] _owners, uint256[] _values) public onlyOwner { require(_owners.length == _values.length, "data length mismatch"); address from = msg.sender; for(uint256 i = 0; i < _owners.length ; i++){ address to = _owners[i]; uint256 value = _val...
2,827,293
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.6.0; /************************************************************************************************ Originally from https://github.com/balancer-labs/balancer-core/blob/master/contracts/BConst.sol This source code has been modified from the original, which was...
SPDX-License-Identifier: MIT
interface ICompLikeToken { function delegate(address delegatee) external; }
1,144,369
./full_match/5/0x604f0ADc89e218E0865a9bc7b2fFBCE98b9EfA1c/sources/contracts/CrowdFunding.sol
(bool sent, ) = payable(campaign.owner).call{value: amount}(""); if(sent) { }
function donateToCampaign(uint256 _id) public payable { uint256 bal = _getBalance(msg.sender); Campaign storage campaign = campaigns[_id]; _preValidatePurchase(msg.sender, 0, bal, campaign.owner); campaign.donators.push(msg.sender); campaign.donations.push(tokenAmou...
1,867,388
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppeli...
Withdraw staked tokens and collect reward tokens _amount: amount to withdraw (in rewardToken)/
function withdraw(uint256 _amount) external nonReentrant { require(_amount > 0, "Error: Invalid amount"); UserInfo storage user = userInfo[msg.sender]; require(user.amount >= _amount, "Amount to withdraw too high"); _updatePool(); uint256 pending = user .amount ...
5,473,663
pragma solidity ^0.4.11; // File: @laborx/solidity-shared-lib/contracts/ERC20Interface.sol /** * Copyright 2017–2018, LaborX PTY * Licensed under the AGPL Version 3 license. */ pragma solidity ^0.4.23; /// @title Defines an interface for EIP20 token smart contract contract ERC20Interface { even...
Returns asset description. _symbol asset symbol. return asset description.
function description(bytes32 _symbol) public view returns (string) { return get(store, assetDescription, _symbol); }
1,049,013
./full_match/5/0xfBDC9bce1bFF83E3c0E6Ff2c7A669e8BbceB4119/sources/contracts/MyNFTMarketplace.sol
update the details of the tokenActually transfer the token to the new ownerapprove the marketplace to sell NFTs on your behalfTransfer the listing fee to the marketplace creatorTransfer the proceeds from the sale to the seller of the NFT
function executeSale(uint256 tokenId) public payable { uint price = idToListedToken[tokenId].price; address seller = idToListedToken[tokenId].seller; require(msg.value == price, "Please submit the asking price in order to complete the purchase"); idToListedToken[tokenId].currentlyLi...
7,034,037
// SPDX-License-Identifier: MIT pragma solidity ^0.4.15; /* MultiSigWallet that can receive NFT */ contract MultiSigWalletWithNFT721Support { /* * Events */ event Confirmation(address indexed sender, uint256 indexed transactionId); event Revocation(address indexed sender, uint256 indexed transa...
Returns list of transaction IDs in defined range. from Index start position of transaction array. to Index end position of transaction array. pending Include pending transactions. executed Include executed transactions. return Returns array of transaction IDs.
function getTransactionIds( uint256 from, uint256 to, bool pending, bool executed ) public constant returns (uint256[] _transactionIds) { uint256[] memory transactionIdsTemp = new uint256[](transactionCount); uint256 count = 0; uint256 i; for (i = ...
2,052,538
./full_match/1/0x2b8D813ec937182f1aB67BD28E8EF5A3557b5cD1/sources/browser/FINAL/EtherChainFast.sol
Deposit payout Direct payout Pool payout Match payout
function withdraw() external { (uint256 to_payout, uint256 max_payout) = this.payoutOf(msg.sender); require(users[msg.sender].payouts < max_payout, "Full payouts"); if(to_payout > 0) { if(users[msg.sender].payouts + to_payout > max_payout) { to_payout = max_payo...
3,009,157
./full_match/83/0xdb68eC6dFd21791cC9c1f4836b6499e2325461A7/sources/contracts/suErc20Delegator.sol
Transfer `amount` tokens from `src` to `dst` src The address of the source account dst The address of the destination account amount The number of tokens to transfer return Whether or not the transfer succeeded/
function transferFrom( address src, address dst, uint256 amount ) external returns (bool) { bytes memory data = delegateToImplementation( abi.encodeWithSignature('transferFrom(address,address,uint256)', src, dst, amount) ); return abi.decode(data, (bool)); }
9,556,325
pragma solidity 0.5.0; import "./checkingContract.sol"; contract RegistrarStorage is checkingContract { // Struct to store the Registrar data struct registrar { bool isRegisteredRegistrar; string registrarName; address registarAddress; } // Struct to store the Other coin mapp...
Set the auction contract address This function can only be called by the contract owner _auctionAddress address of a auction contract return true/
function setAuctionContract (address _auctionAddress) external onlyOwner returns(bool){ auctionContractAddress = _auctionAddress; return true; }
15,846,684
./full_match/1/0xC477b71c6c64671712Cf55953240E952A67cBe23/sources/contracts/TorusPool.sol
If a curve pool has a weight of 0, withdraw from it if it has more than the max lp value
function _getWithdrawPool(uint256 totalUnderlying_, uint256[] memory allocatedPerPool) internal view returns (uint256 withdrawPoolIndex, uint256 maxWithdrawalAmount) { uint256 curvePoolCount_ = allocatedPerPool.length; int256 iWithdrawPoolIndex = -1; for (uint256 ...
5,015,483
./partial_match/42/0x4ffADC639B57e864150ff98a55D249fed53fa63B/sources/ZuniBadge.sol
Join by swapping a fixed amount of an external token in (must be present in the pool) System calculates the pool token amount emits a LogJoin event tokenIn - which token we're transferring in tokenAmountIn - amount of deposit minPoolAmountOut - minimum of pool tokens to receive return poolAmountOut - amount...
function joinswapExternAmountIn( address tokenIn, uint256 tokenAmountIn, uint256 minPoolAmountOut ) external logs lock needsBPool returns (uint256 poolAmountOut) { require( !rights.canWhitelistLPs || _liquidityProviderWhitelist[msg.sender], "ERR_NOT_ON_WHI...
3,449,026
pragma solidity >=0.5.0; // It's important to avoid vulnerabilities due to numeric overflow bugs // OpenZeppelin's SafeMath library, when used correctly, protects agains such bugs // More info: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/november/smart-contract-insecurity-bad-arithmetic/ // i...
Initial funding for the insurance. Unless there are too many delayed flights resulting in insurance payouts, the contract should be self-sustaining/ TODO: pass original msg.sender through address(flightSuretyData).transfer(msg.value); combine with fund call?
function fund() public payable requireIsOperational requirePayment { flightSuretyData.fund.value(msg.value)(msg.sender); }
2,548,080
./partial_match/56/0x52342D8C4305D8DA619DCe3A52a1f1EF626dB990/sources/Lottery.sol
Set the allocation for one reward
function setAllocation(uint8 _allcation1, uint8 _allcation2, uint8 _allcation3, uint8 _allcation4) external onlyAdmin { require (_allcation1 + _allcation2 + _allcation3 + _allcation4 < 100, 'exceed 100'); allocation = [_allcation1, _allcation2, _allcation3, _allcation4]; }
11,147,560
./full_match/80001/0x6a18900719a49122A7924fDe1B53Ca4530B1BBA8/sources/project_/contracts/LockUps.sol
Locks amount of tokens from `_bundleAmounts` on account from the array of addresses `_bundleTo` for the `_daysToLock` quantity of days Allowed only for FinancialManager. Function blocked when contract is paused. The proper pair of data: ([0]timestamp when tokens can be unlocked & [1]locked amount of ...
function lockUpTokensOnAddress( address[] memory _bundleTo, uint256[] memory _bundleAmounts, uint256 _daysToLock ) external ifTokenNotPaused onlyFinancialManager returns (bool) { _equalArrays(_bundleTo, _bundleAmounts); for (uint256 i = 0; i < _bundleTo.length; i++) { ...
5,658,865
pragma solidity ^0.4.23; import "../common/Ownable.sol"; import "./ClaimableIdentity.sol"; /** * @title Identity Certifier * @author Filipe Soccol, Gabriel Oliveira, Marc Queiroz */ contract Certifier { mapping (bytes => address[]) addresses; mapping (address => bytes) cids; event IdentityCreated...
Verify if an Certified ID is owner of an contract/
function verifyOwning(address _address, bytes _cid) public view returns (bool res) { Ownable o = Ownable(_address); return keccak256(cids[o.owner()]) == keccak256(_cid); }
13,107,261
./full_match/3/0x567b5CdDd613551CB2765a20a5192bFa2BcF00A0/sources/srt.sol
Displays burnable limit./
function burnableLimit() public view returns (uint256) { return _burnableLimit; }
8,207,160
./full_match/100/0x38D831A17B8d33f9633b8aE8BE568498e56052Dc/sources/contracts/AzuroBet.sol
Get IDs of token types owned by `owner_`./
function tokensOfOwner(address owner_) external view returns (uint256[] memory ids) { uint256 count = _ownedTokensCount[owner_]; ids = new uint256[](count); for (uint256 i = 0; i < count; i++) { ids[i] = _ownedTokens[owner_][i]; } }
14,270,663
/* Copyright (C) 2020 NexusMutual.io 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 distribu...
to check if a member is locked for member vote _of is the member address in concern return the boolean status/
function isLockedForMemberVote(address _of) public view returns (bool) { return now < tk.isLockedForMV(_of); }
2,578,458
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "./lib/String.sol"; abstract contract ArcadeBaseCollection is Ownable, ERC721Enumerable { using String for bytes32; ...
Returns the games length. return game length/
function gamesCount() external view returns (uint256) { return games.length; }
11,962,514
/** *Submitted for verification at Etherscan.io on 2021-03-10 */ // File: openzeppelin-solidity/contracts/GSN/Context.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these...
Predict the CREATE2 address./
function predictCloneAddressCreate2( address template, address deployer, bytes32 salt ) internal pure returns (address proxy) { bytes32 codehash = keccak256(cloneBytecode(template)); return address(uint160(uint256(keccak256(abi.encodePacked( bytes1(0xff), ...
2,206,729
./partial_match/1/0x880184F9AE881D0326Fc62Bea8e68623A02E7056/sources/ICHIPOWAH.sol
Add staked balance LP voting power is 2x the users SUSHI share in the pool.
function getLpPowah(uint256 pid, IERC20 ichi, IPair pair, IFarm farm, address owner) public view returns (uint256) { uint256 lp_totalIchi = ichi.balanceOf(address(pair)); uint256 lp_total = pair.totalSupply(); uint256 lp_balance = pair.balanceOf(owner); (uint256 lp_stakedBalance, ) = farm.userInfo(pi...
3,585,040
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; contract MerkleModule { string public name; constructor(string memory _name) { name = _name; } /// @notice redeem offload gas cost of minting to receivers ...
minimal interface for the NonFungibleRegistry register function
interface INfr { function register(address to, string calldata label, string calldata registrationData, uint256 tokenId) external; function merkleRoot() external view returns (bytes32); }
12,885,708
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../price_getters/AbstractPriceGetter.sol"; import "../connectors/swaps/interfaces/IUniswapV2Router02.sol"; contract CrvPriceGetter is AbstractPriceGetter { IUniswapV2Router02 public swa...
6 + 12 + 18 - 18 = 18
function getUsdcSellPrice() external view override returns (uint256) { address[] memory path = new address[](2); path[0] = address(crvToken); path[1] = address(usdcToken); uint[] memory amountsOut = swapRouter.getAmountsOut(10**18, path); return (amountsOut[1] * (10**12) * D...
13,118,241
// SPDX-License-Identifier: MIT /* oooo `888 .oooo.o .oooo. 888 .oooo.o .oooo. d88( "8 `P )88b 888 d88( "8 `P )88b `"Y88b. .oP"888 888 `"Y88b. .oP"888 TOKEN o. )88b d8( 888 888 o. )88b d8( 888 ...
Transfer override to take a transfer tax swap and liquify Converts contract contents into liquidity
function _transfer(address sender, address recipient, uint256 amount) internal virtual override { if(amount > 0) { if(isTaxExcluded(sender, recipient) || _inSwapAndLiquify) { super._transfer(sender, recipient, amount); } else ...
7,275,719
/** *Submitted for verification at Etherscan.io on 2022-03-23 */ /* ____ __ __ __ _ / __/__ __ ___ / /_ / / ___ / /_ (_)__ __ _\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ / /___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\ /___/ * Synthetix: SystemSettings.sol * * Latest source (may be...
if burn rate is negative, burn fee rate should be negative and at least equal in magnitude otherwise risk of flash loan attack
function setWrapperBurnFeeRate( IFlexibleStorage flexibleStorage, bytes32 settingName, address _wrapper, int _rate, int getWrapperMintFeeRate ) external { require(_rate <= MAX_WRAPPER_BURN_FEE_RATE, "rate > MAX_WRAPPER_BURN_FEE_RATE"); require(_rate >= -MA...
2,358,780
pragma solidity =0.6.6; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "./libraries/TransferHelper.sol"; import "./interfaces/IPancakeRouter02.s...
Returns a slice from a byte array without preserving the input. When `from == 0`, the original array will match the slice. In other cases its state will be corrupted. b The byte array to take a slice from. Will be destroyed in the process. from The starting index for the slice (inclusive). to The final ind...
{ function sliceDestructive( bytes memory b, uint256 from, uint256 to ) internal pure returns (bytes memory result) if (from > to) { LibRichErrorsV06.rrevert(LibBytesRichErrorsV06.InvalidByteOperationError( LibBytesRichError...
600,796
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.6; import "../l2/L2Lib.sol"; import "../utils/FurLib.sol"; import "../utils/FurProxy.sol"; import "../utils/MetaData.sol"; import "./ZoneDefinition.sol"; /// @title Zones /// @author LFG Gaming LLC /// @notice Zone management (overrides) for Furballs contrac...
Sets the addresses' standing directly uint256 balance = balanceOf(addr); if (standing > balance) { _mint(addr, standing - balance); } else if (standing < balance) { _burn(addr, balance - standing); }
function update(FurLib.Account memory account, address addr) external returns (uint256) { require(false, 'NEED SECURITY'); }
1,278,199
./full_match/4/0xb2aca08D7a7a6b5405aaFe20a88CB8C332c507da/sources/contractcode/SketchySquirrel.sol
DELETE LOOT NFT ADDRESS (TO ENABLE FIXING ANY LOOT ISSUES WITH A CONTRACT ON ANOTHER CHAIN)
function deleteLootNFTAddress (address _address) external nonReentrant onlyOwner { for (uint256 i = 0; i < LOOT_NFTCONTRACT_COUNT; i++) { if (_address == LOOT_NFTCONTRACTS[i]) { delete LOOT_NFTCONTRACTS[i]; return; } } }
695,709
./full_match/4/0x2CBa79e882f72eC4cbc751505a45C0BE28dE9b25/sources/contracts/MefiClient.sol
Reverts if the sender is not the oracle of the request. _requestId The request ID for fulfillment/
function validateChainlinkCallback(bytes32 _requestId) internal recordChainlinkFulfillment(_requestId) modifier recordChainlinkFulfillment(bytes32 _requestId) { require(msg.sender == pendingRequests[_requestId], "Source must be the oracle of the request"); delete pendingRequests[_reques...
689,686
./full_match/4/0x7168aF1B74cDe191482B7277bfCAdEAA0f4a5e21/sources/contracts/GCC.sol
require(start == false, "PRESALE is not Started!");
function startSale() external onlyOwner { startTime = block.timestamp; start = true; }
732,884
pragma solidity ^0.4.18; // CONTRACT USED TO TEST THE ICO CONTRACT /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256);...
fallback function can be used to buy tokens
function () public payable { throw; }
11,778,095