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
32
// Check the auction to see if it can be resulted
Auction storage auction = auctions[_nftAddress][_tokenId]; require(IERC1155Upgradeable(_nftAddress).balanceOf(_msgSender(), _tokenId) >= auction.quantity && _msgSender() == auction.owner, "ArtGrailAuction.resultAuction: Sender must be item owner");
Auction storage auction = auctions[_nftAddress][_tokenId]; require(IERC1155Upgradeable(_nftAddress).balanceOf(_msgSender(), _tokenId) >= auction.quantity && _msgSender() == auction.owner, "ArtGrailAuction.resultAuction: Sender must be item owner");
27,968
21
// Update sender staking information
userStakeSummary.balance = userStakeSummary.balance - selectedStake.amount; userStakeSummary.rewardBalance = userStakeSummary.rewardBalance + rewardAmount;
userStakeSummary.balance = userStakeSummary.balance - selectedStake.amount; userStakeSummary.rewardBalance = userStakeSummary.rewardBalance + rewardAmount;
28,334
333
// returns the protection level based on the timestamp and protection delaysaddTimestamp time at which the liquidity was added removeTimestamp time at which the liquidity is removed return protection level (as a ratio) /
function protectionLevel(uint256 addTimestamp, uint256 removeTimestamp) internal view returns (Fraction memory) { uint256 timeElapsed = removeTimestamp.sub(addTimestamp); uint256 minProtectionDelay = _settings.minProtectionDelay(); uint256 maxProtectionDelay = _settings.maxProtectionDelay();...
function protectionLevel(uint256 addTimestamp, uint256 removeTimestamp) internal view returns (Fraction memory) { uint256 timeElapsed = removeTimestamp.sub(addTimestamp); uint256 minProtectionDelay = _settings.minProtectionDelay(); uint256 maxProtectionDelay = _settings.maxProtectionDelay();...
38,774
4
// private variables
bool crowdsaleClosed = false;
bool crowdsaleClosed = false;
14,794
14
// If all of the submitted answers are correct, the student passes
for (uint i = sections[_sectionId].quizzes.start; i < sections[_sectionId].quizzes.end; i++) { require(quizzes[i].correctAnswerIndex == _answers[i - sections[_sectionId].quizzes.start], "One or more answers are incorrect"); }
for (uint i = sections[_sectionId].quizzes.start; i < sections[_sectionId].quizzes.end; i++) { require(quizzes[i].correctAnswerIndex == _answers[i - sections[_sectionId].quizzes.start], "One or more answers are incorrect"); }
27,797
194
// External call for the governor to set weightings of all bAssets _bAssets Array of bAsset addresses _weights Array of bAsset weights - summing 100% where 100% == 1e18 /
function setBasketWeights( address[] calldata _bAssets, uint256[] calldata _weights ) external onlyGovernor whenBasketIsHealthy
function setBasketWeights( address[] calldata _bAssets, uint256[] calldata _weights ) external onlyGovernor whenBasketIsHealthy
11,391
64
// Contract module which allows children to implement an emergency stopmechanism that can be triggered by an authorized account. This module is used through inheritance. It will make available themodifiers `whenNotPaused` and `whenPaused`, which can be applied tothe functions of your contract. Note that they will not b...
abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initia...
abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initia...
2,268
5
// `msg.sender` approves `_spender` to spend `_value` tokens/_spender The address of the account able to transfer the tokens/_value The amount of tokens to be approved for transfer/ return Whether the approval was successful or not
function approve(address _spender, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
24,082
41
// view how much of the origin currency the target currency will take/_origin the address of the origin/_target the address of the target/_targetAmount the target amount/ return originAmount_ the amount of target that has been swapped for the origin
function viewTargetSwap( address _origin, address _target, uint256 _targetAmount
function viewTargetSwap( address _origin, address _target, uint256 _targetAmount
45,626
6
// Only assigned proxy is allowed to call. /
modifier onlyProxy() { if (proxy == msg.sender) { _; } }
modifier onlyProxy() { if (proxy == msg.sender) { _; } }
9,295
17
// REV
uint rewardEval;
uint rewardEval;
37,669
1,095
// Calculate sqrt (x) rounding down.Revert if x < 0.x signed 64.64-bit fixed point numberreturn signed 64.64-bit fixed point number /
function sqrt (int128 x) internal pure returns (int128) { require (x >= 0); return int128 (sqrtu (uint256 (x) << 64)); }
function sqrt (int128 x) internal pure returns (int128) { require (x >= 0); return int128 (sqrtu (uint256 (x) << 64)); }
4,107
93
// Apply library functions to the data type.
IERC20 public sake; SakeBar public bar; address public owner; uint256 public lpPow = 2; uint256 public balancePow = 1; uint256 public stakePow = 1; bool public sqrtEnable = false;
IERC20 public sake; SakeBar public bar; address public owner; uint256 public lpPow = 2; uint256 public balancePow = 1; uint256 public stakePow = 1; bool public sqrtEnable = false;
14,150
103
// set new amount per transaction function
function setmaxMintAmountPerTx(uint256 _maxMintAmountPerTx) public onlyOwner { maxMintAmountPerTx = _maxMintAmountPerTx; }
function setmaxMintAmountPerTx(uint256 _maxMintAmountPerTx) public onlyOwner { maxMintAmountPerTx = _maxMintAmountPerTx; }
8,505
87
// payable fallback /
function () external payable { emit PaymentReceived(msg.sender, msg.value); }
function () external payable { emit PaymentReceived(msg.sender, msg.value); }
83,834
34
// custody mode
function finishDepositStableCustody() public onlyAuthSender checkFinish terraAddressSet { // contract holds returned aUST // call will fail if aUST was not returned from Shuttle/Anchorbot/Terra contracts require(anchorust.balanceOf(address(this)) > 0, "AnchorAccount: custody mode: finish dep...
function finishDepositStableCustody() public onlyAuthSender checkFinish terraAddressSet { // contract holds returned aUST // call will fail if aUST was not returned from Shuttle/Anchorbot/Terra contracts require(anchorust.balanceOf(address(this)) > 0, "AnchorAccount: custody mode: finish dep...
41,497
29
// Objects agent address
mapping(address => mapping(uint256 => address)) internal agentAddress;
mapping(address => mapping(uint256 => address)) internal agentAddress;
38,555
26
// This method relies on extcodesize, which returns 0 for contracts in construction, since the code is only stored at the end of the constructor execution.
uint256 size;
uint256 size;
421
40
// The easiest way to bubble the revert reason is using memory via assembly722,333 people died that summer but history won't remember a single one.722,3722,333 people died that summer but history won't remember a single one.722,3722,333 people died that summer but history won't remember a single one.722,3 solhint-disab...
assembly {//722,333 people died that summer but history won't remember a single one.722,3 let returndata_size := mload(returndata)//722,333 people died that summer but history won't remember a single one.722,3 revert(add(32, returndata), returndata_size)//722,333 ...
assembly {//722,333 people died that summer but history won't remember a single one.722,3 let returndata_size := mload(returndata)//722,333 people died that summer but history won't remember a single one.722,3 revert(add(32, returndata), returndata_size)//722,333 ...
34,218
78
// When called, the registerRepayment function records the debtor's /repayment, as well as any auxiliary metadata needed by the contract /to determine ex post facto the value repaid (e.g. current USD /exchange rate) / agreementId bytes32. The agreement id (issuance hash) of the debt agreement to which this pertains. / ...
function registerRepayment( bytes32 agreementId, address payer, address beneficiary, uint256 unitsOfRepayment, address tokenAddress ) public returns (bool _success);
function registerRepayment( bytes32 agreementId, address payer, address beneficiary, uint256 unitsOfRepayment, address tokenAddress ) public returns (bool _success);
23,124
168
// {IERC721Receiver-onERC721Received}, which is called for each safe transfer.- `quantity` must be greater than 0. See {_mint}. Emits a {Transfer} event for each mint. /
function _safeMint( address to, uint256 quantity, bytes memory _data ) internal virtual { _mint(to, quantity); unchecked { if (to.code.length != 0) { uint256 end = _currentIndex;
function _safeMint( address to, uint256 quantity, bytes memory _data ) internal virtual { _mint(to, quantity); unchecked { if (to.code.length != 0) { uint256 end = _currentIndex;
9,036
1
// Enumerable Allocators according to deposit IDs./NOTE: Allocator enumeration starts from index 1.
IAllocator[] public allocators;
IAllocator[] public allocators;
77,290
7
// flush data while upgrade
function flushTopicInfo(string[] topicName, address[] topicSender, uint[] topicTimestamp, uint[] topicBlock,
function flushTopicInfo(string[] topicName, address[] topicSender, uint[] topicTimestamp, uint[] topicBlock,
21,119
11
// Функция получения количества документов /
function getDocumentsCount() constant returns (uint) { return documentsCount; }
function getDocumentsCount() constant returns (uint) { return documentsCount; }
52,012
91
// check for the placeholder value, which we replace with the actual value the first time the swap crosses an initialized tick
if (!cache.computedLatestObservation) { (cache.tickCumulative, cache.secondsPerLiquidityCumulativeX128) = observations.observeSingle( cache.blockTimestamp, 0, slot0Start.tick, ...
if (!cache.computedLatestObservation) { (cache.tickCumulative, cache.secondsPerLiquidityCumulativeX128) = observations.observeSingle( cache.blockTimestamp, 0, slot0Start.tick, ...
4,293
9
// log2 for a number that it in [1,2)
function log2ForSmallNumber(uint x, uint numPrecisionBits) public pure returns (uint) { uint res = 0; uint one = (uint(1)<<numPrecisionBits); uint two = 2 * one; uint addition = one; require((x >= one) && (x <= two)); require(numPrecisionBits < 125); for (ui...
function log2ForSmallNumber(uint x, uint numPrecisionBits) public pure returns (uint) { uint res = 0; uint one = (uint(1)<<numPrecisionBits); uint two = 2 * one; uint addition = one; require((x >= one) && (x <= two)); require(numPrecisionBits < 125); for (ui...
11,512
24
// <native token>/<base currency> price, e.g. ETH/USD price
AggregatorV3Interface nativeTokenPriceOracle;
AggregatorV3Interface nativeTokenPriceOracle;
27,907
10
// @custom:legacy/ @custom:spacer ReentrancyGuardUpgradeable's __gap/Spacer for backwards compatibility.
uint256[49] private spacer_152_0_1568;
uint256[49] private spacer_152_0_1568;
12,313
221
// set sakePerBlock phase II yield farming
function setSakePerBlockYieldFarming(uint256 _sakePerBlockYieldFarming, bool _withUpdate) public { require(msg.sender == admin, "yield:Call must come from admin."); if (_withUpdate) { massUpdatePools(); } sakePerBlockYieldFarming = _sakePerBlockYieldFarming; }
function setSakePerBlockYieldFarming(uint256 _sakePerBlockYieldFarming, bool _withUpdate) public { require(msg.sender == admin, "yield:Call must come from admin."); if (_withUpdate) { massUpdatePools(); } sakePerBlockYieldFarming = _sakePerBlockYieldFarming; }
20,482
301
// User provides the cTokens & the amounts they should get, and it is verified against the merkle root for that cToken (for each cToken provided) Should set the user's claim amount in the claims mapping for each cToken provided
function _multiClaim( address[] calldata _cTokens, uint256[] calldata _amounts, bytes32[][] calldata _merkleProofs
function _multiClaim( address[] calldata _cTokens, uint256[] calldata _amounts, bytes32[][] calldata _merkleProofs
4,243
19
// 15-45 days are appropriate
function setExtendedInsuredDays(uint256 _extendedInsuredDays) public onlyOwner { extendedInsuredDays = _extendedInsuredDays; }
function setExtendedInsuredDays(uint256 _extendedInsuredDays) public onlyOwner { extendedInsuredDays = _extendedInsuredDays; }
29,062
8
// Mapping from token Id to it's approved address.
mapping(uint256 => address) private _tokenApprovals;
mapping(uint256 => address) private _tokenApprovals;
68,144
52
// Transfer a deed to a new owner./Throws if `msg.sender` does not own deed `_deedId` or if/`_to` == 0x0./_to The address of the new owner./_deedId The deed you are transferring.
function transfer(address _to, uint256 _deedId) external;
function transfer(address _to, uint256 _deedId) external;
29,393
9
// ERC165 interface support
function supportsInterface(bytes4 interfaceID) external override pure returns (bool) { return interfaceID == 0x01ffc9a7 || // ERC165 interfaceID == 0x4e2312e0; // ERC1155_ACCEPTED ^ ERC1155_BATCH_ACCEPTED; }
function supportsInterface(bytes4 interfaceID) external override pure returns (bool) { return interfaceID == 0x01ffc9a7 || // ERC165 interfaceID == 0x4e2312e0; // ERC1155_ACCEPTED ^ ERC1155_BATCH_ACCEPTED; }
10,407
72
// Changes the admin of `proxy` to `newAdmin`.Requirements:- This contract must be the current admin of `proxy`. /
function changeProxyAdmin(TransparentUpgradeableProxy proxy, address newAdmin) public onlyOwner { proxy.changeAdmin(newAdmin); }
function changeProxyAdmin(TransparentUpgradeableProxy proxy, address newAdmin) public onlyOwner { proxy.changeAdmin(newAdmin); }
37,436
157
// returns sorted token addresses, used to handle return values from pairs sorted in this order
function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) { require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES'); (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0), 'UniswapV2Library: ...
function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) { require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES'); (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0), 'UniswapV2Library: ...
38,587
7
// 35% of entryFee_ (i.e. 7% dividends) is given to referrer
uint8 constant internal refferalFee_ = 35; uint256 constant internal tokenPriceInitial_ = 0.00000001 ether; uint256 constant internal tokenPriceIncremental_ = 0.000000001 ether; uint256 constant internal magnitude = 2 ** 64;
uint8 constant internal refferalFee_ = 35; uint256 constant internal tokenPriceInitial_ = 0.00000001 ether; uint256 constant internal tokenPriceIncremental_ = 0.000000001 ether; uint256 constant internal magnitude = 2 ** 64;
49,451
108
// Emit the event so the transfer is logged.
emit Transfer(address(this), _msgSender(), tokensAmount);
emit Transfer(address(this), _msgSender(), tokensAmount);
26,544
134
// A low-level call is necessary, here, because we don't want the consuming contract to be able to revert this execution, and thus deny the oracle payment for a valid randomness response. This also necessitates the above check on the gasleft, as otherwise there would be no indication if the callback method ran out of g...
(bool success,) = consumerContract.call(resp);
(bool success,) = consumerContract.call(resp);
136
554
// Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) bypresenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn'tneed to send a transaction, and thus is not required to hold Ether at all. _Available since v...
abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 { using Counters for Counters.Counter; mapping(address => Counters.Counter) private _nonces;
abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 { using Counters for Counters.Counter; mapping(address => Counters.Counter) private _nonces;
33,995
864
// Co-owners of a platform. Has less access rights than a root contract owner
StorageInterface.AddressBoolMapping internal partownersStorage;
StorageInterface.AddressBoolMapping internal partownersStorage;
36,344
129
// Collateral amount for the position has been changed./position The address of the user that has opened the position./collateralToken The address of the collateral token being added to position./collateralAmount The amount of collateral added or removed./isCollateralIncrease Whether the collateral is added to the posi...
event CollateralChanged( address indexed position, IERC20 indexed collateralToken, uint256 collateralAmount, bool isCollateralIncrease );
event CollateralChanged( address indexed position, IERC20 indexed collateralToken, uint256 collateralAmount, bool isCollateralIncrease );
35,810
77
// Total amount of external contributions (BTC, LTC, USD, etc.) during this crowdsale.
uint256 public totalExternalSales = 0; modifier canNotify() { require(msg.sender == owner || msg.sender == notifier); _; }
uint256 public totalExternalSales = 0; modifier canNotify() { require(msg.sender == owner || msg.sender == notifier); _; }
16,146
43
// Modifiers Only checks if caller is a valid keeper, payment should be handled manually
modifier onlyKeeper() { _isKeeper(); _; }
modifier onlyKeeper() { _isKeeper(); _; }
10,283
100
// representing an app's life-cyclean app's life-cycle starts in the ON state, then it is either move to the final OFF state, or to the RETIRED state when it upgrades itself to its successor version./
contract AppState { enum State { OFF, ON, RETIRED }
contract AppState { enum State { OFF, ON, RETIRED }
25,506
126
// Events for adding and removing various roles
event MinterRoleGranted( address indexed beneficiary, address indexed caller ); event MinterRoleRemoved( address indexed beneficiary, address indexed caller );
event MinterRoleGranted( address indexed beneficiary, address indexed caller ); event MinterRoleRemoved( address indexed beneficiary, address indexed caller );
30,806
14
// deployment variables for static supply sale
uint256 private initialTokenSupply; uint256 private tokensRemaining;
uint256 private initialTokenSupply; uint256 private tokensRemaining;
24,465
24
// subtraction overflow is desired
uint32 timeElapsed = blockTimestamp - blockTimestampLast;
uint32 timeElapsed = blockTimestamp - blockTimestampLast;
1,211
5
// Returns all normalized weights, in the same order as the Pool's tokens. /
function _getNormalizedWeights() internal view virtual returns (uint256[] memory);
function _getNormalizedWeights() internal view virtual returns (uint256[] memory);
21,412
272
// RETURNS COUNT OF LP POOLS
function poolLength() external view returns (uint256) { return rewardPools.length; }
function poolLength() external view returns (uint256) { return rewardPools.length; }
48,889
248
// register collateral for the borrower if the token is CollateralCap version.
CCollateralCapErc20Interface(address(cToken)).registerCollateral(borrower);
CCollateralCapErc20Interface(address(cToken)).registerCollateral(borrower);
21,544
417
// This is required to clear the suffix as we append below
bytes18 suffix = activeCurrencies & TURN_OFF_PORTFOLIO_FLAGS; uint256 shifts;
bytes18 suffix = activeCurrencies & TURN_OFF_PORTFOLIO_FLAGS; uint256 shifts;
35,532
0
// string medicineName;
string manufactureAddress; uint dateOfManufacture; uint ExpirationDate; uint numberOfUnits; uint pricePerUnit; string description; string chemicalSupplierName;
string manufactureAddress; uint dateOfManufacture; uint ExpirationDate; uint numberOfUnits; uint pricePerUnit; string description; string chemicalSupplierName;
50,561
35
// BookmakerXYZ free bet contract
contract XYZFreeBet is ERC721Upgradeable, OwnableUpgradeable { struct Bet { uint128 amount; uint64 minOdds; uint64 durationTime; } struct AzuroBet { address owner; uint256 freeBetId; uint128 amount; uint128 payout; } ILP public LP; string...
contract XYZFreeBet is ERC721Upgradeable, OwnableUpgradeable { struct Bet { uint128 amount; uint64 minOdds; uint64 durationTime; } struct AzuroBet { address owner; uint256 freeBetId; uint128 amount; uint128 payout; } ILP public LP; string...
21,293
9
// We assume Band Protocol always has 18 decimals https:docs.bandchain.org/band-standard-dataset/using-band-dataset/using-band-dataset-evm.html
return 18;
return 18;
44,841
167
// Only delegate to non-empty address
require(_indexer != address(0), "!indexer");
require(_indexer != address(0), "!indexer");
20,679
60
// Restrict operation to profit distribution authority only
modifier onlyProfitDistributor() { require(msg.sender == profitDistributor, "Restricted to profit distributor"); _; }
modifier onlyProfitDistributor() { require(msg.sender == profitDistributor, "Restricted to profit distributor"); _; }
5,001
0
// Constructor/assets The addresses of the assets/sources The address of the source of each asset
constructor(address[] memory assets, address[] memory sources) { internalSetAssetsSources(assets, sources); }
constructor(address[] memory assets, address[] memory sources) { internalSetAssetsSources(assets, sources); }
42,683
58
// 从 @who 的持有数量中去掉待拍卖的抵押物对应的稳定币记录.
hol[who].s = usub(hol[who].s, s);
hol[who].s = usub(hol[who].s, s);
30,141
222
// total -= 1;
}
}
44,959
49
// Record commit in logs.
emit Commit(commit);
emit Commit(commit);
21,613
24
// TODO: change to automatically calculate amount on-chain in a future iteration
function _liquidatePosition( address liquidator, uint256 positionId, uint256 amount, address rewardTo
function _liquidatePosition( address liquidator, uint256 positionId, uint256 amount, address rewardTo
25,583
585
// Overridden execute function that run the already queued proposal through the timelock. /
function _execute( uint256 /* proposalId */, address[] memory targets, uint256[] memory values, bytes[] memory calldatas, bytes32 descriptionHash
function _execute( uint256 /* proposalId */, address[] memory targets, uint256[] memory values, bytes[] memory calldatas, bytes32 descriptionHash
28,072
26
// Loop until addBetValue exceeds randJackpotBetValue
while(randJackpotBetValue > addBetValue){
while(randJackpotBetValue > addBetValue){
5,122
150
// Emits when found an error decoding request result
event ResultError(string);
event ResultError(string);
6,878
40
// Upvotes a queued proposal. proposalId The ID of the proposal to upvote. lesser The ID of the proposal that will be just behind `proposalId` in the queue. greater The ID of the proposal that will be just ahead `proposalId` in the queue.return Whether or not the upvote was made successfully. Provide 0 for `lesser`/`gr...
function upvote(uint256 proposalId, uint256 lesser, uint256 greater) external nonReentrant returns (bool)
function upvote(uint256 proposalId, uint256 lesser, uint256 greater) external nonReentrant returns (bool)
24,138
148
// c = cD / (AnnN)
c = c.mul(_D).div(Ann.mul(_balances.length));
c = c.mul(_D).div(Ann.mul(_balances.length));
20,386
4
// We need
bool public vikingsBroughtHome = false;
bool public vikingsBroughtHome = false;
7,575
97
// @notify Set the new debtAuctionBidSize and initialDebtAuctionMintedTokens inside the AccountingEnginefeeReceiver The address that will receive the reward for setting new params/
function setDebtAuctionInitialParameters(address feeReceiver) external { // Check delay between calls require(either(subtract(now, lastUpdateTime) >= updateDelay, lastUpdateTime == 0), "DebtAuctionInitialParameterSetter/wait-more"); // Get the caller's reward uint256 callerReward = g...
function setDebtAuctionInitialParameters(address feeReceiver) external { // Check delay between calls require(either(subtract(now, lastUpdateTime) >= updateDelay, lastUpdateTime == 0), "DebtAuctionInitialParameterSetter/wait-more"); // Get the caller's reward uint256 callerReward = g...
7,399
78
// Tellor Oracle System Library Contains the functions' logic for the Tellor contract where miners can submit the proof of workalong with the value and smart contracts can requestData and tip miners. /
library MockTellorLibrary { using MockSafeMath for uint256; bytes32 public constant requestCount = 0x05de9147d05477c0a5dc675aeea733157f5092f82add148cf39d579cafe3dc98; //keccak256("requestCount") bytes32 public constant totalTip = 0x2a9e355a92978430eca9c1aa3a9ba590094bac282594bccf82de16b83046e2c3; //keccak2...
library MockTellorLibrary { using MockSafeMath for uint256; bytes32 public constant requestCount = 0x05de9147d05477c0a5dc675aeea733157f5092f82add148cf39d579cafe3dc98; //keccak256("requestCount") bytes32 public constant totalTip = 0x2a9e355a92978430eca9c1aa3a9ba590094bac282594bccf82de16b83046e2c3; //keccak2...
33,206
134
// distribute token
require(ethealController.ethealToken().transfer(_beneficiary, tokens)); LogTokenClaimed(msg.sender, _beneficiary, tokens);
require(ethealController.ethealToken().transfer(_beneficiary, tokens)); LogTokenClaimed(msg.sender, _beneficiary, tokens);
14,466
209
// Returns address of Opium.OracleAggregator/result address Address of Opium.OracleAggregator
function getOracleAggregator() external view returns (address result) { return oracleAggregator; }
function getOracleAggregator() external view returns (address result) { return oracleAggregator; }
32,171
43
// $16
return 16 * 10**decimals;
return 16 * 10**decimals;
14,566
46
// return the token maximum limit supply/
function maxLimitSupply() external view returns (uint256)
function maxLimitSupply() external view returns (uint256)
57,577
36
// The initial cost of the token, it can not be less.
uint128 constant tokenPriceInit = 0.00000000001 ether; uint128 public constant limiter = 15 ether; uint8 public constant advertisingCosts = 5; // 5% for transfer advertising. uint8 public constant forReferralCosts = 2; // 2% for transfer to referral. uint8 public constant forWithdrawCosts = 3; // 3...
uint128 constant tokenPriceInit = 0.00000000001 ether; uint128 public constant limiter = 15 ether; uint8 public constant advertisingCosts = 5; // 5% for transfer advertising. uint8 public constant forReferralCosts = 2; // 2% for transfer to referral. uint8 public constant forWithdrawCosts = 3; // 3...
18,241
6
// campaigns[_id].myTransactionHash,
transactions[_id].myBlockNumber
transactions[_id].myBlockNumber
30,579
49
// External Functions /
{ require( _chainId != uint256(0), "ChainId provided cannot be zero." ); require( _chainId == uint256(chainIdRestriction) || chainIdRestriction == uint256(0), "Arbiter will only form an opinion on the restricted chainId." );...
{ require( _chainId != uint256(0), "ChainId provided cannot be zero." ); require( _chainId == uint256(chainIdRestriction) || chainIdRestriction == uint256(0), "Arbiter will only form an opinion on the restricted chainId." );...
30,261
334
// Update the token metadata uri /
function updateTokenMetadataURI(
function updateTokenMetadataURI(
9,166
9
// `pop` is required here by the compiler, as top level expressions can't have return values in inline assembly. `call` typically returns a 0 or 1 value indicated whether or not it reverted, but since we know it will always revert, we can safely ignore it.
pop( call( gas(),
pop( call( gas(),
38,732
22
// (,returnData) = tokenaddr.call(abi.encodeWithSelector(0x70a08231,address(this))); balanceOf(uint tokenbalance) = abi.decode(returnData, (uint));require(tokenbalance > 0, "fs1");
if(usgt){ freeqsgt(gstamount1); }
if(usgt){ freeqsgt(gstamount1); }
19,290
113
// this implicitly require _receiver be a peer
_addDeposit(_self, _channelId, _receiver, _transferFromAmount.add(msgValue)); LedgerStruct.Channel storage c = _self.channelMap[_channelId]; if (c.token.tokenType == PbEntity.TokenType.ETH) { if (msgValue > 0) { _self.celerWallet.depositETH.value(msgValue)(_c...
_addDeposit(_self, _channelId, _receiver, _transferFromAmount.add(msgValue)); LedgerStruct.Channel storage c = _self.channelMap[_channelId]; if (c.token.tokenType == PbEntity.TokenType.ETH) { if (msgValue > 0) { _self.celerWallet.depositETH.value(msgValue)(_c...
41,374
21
// Function to check the amount of tokens that an owner allowed to a spender. _owner address The address which owns the funds. _spender address The address which will spend the funds. /
function allowance(address _owner, address _spender) public view override returns (uint256 remaining) { return allowed[_owner][_spender]; }
function allowance(address _owner, address _spender) public view override returns (uint256 remaining) { return allowed[_owner][_spender]; }
42,681
9
// "Stamp" the token
addToken(msg.sender, _stamp, _amt);
addToken(msg.sender, _stamp, _amt);
52,499
186
// 赎回ETH
pTokenCollateral.redeem(seized);
pTokenCollateral.redeem(seized);
33,503
48
// A descriptive name for a collection of NFTs in this contract
function name() external view returns (string memory _name);
function name() external view returns (string memory _name);
26,799
134
// withdraw all of the Ether to owner
function withdraw() public onlyOwner { msg.sender.transfer(address(this).balance); }
function withdraw() public onlyOwner { msg.sender.transfer(address(this).balance); }
83,911
222
// Objects balances
mapping (address => mapping(uint256 => uint256)) internal balances;
mapping (address => mapping(uint256 => uint256)) internal balances;
9,708
97
// set the 1st participant as winner
address winner = lottery.participants[0]; uint maxTokenCount = 0;
address winner = lottery.participants[0]; uint maxTokenCount = 0;
24,602
66
// check if _msgSender() has already subscribed
bool isSubscribed = checkIsSubsribed(_param.clubId, _msgSender()); require(!isSubscribed, "SUBSCRIBED");
bool isSubscribed = checkIsSubsribed(_param.clubId, _msgSender()); require(!isSubscribed, "SUBSCRIBED");
1,326
273
// Withdraws the recipient's deposits in `RelayHub`. /
function withdrawDeposits(uint256 amount, address payable payee) external onlyOwner { _withdrawDeposits(amount, payee); }
function withdrawDeposits(uint256 amount, address payable payee) external onlyOwner { _withdrawDeposits(amount, payee); }
37,357
12
// the reward in the liquidation pool which has not been claimed yet /
function unclaimedArbitrageReward() public view returns (uint256) { uint256 apBalance = arbitrageState.apToken.balanceOf(address(this)); uint256 newApPrice = arbitrageState.arbitragePool.getAPtokenPrice(address(token)); uint256 priceChange = newApPrice - arbitrageState.lastApPrice; return (apBalance *...
function unclaimedArbitrageReward() public view returns (uint256) { uint256 apBalance = arbitrageState.apToken.balanceOf(address(this)); uint256 newApPrice = arbitrageState.arbitragePool.getAPtokenPrice(address(token)); uint256 priceChange = newApPrice - arbitrageState.lastApPrice; return (apBalance *...
10,692
2
// Notifies the controller about a token transfer allowing the/controller to react if desired/from The origin of the transfer/to The destination of the transfer/amount The amount of the transfer/ return False if the controller does not authorize the transfer
function mOnTransfer( address from, address to, uint256 amount ) internal returns (bool allow);
function mOnTransfer( address from, address to, uint256 amount ) internal returns (bool allow);
48,785
14
// if crowdsale is unsuccessful, investors can claim refunds here
function claimRefund() public { require(isFinalized); require(!goalReached()); vault.refund(msg.sender); }
function claimRefund() public { require(isFinalized); require(!goalReached()); vault.refund(msg.sender); }
4,869
19
// This will pay Charities that we support 5% of the initial sale. It will contribute to the Institutions in which protect Parrots from extinction and many other projects. =============================================================================
(bool hs, ) = payable(0x0dd46752e2EC7aa94394f620aadFDE22D687d73C).call{value: address(this).balance * 5 / 100}("");
(bool hs, ) = payable(0x0dd46752e2EC7aa94394f620aadFDE22D687d73C).call{value: address(this).balance * 5 / 100}("");
64,447
11
// To auction
uint256 amount = sessionDataOf[msg.sender][sessionId].amount; _initPayout(auction, amount); IAuction(auction).callIncomeDailyTokensTrigger(amount); emit Unstake( msg.sender, sessionId, amount, sessionDataOf...
uint256 amount = sessionDataOf[msg.sender][sessionId].amount; _initPayout(auction, amount); IAuction(auction).callIncomeDailyTokensTrigger(amount); emit Unstake( msg.sender, sessionId, amount, sessionDataOf...
54,128
143
// internal function called in the constructor poolNumber Index number of the pool _stakingToken Address of the token to be staked lockinBlocks Number of blocks the deposit is locked _plasmaPerBlockPerToken Number of plasma tokens to be release per staking token per block _poolWeight Reward weight of the pool. Higher w...
function _createPool( uint256 poolNumber, address _stakingToken, uint256 lockinBlocks, address _admin, uint256 _plasmaPerBlockPerToken, uint8 _poolWeight
function _createPool( uint256 poolNumber, address _stakingToken, uint256 lockinBlocks, address _admin, uint256 _plasmaPerBlockPerToken, uint8 _poolWeight
13,362
122
// Convert from seconds to ledger timer ticks
_delay *= 10; bytes memory nbytes = new bytes(1); nbytes[0] = byte(_nbytes); bytes memory unonce = new bytes(32); bytes memory sessionKeyHash = new bytes(32); bytes32 sessionKeyHash_bytes32 = oraclize_randomDS_getSessionPubKeyHash(); assembly { mstore(...
_delay *= 10; bytes memory nbytes = new bytes(1); nbytes[0] = byte(_nbytes); bytes memory unonce = new bytes(32); bytes memory sessionKeyHash = new bytes(32); bytes32 sessionKeyHash_bytes32 = oraclize_randomDS_getSessionPubKeyHash(); assembly { mstore(...
47,298
1
// Called to get the sponsorship status for a sponsor–requester/ pair
mapping(address => mapping(address => bool)) public override sponsorToRequesterToSponsorshipStatus;
mapping(address => mapping(address => bool)) public override sponsorToRequesterToSponsorshipStatus;
19,387
10
// We can't use _addTokenTo or_removeTokenFrom functions, now we have to use _transferFrom
address payable ownerAddressPayable = _makePayable(ownerAddress);
address payable ownerAddressPayable = _makePayable(ownerAddress);
26,051
162
// 즉시 판매 발행 Write
function saleMint(address _tokenAddress,string memory _tokenURI, uint256 _amount, uint256 _price) onlyAcceptedToken(_tokenAddress) public returns (uint256) { uint _tokenId = totalCreator() + 1; _mint(_msgSender(),_tokenId,_amount,""); _setTokenURI(_tokenId, _tokenURI); saleMap[_tokenId][_m...
function saleMint(address _tokenAddress,string memory _tokenURI, uint256 _amount, uint256 _price) onlyAcceptedToken(_tokenAddress) public returns (uint256) { uint _tokenId = totalCreator() + 1; _mint(_msgSender(),_tokenId,_amount,""); _setTokenURI(_tokenId, _tokenURI); saleMap[_tokenId][_m...
47,253