Unnamed: 0
int64
0
7.36k
comments
stringlengths
3
35.2k
code_string
stringlengths
1
527k
code
stringlengths
1
527k
__index_level_0__
int64
0
88.6k
1
// Informs third-party platforms that NFT metadata should be updated/This event comes from https:eips.ethereum.org/EIPS/eip-4906/tokenId the id of the token that should have its metadata updated
event MetadataUpdate(uint256 tokenId); function initialize(string memory nftName, string memory nftSymbol) external; // initializer; function triggerMetadataUpdate(uint256 tokenId) external;
event MetadataUpdate(uint256 tokenId); function initialize(string memory nftName, string memory nftSymbol) external; // initializer; function triggerMetadataUpdate(uint256 tokenId) external;
34,060
19
// Tells the address of the current implementation return address of the current implementation/
function implementation() public view returns (address) { return _implementation; }
function implementation() public view returns (address) { return _implementation; }
12,115
32
// See {ICreatorCore-setMintPermissions}. /
function setMintPermissions(address extension, address permissions) external override adminRequired { _setMintPermissions(extension, permissions); }
function setMintPermissions(address extension, address permissions) external override adminRequired { _setMintPermissions(extension, permissions); }
17,161
10
// perform Export /
public isValidPerformer(_batchNo,'EXPORTER') returns(bool) { /* Call Storage Contract */ bool status = supplyChainStorage.setExporterData(_batchNo, _quantity, _destinationAddress, _shipName,_shipNo, _estimateDateTime,_exporterId); ...
public isValidPerformer(_batchNo,'EXPORTER') returns(bool) { /* Call Storage Contract */ bool status = supplyChainStorage.setExporterData(_batchNo, _quantity, _destinationAddress, _shipName,_shipNo, _estimateDateTime,_exporterId); ...
4,771
171
// Internal Functions
function _transferOwnership( address __owner )
function _transferOwnership( address __owner )
22,045
28
// Internal object that represents a token
struct Token { address tokenAddress; bool hasTransferFee; int256 decimals; TokenType tokenType; uint256 maxCollateralBalance; }
struct Token { address tokenAddress; bool hasTransferFee; int256 decimals; TokenType tokenType; uint256 maxCollateralBalance; }
44,022
3
// Event for token purchase logging purchaser who paid for the tokens beneficiary who got the tokens value weis paid for purchase tokenId the token id purchased /
event TokenPurchase( address indexed purchaser, address indexed beneficiary, uint256 value, uint256 tokenId );
event TokenPurchase( address indexed purchaser, address indexed beneficiary, uint256 value, uint256 tokenId );
17,888
15
// First of all, we need to see if the operator has grant delegated. If not, we don't need to bother about checking grantee or managed grantee and we just return false.
if (!hasGrantDelegated(self, operator)) { return false; }
if (!hasGrantDelegated(self, operator)) { return false; }
25,268
67
// Restrict by the allowance that `sender` has to this contract NOTE: No need for allowance check if `sender` is this contract
if (sender != address(this)) { availableShares = Math.min(availableShares, vaults[id].allowance(sender, address(this))); }
if (sender != address(this)) { availableShares = Math.min(availableShares, vaults[id].allowance(sender, address(this))); }
85,594
26
// mint a specific `amount` of tokens to the `target`
function _mint(address _target, uint256 _amount) internal { uint256 __gonsPerFragment = _gonsPerFragment; // the gonbalances of the sender is in gons, therefore we must multiply the deposit amount, which is in fragments, by gonsperfragment _gonBalances[_target] += _amount * __gonsPerFragment; // total...
function _mint(address _target, uint256 _amount) internal { uint256 __gonsPerFragment = _gonsPerFragment; // the gonbalances of the sender is in gons, therefore we must multiply the deposit amount, which is in fragments, by gonsperfragment _gonBalances[_target] += _amount * __gonsPerFragment; // total...
7,697
14
// Transfers a specific NFT (`tokenId`) from one account (`from`) toanother (`to`). Requirements:- `from`, `to` cannot be zero.- `tokenId` must be owned by `from`.- If the caller is not `from`, it must be have been allowed to move thisNFT by either `approve` or `setApproveForAll`. /
function safeTransferFrom(address from, address to, uint256 tokenId) public;
function safeTransferFrom(address from, address to, uint256 tokenId) public;
10,515
157
// Deposits a given amount of StakingToken from sender _amount Units of StakingToken /
function _stakeRaw(address _beneficiary, uint256 _amount) internal nonReentrant { _rawBalances[_beneficiary] += _amount; stakingToken.safeTransferFrom(msg.sender, address(this), _amount); }
function _stakeRaw(address _beneficiary, uint256 _amount) internal nonReentrant { _rawBalances[_beneficiary] += _amount; stakingToken.safeTransferFrom(msg.sender, address(this), _amount); }
49,989
106
// returns bool isProfit, uint profitOrLoss the position's profit/loss denominated in positionToken
function getProfitOrLoss( address positionTokenAddress, address loanTokenAddress, uint positionTokenAmount, uint loanTokenAmount) public view returns (bool isProfit, uint profitOrLoss)
function getProfitOrLoss( address positionTokenAddress, address loanTokenAddress, uint positionTokenAmount, uint loanTokenAmount) public view returns (bool isProfit, uint profitOrLoss)
4,802
0
// Grammer: using A(library) for B(type, struct data type)
using Counters for Counters.Counter; Counters.Counter private tokenCount; string public baseURI;
using Counters for Counters.Counter; Counters.Counter private tokenCount; string public baseURI;
28,825
4,644
// 2323
entry "sealskinned" : ENG_ADJECTIVE
entry "sealskinned" : ENG_ADJECTIVE
18,935
58
// Returns one of the accounts that have `role`. `index` must be a
* value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all que...
* value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all que...
37,092
3
// Make sure our discount algorithm never returns a higher rate than the base.
require(result <= Consts.DISCOUNT_RATE_BASE(), "DISCOUNT_ERROR");
require(result <= Consts.DISCOUNT_RATE_BASE(), "DISCOUNT_ERROR");
46,903
95
// Stores the bridged token of a message sent to the AMB bridge._messageId of the message sent to the bridge._token bridged token address./
function setMessageToken(bytes32 _messageId, address _token) internal { addressStorage[keccak256(abi.encodePacked("messageToken", _messageId))] = _token; }
function setMessageToken(bytes32 _messageId, address _token) internal { addressStorage[keccak256(abi.encodePacked("messageToken", _messageId))] = _token; }
20,986
64
// claims any outstanding rewards. /
function claimRewards() public virtual { address sender = _msgSender(); require(sender != _dividendWallet && sender != _dev && sender != _team && sender != _donation && sender != _marketing && sender != _liquidity && sender != _...
function claimRewards() public virtual { address sender = _msgSender(); require(sender != _dividendWallet && sender != _dev && sender != _team && sender != _donation && sender != _marketing && sender != _liquidity && sender != _...
8,436
19
// Variable of token frozen rules for YAC team members.
uint public unlockat;
uint public unlockat;
60,330
643
// Calculate a YieldSpace pool invariant according to the whitepaper /
function invariant(uint128 baseReserves, uint128 fyTokenReserves, uint256 totalSupply, uint128 timeTillMaturity, int128 ts) public pure returns(uint128)
function invariant(uint128 baseReserves, uint128 fyTokenReserves, uint256 totalSupply, uint128 timeTillMaturity, int128 ts) public pure returns(uint128)
47,334
154
// Allows a user to create a game from Credits. Gas Cost: 61k - 22k: tx overhead - 26k: see _createNewGame() -3k: event -2k: curMaxBet() -2k: 1 event: CreditsUsed -5k: update credits[user] -1k: SLOAD, execution
function betWithCredits(uint64 _bet) public
function betWithCredits(uint64 _bet) public
57,099
8
// 要求拥有管理员权限
modifyUserInfo(_name, _stuNo, _grade, _identity, ModifiedUser); iLog.addLog_User("User", "Superadmin_Modify_UserInfo", msg.sender, users[msg.sender].Name, true); return true;
modifyUserInfo(_name, _stuNo, _grade, _identity, ModifiedUser); iLog.addLog_User("User", "Superadmin_Modify_UserInfo", msg.sender, users[msg.sender].Name, true); return true;
50,450
31
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
(bool success, bytes memory returndata) = target.call{ value: value }(data);
1,370
4
// Mask for the 128 least significant bits
uint256 private constant MASK_128_BITS = 0xffffffffffffffffffffffffffffffff;
uint256 private constant MASK_128_BITS = 0xffffffffffffffffffffffffffffffff;
29,714
93
// The supplier reedems the BNDESToken by transfering the tokens to a specific address,called Redemption address.By default, the redemption address is the address of the owner.The owner can change the redemption address using this function. rs new Redemption address/
function setRedemptionAddress(address rs) onlyOwner public { redemptionAddress = rs; }
function setRedemptionAddress(address rs) onlyOwner public { redemptionAddress = rs; }
40,102
141
// Query if a contract implements an interface _interfaceIDThe interface identifier, as specified in ERC-165return `true` if the contract implements `_interfaceID` and /
function supportsInterface(bytes4 _interfaceID) public override virtual pure returns (bool) { if (_interfaceID == type(IERC1155Metadata).interfaceId) { return true; } return super.supportsInterface(_interfaceID); }
function supportsInterface(bytes4 _interfaceID) public override virtual pure returns (bool) { if (_interfaceID == type(IERC1155Metadata).interfaceId) { return true; } return super.supportsInterface(_interfaceID); }
10,399
38
// Update delegation params
pool.indexingRewardCut = _indexingRewardCut; pool.queryFeeCut = _queryFeeCut; pool.cooldownBlocks = _cooldownBlocks; pool.updatedAtBlock = block.number; emit DelegationParametersUpdated( indexer, _indexingRewardCut, _queryFeeCut, _...
pool.indexingRewardCut = _indexingRewardCut; pool.queryFeeCut = _queryFeeCut; pool.cooldownBlocks = _cooldownBlocks; pool.updatedAtBlock = block.number; emit DelegationParametersUpdated( indexer, _indexingRewardCut, _queryFeeCut, _...
19,622
287
// Burn liquidity
(uint256 owed0, uint256 owed1) = IUniswapV3Pool(pool).burn( tickLower, tickUpper, liquidity );
(uint256 owed0, uint256 owed1) = IUniswapV3Pool(pool).burn( tickLower, tickUpper, liquidity );
15,243
379
// ctor
constructor () public { }
constructor () public { }
41,446
18
// if NFT was created by our factory contract
if ( factoryCreatedTokens[_nftCollectionAddress] > DeNftConstants.DENFT_TYPE_THIRDPARTY &&
if ( factoryCreatedTokens[_nftCollectionAddress] > DeNftConstants.DENFT_TYPE_THIRDPARTY &&
7,957
1
// slither-disable-next-line unused-return
deployedAddress_.safeNativeTransfer(msg.value);
deployedAddress_.safeNativeTransfer(msg.value);
31,236
23
// set shamapass address
function setShamaPassAddress(address _address) public onlyOwner { SHAMAPASS_ADDRESS = _address; }
function setShamaPassAddress(address _address) public onlyOwner { SHAMAPASS_ADDRESS = _address; }
35,573
28
// decider => true if this address is a decider
mapping(address => bool) public isDecider;
mapping(address => bool) public isDecider;
36,627
8
// Fallback to centralised URI
return string(abi.encodePacked(baseURI(), address(this), '/', tokenId.toString()));
return string(abi.encodePacked(baseURI(), address(this), '/', tokenId.toString()));
32,446
16
// Process sweep transaction inputs and extract all information needed to perform deposit bookkeeping.
DepositSweepTxInputsInfo memory inputsInfo = processDepositSweepTxInputs( self, DepositSweepTxInputsProcessingInfo( sweepTx.inputVector, resolvedMainUtxo, vault ) );
DepositSweepTxInputsInfo memory inputsInfo = processDepositSweepTxInputs( self, DepositSweepTxInputsProcessingInfo( sweepTx.inputVector, resolvedMainUtxo, vault ) );
10,988
172
// Maximum number of priority request to clear during verifying the block/Cause deleting storage slots cost 5k gas per each slot it's unprofitable to clear too many slots/Value based on the assumption of ~750k gas cost of verifying and 5 used storage slots per PriorityOperation structure
uint64 constant MAX_PRIORITY_REQUESTS_TO_DELETE_IN_VERIFY = 6;
uint64 constant MAX_PRIORITY_REQUESTS_TO_DELETE_IN_VERIFY = 6;
29,750
38
// short case: marketSize - skew= (|longSize| + |shortSize|) - (longSize + shortSize)= 2-shortSize
newSideSize = newMarketSize.sub(newSkew);
newSideSize = newMarketSize.sub(newSkew);
50,686
10
// Replacement for Solidity's `transfer`: sends `amount` wei to`recipient`, forwarding all available gas and reverting on errors. of certain opcodes, possibly making contracts go over the 2300 gas limitimposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using ...
* `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using ...
20,135
122
// Buy collateral from an auction at an increasing discount id ID of the auction to buy collateral from wad New bid submitted (as a WAD which has 18 decimals) /
function buyCollateral(uint256 id, uint256 wad) external { require(both(bids[id].amountToSell > 0, bids[id].amountToRaise > 0), "IncreasingDiscountCollateralAuctionHouse/inexistent-auction"); require(both(wad > 0, wad >= minimumBid), "IncreasingDiscountCollateralAuctionHouse/invalid-bid"); ...
function buyCollateral(uint256 id, uint256 wad) external { require(both(bids[id].amountToSell > 0, bids[id].amountToRaise > 0), "IncreasingDiscountCollateralAuctionHouse/inexistent-auction"); require(both(wad > 0, wad >= minimumBid), "IncreasingDiscountCollateralAuctionHouse/invalid-bid"); ...
11,729
14
// Execute multiple meta-transactions./mtxs The meta-transactions./signatures The signature by each respective `mtx.signer`./ return returnResults The ABI-encoded results of the underlying calls.
function batchExecuteMetaTransactions( MetaTransactionData[] calldata mtxs, bytes[] calldata signatures ) external payable returns (bytes[] memory returnResults);
function batchExecuteMetaTransactions( MetaTransactionData[] calldata mtxs, bytes[] calldata signatures ) external payable returns (bytes[] memory returnResults);
28,004
73
// Let everyone know that our pause state has changed.
emit PauseChanged(paused);
emit PauseChanged(paused);
8,902
62
//
contract BasketDAOBuyAndBurn { using SafeERC20 for IERC20; /// @dev Owner of the contract. address public owner; /// @dev Address of the KeeperDAO borrow proxy. This will be the /// `msg.sender` for calls to the `helloCallback` function. address public borrowProxy; /// @dev Addres...
contract BasketDAOBuyAndBurn { using SafeERC20 for IERC20; /// @dev Owner of the contract. address public owner; /// @dev Address of the KeeperDAO borrow proxy. This will be the /// `msg.sender` for calls to the `helloCallback` function. address public borrowProxy; /// @dev Addres...
6,522
5
// An event sent when funds are received.
event Funded(address from, uint value);
event Funded(address from, uint value);
38,399
55
// ReentrancyGuard The contract provides protection against re-entrancy - calling a function (directly or indirectly) from within itself./
contract ReentrancyGuard { // true while protected code is being executed, false otherwise bool private locked = false; /** * @dev ensures instantiation only by sub-contracts */ constructor() internal {} // protects a function against reentrancy attacks modifier protected() { ...
contract ReentrancyGuard { // true while protected code is being executed, false otherwise bool private locked = false; /** * @dev ensures instantiation only by sub-contracts */ constructor() internal {} // protects a function against reentrancy attacks modifier protected() { ...
48,682
6
// Gives an address permission to execute a method/selector The method selector to execute/executor The address to grant permission to
function addAccess(bytes4 selector, address executor) internal { if (executor == address(this)) { revert CannotAuthoriseSelf(); } AccessStorage storage accStor = accessStorage(); accStor.execAccess[selector][executor] = true; emit AccessGranted(executor, selector)...
function addAccess(bytes4 selector, address executor) internal { if (executor == address(this)) { revert CannotAuthoriseSelf(); } AccessStorage storage accStor = accessStorage(); accStor.execAccess[selector][executor] = true; emit AccessGranted(executor, selector)...
18,428
82
// ============ R = 1 cases ============
function _ROneSellBaseToken(PMMState memory state, uint256 payBaseAmount) internal pure returns ( uint256 // receiveQuoteToken )
function _ROneSellBaseToken(PMMState memory state, uint256 payBaseAmount) internal pure returns ( uint256 // receiveQuoteToken )
7,949
224
// return if an expired oToken is ready to be settled, only true when price for underlying,strike and collateral assets at this specific expiry is available in our Oracle module _otoken oToken /
function isSettlementAllowed(address _otoken) external view returns (bool) { (address underlying, address strike, address collateral, uint256 expiry) = _getOtokenDetails(_otoken); return _canSettleAssets(underlying, strike, collateral, expiry); }
function isSettlementAllowed(address _otoken) external view returns (bool) { (address underlying, address strike, address collateral, uint256 expiry) = _getOtokenDetails(_otoken); return _canSettleAssets(underlying, strike, collateral, expiry); }
34,519
20
// Transfers of 0 values MUST be treated as normal transfers and fire the Transfer event (ERC-20)
require(_value >= 0);
require(_value >= 0);
11,663
48
// Returns array with owner addresses, which confirmed transaction./_transactionId Transaction ID./ return _confirmations Returns array of owner addresses.
function getLogConfirmations(uint256 _transactionId) public view returns (address[] memory _confirmations)
function getLogConfirmations(uint256 _transactionId) public view returns (address[] memory _confirmations)
16,020
1
// assert(b > 0);Solidity automatically throws when dividing by 0
uint256 c = a / b;
uint256 c = a / b;
278
14
// See {IERC20-approve}. Requirements: - `spender` cannot be the zero address. /
function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; }
function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; }
41,836
66
// Returns amount of tokens specific address orstaker has earned so far based on his stake and timethe stake been active so far. /
function earned( address account ) public view returns (uint256)
function earned( address account ) public view returns (uint256)
32,162
582
// The buffer duration required to return the highest bid if no action taken.
uint256 public receiptBuffer;
uint256 public receiptBuffer;
46,578
882
// Unique identifier for DVM price feed ticker.
bytes32 public priceIdentifier;
bytes32 public priceIdentifier;
12,311
1
// Change IPFS hash /
function lockedAmount(address owner) external view returns (uint256 quantity);
function lockedAmount(address owner) external view returns (uint256 quantity);
6,430
13
// Unpause contract Requirements: - The contract must be paused./
function unpause() external whenPaused onlyContractAdmin { _unpause(); }
function unpause() external whenPaused onlyContractAdmin { _unpause(); }
10,072
96
// if current week before supply decay ends we add the new supply for the week diff between current week and (supply decay start week - 1)
uint decayCount = currentWeek.sub(SUPPLY_DECAY_START - 1); totalAmount = totalAmount.add(tokenDecaySupplyForWeek(decayCount)); remainingWeeksToMint--;
uint decayCount = currentWeek.sub(SUPPLY_DECAY_START - 1); totalAmount = totalAmount.add(tokenDecaySupplyForWeek(decayCount)); remainingWeeksToMint--;
10,422
6
// pass ACE Equity Token Configurations to the Constructor
function ACEEquityToken(uint initial_balance, string tokenName, string tokenSymbol, uint8 decimalUnits) public { cap_ACE = initial_balance; _supply += initial_balance; _balances[msg.sender] = initial_balance; decimals = decimalUnits; symbol = tokenSymbol; name = tokenName; dev = msg.sen...
function ACEEquityToken(uint initial_balance, string tokenName, string tokenSymbol, uint8 decimalUnits) public { cap_ACE = initial_balance; _supply += initial_balance; _balances[msg.sender] = initial_balance; decimals = decimalUnits; symbol = tokenSymbol; name = tokenName; dev = msg.sen...
10,431
18
// Remove extra owner. /
function removeOwner(address owner) onlyOwner public { // This check is neccessary to prevent a situation where all owners // are accidentally removed, because we do not want an ownable contract // to become an orphan. require(ownerCount > 1); require(isOwner[owner]); ...
function removeOwner(address owner) onlyOwner public { // This check is neccessary to prevent a situation where all owners // are accidentally removed, because we do not want an ownable contract // to become an orphan. require(ownerCount > 1); require(isOwner[owner]); ...
14,626
3
// User Interface // Sender supplies assets into the market and receives cTokens in exchange Reverts upon any failure /
function mint() external payable { (uint256 err, ) = mintInternal(msg.value); requireNoError(err, "mint failed"); }
function mint() external payable { (uint256 err, ) = mintInternal(msg.value); requireNoError(err, "mint failed"); }
18,263
11
// get the length of the data
let rlpLength := mload(rlpBytes)
let rlpLength := mload(rlpBytes)
11,018
22
// make a new transaction
Transaction memory newTransaction = Transaction({ purchaseId: transactions.length, expirationTime: expirationTime, nftId: nftId, cost: cost, buyerAddress: buyerAddress, sellerAddress: msg.sender, // use the message sender as the seller ...
Transaction memory newTransaction = Transaction({ purchaseId: transactions.length, expirationTime: expirationTime, nftId: nftId, cost: cost, buyerAddress: buyerAddress, sellerAddress: msg.sender, // use the message sender as the seller ...
54,264
1
// For marketing etc.
function reserveMintBatch(uint256[] calldata quantities, address[] calldata tos) external onlyOwner { for(uint256 j = 0; j < quantities.length; j++){ require( totalSupply() + quantities[j] <= collectionSize, "Too many already minted before dev mint." ...
function reserveMintBatch(uint256[] calldata quantities, address[] calldata tos) external onlyOwner { for(uint256 j = 0; j < quantities.length; j++){ require( totalSupply() + quantities[j] <= collectionSize, "Too many already minted before dev mint." ...
5,070
46
// BEP20Operable
* @dev Implementation of the {IBEP20Operable} interface */ abstract contract BEP20Operable is BEP20, IBEP20Operable, ERC165 { using Address for address; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) re...
* @dev Implementation of the {IBEP20Operable} interface */ abstract contract BEP20Operable is BEP20, IBEP20Operable, ERC165 { using Address for address; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) re...
79,738
3
// Execute the Arbitrable associated to a dispute based on its final ruling_disputeId Identification number of the dispute to be executed/
function executeRuling(uint256 _disputeId) external;
function executeRuling(uint256 _disputeId) external;
16,521
33
// call by Owner (SupplyBooster)
function initialize( address _virtualBalance, address _underlyToken, bool _isErc20
function initialize( address _virtualBalance, address _underlyToken, bool _isErc20
26,353
42
// This method will parse a delimited string and insert them into the Domain map of a Rule/
function splitStrIntoMap(string memory str, string memory delimiter, WonkaLibrary.WonkaRule storage targetRule, bool isOpRule) private { bytes memory b = bytes(str); //cast the string to bytes to iterate bytes memory delm = bytes(delimiter); splitTempStr = ""; for(uint i; i<b.l...
function splitStrIntoMap(string memory str, string memory delimiter, WonkaLibrary.WonkaRule storage targetRule, bool isOpRule) private { bytes memory b = bytes(str); //cast the string to bytes to iterate bytes memory delm = bytes(delimiter); splitTempStr = ""; for(uint i; i<b.l...
54,395
28
// @inheritdoc IERC165
function supportsInterface( bytes4 interfaceId_ ) public view override(ERC721Enumerable, ERC2981) returns (bool)
function supportsInterface( bytes4 interfaceId_ ) public view override(ERC721Enumerable, ERC2981) returns (bool)
9,421
32
// Liquididity providers add liquidity _amount liquidity amount that users want to deposit. _tokenAddress address of the liquidity token. /
function addLiquidity( uint256 _amount, address _tokenAddress ) external payable nonReentrant whenNotPaused
function addLiquidity( uint256 _amount, address _tokenAddress ) external payable nonReentrant whenNotPaused
25,289
179
// withdraw
function withdraw() public payable onlyOwner { uint256 _each = address(this).balance / 1; require(payable(_address_for_withdrawal).send(_each)); }
function withdraw() public payable onlyOwner { uint256 _each = address(this).balance / 1; require(payable(_address_for_withdrawal).send(_each)); }
74,539
10
// init
_initialized = true; return true;
_initialized = true; return true;
4,584
55
// read the current registrar /
function getRegistrar() external view returns ( address )
function getRegistrar() external view returns ( address )
46,854
160
// Delete the slot where the moved entry was stored
map._entries.pop();
map._entries.pop();
2,102
22
// check if ticket is on sale
require(_exists, "Token requested is not for sale.");
require(_exists, "Token requested is not for sale.");
39,592
14
// Override this function to set initial operational values for module instances
function _setUp(bytes calldata _initData) internal virtual { } /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ /// @notice Deploy the implementation contract and set its version /// @dev...
function _setUp(bytes calldata _initData) internal virtual { } /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ /// @notice Deploy the implementation contract and set its version /// @dev...
28,802
23
// THIS FUMCTION WILL BE USED BY INVESTOR FOR BUYING TOKENSIF THE OWNER WILL END ICO THEN NO ONE CAN INVEST ANYMORE
function buyToken() public payable{ require(msg.value > 0,"You are passing wrong value"); require(msg.sender != address(0),"Invalid Address of Buyer"); require(now <= releaseTime, "ICO is ended."); address sender = msg.sender; uint256 quantity = (msg.value / tokenPrice) * 10...
function buyToken() public payable{ require(msg.value > 0,"You are passing wrong value"); require(msg.sender != address(0),"Invalid Address of Buyer"); require(now <= releaseTime, "ICO is ended."); address sender = msg.sender; uint256 quantity = (msg.value / tokenPrice) * 10...
13
18
// The addresses of the accounts (or contracts) that can execute actions within each roles.
address public devAddress = msg.sender;
address public devAddress = msg.sender;
9,720
44
// EFFICIENCY ATTRIBUTE MULTIPLIER
if(blockDif >= ONE_MINUTE_BLOCKS){ uint mins = blockDif.div(ONE_MINUTE_BLOCKS); if(mins > 1){
if(blockDif >= ONE_MINUTE_BLOCKS){ uint mins = blockDif.div(ONE_MINUTE_BLOCKS); if(mins > 1){
25,032
75
// setSalePrice// Set the token for sale. The owner of the token must be the sender and have the marketplace approved. _tokenId uint256 ID of the token _amount uint256 wei value that the item is for sale _owner address of the token owner /
function setSalePrice( uint256 _tokenId, uint256 _amount, address _owner
function setSalePrice( uint256 _tokenId, uint256 _amount, address _owner
55,150
18
// - converts raw bytes representation of a Syscoin block header to struct representation_rawBytes - first 80 bytes of a block header return - exact same header information in BlockHeader struct form
function parseHeaderBytes(bytes memory _rawBytes, uint pos) private view returns (BlockHeader memory bh) { bh.bits = getBits(_rawBytes, pos); bh.blockHash = bytes32(dblShaFlipMem(_rawBytes, pos, 80)); bh.timestamp = getTimestamp(_rawBytes, pos); bh.prevBlock = bytes32(getHashPrevBloc...
function parseHeaderBytes(bytes memory _rawBytes, uint pos) private view returns (BlockHeader memory bh) { bh.bits = getBits(_rawBytes, pos); bh.blockHash = bytes32(dblShaFlipMem(_rawBytes, pos, 80)); bh.timestamp = getTimestamp(_rawBytes, pos); bh.prevBlock = bytes32(getHashPrevBloc...
48,639
11
// Get Users Lenght
function getUsersCount() external view
function getUsersCount() external view
51,911
13
// Check if strategy already has been added, if not/ add it to the list of strategies
function _addStrategy(address _strategy) internal { uint256 strategiesLength = strategies.length; for (uint256 i; i < strategiesLength; ++i) { if (strategies[i] == _strategy) { return; } } strategies.push(_strategy); }
function _addStrategy(address _strategy) internal { uint256 strategiesLength = strategies.length; for (uint256 i; i < strategiesLength; ++i) { if (strategies[i] == _strategy) { return; } } strategies.push(_strategy); }
33,032
62
// has active bid// has active bid _tokenId uint256 ID of the token _owner address of the token owner /
function hasTokenActiveBid(uint256 _tokenId, address _owner) external view override returns (bool){ ActiveBid memory ab = activeBid[_tokenId][_owner]; if (ab.bidder == _owner || ab.bidder == address(0)) return false; return true; }
function hasTokenActiveBid(uint256 _tokenId, address _owner) external view override returns (bool){ ActiveBid memory ab = activeBid[_tokenId][_owner]; if (ab.bidder == _owner || ab.bidder == address(0)) return false; return true; }
55,140
8
// NFTSVG/Provides a function for generating an SVG associated with a Uniswap NFT
library MetadataGenerator { using Strings for uint256; using HexStrings for uint160; using ToColor for bytes3; function statsBar(uint chubbiness) internal pure returns (string memory) { string memory line = '<line x1="0" y1="300" x2="400" y2="300" stroke="black" />'; string memory text ...
library MetadataGenerator { using Strings for uint256; using HexStrings for uint160; using ToColor for bytes3; function statsBar(uint chubbiness) internal pure returns (string memory) { string memory line = '<line x1="0" y1="300" x2="400" y2="300" stroke="black" />'; string memory text ...
2,290
4
// Burn liquidity from the sender and account tokens owed for the liquidity to the position/Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0/Fees must be collected separately via a call to collect/tickLower The lower tick of the position for which to burn liquidity/tickUp...
function burn( int24 tickLower, int24 tickUpper, uint128 amount ) external returns (uint256 amount0, uint256 amount1);
function burn( int24 tickLower, int24 tickUpper, uint128 amount ) external returns (uint256 amount0, uint256 amount1);
17,400
304
// Disable internal _transfer function for ERC721 - do nth, must use safeTransferFrom to transfer token
_transfer(from, to, tokenId);
_transfer(from, to, tokenId);
44,181
16
// state variables
OpenBooks private openBooks;
OpenBooks private openBooks;
2,480
10
// Wager amount in wei.
uint amount;
uint amount;
19,518
28
// key should be pmt sha3 hash. But currently txRef is used to globaqueue after checking queue.
uint public globalGridlockQueueDepth; mapping (bytes32 => GridlockedPmt) public globalGridlockQueue; uint public maxQueueDepth; // queue depth trigger
uint public globalGridlockQueueDepth; mapping (bytes32 => GridlockedPmt) public globalGridlockQueue; uint public maxQueueDepth; // queue depth trigger
32,543
0
// mint(msg.sender, 20);
admin = msg.sender;
admin = msg.sender;
3,379
66
// 32 byte slot 1Current round number. `round` represents the number of `period`s elapsed.
uint16 round;
uint16 round;
48,702
35
// StablePriceOracle sets a price in USD, based on an oracle.
contract StablePriceOracle is Ownable, PriceOracle { using SafeMath for *; using StringUtils for *; // Oracle address DSValue usdOracle; // Rent in attodollars (1e-18) per second uint[] public rentPrices; event OracleChanged(address oracle); event RentPriceChanged(uint[] prices); ...
contract StablePriceOracle is Ownable, PriceOracle { using SafeMath for *; using StringUtils for *; // Oracle address DSValue usdOracle; // Rent in attodollars (1e-18) per second uint[] public rentPrices; event OracleChanged(address oracle); event RentPriceChanged(uint[] prices); ...
26,403
295
// Confirm both aggregate account balance and directly staked amount are valid
this.validateAccountStakeBalance(msg.sender); uint256 currentlyStakedForOwner = Staking(stakingAddress).totalStakedFor(msg.sender);
this.validateAccountStakeBalance(msg.sender); uint256 currentlyStakedForOwner = Staking(stakingAddress).totalStakedFor(msg.sender);
3,198
22
// solium-disable indentation // solium-enable indentation / Raise appeal if both sides are fully funded.
if (round.hasPaid[uint(Party.Challenger)] && round.hasPaid[uint(Party.Requester)]) { request.arbitrator.appeal.value(appealCost)(request.disputeID, request.arbitratorExtraData); request.rounds.length++; round.feeRewards = round.feeRewards.subCap(appealCost); }
if (round.hasPaid[uint(Party.Challenger)] && round.hasPaid[uint(Party.Requester)]) { request.arbitrator.appeal.value(appealCost)(request.disputeID, request.arbitratorExtraData); request.rounds.length++; round.feeRewards = round.feeRewards.subCap(appealCost); }
12,702
286
// the current protocol fee as a percentage of the swap fee taken on withdrawal represented as an integer denominator (1/x)%
uint8 feeProtocol;
uint8 feeProtocol;
31,043
2
// The main logic. If the timer has elapsed and there is a schedule upgrade, the governance can upgrade the vault/
function upgrade() external { (bool should, address newImplementation) = IUpgradeSource(address(this)).shouldUpgrade(); require(should, "Upgrade not scheduled"); _upgradeTo(newImplementation); // the finalization needs to be executed on itself to update the storage of this proxy // it also needs ...
function upgrade() external { (bool should, address newImplementation) = IUpgradeSource(address(this)).shouldUpgrade(); require(should, "Upgrade not scheduled"); _upgradeTo(newImplementation); // the finalization needs to be executed on itself to update the storage of this proxy // it also needs ...
25,366
65
// Emitted after aTokens are burned from The owner of the aTokens, getting them burned target The address that will receive the underlying value The amount being burned index The new liquidity index of the reserve // Emitted during the transfer action from The user whose tokens are being transferred to The recipient va...
function mintToTreasury(uint256 amount, uint256 index) external;
function mintToTreasury(uint256 amount, uint256 index) external;
12,794
48
// Generates `_amount` tokens that are assigned to `_owner`/_owner The address that will be assigned the new tokens/_amount The quantity of tokens generated/ return True if the tokens are generated correctly
function _generateTokens(address _owner, uint _amount) internal returns (bool) { uint curTotalSupply = totalSupply(); require(curTotalSupply + _amount >= curTotalSupply); // Check for overflow uint previousBalanceTo = balanceOf(_owner); require(previousBalanceTo + _amount >= previous...
function _generateTokens(address _owner, uint _amount) internal returns (bool) { uint curTotalSupply = totalSupply(); require(curTotalSupply + _amount >= curTotalSupply); // Check for overflow uint previousBalanceTo = balanceOf(_owner); require(previousBalanceTo + _amount >= previous...
1,169
264
// MUST emit when an approval is updated.
event ApprovalForAll( address indexed _owner, address indexed _operator, bool _approved );
event ApprovalForAll( address indexed _owner, address indexed _operator, bool _approved );
18,430