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
// function transferOwnership(address newOwner) external;
function allowance(address _owner, address _spender) external view returns (uint256); function frozenAccount(address _account) external view returns (bool); function frozenAmount(address _account) external view returns (uint256);
function allowance(address _owner, address _spender) external view returns (uint256); function frozenAccount(address _account) external view returns (bool); function frozenAmount(address _account) external view returns (uint256);
40,311
193
// Returns the committee members and their weights/Private function called by getCommittee and emitCommitteeSnapshot/ return addrs is the committee members list/ return weights is an array of uint, indicating committee members list weight/ return certification is an array of bool, indicating the committee members certi...
function _getCommittee() private view returns (address[] memory addrs, uint256[] memory weights, bool[] memory certification) { CommitteeMember[] memory _committee = committee; addrs = new address[](_committee.length); weights = new uint[](_committee.length); certification = new bool[](_committee.length); f...
function _getCommittee() private view returns (address[] memory addrs, uint256[] memory weights, bool[] memory certification) { CommitteeMember[] memory _committee = committee; addrs = new address[](_committee.length); weights = new uint[](_committee.length); certification = new bool[](_committee.length); f...
1,095
133
// Reverts if the current stage is not the specified stage. /
modifier onlyAtStage(Stage _stage) { require(stage == _stage, "Raise: not at correct stage"); _; }
modifier onlyAtStage(Stage _stage) { require(stage == _stage, "Raise: not at correct stage"); _; }
28,515
100
// If selling, contract balance > numTokensSellToAddToLiquidity and not already swapping then swap
if (balanceOf(address(this)) >= numTokensSellToAddToLiquidity && !inSwapAndLiquify && !automatedMarketMakerPairs[sender] && swapAndLiquifyEnabled) { inSwapAndLiquify = true; uint256 _marketingFee = marketingFee; uint256 marketingTokensToSwap = numTokensSellToAddToLiquidity * ...
if (balanceOf(address(this)) >= numTokensSellToAddToLiquidity && !inSwapAndLiquify && !automatedMarketMakerPairs[sender] && swapAndLiquifyEnabled) { inSwapAndLiquify = true; uint256 _marketingFee = marketingFee; uint256 marketingTokensToSwap = numTokensSellToAddToLiquidity * ...
37,651
72
// Returns the storage pointer to the BaseData for (`edition`, `mintId`). edition The edition address. mintIdThe mint ID.return data Storage pointer to a BaseData. /
function _getBaseDataUnchecked(address edition, uint128 mintId) internal view returns (BaseData storage data) { data = _baseData[edition][mintId]; }
function _getBaseDataUnchecked(address edition, uint128 mintId) internal view returns (BaseData storage data) { data = _baseData[edition][mintId]; }
8,077
4
// Return the price, in wei, of submitting a new retryable tx with a given calldata size. Return value is (price, nextUpdateTimestamp). Price is guaranteed not to change until nextUpdateTimestamp.
function getSubmissionPrice(uint calldataSize) external view returns (uint, uint);
function getSubmissionPrice(uint calldataSize) external view returns (uint, uint);
17,336
94
// Minmum amount of veCRV for the boost for this Offer
uint256 minBoostAmount = (userBalance * minPerc) / MAX_PCT;
uint256 minBoostAmount = (userBalance * minPerc) / MAX_PCT;
4,670
182
// offset the bitboard to scan from `bucketIndex`.
bb = bb >> (0xff ^ bucketIndex); // bb >> (255 - bucketIndex) if(bb > 0) { unchecked { setBitIndex = (bucket << 8) | (bucketIndex - bb.bitScanForward256()); }
bb = bb >> (0xff ^ bucketIndex); // bb >> (255 - bucketIndex) if(bb > 0) { unchecked { setBitIndex = (bucket << 8) | (bucketIndex - bb.bitScanForward256()); }
38,766
57
// Push new observation data in the observation arraytimeElapsedSinceLatest Time elapsed between now and the earliest observation in the windownewResult Latest result coming from Chainlink/
) internal { // Compute the new time adjusted result uint256 newTimeAdjustedResult = multiply(newResult, timeElapsedSinceLatest); // Add Chainlink observation chainlinkObservations.push(ChainlinkObservation(now, newTimeAdjustedResult)); // Add the new update converter...
) internal { // Compute the new time adjusted result uint256 newTimeAdjustedResult = multiply(newResult, timeElapsedSinceLatest); // Add Chainlink observation chainlinkObservations.push(ChainlinkObservation(now, newTimeAdjustedResult)); // Add the new update converter...
29,041
76
// y' = w + x z
dydt := add(w, sar(PRECISION, mul(x, z)))
dydt := add(w, sar(PRECISION, mul(x, z)))
40,450
4
// Emitted when fee rate is updated
event FeeRateChanged(uint256 feeRate, uint256 feeShareRate);
event FeeRateChanged(uint256 feeRate, uint256 feeShareRate);
23,326
28
// Overrides StandardToken._burn in order for burn and burnFrom to emitan additional Burn event. /
function _burn(address _who, uint256 _value) internal { super._burn(_who, _value); emit Burn(_who, _value); }
function _burn(address _who, uint256 _value) internal { super._burn(_who, _value); emit Burn(_who, _value); }
28,145
308
// total non-optimized amount of shares for each strategy
uint128[] memory totalShares = new uint128[](withdrawData.reallocationTable.length);
uint128[] memory totalShares = new uint128[](withdrawData.reallocationTable.length);
34,778
144
// NOTE: As individual market debt is not tracked here, the underlying markets need to be careful never to subtract more debt than they added. This can't be enforced without additional state/communication overhead.
totalDeposited = totalDeposited.sub(delta);
totalDeposited = totalDeposited.sub(delta);
2,656
55
// Jekyll_Island_Inc.deposit.value(address(this).balance)();
223
8
// balanceAtTs returns the amount of BOND that the user currently staked (bonus NOT included)
function balanceAtTs(address user, uint256 timestamp) external view returns (uint256);
function balanceAtTs(address user, uint256 timestamp) external view returns (uint256);
6,747
106
// Auth checks.
require(globals.isValidLoanFactory(loanFactory), "P:INVALID_LF"); require(ILoanFactory(loanFactory).isLoan(loan), "P:INVALID_L"); require(globals.isValidSubFactory(superFactory, dlFactory, DL_FACTORY), "P:INVALID_DLF"); address debtLocker =...
require(globals.isValidLoanFactory(loanFactory), "P:INVALID_LF"); require(ILoanFactory(loanFactory).isLoan(loan), "P:INVALID_L"); require(globals.isValidSubFactory(superFactory, dlFactory, DL_FACTORY), "P:INVALID_DLF"); address debtLocker =...
25,109
21
// source of truth for subscriptions
mapping(uint64 => Subscription) public subscriptions;
mapping(uint64 => Subscription) public subscriptions;
4,110
0
// Diamond specific errors
error IncorrectFacetCutAction(); error NoSelectorsInFace(); error FunctionAlreadyExists(); error FacetAddressIsZero(); error FacetAddressIsNotZero(); error FacetContainsNoCode(); error FunctionDoesNotExist(); error FunctionIsImmutable(); error InitZeroButCalldataNotEmpty(); error...
error IncorrectFacetCutAction(); error NoSelectorsInFace(); error FunctionAlreadyExists(); error FacetAddressIsZero(); error FacetAddressIsNotZero(); error FacetContainsNoCode(); error FunctionDoesNotExist(); error FunctionIsImmutable(); error InitZeroButCalldataNotEmpty(); error...
3,306
5
// testing retrieval of all participants in projects
function testGetProjectAdopterAddressByProjectIdInArray() public { //there should be a participant address expected = this; //store participants in memory address[16] memory projectAdopters = project.getProjectAdopters(); Assert.equal(projectAdopters[8], expected, "Participan...
function testGetProjectAdopterAddressByProjectIdInArray() public { //there should be a participant address expected = this; //store participants in memory address[16] memory projectAdopters = project.getProjectAdopters(); Assert.equal(projectAdopters[8], expected, "Participan...
43,164
9
// onlyENGNS comment this out for testing
{ winner = _highestBidder; winningPrice = _highestBidAmount; state = AuctionState.COMPLETED; stakeAmounts[_highestBidder] -= winningPrice; emit Winner(_highestBidder, _highestBidAmount); }
{ winner = _highestBidder; winningPrice = _highestBidAmount; state = AuctionState.COMPLETED; stakeAmounts[_highestBidder] -= winningPrice; emit Winner(_highestBidder, _highestBidAmount); }
33,261
35
// The actual balance could be greater than totalBalances[token] because anyone can send tokens to the contract's address which cannot be accounted forassert(TokenInteract.balanceOf(token, address(this)) >= totalBalances[token]);
return (balances[token][user].availableBalance, balances[token][user].frozenBalace);
return (balances[token][user].availableBalance, balances[token][user].frozenBalace);
27,054
1
// This is the interface that {BeaconProxy} expects of its beacon./ Must return an address that can be used as a delegate call target. {BeaconProxy} will check that this address is a contract. /
function implementation() external view returns (address);
function implementation() external view returns (address);
964
130
// transfers the interest to the lender, less the interest fee
VAULTWITHDRAW131( interestToken, lender, interestOwedNow .SUB395(lendingFee) );
VAULTWITHDRAW131( interestToken, lender, interestOwedNow .SUB395(lendingFee) );
43,494
112
// Callback Proof managment /
event WorkOrderCallbackProof(address indexed woid, address requester, address beneficiary,address indexed callbackTo, address indexed gasCallbackProvider,string stdout, string stderr , string uri);
event WorkOrderCallbackProof(address indexed woid, address requester, address beneficiary,address indexed callbackTo, address indexed gasCallbackProvider,string stdout, string stderr , string uri);
22,875
42
// Crypxie Contract to create the Crypxie /
contract Crypxie is CrowdsaleToken { string public constant name = "Crypxie"; string public constant symbol = "CPX"; uint32 public constant decimals = 18; }
contract Crypxie is CrowdsaleToken { string public constant name = "Crypxie"; string public constant symbol = "CPX"; uint32 public constant decimals = 18; }
30,325
9
// When error occurs during document key retrieval.
event DocumentKeyShadowRetrievalError(bytes32 indexed serverKeyId, address indexed requester);
event DocumentKeyShadowRetrievalError(bytes32 indexed serverKeyId, address indexed requester);
8,482
26
// total LP tokens locked
uint256 public totalLpTokensLocked;
uint256 public totalLpTokensLocked;
67,287
25
// Sets {amount} as the allowance of {spender} over the {owner} s tokens.
function _approve(address owner, address spender, uint256 amount) internal virtual returns (bool) { if ((owner == address(0)) || (spender == address(0))) return false; mDataAllowed[owner][spender] = amount; emit Approval(owner, spender, amount); return true; ...
function _approve(address owner, address spender, uint256 amount) internal virtual returns (bool) { if ((owner == address(0)) || (spender == address(0))) return false; mDataAllowed[owner][spender] = amount; emit Approval(owner, spender, amount); return true; ...
17,080
92
// Helper to convert an amount from a _baseAsset to a _quoteAsset
function __calcConversionAmount( address _baseAsset, uint256 _baseAssetAmount, uint256 _baseAssetRate, address _quoteAsset, uint256 _quoteAssetRate
function __calcConversionAmount( address _baseAsset, uint256 _baseAssetAmount, uint256 _baseAssetRate, address _quoteAsset, uint256 _quoteAssetRate
66,813
163
// CLUSTER LOCK INTERFACE //Covers locking amount of DHV for staking cluster token./_cluster Address of cluster token./_amount Amount of staked cluster./_user Address of user who staked cluster tokens.
function coverCluster( address _cluster, address _user, uint256 _amount, uint256 _pid
function coverCluster( address _cluster, address _user, uint256 _amount, uint256 _pid
49,594
2
// Restricts withdraw, swap feature till liquidity is added to the pool
/* modifier activePool() { require(totalShares > 0, "Zero Liquidity"); _; }*/
/* modifier activePool() { require(totalShares > 0, "Zero Liquidity"); _; }*/
5,315
17
// The AO sets NameTAOPosition address _nameTAOPositionAddress The address of NameTAOPosition /
function setNameTAOPositionAddress(address _nameTAOPositionAddress) public onlyTheAO { require (_nameTAOPositionAddress != address(0)); nameTAOPositionAddress = _nameTAOPositionAddress; _nameTAOPosition = INameTAOPosition(_nameTAOPositionAddress); }
function setNameTAOPositionAddress(address _nameTAOPositionAddress) public onlyTheAO { require (_nameTAOPositionAddress != address(0)); nameTAOPositionAddress = _nameTAOPositionAddress; _nameTAOPosition = INameTAOPosition(_nameTAOPositionAddress); }
30,030
21
// Amount sent to contract in USDC (swap value);
uint256 usdcPrincipal;
uint256 usdcPrincipal;
14,474
67
// uniswap v2
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x10ED43C718714eb63d5aA57B78B54704E256024E);
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x10ED43C718714eb63d5aA57B78B54704E256024E);
37,729
116
// Set the referrer, if no referrer has been set yet, and the player and referrer are not the same address.
_setReferrer(playerAddr, referrerAddr);
_setReferrer(playerAddr, referrerAddr);
12,587
20
// Mapping from token ID to owner
mapping (uint256 => address) private tokenOwner;
mapping (uint256 => address) private tokenOwner;
9,391
6
// Transfer tokens from one address to another and then execute a callback on `to`. from The address which you want to send tokens from to The address which you want to transfer to amount The amount of tokens to be transferredreturn A boolean that indicates if the operation was successful. /
function transferFromAndCall( address from, address to, uint256 amount
function transferFromAndCall( address from, address to, uint256 amount
19,274
209
// If pausing, set paused price; else if unpausing, clear pausedPrice
if(collateralPricePaused == false){ pausedPrice = _new_price; } else {
if(collateralPricePaused == false){ pausedPrice = _new_price; } else {
22,166
18
// return current price of cToken in underlying /
function getPriceInToken() external view
function getPriceInToken() external view
39,985
85
// modifier that throws if trading has not started yet /
modifier hasStartedTrading() { require(tradingStarted); _; }
modifier hasStartedTrading() { require(tradingStarted); _; }
26,879
6
// gets the number of comments directly under a specific content
function getCommentCount(uint256 contentIndex) external view returns
function getCommentCount(uint256 contentIndex) external view returns
45,949
5
// Calculates the funding rate based on prices/realPriceX128 spot price of token/virtualPriceX128 futures price of token
function getFundingRate(uint256 realPriceX128, uint256 virtualPriceX128) internal pure returns (int256 fundingRateX128)
function getFundingRate(uint256 realPriceX128, uint256 virtualPriceX128) internal pure returns (int256 fundingRateX128)
15,806
1
// Spot check assumptions
assertEq(snapshots.epoch(), 1, "Next snapshot should be 1"); assertEq(snapshots.getRawSignatureSnapshot(3).length, 0, "foo");
assertEq(snapshots.epoch(), 1, "Next snapshot should be 1"); assertEq(snapshots.getRawSignatureSnapshot(3).length, 0, "foo");
3,895
6
// Remove the donor from the donators array
uint256 donorIndex; for (uint256 i = 0; i < campaign.donators.length; i++) { if (campaign.donators[i] == _donor) { donorIndex = i; break; }
uint256 donorIndex; for (uint256 i = 0; i < campaign.donators.length; i++) { if (campaign.donators[i] == _donor) { donorIndex = i; break; }
24,081
37
// Allows the current owner to transfer control of the contract to a newOwner. newOwner The address to transfer ownership to. /
function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); }
function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); }
1,350
87
// Counter to keep track of how many of forced requests are open so we can limit the work that needs to be done by the owner
uint32 numPendingForcedTransactions;
uint32 numPendingForcedTransactions;
3,486
124
// make sure we can actually claim it and that we are paying the correct amount
require(canClaim); require(amount == lowestClaimPrice);
require(canClaim); require(amount == lowestClaimPrice);
50,800
174
// for mainnet
uint256 private constant EPOCH_PERIOD = 7200; // 2 hours
uint256 private constant EPOCH_PERIOD = 7200; // 2 hours
29,635
91
// All hero starts in the novice dungeon, also hero can only be recruited in novice dungoen.
uint public noviceDungeonId = 31; // < dungeon ID 31 = Abyss
uint public noviceDungeonId = 31; // < dungeon ID 31 = Abyss
56,661
180
// require(addresses[i].isContract(), "Role address need contract only");
if (setTo[i]) { grantRole(roleType, addresses[i]); } else {
if (setTo[i]) { grantRole(roleType, addresses[i]); } else {
48,822
13
// check all items before actions[i], does not equal to action[i]
require(_actions[i] != address(0), "O4"); for(uint256 j = 0; j < i; j++) { require(_actions[i] != _actions[j], "O5"); }
require(_actions[i] != address(0), "O4"); for(uint256 j = 0; j < i; j++) { require(_actions[i] != _actions[j], "O5"); }
56,148
309
// Gets the configuration flags of the reserve from a memory object self The reserve configurationreturn The state flags representing active, frozen, borrowing enabled, stableRateBorrowing enabled /
{ return ( (self.data & ~ACTIVE_MASK) != 0, (self.data & ~FROZEN_MASK) != 0, (self.data & ~BORROWING_MASK) != 0, (self.data & ~STABLE_BORROWING_MASK) != 0 ); }
{ return ( (self.data & ~ACTIVE_MASK) != 0, (self.data & ~FROZEN_MASK) != 0, (self.data & ~BORROWING_MASK) != 0, (self.data & ~STABLE_BORROWING_MASK) != 0 ); }
15,332
37
// Allow the owner to set a transaction proxy which can perform value exchanges on behalf of this contract. (unrelated to the requestProxy which is not whiteList)
function enableProxy(address _proxy) onlyOwner public
function enableProxy(address _proxy) onlyOwner public
27,779
105
// The second when mining ends.
uint256 public bonusEndTime;
uint256 public bonusEndTime;
972
79
// The number of checkpoints for each account
mapping(address => uint32) public numCheckpoints;
mapping(address => uint32) public numCheckpoints;
67,893
12
// Close professional office/_id The professional office id
function setProfessionalOfficeClosed(uint32 _id) external onlyWhitelistAdmin onlyExistingOffice(_id) { _changeOfficeStatus(_id, STATUS_CLOSED); emit ProfessionalOfficeActivated(_id, offices[_id].name); }
function setProfessionalOfficeClosed(uint32 _id) external onlyWhitelistAdmin onlyExistingOffice(_id) { _changeOfficeStatus(_id, STATUS_CLOSED); emit ProfessionalOfficeActivated(_id, offices[_id].name); }
8,959
10
// Returns `user`'s Internal Balance for a set of tokens. /
function getInternalBalance(address user, IERC20[] memory tokens) external view returns (uint256[] memory);
function getInternalBalance(address user, IERC20[] memory tokens) external view returns (uint256[] memory);
25,820
26
// increment the participant's sub-tokens and sub-ether
participantTokens[_recipient] = safeAdd(participantTokens[_recipient], totalTokens); participantValues[_recipient] = safeAdd(participantValues[_recipient], msg.value);
participantTokens[_recipient] = safeAdd(participantTokens[_recipient], totalTokens); participantValues[_recipient] = safeAdd(participantValues[_recipient], msg.value);
18,214
52
// This function cleans outstanding orders and rebalances yield between bathTokens
function bathScrub() external { // 4. Cancel Outstanding Orders that need to be cleared or logged for yield cancelPartialFills(); }
function bathScrub() external { // 4. Cancel Outstanding Orders that need to be cleared or logged for yield cancelPartialFills(); }
16,534
18
// Contract Constants // Contract Variables // Constructor initializes the owner's balance and the supply/
function BethereumERC223() { owner = msg.sender; }
function BethereumERC223() { owner = msg.sender; }
34,658
21
// pool index => the timestamp which the pool filled at
mapping(uint256 => uint256) public filledAtP;
mapping(uint256 => uint256) public filledAtP;
52,364
34
// Forward ERC20 methods to upgraded contract after the upgrade timestamp has been reached
function transfer(address _to, uint256 _value) public returns (bool success) { if (now > upgradeTimestamp) { return UpgradedStandardToken(upgradeAddress).transferByLegacy(msg.sender, _to, _value); } else { return super.transfer(_to, _value); } }
function transfer(address _to, uint256 _value) public returns (bool success) { if (now > upgradeTimestamp) { return UpgradedStandardToken(upgradeAddress).transferByLegacy(msg.sender, _to, _value); } else { return super.transfer(_to, _value); } }
22,794
322
// Returns 1 as an unsigned 60.18-decimal fixed-point number.
function scale() internal pure returns (uint256 result) { result = SCALE; }
function scale() internal pure returns (uint256 result) { result = SCALE; }
22,629
78
// Returns the values of {UserInfo}. /
function userInfos(address, uint256)
function userInfos(address, uint256)
70,708
2
// copycalldata of size calldatasize starting from 0 of call data to location at ptr
calldatacopy(ptr, 0, calldatasize)
calldatacopy(ptr, 0, calldatasize)
20,346
11
// Don't allow a zero index, start counting at 1
return value+1;
return value+1;
35,590
1,110
// Every price request costs a fixed fee. Check that this user has enough deposited to cover the final fee.
FixedPoint.Unsigned memory finalFee = _computeFinalFees(); require( _getFeeAdjustedCollateral(depositBoxData.rawCollateral).isGreaterThanOrEqual(finalFee), "Cannot pay final fee" ); _payFinalFees(address(this), finalFee);
FixedPoint.Unsigned memory finalFee = _computeFinalFees(); require( _getFeeAdjustedCollateral(depositBoxData.rawCollateral).isGreaterThanOrEqual(finalFee), "Cannot pay final fee" ); _payFinalFees(address(this), finalFee);
10,318
121
// Tracks pending withdrawal requests. A withdrawal request is pending if `withdrawalRequestPassTimestamp != 0`.
uint256 withdrawalRequestPassTimestamp; Unsigned withdrawalRequestAmount;
uint256 withdrawalRequestPassTimestamp; Unsigned withdrawalRequestAmount;
9,674
73
// TheLostGlitches contract /
contract TheLostGlitches is ERC721Enumerable, ERC721URIStorage, Ownable { string public PROVENANCE_HASH = ""; uint256 public MAX_GLITCHES; uint256 public OFFSET_VALUE; bool public METADATA_FROZEN; bool public PROVENANCE_FROZEN; string public baseUri; bool public saleIsActive; uint256 pu...
contract TheLostGlitches is ERC721Enumerable, ERC721URIStorage, Ownable { string public PROVENANCE_HASH = ""; uint256 public MAX_GLITCHES; uint256 public OFFSET_VALUE; bool public METADATA_FROZEN; bool public PROVENANCE_FROZEN; string public baseUri; bool public saleIsActive; uint256 pu...
66,790
327
// Check that the current state of the pricelessPositionManager is Open. This prevents multiple calls to `expire` and `EmergencyShutdown` post expiration.
modifier onlyOpenState() { _onlyOpenState(); _; }
modifier onlyOpenState() { _onlyOpenState(); _; }
11,963
9
// mock the payload for sendFrom()
bytes memory payload = _encodeSendPayload(_toAddress, _ld2sd(_amount)); return lzEndpoint.estimateFees(_dstChainId, address(this), payload, _useZro, _adapterParams);
bytes memory payload = _encodeSendPayload(_toAddress, _ld2sd(_amount)); return lzEndpoint.estimateFees(_dstChainId, address(this), payload, _useZro, _adapterParams);
6,236
108
// Returns the current admin of `proxy`. Requirements: - This contract must be the admin of `proxy`. /
function getProxyAdmin(TransparentUpgradeableProxy proxy) public view virtual returns (address) { // We need to manually run the static call since the getter cannot be flagged as view // bytes4(keccak256("admin()")) == 0xf851a440 (bool success, bytes memory returndata) = address(proxy).stati...
function getProxyAdmin(TransparentUpgradeableProxy proxy) public view virtual returns (address) { // We need to manually run the static call since the getter cannot be flagged as view // bytes4(keccak256("admin()")) == 0xf851a440 (bool success, bytes memory returndata) = address(proxy).stati...
8,911
24
// presale failed, withdraw to calling user
if (presaleFailed) { uint256 amount = balances[msg.sender]; balances[msg.sender] = 0; send(msg.sender, amount); return true; }
if (presaleFailed) { uint256 amount = balances[msg.sender]; balances[msg.sender] = 0; send(msg.sender, amount); return true; }
21,796
53
// round 51
t0, t1, t2, t3, t4 := ark(t0, t1, t2, t3, t4, q, 3078975275808111706229899605611544294904276390490742680006005661017864583210) t0 := sbox_partial(t0, q) t0, t1, t2, t3, t4 := mix(t0, t1, t2, t3, t4, q)
t0, t1, t2, t3, t4 := ark(t0, t1, t2, t3, t4, q, 3078975275808111706229899605611544294904276390490742680006005661017864583210) t0 := sbox_partial(t0, q) t0, t1, t2, t3, t4 := mix(t0, t1, t2, t3, t4, q)
27,676
4
// Initializes the contract setting the deployer as the initial Governor. /
constructor() { _setGovernor(msg.sender); emit GovernorshipTransferred(address(0), _governor()); }
constructor() { _setGovernor(msg.sender); emit GovernorshipTransferred(address(0), _governor()); }
13,503
42
// Don't forget to add 0x into it
function getWalletFromPublicKey(bytes memory _publicKey) public pure returns (address wallet)
function getWalletFromPublicKey(bytes memory _publicKey) public pure returns (address wallet)
35,132
39
// Modifier to make a function callable only when the contract has Atomic Swaps not available./
modifier isNotAtomicSwap() { require(!isTokenSwapAtomic, "Has to be non Atomic swap"); _; }
modifier isNotAtomicSwap() { require(!isTokenSwapAtomic, "Has to be non Atomic swap"); _; }
22,505
20
// Transfers ownership of the contract to `_newOwner`./Callable by the founder only./Callable only by a none-zero address.
function transferOwnership(address payable _newOwner) onlyFounder noneZero(_newOwner) public returns (bool success)
function transferOwnership(address payable _newOwner) onlyFounder noneZero(_newOwner) public returns (bool success)
41,496
279
// Compare and take the item with the lowst chance
if(layerItem1.chance <= layerItem2.chance){ rarestLayerPositions[i] = layerItemPosition1[i]; rarestBorgAttributeNames[i] = layerItem1.borgAttributeName; }
if(layerItem1.chance <= layerItem2.chance){ rarestLayerPositions[i] = layerItemPosition1[i]; rarestBorgAttributeNames[i] = layerItem1.borgAttributeName; }
29,475
151
// console.log("[sc] deposit amount:", amount);
token.safeTransferFrom(msg.sender, address(this), amount); totalDeposits = totalDeposits.add(amount); updateBetterDeposit(true, amount, msg.sender); emit Deposit(msg.sender, amount);
token.safeTransferFrom(msg.sender, address(this), amount); totalDeposits = totalDeposits.add(amount); updateBetterDeposit(true, amount, msg.sender); emit Deposit(msg.sender, amount);
8,469
9
// 確保付的錢大於等於票的價格
require(msg.value >= tickets[_index].price); tickets[_index].owner = msg.sender;
require(msg.value >= tickets[_index].price); tickets[_index].owner = msg.sender;
34,600
230
// register new contract for state sync
function register(address sender, address receiver) public { require( isOwner() || registrations[receiver] == msg.sender, "StateSender.register: Not authorized to register" ); registrations[receiver] = sender; if (registrations[receiver] == address(0)) { ...
function register(address sender, address receiver) public { require( isOwner() || registrations[receiver] == msg.sender, "StateSender.register: Not authorized to register" ); registrations[receiver] = sender; if (registrations[receiver] == address(0)) { ...
21,286
63
// Provides a descriptive tag for bot consumption This should be modified weekly to provide a summary of the actions Hash: seth keccak -- "$(wget https:raw.githubusercontent.com/makerdao/community/2dfe2a94162345e448c0353ec0e522038572366a/governance/votes/Executive%20vote%20-%20December%203%2C%202021.md -q -O - 2>/dev/n...
string public constant override description = "2021-12-03 MakerDAO Executive Spell | Hash: 0x9068bf87d0ec441f57ff92e2544a3df16d42a481b3e94ec2c37a443031833b84";
string public constant override description = "2021-12-03 MakerDAO Executive Spell | Hash: 0x9068bf87d0ec441f57ff92e2544a3df16d42a481b3e94ec2c37a443031833b84";
15,311
1
// Raphael Pinto Gregorio/return contract owner/basic function/ return contract owner address
function getOwner() external view returns(address) { return _owner; }
function getOwner() external view returns(address) { return _owner; }
42,145
76
// ping to update interest up to now
_updateForgeFee(_underlyingAsset, _expiry, 0); uint256 _totalFee = totalFee[_underlyingAsset][_expiry]; totalFee[_underlyingAsset][_expiry] = 0; address treasuryAddress = data.treasury(); _totalFee = _safeTransfer( yieldToken, _underlyingAsset, ...
_updateForgeFee(_underlyingAsset, _expiry, 0); uint256 _totalFee = totalFee[_underlyingAsset][_expiry]; totalFee[_underlyingAsset][_expiry] = 0; address treasuryAddress = data.treasury(); _totalFee = _safeTransfer( yieldToken, _underlyingAsset, ...
9,851
10
// ReviewStorage The ReviewStorage contract has an. /
contract ReviewStorage { mapping (string => bool) internal clientReviews; string[] public indexReview; event NewReviewHash(string _reviewHash, uint256 _createdTime); /** * @dev Returns whether this hash exists or not. * @param _hashReview Verifiable hash. */ function getExistingRe...
contract ReviewStorage { mapping (string => bool) internal clientReviews; string[] public indexReview; event NewReviewHash(string _reviewHash, uint256 _createdTime); /** * @dev Returns whether this hash exists or not. * @param _hashReview Verifiable hash. */ function getExistingRe...
33,369
53
// if the sender is deleting a flow to a super app receiver
if (ISuperfluid(msg.sender).isApp(ISuperApp(flowVars.receiver))) { newCtx = _changeFlowToApp( flowVars.receiver, flowVars.token, flowParams, oldFlowData, newCtx, currentContext, FlowChangeType.DELETE_FLOW); } else {
if (ISuperfluid(msg.sender).isApp(ISuperApp(flowVars.receiver))) { newCtx = _changeFlowToApp( flowVars.receiver, flowVars.token, flowParams, oldFlowData, newCtx, currentContext, FlowChangeType.DELETE_FLOW); } else {
6,000
160
// Creates a non-upgradeable token proxy for PermitableToken.sol, initializes its eternalStorage._tokenImage address of the token image used for mirroring all functions._name token name._symbol token symbol._decimals token decimals._chainId chain id for current network./
constructor(address _tokenImage, string memory _name, string memory _symbol, uint8 _decimals, uint256 _chainId) public
constructor(address _tokenImage, string memory _name, string memory _symbol, uint8 _decimals, uint256 _chainId) public
51,521
120
// DNSZoneCleared is emitted whenever a given node's zone information is cleared.
event DNSZoneCleared(bytes32 indexed node);
event DNSZoneCleared(bytes32 indexed node);
16,957
22
// ETHFLEX Contract Extends ERC721 Non-Fungible Token Standard basic implementation /
contract ETHFLEX is ERC721, Ownable { using SafeMath for uint256; using Counters for Counters.Counter; Counters.Counter private _tokenIdTracker; string public PROVENANCE = ""; uint256[13] public RandomIds = [ 10000, // This will be Brown ID 10000, // This will be Brown ID 1...
contract ETHFLEX is ERC721, Ownable { using SafeMath for uint256; using Counters for Counters.Counter; Counters.Counter private _tokenIdTracker; string public PROVENANCE = ""; uint256[13] public RandomIds = [ 10000, // This will be Brown ID 10000, // This will be Brown ID 1...
16,979
31
// Set the new length of the splits.
_splitCountOf[_projectId][_domain][_group] = _splits.length;
_splitCountOf[_projectId][_domain][_group] = _splits.length;
26,991
72
// Destroys `amount` tokens from sender, reducing thetotal supply.
* Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function burn(uint256 amount) external virtual{ _burn(msg.sender,amount); }
* Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function burn(uint256 amount) external virtual{ _burn(msg.sender,amount); }
77,772
11
// Blacklisted addresses.
address[] blacklist;
address[] blacklist;
13,468
37
// uint256 collatteralValueInBYN;
getBeyondTokenValue(); (, /*collatteralValueInBYN*/, , , collatteralRatioUpdated) = checkUserCollatteral(_beneficiary); uint256 amountInBYN = (_value.mul(1 ether)).div(getBeyondTokenValue()); uint256 collatteralValueInBYN = (amountInBYN.mul((collatteralRatio.mul(1 ethe...
getBeyondTokenValue(); (, /*collatteralValueInBYN*/, , , collatteralRatioUpdated) = checkUserCollatteral(_beneficiary); uint256 amountInBYN = (_value.mul(1 ether)).div(getBeyondTokenValue()); uint256 collatteralValueInBYN = (amountInBYN.mul((collatteralRatio.mul(1 ethe...
794
28
// Allows anyone to enter the lottery (payable - accepts ETH)
function enter() public payable { // if it's open require(lottery_state == LOTTERY_STATE.OPEN); // and they pay the entry fee require(msg.value >= getEntranceFee(), "Not enough ETH!"); // Store the entry players.push(payable(msg.sender)); }
function enter() public payable { // if it's open require(lottery_state == LOTTERY_STATE.OPEN); // and they pay the entry fee require(msg.value >= getEntranceFee(), "Not enough ETH!"); // Store the entry players.push(payable(msg.sender)); }
46,731
27
// Versioned/Iulian Rotaru/Initialized for multiple versions
contract Versioned { // // _ _ // ___| |_ __ _| |_ ___ // / __| __/ _` | __/ _ \ // \__ \ || (_| | || __/ // |___/\__\__,_|\__\___| // // Stores the current implementation version uint256 version; // Stores the initializing state for each version bool private _initializing; // ...
contract Versioned { // // _ _ // ___| |_ __ _| |_ ___ // / __| __/ _` | __/ _ \ // \__ \ || (_| | || __/ // |___/\__\__,_|\__\___| // // Stores the current implementation version uint256 version; // Stores the initializing state for each version bool private _initializing; // ...
50,744
57
// If phase exists return corresponding bonus for the given date else return 0 (percent)
function getBonusPercent(uint256 datetime) private view returns (uint256) { for (uint i = 0; i < totalPhases; i++) { if (datetime >= phases[i].startTime && datetime <= phases[i].endTime) { return phases[i].bonusPercent; } } return 0; }
function getBonusPercent(uint256 datetime) private view returns (uint256) { for (uint i = 0; i < totalPhases; i++) { if (datetime >= phases[i].startTime && datetime <= phases[i].endTime) { return phases[i].bonusPercent; } } return 0; }
43,078
6
// Default function; Gets called when Ether is deposited, and forwards it to the parent address /
receive() external payable { // throws on failure modirAddress.transfer(msg.value); // Fire off the deposited event if we can forward it ////emit ForwarderDeposited(msg.sender, msg.value, msg.data); }
receive() external payable { // throws on failure modirAddress.transfer(msg.value); // Fire off the deposited event if we can forward it ////emit ForwarderDeposited(msg.sender, msg.value, msg.data); }
4,725
137
// Collection metadata URI
string private _baseURIExtended;
string private _baseURIExtended;
41,827