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 |
|---|---|---|---|---|
8 | // Sets an immutable fixed `size` to `classId` / | function _fixClassSize(uint256 classId, uint256 size)
internal virtual
| function _fixClassSize(uint256 classId, uint256 size)
internal virtual
| 48,678 |
28 | // Sets `amount` as the allowance of `spender` over the `owner` s tokens. This internal function is equivalent to `approve`, and can be used toe.g. set automatic allowances for certain subsystems, etc. | * Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address... | * Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address... | 519 |
17 | // the constructor of the contract / | constructor() public {
totalSupply = 100000000000000000;
balanceOf[msg.sender] = totalSupply;
name = "QIEX Credit Points";
symbol = "QI";
decimals = 8; ... | constructor() public {
totalSupply = 100000000000000000;
balanceOf[msg.sender] = totalSupply;
name = "QIEX Credit Points";
symbol = "QI";
decimals = 8; ... | 21,780 |
230 | // Invalidates a Data Availability Service keyset ksHash hash of the keyset / | function invalidateKeysetHash(bytes32 ksHash) external;
| function invalidateKeysetHash(bytes32 ksHash) external;
| 36,706 |
141 | // Update the status for the inbox for a given message hash to`Progressed`_messageBox Message Box. _message Message object. _unlockSecret Unlock secret for the hash lock provided while declaration. return messageHash_ Message hash. / | function progressInbox(
MessageBox storage _messageBox,
Message storage _message,
bytes32 _unlockSecret
)
external
returns (bytes32 messageHash_)
| function progressInbox(
MessageBox storage _messageBox,
Message storage _message,
bytes32 _unlockSecret
)
external
returns (bytes32 messageHash_)
| 25,149 |
32 | // Default function; Gets called when Ether is deposited with no data, and forwards it to the parent address / | receive() external payable {
flush();
}
| receive() external payable {
flush();
}
| 24,815 |
17 | // owner一次性获取代币 | function HLWCOIN() public {
balances[msg.sender] = MAX_SUPPLY;
Transfer(0x0, msg.sender, MAX_SUPPLY);
}
| function HLWCOIN() public {
balances[msg.sender] = MAX_SUPPLY;
Transfer(0x0, msg.sender, MAX_SUPPLY);
}
| 73,253 |
19 | // State Getters | function getFixedPercRate() external view returns (uint256) {
return percentageFee;
}
| function getFixedPercRate() external view returns (uint256) {
return percentageFee;
}
| 44,445 |
144 | // TODO Require that amount <= available rewards. | _updateAccrual();
| _updateAccrual();
| 25,315 |
2 | // This contract is used to generate clone contracts from a contract. It is based on the MiniMeTokenFactory contract. In solidity this is the way to create a contract from a contract of the same class / | contract ExpositoProjectFactory {
/**
* @notice Update the DApp by creating a new token with new functionalities
* the msg.sender becomes the controller of this clone token
* @param _parentToken Address of the token being cloned
* @param _snapshotBlock Block of the parent token that will
... | contract ExpositoProjectFactory {
/**
* @notice Update the DApp by creating a new token with new functionalities
* the msg.sender becomes the controller of this clone token
* @param _parentToken Address of the token being cloned
* @param _snapshotBlock Block of the parent token that will
... | 21,584 |
0 | // [[a,b,c,d], [a1,b1,c1,d1]...] where each subarray is a column. since you'd access the subarray-style 2D array like this: col, row that means that in the 1D array, the first grouping is the first col. The second grouping is the second col, etc As such, element 1 is equivalent to 0,1 -- element 2 = 0,2 -- element 33 =... | address creator;
function MapElevationStorage()
| address creator;
function MapElevationStorage()
| 39,680 |
26 | // perform the actual conversion and optionally send ETH to the network | uint256 targetAmount = network.convertByPath{ value: value }(path, amount, 1, address(this), address(0), 0);
| uint256 targetAmount = network.convertByPath{ value: value }(path, amount, 1, address(this), address(0), 0);
| 22,289 |
28 | // register the agreement proxy | _agreementClasses.push((agreementClass));
_agreementClassIndices[agreementType] = _agreementClasses.length;
emit AgreementClassRegistered(agreementType, address(agreementClassLogic));
| _agreementClasses.push((agreementClass));
_agreementClassIndices[agreementType] = _agreementClasses.length;
emit AgreementClassRegistered(agreementType, address(agreementClassLogic));
| 33,736 |
95 | // Checks if daily and/or monthly cooldown must be reset, then check if _value sent has been exceeded,if not increases user's OnchainID counters. _userAddress, address on which counters will be increased _value, value of transaction)to be increased/ | function _increaseCounters(address _userAddress, uint256 _value) internal {
address identity = _getIdentity(_userAddress);
_resetDailyCooldown(identity);
_resetMonthlyCooldown(identity);
if ((usersCounters[identity].dailyCount + _value) <= dailyLimit) {
usersCounters[iden... | function _increaseCounters(address _userAddress, uint256 _value) internal {
address identity = _getIdentity(_userAddress);
_resetDailyCooldown(identity);
_resetMonthlyCooldown(identity);
if ((usersCounters[identity].dailyCount + _value) <= dailyLimit) {
usersCounters[iden... | 18,241 |
13 | // THIS IS AN EXAMPLE CONTRACT WHICH USES HARDCODED VALUES FOR CLARITY.PLEASE DO NOT USE THIS CODE IN PRODUCTION. / | contract FilinkConsumer is ChainlinkClient {
using Chainlink for Chainlink.Request;
mapping(bytes32 => string) private mapRequestDeal;
mapping(string => uint256) private mapDealPrice;
address private oracle;
bytes32 private jobId;
uint256 private fee;
uint256 public price;
... | contract FilinkConsumer is ChainlinkClient {
using Chainlink for Chainlink.Request;
mapping(bytes32 => string) private mapRequestDeal;
mapping(string => uint256) private mapDealPrice;
address private oracle;
bytes32 private jobId;
uint256 private fee;
uint256 public price;
... | 53,443 |
3 | // The maximum value that can be returned from getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK) | uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342;
| uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342;
| 34,393 |
41 | // anyone who participated but did not win the auction should be allowed to withdraw the full amount of their funds | withdrawalAccount = payable(msg.sender);
withdrawalAmount = _auctionInfos[auctionID].fundsByBidder[withdrawalAccount];
| withdrawalAccount = payable(msg.sender);
withdrawalAmount = _auctionInfos[auctionID].fundsByBidder[withdrawalAccount];
| 18,641 |
195 | // Verification Holders Timestamp | verificationHoldersTimestampMap[ _from ] = now;
| verificationHoldersTimestampMap[ _from ] = now;
| 6,667 |
6 | // Resolve this ENSSubdomainRegistrar's root node to `_target`_target Ethereum address root node will point to/ | function pointRootNode(address _target) external auth(POINT_ROOTNODE_ROLE) {
_pointToResolverAndResolve(rootNode, _target);
}
| function pointRootNode(address _target) external auth(POINT_ROOTNODE_ROLE) {
_pointToResolverAndResolve(rootNode, _target);
}
| 32,830 |
10 | // bytes32 private constant NAME_HASH = keccak256("Aragon Network Token") | bytes32 private constant NAME_HASH = 0x711a8013284a3c0046af6c0d6ed33e8bbc2c7a11d615cf4fdc8b1ac753bda618;
| bytes32 private constant NAME_HASH = 0x711a8013284a3c0046af6c0d6ed33e8bbc2c7a11d615cf4fdc8b1ac753bda618;
| 38,532 |
49 | // Atomically decreases the allowance granted to `spender` by the caller. | * This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `... | * This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `... | 9,474 |
315 | // can be set only once | require(m_funds == address(0));
m_funds = FundsRegistry(_funds);
| require(m_funds == address(0));
m_funds = FundsRegistry(_funds);
| 33,100 |
17 | // ------------------------------------------------------------------------ | function BithubCommunityToken() public {
symbol = "BHCx";
name = "Bithubcommunity Token";
decimals = 18;
_totalSupply = 1000000000000000000000000000;
balances[0xbfde0299a76e9437df7242d090c73ba709834ba5] = 734750000000000000000000000;
Transfer(address(0), 0xbfde0299a76... | function BithubCommunityToken() public {
symbol = "BHCx";
name = "Bithubcommunity Token";
decimals = 18;
_totalSupply = 1000000000000000000000000000;
balances[0xbfde0299a76e9437df7242d090c73ba709834ba5] = 734750000000000000000000000;
Transfer(address(0), 0xbfde0299a76... | 26,628 |
333 | // Swaps two indexes in the withdrawal stack./index1 One index involved in the swap/index2 The other index involved in the swap. | function swapWithdrawalStackIndexes(uint256 index1, uint256 index2) external requiresAuth {
// Get the (soon to be) new strategies at each index.
Strategy newStrategy2 = withdrawalStack[index1];
Strategy newStrategy1 = withdrawalStack[index2];
// Swap the strategies at both indexes.... | function swapWithdrawalStackIndexes(uint256 index1, uint256 index2) external requiresAuth {
// Get the (soon to be) new strategies at each index.
Strategy newStrategy2 = withdrawalStack[index1];
Strategy newStrategy1 = withdrawalStack[index2];
// Swap the strategies at both indexes.... | 55,559 |
5 | // Preview the number of points that would be returned for the/ given amount and duration.//amount mav to be staked/duration number of seconds to stake for/ return points staking points that would be returned/ return end staking period end date | function previewPoints(uint256 amount, uint256 duration) external view returns (uint256, uint256);
| function previewPoints(uint256 amount, uint256 duration) external view returns (uint256, uint256);
| 36,011 |
452 | // Service function to calculate and pay pending vault and yield rewards to the senderInternally executes similar function `_processRewards` from the parent smart contract to calculate and pay yield rewards; adds vault rewards processingCan be executed by anyone at any time, but has an effect only when executed by depo... | function processRewards(bool _useSILV) external override {
_processRewards(msg.sender, _useSILV, true);
}
| function processRewards(bool _useSILV) external override {
_processRewards(msg.sender, _useSILV, true);
}
| 50,800 |
11 | // Transfers tokens using a signed permit messages/permit The permit data signed over by the owner/dataHash The EIP-712 hash of permit data to include when checking signature/owner The owner of the tokens to transfer/signature The signature to verify | function _permitTransferFrom(
PermitBatchTransferFrom memory permit,
SignatureTransferDetails[] calldata transferDetails,
address owner,
bytes32 dataHash,
bytes calldata signature
| function _permitTransferFrom(
PermitBatchTransferFrom memory permit,
SignatureTransferDetails[] calldata transferDetails,
address owner,
bytes32 dataHash,
bytes calldata signature
| 24,867 |
37 | // List of enabled Modules; Modules extend the functionality of SetTokens | address[] public modules;
| address[] public modules;
| 8,871 |
65 | // WETH -> VaultX -> XWETH -> Bridge -> PXWETH _toAddress need to be little endian and start with 0x fef: https:peterlinx.github.io/DataTransformationTools/ | function lock(bytes memory _toAddress, uint256 _amount) public {
// need approve infinte amount from user then safe transfer from
IERC20(want).safeTransferFrom(msg.sender, address(this), _amount);
IERC20(want).approve(xvault, _amount);
Vault(xvault).deposit(_amount);
// https... | function lock(bytes memory _toAddress, uint256 _amount) public {
// need approve infinte amount from user then safe transfer from
IERC20(want).safeTransferFrom(msg.sender, address(this), _amount);
IERC20(want).approve(xvault, _amount);
Vault(xvault).deposit(_amount);
// https... | 9,973 |
24 | // index da compra per account | accountOrdens[_account].push(index);
if(_batch == WL){
totalSoldWL+= _tokens;
}
| accountOrdens[_account].push(index);
if(_batch == WL){
totalSoldWL+= _tokens;
}
| 16,566 |
188 | // Duplicated affirmations | require(!affirmationsSigned(hashSender));
setAffirmationsSigned(hashSender, true);
uint256 signed = numAffirmationsSigned(hashMsg);
require(!isAlreadyProcessed(signed));
| require(!affirmationsSigned(hashSender));
setAffirmationsSigned(hashSender, true);
uint256 signed = numAffirmationsSigned(hashMsg);
require(!isAlreadyProcessed(signed));
| 7,742 |
40 | // skip for non-kine config, which should have valid underlying address | if(config.underlying != address(0)){
uint reporterPrice = priceData.getPrice(reporter, symbols[i]);
if(config.priceSource != KPriceSource.COMPOUND)
postPriceInternal(symbols[i], ethPrice, config, reporterPrice);
}
| if(config.underlying != address(0)){
uint reporterPrice = priceData.getPrice(reporter, symbols[i]);
if(config.priceSource != KPriceSource.COMPOUND)
postPriceInternal(symbols[i], ethPrice, config, reporterPrice);
}
| 415 |
6 | // Returns the bit at the given '_index' in '_self'. _self Uint to check. _index Index of the bit to get.return The value of the bit at '_index'. / | function getBit(uint _self, uint8 _index)
internal
pure
returns (uint8)
| function getBit(uint _self, uint8 _index)
internal
pure
returns (uint8)
| 8,615 |
250 | // The fish's genetic code - this will never change for any fish. | uint256 genes;
| uint256 genes;
| 3,561 |
12 | // Mint the token(s) | _mint(msg.sender, amount, false, false);
| _mint(msg.sender, amount, false, false);
| 54,244 |
10 | // The ZrxRouter is used by settlement to execute orders through 0x | contract ZrxRouter is BaseAccess, IDexRouter {
using SafeMath for uint256;
using SafeMath for uint112;
using SafeMath for uint;
using SafeERC20 for IERC20;
function initialize() public initializer {
BaseAccess.initAccess();
}
// @dev Executes a call to 0x to make fill the order
// @p... | contract ZrxRouter is BaseAccess, IDexRouter {
using SafeMath for uint256;
using SafeMath for uint112;
using SafeMath for uint;
using SafeERC20 for IERC20;
function initialize() public initializer {
BaseAccess.initAccess();
}
// @dev Executes a call to 0x to make fill the order
// @p... | 19,570 |
62 | // Add a new LP to the pool.Can only be called by the owner./ DO NOT add the same LP token more than once. Rewards will be messed up if you do./allocPoint AP of the new pool./_pid Pid on MCV2 | function add(uint256 allocPoint, uint256 _pid) public onlyOwner {
require(poolInfo[_pid].lastRewardBlock == 0, "Pool already exists");
uint256 lastRewardBlock = block.number;
totalAllocPoint = totalAllocPoint.add(allocPoint);
poolInfo[_pid] = PoolInfo({
allocPoint: alloc... | function add(uint256 allocPoint, uint256 _pid) public onlyOwner {
require(poolInfo[_pid].lastRewardBlock == 0, "Pool already exists");
uint256 lastRewardBlock = block.number;
totalAllocPoint = totalAllocPoint.add(allocPoint);
poolInfo[_pid] = PoolInfo({
allocPoint: alloc... | 23,500 |
1 | // Should return whether the signature provided is valid for the provided hash hash 32 bytes hash to be signed signature Signature byte array associated with hashreturn magicValue - 0x1626ba7e if valid else 0x00000000 / | function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);
| function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);
| 17,094 |
4 | // registered relayers | mapping(address => RelayerInfo) private _relayerInfo;
| mapping(address => RelayerInfo) private _relayerInfo;
| 2,916 |
50 | // Get the approved address for a single ELHT/_tokenId The ELHT to find the approved address for/ return The approved address for this ELHT, or the zero address if there is none | function getApproved(uint256 _tokenId) external view isValidToken(_tokenId) returns (address) {
return cardIdToApprovals[_tokenId];
}
| function getApproved(uint256 _tokenId) external view isValidToken(_tokenId) returns (address) {
return cardIdToApprovals[_tokenId];
}
| 14,261 |
74 | // For a new target range to be valid:- the pool must currently be between the current targets (meaning no fees are currently pending)- the pool must currently be between the new targets (meaning setting them does not cause for fees to bepending) The first requirement could be relaxed, as the LPs actually benefit from ... |
(uint256 currentLowerTarget, uint256 currentUpperTarget) = getTargets();
_require(_isMainBalanceWithinTargets(currentLowerTarget, currentUpperTarget), Errors.OUT_OF_TARGET_RANGE);
_require(_isMainBalanceWithinTargets(newLowerTarget, newUpperTarget), Errors.OUT_OF_NEW_TARGET_RANGE);
_se... |
(uint256 currentLowerTarget, uint256 currentUpperTarget) = getTargets();
_require(_isMainBalanceWithinTargets(currentLowerTarget, currentUpperTarget), Errors.OUT_OF_TARGET_RANGE);
_require(_isMainBalanceWithinTargets(newLowerTarget, newUpperTarget), Errors.OUT_OF_NEW_TARGET_RANGE);
_se... | 67,770 |
3 | // Address of CLA contract. | ClaimToken public cla;
| ClaimToken public cla;
| 50,453 |
32 | // Protocol fees are skipped when processing recovery mode exits, since these are pool-agnostic and it is therefore impossible to know how many fees are due. For consistency, all regular joins and exits are processed as if the protocol swap fee percentage was zero. | dueProtocolFeeAmounts = new uint256[](balances.length);
(bptAmountIn, amountsOut) = _doRecoveryModeExit(balances, totalSupply(), userData);
| dueProtocolFeeAmounts = new uint256[](balances.length);
(bptAmountIn, amountsOut) = _doRecoveryModeExit(balances, totalSupply(), userData);
| 15,391 |
172 | // The number of standard deviations (from volatilityOracle) to +/- from mean when choosing/ range for primary Uniswap position | function B() external view returns (uint8);
| function B() external view returns (uint8);
| 57,825 |
136 | // default method when ether is paid to the contract's address used for the WETH withdraw callback | function() external payable {
}
| function() external payable {
}
| 54,068 |
461 | // If the loan was already fully canceled, then just return 0 amount was canceled | if (amountToCancel == 0) {
return 0;
}
| if (amountToCancel == 0) {
return 0;
}
| 35,261 |
6 | // mapping from hashed(tokenTrait) to tokenId | mapping(uint256 => uint256) public existingTraits;
| mapping(uint256 => uint256) public existingTraits;
| 49,705 |
7 | // set the baseTokenURI of an extension.Can only be called by extension.For tokens with no uri configured, tokenURI will return "uri+tokenId" / | function setBaseTokenURIExtension(string calldata uri, bool identical)
| function setBaseTokenURIExtension(string calldata uri, bool identical)
| 24,406 |
6 | // swap directly based on provided inputs | function swap() onlyOwner public{
address[] memory uniswapPairPath = new address[](2);
uniswapPairPath[0] = _wethAddress;
uniswapPairPath[1] = tokenAddress;
(address token0,) = sortTokens(_wethAddress, tokenAddress);
(uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(... | function swap() onlyOwner public{
address[] memory uniswapPairPath = new address[](2);
uniswapPairPath[0] = _wethAddress;
uniswapPairPath[1] = tokenAddress;
(address token0,) = sortTokens(_wethAddress, tokenAddress);
(uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(... | 11,675 |
13 | // Gets the amount of creator annuities reserved for the creator for the specified NFT/contractAddress The Address to the Contract of the NFT/tokenId The Token ID of the NFT/ return creator The address of the creator/ return annuityPct The percentage amount of annuities reserved for the creator | function getCreatorAnnuities(
address contractAddress,
uint256 tokenId
)
external
view
override
virtual
returns (address creator, uint256 annuityPct)
| function getCreatorAnnuities(
address contractAddress,
uint256 tokenId
)
external
view
override
virtual
returns (address creator, uint256 annuityPct)
| 26,087 |
12 | // Job Id to get > string 7d80a6386ef543a3abb52817f6707e3b | jobId = "7d80a6386ef543a3abb52817f6707e3b";
| jobId = "7d80a6386ef543a3abb52817f6707e3b";
| 36,049 |
11 | // Execute the transaction | _returnValues[i] = _decodeAndExecuteTransaction(_transactions[i], _isMetaTransaction);
| _returnValues[i] = _decodeAndExecuteTransaction(_transactions[i], _isMetaTransaction);
| 47,658 |
242 | // Get the Vault's current total strategy holdings. | uint256 oldTotalStrategyHoldings = totalStrategyHoldings;
| uint256 oldTotalStrategyHoldings = totalStrategyHoldings;
| 21,418 |
23 | // llama a una funcion privada y devuelve el nombre del candidato ganador | function nombre_ganador() public view returns(string memory){
require(!periodo_eleccion, "Las votaciones siguen vigentes");
string memory nombre;
(nombre,) = _ganador_votacion();//con la , ignoramos la cantidad que obtuvo ya que lo utilizaremos en otra funcion
return nombre;
}
| function nombre_ganador() public view returns(string memory){
require(!periodo_eleccion, "Las votaciones siguen vigentes");
string memory nombre;
(nombre,) = _ganador_votacion();//con la , ignoramos la cantidad que obtuvo ya que lo utilizaremos en otra funcion
return nombre;
}
| 10,266 |
14 | // Review section | reviews[productId].push(Review(user, productId, rating, comment, 0));
userReviews[user].push(productId);
products[productId].totalRatings += rating;
products[productId].numReviews++;
emit ReviewAdded(productId, user, rating, comment);
reviewCounter++;
| reviews[productId].push(Review(user, productId, rating, comment, 0));
userReviews[user].push(productId);
products[productId].totalRatings += rating;
products[productId].numReviews++;
emit ReviewAdded(productId, user, rating, comment);
reviewCounter++;
| 31,441 |
72 | // Calculate and create all team share VUPs |
coreTeamShare = CORE_TEAM_PORTION;
uint256 devTeamShare = DEV_TEAM_PORTION;
cofounderShare = CO_FOUNDER_PORTION;
uint256 udfShare = UDF_PORTION;
balances[devVUPDestination] = devTeamShare;
balances[advisoryVUPDestination] = advisoryTeamShare;
balances[udfVUPDestination] = udfShare;
|
coreTeamShare = CORE_TEAM_PORTION;
uint256 devTeamShare = DEV_TEAM_PORTION;
cofounderShare = CO_FOUNDER_PORTION;
uint256 udfShare = UDF_PORTION;
balances[devVUPDestination] = devTeamShare;
balances[advisoryVUPDestination] = advisoryTeamShare;
balances[udfVUPDestination] = udfShare;
| 30,178 |
287 | // Changes the name for tokenId / | function changeArt(
uint256 tokenId,
string memory newRoomOwnerName,
uint256 newTimeStamp
| function changeArt(
uint256 tokenId,
string memory newRoomOwnerName,
uint256 newTimeStamp
| 10,480 |
42 | // fee Code | uint256 fee = transferFee.mul(value).div(10000);
| uint256 fee = transferFee.mul(value).div(10000);
| 7,814 |
10 | // misc | uint256 internal constant EMPTY_BITMAP = 0;
string internal constant WHERE_TO_FIND_TERMS =
"Terms and conditions can be found by calling getTerms() on the Keepers contract.";
| uint256 internal constant EMPTY_BITMAP = 0;
string internal constant WHERE_TO_FIND_TERMS =
"Terms and conditions can be found by calling getTerms() on the Keepers contract.";
| 29,538 |
175 | // Otherwise, use the previously stored number from the matrix. | value = tokenMatrix[random];
| value = tokenMatrix[random];
| 20,331 |
51 | // 返回可提取的ETH数量 | function withdrawETHAmount(uint256 _stepIndex, address _addr) public view returns (uint256) {
return ETHBalance[_stepIndex][_addr]
.add(FissionBalance[_stepIndex][_addr])
.add(FOMOBalance[_stepIndex][_addr])
.add(LuckyBalance[_stepIndex][_addr]);
}
| function withdrawETHAmount(uint256 _stepIndex, address _addr) public view returns (uint256) {
return ETHBalance[_stepIndex][_addr]
.add(FissionBalance[_stepIndex][_addr])
.add(FOMOBalance[_stepIndex][_addr])
.add(LuckyBalance[_stepIndex][_addr]);
}
| 11,104 |
0 | // target contract => calling address => function => permission yes/no TODO: maybe there is a better way to do this | mapping(address => mapping(address => mapping(bytes4 => bool))) authorizations;
| mapping(address => mapping(address => mapping(bytes4 => bool))) authorizations;
| 44,454 |
183 | // Mapping to check if an address has claimed tokens | mapping(address => bool) hasClaimed;
| mapping(address => bool) hasClaimed;
| 70,628 |
17 | // BiFi's safe-math Contract BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) / | library SafeMath {
uint256 internal constant unifiedPoint = 10 ** 18;
/******************** Safe Math********************/
function add(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a + b;
require(c >= a, "a");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uin... | library SafeMath {
uint256 internal constant unifiedPoint = 10 ** 18;
/******************** Safe Math********************/
function add(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a + b;
require(c >= a, "a");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uin... | 12,531 |
13 | // Add a new liquidity and generate a nft./mintParam params, see MintParam for more/ return lid id of nft/ return liquidity amount of liquidity added/ return amountX amount of tokenX deposited/ return amountY amount of tokenY depsoited | function mint(MintParam calldata mintParam) external payable returns(
uint256 lid,
uint128 liquidity,
uint256 amountX,
uint256 amountY
);
| function mint(MintParam calldata mintParam) external payable returns(
uint256 lid,
uint128 liquidity,
uint256 amountX,
uint256 amountY
);
| 26,727 |
5 | // List of all the registered contracts | address[] public contracts;
| address[] public contracts;
| 40,960 |
22 | // ======================================AXIA EVENTS========================================= |
event NewEpoch(uint epoch, uint emission, uint nextepoch);
event NewDay(uint epoch, uint day, uint nextday);
event BurnEvent(address indexed pool, address indexed burnaddress, uint amount);
event emissions(address indexed root, address indexed pool, uint value);
event TrigRewardEvent(address indexe... |
event NewEpoch(uint epoch, uint emission, uint nextepoch);
event NewDay(uint epoch, uint day, uint nextday);
event BurnEvent(address indexed pool, address indexed burnaddress, uint amount);
event emissions(address indexed root, address indexed pool, uint value);
event TrigRewardEvent(address indexe... | 34,835 |
80 | // Send to Marketing and Buyback contract | transferToAddressETH(MarketingAddress, transferredBalance.div(SELL_FEE).mul(MarketingDivisor));
transferToAddressETH(BuybackAddress, transferredBalance.div(SELL_FEE).mul(BuybackDivisor));
| transferToAddressETH(MarketingAddress, transferredBalance.div(SELL_FEE).mul(MarketingDivisor));
transferToAddressETH(BuybackAddress, transferredBalance.div(SELL_FEE).mul(BuybackDivisor));
| 43,205 |
15 | // now pay accounts that are constrained by even distribution. we split whatever isleft of the holdover evenly. | uint distAmount = holdoverBalance;
if (totalFundsDistributed < evenDistThresh) {
for (i = 0; i < numAccounts; i++ ) {
if (partnerAccounts[i].evenStart) {
acctDist = distAmount / numEvenSplits;... | uint distAmount = holdoverBalance;
if (totalFundsDistributed < evenDistThresh) {
for (i = 0; i < numAccounts; i++ ) {
if (partnerAccounts[i].evenStart) {
acctDist = distAmount / numEvenSplits;... | 37,135 |
36 | // mark a task a complete and release subcontractor payment.Needs builder,contractor and subcontractor signature. task must be in active state. _data bytes encoded from-- uint256 _taskID the index of task- address _projectAddress the address of this contract. For signature security. _signature bytes representing signat... | function setComplete(bytes calldata _data, bytes calldata _signature)
| function setComplete(bytes calldata _data, bytes calldata _signature)
| 6,337 |
0 | // Largest possible fee earned proportion per one second./0.0000001% per second, i.e. 3.1536% per year./0.0000001%(365246060) = 3.1536%/or 3.16224% per year in leap years. | uint256 private constant _MAX_FEE = 10 ** 9;
| uint256 private constant _MAX_FEE = 10 ** 9;
| 12,470 |
148 | // Update the currentLastId with the id in the controller plus the offSet | currentLastId = currentWitnetRequestBoard.postDataRequest{value: msg.value}(_requestAddress) + offset;
| currentLastId = currentWitnetRequestBoard.postDataRequest{value: msg.value}(_requestAddress) + offset;
| 29,106 |
254 | // Clean out ticketExectionHash so the NFT can be reused by ticketeer. | _setnftMetadata(nftIndex, "");
| _setnftMetadata(nftIndex, "");
| 15,015 |
284 | // Checks if a given account holds the Burner role. account The address which is checked for the Burner role.return bool True if the provided account is a Burner. / | function isBurner(address account) public view nonReentrantView() returns (bool) {
return holdsRole(uint256(Roles.Burner), account);
}
| function isBurner(address account) public view nonReentrantView() returns (bool) {
return holdsRole(uint256(Roles.Burner), account);
}
| 17,204 |
112 | // Ensure the previous offer has been removed before refunding | delete tokenIdToOffer[tokenId];
| delete tokenIdToOffer[tokenId];
| 21,010 |
275 | // Returns the current owner of the factory/Can be changed by the current owner via setOwner/ return The address of the factory owner | function owner() external view returns (address);
| function owner() external view returns (address);
| 4,042 |
16 | // Begin of Payment Splitter // this section contains the methods usedto split payment between all collaborators of this project / | contract PaymentSplitter is Ownable{
event PayeeAdded(address account, uint256 shares);
event PaymentReleased(address to, uint256 amount);
event PaymentReceived(address from, uint256 amount);
uint256 private _totalShares;
uint256 private _totalReleased;
mapping(address => uint256) private _sha... | contract PaymentSplitter is Ownable{
event PayeeAdded(address account, uint256 shares);
event PaymentReleased(address to, uint256 amount);
event PaymentReceived(address from, uint256 amount);
uint256 private _totalShares;
uint256 private _totalReleased;
mapping(address => uint256) private _sha... | 24,904 |
92 | // Allows an owner to submit and confirm a token transaction./token address of token SC which supply will b transferred./destination Transaction target address./value Transaction ether value./ return Returns transaction ID. | function submitTokenTransaction(address token, address destination, uint value)
public
ownerExists(msg.sender)
validTokenTransaction(token, destination, value)
returns (uint)
| function submitTokenTransaction(address token, address destination, uint value)
public
ownerExists(msg.sender)
validTokenTransaction(token, destination, value)
returns (uint)
| 34,148 |
125 | // Update reward variables of the given pool to be up-to-date. / | function _updatePool() internal {
if (block.number <= lastRewardBlock) {
return;
}
uint256 stakedTokenSupply = stakedToken.balanceOf(address(this));
if (stakedTokenSupply > 0) {
uint256 multiplier = _getMultiplier(lastRewardBlock, block.number);
... | function _updatePool() internal {
if (block.number <= lastRewardBlock) {
return;
}
uint256 stakedTokenSupply = stakedToken.balanceOf(address(this));
if (stakedTokenSupply > 0) {
uint256 multiplier = _getMultiplier(lastRewardBlock, block.number);
... | 19,070 |
25 | // Records amount of AnyswapV3ERC20 token owned by account. | mapping (address => uint256) public override balanceOf;
uint256 private _totalSupply;
| mapping (address => uint256) public override balanceOf;
uint256 private _totalSupply;
| 3,513 |
25 | // Set the price to 0.0003 ETH/CTest1$0.10 per | if (totalSupply < 25000)
{
rate = 3340;
}
| if (totalSupply < 25000)
{
rate = 3340;
}
| 53,507 |
2 | // _paused is used to pause the contract in case of an emergency | bool public _paused;
| bool public _paused;
| 27,227 |
12 | // Update `lastUpdatedEpoch` of `tokenId`. / | function updateNftEpoch(uint256 tokenId) public {
require(msg.sender == masterChef, "invalid address.");
_meta[tokenId].lastUpdatedEpoch = epoch;
}
| function updateNftEpoch(uint256 tokenId) public {
require(msg.sender == masterChef, "invalid address.");
_meta[tokenId].lastUpdatedEpoch = epoch;
}
| 24,278 |
11 | // Community | event TaskCreated(address msgSender, uint _uuid, uint _amount);
event ProjectCreated(address msgSender, uint _uuid, uint _amount, address _address);
| event TaskCreated(address msgSender, uint _uuid, uint _amount);
event ProjectCreated(address msgSender, uint _uuid, uint _amount, address _address);
| 24,230 |
105 | // public method to execute an epoch which required a submission period and the challenge period is over | function executeEpoch() public {
require(block.timestamp >= minChallengePeriodEnd && minChallengePeriodEnd != 0);
_executeEpoch(bestSubmission.seniorRedeem ,bestSubmission.juniorRedeem,
bestSubmission.seniorSupply, bestSubmission.juniorSupply);
}
| function executeEpoch() public {
require(block.timestamp >= minChallengePeriodEnd && minChallengePeriodEnd != 0);
_executeEpoch(bestSubmission.seniorRedeem ,bestSubmission.juniorRedeem,
bestSubmission.seniorSupply, bestSubmission.juniorSupply);
}
| 16,069 |
5 | // vePendle Fees | uint256 public vePendleHarvestCallerFee;
uint256 public protocolFee; // fee charged by penpie team for operation
address public feeCollector; // penpie team fee destination
address public bribeManagerEOA; // An EOA address to later user vePendle harvested reward as bribe
| uint256 public vePendleHarvestCallerFee;
uint256 public protocolFee; // fee charged by penpie team for operation
address public feeCollector; // penpie team fee destination
address public bribeManagerEOA; // An EOA address to later user vePendle harvested reward as bribe
| 24,381 |
50 | // Determine the higher generation number of the two parents | uint16 parentGen = matron.generation;
if (sire.generation > matron.generation) {
parentGen = sire.generation;
}
| uint16 parentGen = matron.generation;
if (sire.generation > matron.generation) {
parentGen = sire.generation;
}
| 17,782 |
1 | // set expiration to ~4 months from now | _setExpiration(block.timestamp + 124 days);
| _setExpiration(block.timestamp + 124 days);
| 19,530 |
45 | // Checks if a transfer is within the limit. If yes the daily spent is updated._lStorage The storage contract._versionManager The Version Manager._wallet The target wallet._amount The amount for the transfer return true if the transfer is withing the daily limit./ | function checkAndUpdateDailySpent(
ILimitStorage _lStorage,
IVersionManager _versionManager,
address _wallet,
uint256 _amount
)
internal
returns (bool)
| function checkAndUpdateDailySpent(
ILimitStorage _lStorage,
IVersionManager _versionManager,
address _wallet,
uint256 _amount
)
internal
returns (bool)
| 20,267 |
29 | // ``` As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256` (`UintSet`) are supported./ | library EnumerableSet {
struct Set {
bytes32[] _values;
mapping (bytes32 => uint256) _indexes;
}
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.p... | library EnumerableSet {
struct Set {
bytes32[] _values;
mapping (bytes32 => uint256) _indexes;
}
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.p... | 25,368 |
6 | // check if currentHash hash owner is same and if same then update the value | function updateHash(string memory hashOfIpfs, string memory currentHash, uint16 hashNo) public isHashOwner(currentHash, hashNo) {
_updateHash(hashOfIpfs, hashNo);
}
| function updateHash(string memory hashOfIpfs, string memory currentHash, uint16 hashNo) public isHashOwner(currentHash, hashNo) {
_updateHash(hashOfIpfs, hashNo);
}
| 10,019 |
46 | // ISWswap | address constant MASTERCHEF = 0xEc4fC6599c5e64F6e320d3C098Fb9CAFbA7B9273;
| address constant MASTERCHEF = 0xEc4fC6599c5e64F6e320d3C098Fb9CAFbA7B9273;
| 70,780 |
316 | // Mint crate character | mintToken(crate, characterTypeId);
emit CreatePurchased(keccak256(abi.encodePacked(_crateId)), msg.sender, characterTypeId);
| mintToken(crate, characterTypeId);
emit CreatePurchased(keccak256(abi.encodePacked(_crateId)), msg.sender, characterTypeId);
| 47,251 |
121 | // Function to get the number of ACO creators forbidden for a pool.return The number of ACO creators forbidden. / | function getNumberOfAcoCreatorsForbidden() view external virtual returns(uint256) {
return acoForbiddenCreators.length;
}
| function getNumberOfAcoCreatorsForbidden() view external virtual returns(uint256) {
return acoForbiddenCreators.length;
}
| 35,752 |
104 | // called when a horsey is freed for carrots | event HorseyFreed(uint256 tokenId);
| event HorseyFreed(uint256 tokenId);
| 841 |
5,954 | // 2979 | entry "thermionically" : ENG_ADVERB
| entry "thermionically" : ENG_ADVERB
| 23,815 |
123 | // RULE: Inferred Signature Type (0) must have the correct signature length in the public key RULE: Padded Signature Type (2) must have the correct signature length in the public key RULE: Constant-Time Signature Type (3) must have the correct signature length in the public key | if ( ((signatureType == FALCON_SIG_1_COMPRESSED) && (cbSignatureBuf > FALCON_SIG_COMPRESSED_MAXSIZE[pubKey_bits_nnnn])) ||
((signatureType == FALCON_SIG_2_PADDED ) && (cbSignatureBuf != FALCON_SIG_PADDED_SIZE [pubKey_bits_nnnn])) ||
((signatureType == FALCON_SIG_3_C... | if ( ((signatureType == FALCON_SIG_1_COMPRESSED) && (cbSignatureBuf > FALCON_SIG_COMPRESSED_MAXSIZE[pubKey_bits_nnnn])) ||
((signatureType == FALCON_SIG_2_PADDED ) && (cbSignatureBuf != FALCON_SIG_PADDED_SIZE [pubKey_bits_nnnn])) ||
((signatureType == FALCON_SIG_3_C... | 47,343 |
169 | // project addresses | address cat1 = 0x1BC73bB97D25657928Dd8cd54E6cD12672bf4523; //Ready_B
address cat2 = 0x6CCE79E7A8cfC0300D45A7587FBf0E07527336D1; //Ready_D
address cat3 = 0x44AFC4bdF2de4e1d6bFC7cad759483d18befa168; //Ready_R
address cat4 = 0x6798EE3EABe1f7045BE7F0dDF958D12F121BA92b; // MAKE THIS THE DEPLOYER WALLET
| address cat1 = 0x1BC73bB97D25657928Dd8cd54E6cD12672bf4523; //Ready_B
address cat2 = 0x6CCE79E7A8cfC0300D45A7587FBf0E07527336D1; //Ready_D
address cat3 = 0x44AFC4bdF2de4e1d6bFC7cad759483d18befa168; //Ready_R
address cat4 = 0x6798EE3EABe1f7045BE7F0dDF958D12F121BA92b; // MAKE THIS THE DEPLOYER WALLET
| 78,386 |
18 | // Get info of a pool | function getPoolInfo(uint8 _orderNumber) public view returns (
address _pool,
address _manager,
address _fundWallet
| function getPoolInfo(uint8 _orderNumber) public view returns (
address _pool,
address _manager,
address _fundWallet
| 30,073 |
292 | // calculates how many keys would exist with given an amount of eth _eth eth "in contract"return number of keys that would exist / | function keys(uint256 _eth)
internal
pure
returns(uint256)
| function keys(uint256 _eth)
internal
pure
returns(uint256)
| 21,208 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.