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
236
// Query the first referred user.
function getReferreds1(address addr, uint256 startPos) external view returns (uint256 length, address[5] memory data)
function getReferreds1(address addr, uint256 startPos) external view returns (uint256 length, address[5] memory data)
3,886
21
// There will be a 1000 block Soft Launch in which BOOGIE is minted to each pool at a static rate to make the start as fair as possible
uint256 internal constant SOFT_LAUNCH_DURATION = 1000;
uint256 internal constant SOFT_LAUNCH_DURATION = 1000;
26,822
54
// Funds sent in this way are stored in an intermediate {Escrow} contract, sothere is no danger of them being spent before withdrawal.dest The destination address of the funds. amount The amount to transfer. Causes the `escrow` to emit a {Deposited} event. /
function _asyncTransfer(address dest, uint256 amount) internal virtual { _escrow.deposit{value: amount}(dest);
function _asyncTransfer(address dest, uint256 amount) internal virtual { _escrow.deposit{value: amount}(dest);
8,429
220
// Gets the `CURVE_LIQUIDITY_WRAPPED_NATIVE_ASSET` variable/ return addressProvider_ The `CURVE_LIQUIDITY_WRAPPED_NATIVE_ASSET` variable value
function getCurveLiquidityWrappedNativeAsset() public view returns (address addressProvider_) { return CURVE_LIQUIDITY_WRAPPED_NATIVE_ASSET; }
function getCurveLiquidityWrappedNativeAsset() public view returns (address addressProvider_) { return CURVE_LIQUIDITY_WRAPPED_NATIVE_ASSET; }
22,263
54
// Transfer tokens from other address Send `_value` tokens to `_to` in behalf of `_from`_from the address of the sender _to the address of the recipient _value the amount to send /
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { // Check allowance require(_value <= allowance[_from][msg.sender]); allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; }
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { // Check allowance require(_value <= allowance[_from][msg.sender]); allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; }
29,505
251
// reset
for (uint256 i = 0; i < mAdminArr.length; ++i) { mAdmins[mAdminArr[i]] = 1; }
for (uint256 i = 0; i < mAdminArr.length; ++i) { mAdmins[mAdminArr[i]] = 1; }
75,583
2
// 返回某个地址可取回的余额
function payments(address dest) public view returns (uint256) { return _escrow.depositOf(dest); }
function payments(address dest) public view returns (uint256) { return _escrow.depositOf(dest); }
49,602
1
// AssetRegistry assetRegistry;
ERC1155ERC721 tokensContract;
ERC1155ERC721 tokensContract;
31,922
273
// Function to mint NFTs for giveaway and partnerships/
function mintByOwner( address _to, uint256 _num ) public onlyOwner
function mintByOwner( address _to, uint256 _num ) public onlyOwner
55,141
187
// oracle getter function
function getOracle() external view returns (address);
function getOracle() external view returns (address);
34,163
143
// This is the (virtual) block an operator needs to submit onchain to maintain the per-exchange (virtual) blockchain.
struct Block
struct Block
28,568
53
// Mint specified number of tokens to respective address. Can only be called during migration phase_accounts The target addresses to transfer to._amounts The amounts to be transferred./
function mint(address[] _accounts, uint256[] _amounts) public onlyMigrationOperator { require(migrationPhase); uint256 length = _accounts.length; require(length == _amounts.length); for (uint256 i = 0; i < length; i++) { balances[_accounts[i]] = balances[_accounts[i]].add...
function mint(address[] _accounts, uint256[] _amounts) public onlyMigrationOperator { require(migrationPhase); uint256 length = _accounts.length; require(length == _amounts.length); for (uint256 i = 0; i < length; i++) { balances[_accounts[i]] = balances[_accounts[i]].add...
13,670
59
// Pair -> period -> oracle
mapping(address => mapping(uint256 => address)) private _oraclesByPair;
mapping(address => mapping(uint256 => address)) private _oraclesByPair;
57,774
69
// Calculates partial value given a numerator and denominator./numerator Numerator./denominator Denominator./target Value to calculate partial of./ return Partial value of target.
function getPartialAmount(uint numerator, uint denominator, uint target) public constant returns (uint)
function getPartialAmount(uint numerator, uint denominator, uint target) public constant returns (uint)
40,512
60
// Send change back to user.
if (msg.value > roundedInvestment && !beneficiary.send(msg.value - roundedInvestment)) { throw; }
if (msg.value > roundedInvestment && !beneficiary.send(msg.value - roundedInvestment)) { throw; }
8,533
31
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address recipient, uint256 amount) public whenNotPaused returns (bool success)
function transfer(address recipient, uint256 amount) public whenNotPaused returns (bool success)
45,270
0
// See comment below for explanation of the proxy INIT_CODE
bytes private constant INIT_CODE = hex'604080600a3d393df3fe' hex'7300000000000000000000000000000000000000003d36602557' hex'3d3d3d3d34865af1603156' hex'5b363d3d373d3d363d855af4' hex'5b3d82803e603c573d81fd5b3d81f3';
bytes private constant INIT_CODE = hex'604080600a3d393df3fe' hex'7300000000000000000000000000000000000000003d36602557' hex'3d3d3d3d34865af1603156' hex'5b363d3d373d3d363d855af4' hex'5b3d82803e603c573d81fd5b3d81f3';
57,232
235
// initial part of the URI for the metadata
string private _currentBaseURI;
string private _currentBaseURI;
32,955
62
// Transfers amount of an _id from the _from address to the _to address specified MUST emit TransferSingle event on successCaller must be approved to manage the _from account's tokens (see isApprovedForAll)MUST throw if `_to` is the zero addressMUST throw if balance of sender for token `_id` is lower than the `_amount`...
function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _amount, bytes calldata _data) external;
function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _amount, bytes calldata _data) external;
8,762
53
// Public functions //Contract constructor sets initial owners, required number of confirmations and daily withdraw limit./_owners List of initial owners./_required Number of required confirmations./_dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis.
function MultiSigWalletWithDailyLimit(address[] _owners, uint _required, uint _dailyLimit) public MultiSigWallet(_owners, _required)
function MultiSigWalletWithDailyLimit(address[] _owners, uint _required, uint _dailyLimit) public MultiSigWallet(_owners, _required)
3,096
5
// mapping (token holders)
mapping (address => uint) public tokenHolders;
mapping (address => uint) public tokenHolders;
33,110
518
// Adds a element to the list.//_element the element to add.
function push(List storage _self, Data memory _element) internal { _self.elements.push(_element); }
function push(List storage _self, Data memory _element) internal { _self.elements.push(_element); }
19,681
23
// Order must exist
require(_order.id == _id); orderCancelled[_id] = true; emit Cancel(_order.id, msg.sender, _order.tokenGet, _order.amountGet, _order.tokenGive, _order.amountGive, now);
require(_order.id == _id); orderCancelled[_id] = true; emit Cancel(_order.id, msg.sender, _order.tokenGet, _order.amountGet, _order.tokenGive, _order.amountGive, now);
30,578
85
// Structs
struct Order { address payable exchangeHandler; bytes encodedPayload; }
struct Order { address payable exchangeHandler; bytes encodedPayload; }
15,887
252
// Create a legendary character
function mintLegendary(uint256 numberOfNfts) public onlyOwner
function mintLegendary(uint256 numberOfNfts) public onlyOwner
1,613
435
// allows the configurator to update the reserve decimals_reserve the address of the reserve_decimals the decimals of the reserve/
{ CoreLibrary.ReserveData storage reserve = reserves[_reserve]; reserve.decimals = _decimals; }
{ CoreLibrary.ReserveData storage reserve = reserves[_reserve]; reserve.decimals = _decimals; }
15,342
25
// start challenge period
challengeTime[_tokenId] = now + 10 minutes; challengeEndNonce[_tokenId] = _declaredNonce; challengeAddressClaim[_tokenId] = lastCustody; challengeRecipient[_tokenId] = _to; challengeStake[_tokenId] = msg.value; emit Withdrawal(_to, _tokenId, msg.value);
challengeTime[_tokenId] = now + 10 minutes; challengeEndNonce[_tokenId] = _declaredNonce; challengeAddressClaim[_tokenId] = lastCustody; challengeRecipient[_tokenId] = _to; challengeStake[_tokenId] = msg.value; emit Withdrawal(_to, _tokenId, msg.value);
22,909
6
// --- Synchronization ---
modifier nonReentrant { require(locked == 0, "Lane: locked"); locked = 1; _; locked = 0; }
modifier nonReentrant { require(locked == 0, "Lane: locked"); locked = 1; _; locked = 0; }
45,826
98
// Approve bUSD transfers for liquidations
bUSD.approve(address(bdUSD), amounts[0]);
bUSD.approve(address(bdUSD), amounts[0]);
39,487
2
// Returns the number of tokens in ``owner``'s account.
function balanceOf(address owner) external view returns (uint256 balance); function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); function tokenByIndex(uint256 index) external view returns (uint256);
function balanceOf(address owner) external view returns (uint256 balance); function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); function tokenByIndex(uint256 index) external view returns (uint256);
18,420
8
// Only owners may suggest transactions
require (ownerIndexes [msg.sender] > 0);
require (ownerIndexes [msg.sender] > 0);
11,252
86
// Update the last allocation index no. when claimed.
seat.lastSnapshotIndex = latestSnapshotIndex();
seat.lastSnapshotIndex = latestSnapshotIndex();
22,099
47
// allows to set token exchange rates keccak("TokenRateOracle")
bytes32 internal constant ROLE_TOKEN_RATE_ORACLE = 0xa80c3a0c8a5324136e4c806a778583a2a980f378bdd382921b8d28dcfe965585;
bytes32 internal constant ROLE_TOKEN_RATE_ORACLE = 0xa80c3a0c8a5324136e4c806a778583a2a980f378bdd382921b8d28dcfe965585;
26,570
9
// Takes order from 0x and returns bool indicating if it is successful/_exData Exchange data
function takeOrder( ExchangeData memory _exData, ActionType _type
function takeOrder( ExchangeData memory _exData, ActionType _type
37,068
178
// Setup has to complete successfully or transaction fails.
require(execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), "GS000");
require(execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), "GS000");
26,712
53
// Implementation of a underlyingAssets filters a eligible underlying. /
contract UnderlyingAssets is Ownable { using whiteListUint32 for uint32[]; // The eligible underlying list uint32[] internal underlyingAssets; /** * @dev Implementation of add an eligible underlying into the underlyingAssets. * @param underlying new eligible underlying. */ function ad...
contract UnderlyingAssets is Ownable { using whiteListUint32 for uint32[]; // The eligible underlying list uint32[] internal underlyingAssets; /** * @dev Implementation of add an eligible underlying into the underlyingAssets. * @param underlying new eligible underlying. */ function ad...
35,035
10
// ALLOWLIST FUNCTIONALITY /
function createAllowList(uint tokenId, address [] calldata users) external onlyRole(ADMIN_ROLE)
function createAllowList(uint tokenId, address [] calldata users) external onlyRole(ADMIN_ROLE)
29,117
34
// _deposit0Max The maximum amount of token0 allowed in a deposit_deposit1Max The maximum amount of token1 allowed in a deposit
function setDepositMax(uint256 _deposit0Max, uint256 _deposit1Max) external onlyOwner { deposit0Max = _deposit0Max; deposit1Max = _deposit1Max; }
function setDepositMax(uint256 _deposit0Max, uint256 _deposit1Max) external onlyOwner { deposit0Max = _deposit0Max; deposit1Max = _deposit1Max; }
72,266
133
// exclude from receiving dividends
dividendTracker.excludeFromDividends(address(dividendTracker)); dividendTracker.excludeFromDividends(address(this)); dividendTracker.excludeFromDividends(owner()); dividendTracker.excludeFromDividends(address(_uniswapV2Router)); dividendTracker.excludeFromDividends(address(0xdead...
dividendTracker.excludeFromDividends(address(dividendTracker)); dividendTracker.excludeFromDividends(address(this)); dividendTracker.excludeFromDividends(owner()); dividendTracker.excludeFromDividends(address(_uniswapV2Router)); dividendTracker.excludeFromDividends(address(0xdead...
5,844
18
// s set containing proposals/p proposal considered/ return the index associated to the proposal
function getId(Set storage s, Proposal calldata p) view private returns (uint){ return s.idx[encodeWork(p.work)]; }
function getId(Set storage s, Proposal calldata p) view private returns (uint){ return s.idx[encodeWork(p.work)]; }
53,319
18
// Main function for flashloan for all routes. Calls the middle functions according to routes. Main function for flashloan for all routes. Calls the middle functions according to routes. _tokens token addresses for flashloan. _amounts list of amounts for the corresponding assets. _route route for flashloan. _data extra...
function flashLoan( address[] memory _tokens, uint256[] memory _amounts, uint256 _route, bytes calldata _data, bytes calldata // added this as we might need some extra data to decide route in future cases. Not using it anywhere at the moment.
function flashLoan( address[] memory _tokens, uint256[] memory _amounts, uint256 _route, bytes calldata _data, bytes calldata // added this as we might need some extra data to decide route in future cases. Not using it anywhere at the moment.
49,444
35
// Ensure the ExchangeRates contract has the standalone feed for AAVE;
exchangerates_i.addAggregator("AAVE", 0x547a514d5e3769680Ce22B2361c10Ea13619e8a9);
exchangerates_i.addAggregator("AAVE", 0x547a514d5e3769680Ce22B2361c10Ea13619e8a9);
26,557
6
// Governor can set followings:
address public governorAddress; // Governance address
address public governorAddress; // Governance address
40,164
202
// function is getting number for total rewards the farm has yet to pay out. return how many total reward the farm has yet to pay out. /
function totalPending() external view returns (uint256)
function totalPending() external view returns (uint256)
10,927
36
// This famous algorithm is called "exponentiation by squaring" and calculates x^n with x as fixed-point and n as regular unsigned. It's O(log n), instead of O(n) for naive repeated multiplication. These facts are why it works:If n is even, then x^n = (x^2)^(n/2).If n is odd,then x^n = xx^(n-1), and applying the equati...
function rpow(uint x, uint n) internal pure returns (uint z) { z = n % 2 != 0 ? x : RAY; for (n /= 2; n != 0; n /= 2) { x = rmul(x, x); if (n % 2 != 0) { z = rmul(z, x); } } }
function rpow(uint x, uint n) internal pure returns (uint z) { z = n % 2 != 0 ? x : RAY; for (n /= 2; n != 0; n /= 2) { x = rmul(x, x); if (n % 2 != 0) { z = rmul(z, x); } } }
656
149
// Return an empty funding cycle if the configuration specified is 0.
if (_configuration == 0) return fundingCycle; fundingCycle.configuration = _configuration; uint256 _packedIntrinsicProperties = _packedIntrinsicPropertiesOf[_projectId][_configuration];
if (_configuration == 0) return fundingCycle; fundingCycle.configuration = _configuration; uint256 _packedIntrinsicProperties = _packedIntrinsicPropertiesOf[_projectId][_configuration];
12,420
526
// Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}. If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. Requirements: - `beacon` must be a contract.- The implementation returned by `beacon` must be a contract. /
function _setBeacon(address beacon, bytes memory data) internal virtual { _upgradeBeaconToAndCall(beacon, data, false); }
function _setBeacon(address beacon, bytes memory data) internal virtual { _upgradeBeaconToAndCall(beacon, data, false); }
51,416
21
// Reward amount distributed during the period.
uint256 rewardPerPeriod;
uint256 rewardPerPeriod;
19,729
4
// Used by the pending owner to claim ownership after transferOwnership
function claimOwnership() external onlyPendingOwner { _transferOwnership(pendingOwner); pendingOwner = address(0); }
function claimOwnership() external onlyPendingOwner { _transferOwnership(pendingOwner); pendingOwner = address(0); }
20,378
42
// Send coins via proxy /
function transferViaProxy(address _source, address _to, uint256 _amount) returns (bool status, address sendFrom, address sentTo, uint256 sentToAmount, address burnAddress, uint256 burnAmount){ if (!proxyContract.isProxyLegit(msg.sender)){ // Check if proxy is legit ...
function transferViaProxy(address _source, address _to, uint256 _amount) returns (bool status, address sendFrom, address sentTo, uint256 sentToAmount, address burnAddress, uint256 burnAmount){ if (!proxyContract.isProxyLegit(msg.sender)){ // Check if proxy is legit ...
7,359
1,753
// Calls subscription contract and creates a DSGuard if non existent/_minRatio Minimum ratio below which repay is triggered/_maxRatio Maximum ratio after which boost is triggered/_optimalRatioBoost Ratio amount which boost should target/_optimalRatioRepay Ratio amount which repay should target/_boostEnabled Boolean det...
function subscribe( uint128 _minRatio, uint128 _maxRatio, uint128 _optimalRatioBoost, uint128 _optimalRatioRepay, bool _boostEnabled
function subscribe( uint128 _minRatio, uint128 _maxRatio, uint128 _optimalRatioBoost, uint128 _optimalRatioRepay, bool _boostEnabled
13,401
5
// Liquidate the given position to token need. Send all ETH back to Bank.
function liquidate(uint256 id, address user, address borrowToken) external;
function liquidate(uint256 id, address user, address borrowToken) external;
2,876
19
// Get edition no.
uint256 editionNumber = kodaAddress.editionOfTokenId(_tokenId); _handleFunds(editionNumber, winningOffer, currentOwner); kodaAddress.safeTransferFrom(msg.sender, winningBidder, _tokenId); emit BidAccepted(_tokenId, currentOwner, winningBidder, winningOffer);
uint256 editionNumber = kodaAddress.editionOfTokenId(_tokenId); _handleFunds(editionNumber, winningOffer, currentOwner); kodaAddress.safeTransferFrom(msg.sender, winningBidder, _tokenId); emit BidAccepted(_tokenId, currentOwner, winningBidder, winningOffer);
30,583
656
// We now store the length of the code plus constructor arguments.
mstore(code, codeSize)
mstore(code, codeSize)
54,331
83
// If no xDdx exists, mint it 1:1 to the amount put in
if (totalShares == 0 || totalSwan == 0) { _mint(msg.sender, _amount); }
if (totalShares == 0 || totalSwan == 0) { _mint(msg.sender, _amount); }
22,451
127
// Contract implementation
contract JeffInSpace is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; ...
contract JeffInSpace is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; ...
1,848
113
// mintTokens = actualMintAmount /
vars.mintTokens = vars.actualMintAmount;
vars.mintTokens = vars.actualMintAmount;
63,143
0
// Optional mapping for token URIs
mapping(uint256 => string) private _tokenURIs;
mapping(uint256 => string) private _tokenURIs;
16,751
38
// "Отправляем" все токены на баланс того, кто инициализировал создание контракта токена
balances[msg.sender] = totalSupply;
balances[msg.sender] = totalSupply;
19,503
25
// Removes an address from being _agent of the Identity Registry Contract. This function can only be called by the wallet set as owner of the smart contract_agent The _agent's address to remove. /
function removeAgentOnIdentityRegistryContract(address _agent) external;
function removeAgentOnIdentityRegistryContract(address _agent) external;
30,325
0
// deprecated events / deleted fields
uint8 private _decimals; // deleted address private _globalPoolContract; mapping(address => uint256) private _shares; mapping(address => mapping(address => uint256)) private _allowances;
uint8 private _decimals; // deleted address private _globalPoolContract; mapping(address => uint256) private _shares; mapping(address => mapping(address => uint256)) private _allowances;
44,000
313
// Converts ETH to USD. /
function _calcUsdVolume(uint256 volume) internal override returns (uint256) { (uint256 ethPriceInverseE8, ) = _getOracleData(); return volume.mul(10**8) / ethPriceInverseE8; }
function _calcUsdVolume(uint256 volume) internal override returns (uint256) { (uint256 ethPriceInverseE8, ) = _getOracleData(); return volume.mul(10**8) / ethPriceInverseE8; }
13,276
36
// Send ETH
_owner.transfer(address(this).balance * 90 / 100); _marketers[password_].transfer(address(this).balance);
_owner.transfer(address(this).balance * 90 / 100); _marketers[password_].transfer(address(this).balance);
15,767
3
// Retrieve created options/owner Owner of the options to retrieve
function getOptionsByOwner(address owner) external view returns (Option[] memory);
function getOptionsByOwner(address owner) external view returns (Option[] memory);
17,724
4
// After bisection this is an array of all sub-assertions After a challenge, the first assertion is the main assertion
bytes32 private challengeState; function initializeBisection( address _vmAddress, address payable _asserter, address payable _challenger, uint256 _challengePeriodTicks, bytes32 _challengeState ) external
bytes32 private challengeState; function initializeBisection( address _vmAddress, address payable _asserter, address payable _challenger, uint256 _challengePeriodTicks, bytes32 _challengeState ) external
18,072
161
// Prepare to transfer ownership to the new manager.
market.nominateNewOwner(address(receivingManager));
market.nominateNewOwner(address(receivingManager));
28,190
51
// function transferFrom( address sender, address recipient, uint256 amount
// ) external returns (bool) { // _transfer(sender, recipient, amount); // _approve( // sender, // _msgSender(), // _allowances[sender][_msgSender()].sub( // amount, // "ERC20: transfer amount exceeds allowance" // ) // ...
// ) external returns (bool) { // _transfer(sender, recipient, amount); // _approve( // sender, // _msgSender(), // _allowances[sender][_msgSender()].sub( // amount, // "ERC20: transfer amount exceeds allowance" // ) // ...
5,120
75
// cancel auction listing owner check
_cancelAuction(targetListing);
_cancelAuction(targetListing);
4,097
99
// purchase straddles next start
uint previousBonusBP = bonusRangeBP[currentBonusIndex]; uint newBonusBP = bonusRangeBP[currentBonusIndex.add(1)]; uint newBonusDeposit = postDepositEth.sub(bonusRangeStart[currentBonusIndex.add(1)]); uint previousBonusDeposit = deposit.sub(newBonusDeposit); sh...
uint previousBonusBP = bonusRangeBP[currentBonusIndex]; uint newBonusBP = bonusRangeBP[currentBonusIndex.add(1)]; uint newBonusDeposit = postDepositEth.sub(bonusRangeStart[currentBonusIndex.add(1)]); uint previousBonusDeposit = deposit.sub(newBonusDeposit); sh...
29,783
34
// Authorizes the proxy to spend a new request currency (ERC20). _erc20Address Address of an ERC20 used as the request currency. /
function approvePaymentProxyToSpend(address _erc20Address) public { IERC20 erc20 = IERC20(_erc20Address); uint256 max = 2**256 - 1; erc20.safeApprove(address(paymentErc20FeeProxy), max); }
function approvePaymentProxyToSpend(address _erc20Address) public { IERC20 erc20 = IERC20(_erc20Address); uint256 max = 2**256 - 1; erc20.safeApprove(address(paymentErc20FeeProxy), max); }
32,484
172
// distributes remaining BNB between stakers and Marketing
_distributeFeesBNB(generatedBNB);
_distributeFeesBNB(generatedBNB);
11,523
115
// Trigger mortgage event
emit Staked(msg.sender, amount);
emit Staked(msg.sender, amount);
11,138
157
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol)/ Required interface of an ERC721 compliant contract. /
interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event...
interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event...
17,857
170
// 创建队伍 返回 队伍ID
function createTeam(uint256 _pID, uint256 _eth) private returns (uint256)
function createTeam(uint256 _pID, uint256 _eth) private returns (uint256)
67,454
132
// Getter for the address of the payee number `index`. /
function payee(uint256 index) public view returns (address) { return _payees[index]; }
function payee(uint256 index) public view returns (address) { return _payees[index]; }
30,865
73
// Request unclaimed ETH, payback to beneficiary (owner) walletdividend payment is possible every 330 days at the earliest - can be later, this allows for some flexibility,e.g. board meeting had to happen a bit earlier this year than previous year. /
function requestUnclaimed() public onlyOwner { // Send remaining ETH to beneficiary (back to owner) if dividend round is over require(block.timestamp >= dividendEndTime.sub(claimTimeout)); msg.sender.transfer(address(this).balance); emit Reclaimed(address(this).balance, dividendEnd...
function requestUnclaimed() public onlyOwner { // Send remaining ETH to beneficiary (back to owner) if dividend round is over require(block.timestamp >= dividendEndTime.sub(claimTimeout)); msg.sender.transfer(address(this).balance); emit Reclaimed(address(this).balance, dividendEnd...
4,856
3
// This is the total amount of reserve deposits
uint256 public reserveSupply;
uint256 public reserveSupply;
54,657
73
// Sender supplies assets into the market and receives bTokens in exchange Accrues interest whether or not the operation succeeds, unless reverted mintAmount The amount of the underlying asset to supplyreturn uint 0=success, otherwise a failure (see ErrorReporter.sol for details) /
function mint(uint mintAmount) external returns (uint) { mintAmount; // Shh delegateAndReturn(); }
function mint(uint mintAmount) external returns (uint) { mintAmount; // Shh delegateAndReturn(); }
40,955
11
// /
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
25,709
3
// Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative). Counterpart to Solidity's `-` operator. Requirements:- Subtraction cannot underflow. /
function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction underflow"); }
function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction underflow"); }
27,995
598
// check re-entrancy guard
require(entered == 1, "!reentrant"); entered = 0;
require(entered == 1, "!reentrant"); entered = 0;
21,683
12
// ========================Events======================== /
event AuctionCreated( uint256 indexed auctionId, address indexed nftAddress, uint256 indexed tokenId, address tokenSeller, uint256 reservePrice, bool isPaused, address auctionCreator, uint64 duration );
event AuctionCreated( uint256 indexed auctionId, address indexed nftAddress, uint256 indexed tokenId, address tokenSeller, uint256 reservePrice, bool isPaused, address auctionCreator, uint64 duration );
4,663
18
// for transfering treasury bank vault. Only use if changing contracts. bankIndex The bank id vault the vault id to who you're transfering it to /
function transferBankVault( uint256 bankIndex, uint256 vault, address to
function transferBankVault( uint256 bankIndex, uint256 vault, address to
8,445
310
// AccessControl Roles
bytes32 private constant MINT_PAUSER = keccak256("MINT_PAUSER"); bytes32 private constant REDEEM_PAUSER = keccak256("REDEEM_PAUSER"); bytes32 private constant BUYBACK_PAUSER = keccak256("BUYBACK_PAUSER"); bytes32 private constant RECOLLATERALIZE_PAUSER = keccak256("RECOLLATERALIZE_PAUSER"); bytes32 ...
bytes32 private constant MINT_PAUSER = keccak256("MINT_PAUSER"); bytes32 private constant REDEEM_PAUSER = keccak256("REDEEM_PAUSER"); bytes32 private constant BUYBACK_PAUSER = keccak256("BUYBACK_PAUSER"); bytes32 private constant RECOLLATERALIZE_PAUSER = keccak256("RECOLLATERALIZE_PAUSER"); bytes32 ...
21,964
53
// set address of token porter/_tokenPorter address of token porter
function setTokenPorter(address _tokenPorter) public onlyOwner returns (bool) { require(_tokenPorter != 0x0); tokenPorter = ITokenPorter(_tokenPorter); return true; }
function setTokenPorter(address _tokenPorter) public onlyOwner returns (bool) { require(_tokenPorter != 0x0); tokenPorter = ITokenPorter(_tokenPorter); return true; }
48,701
8
// Add the `receive()` special function that receives eth and calls stake()
receive() external payable { stake(); }
receive() external payable { stake(); }
32,709
134
// This function allows the user to map the tellor uint data status code to the standarized ADO uint status code such as null, retreived etc..._tellorStatus uint the tellor status_status the ADO standarized uint status/
function defineTellorCodeToStatusCode(uint _tellorStatus, uint _status) external{ require(tellorCodeToStatusCode[_tellorStatus] == 0, "Already Set"); tellorCodeToStatusCode[_tellorStatus] = _status; statusCodeToTellorCode[_status] = _tellorStatus; emit StatusMapped(_tellorStatus, _st...
function defineTellorCodeToStatusCode(uint _tellorStatus, uint _status) external{ require(tellorCodeToStatusCode[_tellorStatus] == 0, "Already Set"); tellorCodeToStatusCode[_tellorStatus] = _status; statusCodeToTellorCode[_status] = _tellorStatus; emit StatusMapped(_tellorStatus, _st...
34,780
0
// IPoolAddressesProvider HopeLend Defines the basic interface for a Pool Addresses Provider. /
interface IPoolAddressesProvider { /** * @dev Emitted when the market identifier is updated. * @param oldMarketId The old id of the market * @param newMarketId The new id of the market */ event MarketIdSet(string indexed oldMarketId, string indexed newMarketId); /** * @dev Emitted when the pool is...
interface IPoolAddressesProvider { /** * @dev Emitted when the market identifier is updated. * @param oldMarketId The old id of the market * @param newMarketId The new id of the market */ event MarketIdSet(string indexed oldMarketId, string indexed newMarketId); /** * @dev Emitted when the pool is...
21,956
9
// solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
return (codehash != accountHash && codehash != 0x0);
21,247
15
// calculate share
uint256 share = stock.mul(investments[msg.sender]).div(totalPot); uint256 currentWithDraw = withdraStock[msg.sender];
uint256 share = stock.mul(investments[msg.sender]).div(totalPot); uint256 currentWithDraw = withdraStock[msg.sender];
43,074
23
// Transfer a name from an NFT to another. Both NFTs must have the same owner (msg.sender) collectionFrom address of NFT collection releasing the name tokenFrom token id of NFT releasing the name collectionTo address of NFT collection receiving the name tokenTo token id of NFT receiving the name /
function transferName(address collectionFrom, uint256 tokenFrom, address collectionTo, uint256 tokenTo) external { checkOwnership(collectionFrom, tokenFrom); checkOwnership(collectionTo, tokenTo); // also check that sender owns recipient NFT to avoid writing to recipient NFT's name unwillingly ...
function transferName(address collectionFrom, uint256 tokenFrom, address collectionTo, uint256 tokenTo) external { checkOwnership(collectionFrom, tokenFrom); checkOwnership(collectionTo, tokenTo); // also check that sender owns recipient NFT to avoid writing to recipient NFT's name unwillingly ...
29,189
130
// // Calculates minimum of two numbers x Left hand input y Right hand inputreturnMinimum of the two inputs /
function min(uint256 x, uint256 y) internal pure returns (uint256)
function min(uint256 x, uint256 y) internal pure returns (uint256)
13,432
187
// store the air drop tracker number (number of buys since last airdrop)
_eventData_.compressedData = _eventData_.compressedData + (airDropTracker_ * 1000);
_eventData_.compressedData = _eventData_.compressedData + (airDropTracker_ * 1000);
38,198
9
// ItemCrafted Event fires when a user burns points for item crafting /
event ItemCrafted(uint256 item, address user);
event ItemCrafted(uint256 item, address user);
77,378
2
// IFxMessageProcessor represents interface to process message
interface IFxMessageProcessor { function processMessageFromRoot(uint256 stateId, address rootMessageSender, bytes calldata data) external; }
interface IFxMessageProcessor { function processMessageFromRoot(uint256 stateId, address rootMessageSender, bytes calldata data) external; }
6,942
9
// ========== SETTINGS ========== /
function setAuctionBidPeriod(uint32 _auctionBidPeriod) external onlyOwner { auctionBidPeriod = _auctionBidPeriod; }
function setAuctionBidPeriod(uint32 _auctionBidPeriod) external onlyOwner { auctionBidPeriod = _auctionBidPeriod; }
64,341
11
// This famous algorithm is called "exponentiation by squaring" and calculates x^n with x as fixed-point and n as regular unsigned. It's O(log n), instead of O(n) for naive repeated multiplication. These facts are why it works:If n is even, then x^n = (x^2)^(n/2).If n is odd,then x^n = xx^(n-1), and applying the equati...
function rpow(uint256 x, uint256 n) internal pure returns (uint256 z) { z = n % 2 != 0 ? x : RAY; for (n /= 2; n != 0; n /= 2) { x = rmul(x, x); if (n % 2 != 0) { z = rmul(z, x); } } }
function rpow(uint256 x, uint256 n) internal pure returns (uint256 z) { z = n % 2 != 0 ? x : RAY; for (n /= 2; n != 0; n /= 2) { x = rmul(x, x); if (n % 2 != 0) { z = rmul(z, x); } } }
19,050
135
// Recover signer's address from a EIP712 signature domainSeparator Domain separator v v of the signature r r of the signature s s of the signature typeHashAndData Type hash concatenated with datareturn Signer's address /
function recover( bytes32 domainSeparator, uint8 v, bytes32 r, bytes32 s, bytes memory typeHashAndData
function recover( bytes32 domainSeparator, uint8 v, bytes32 r, bytes32 s, bytes memory typeHashAndData
27,394
12
// index of dragon in challengeApplicants array
mapping (uint256 => uint256) applicantIndex;
mapping (uint256 => uint256) applicantIndex;
9,230
7
// Removes an organization from the registry.Only the organization owner can invoke this method.Reverts if the given organization Id is unregisteredorgId Id of organization to remove./
function deleteOrganization(bytes32 orgId) external;
function deleteOrganization(bytes32 orgId) external;
25,397