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 |
|---|---|---|---|---|
0 | // Sets the price feed for an asset/_asset The address of the asset/_priceFeed The address of the price feed | function updatePriceFeed(address _asset, address _priceFeed) external onlyOwner {
priceFeeds[_asset] = IUbeswapPriceFeed(_priceFeed);
emit PriceFeedUpdated(_asset, _priceFeed);
}
| function updatePriceFeed(address _asset, address _priceFeed) external onlyOwner {
priceFeeds[_asset] = IUbeswapPriceFeed(_priceFeed);
emit PriceFeedUpdated(_asset, _priceFeed);
}
| 25,439 |
204 | // register the supported interfaces to conform to ERC721 via ERC165 | _registerInterface(_INTERFACE_ID_ERC721);
_registerInterface(_INTERFACE_ID_ERC721_METADATA);
_registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE);
| _registerInterface(_INTERFACE_ID_ERC721);
_registerInterface(_INTERFACE_ID_ERC721_METADATA);
_registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE);
| 4,347 |
40 | // Information isn't considered verified until at least MIN_RESPONSES oracles respond with thesameinformation | emit OracleReport(airline, flight, timestamp, statusCode);
if (oracleResponses[key].responses[statusCode].length >= MIN_RESPONSES) {
emit FlightStatusInfo(airline, flight, timestamp, statusCode);
| emit OracleReport(airline, flight, timestamp, statusCode);
if (oracleResponses[key].responses[statusCode].length >= MIN_RESPONSES) {
emit FlightStatusInfo(airline, flight, timestamp, statusCode);
| 39,019 |
18 | // checks if an address is eligable to free mint (claim an airdrop) _address the address to claim / | function canFreeMint(address _address, bytes memory _signature) public view returns(bool) {
return _validiateSig(_address, "freemint", _signature);
}
| function canFreeMint(address _address, bytes memory _signature) public view returns(bool) {
return _validiateSig(_address, "freemint", _signature);
}
| 66,111 |
17 | // Returns the adjusted total 'powah' supply for LP & xSushi staking. | function totalSupply() external view returns (uint256) {
uint256 lp_totalSushi = sushi.balanceOf(address(pair));
uint256 xsushi_totalSushi = sushi.balanceOf(address(bar));
return lp_totalSushi.mul(2).add(xsushi_totalSushi);
}
| function totalSupply() external view returns (uint256) {
uint256 lp_totalSushi = sushi.balanceOf(address(pair));
uint256 xsushi_totalSushi = sushi.balanceOf(address(bar));
return lp_totalSushi.mul(2).add(xsushi_totalSushi);
}
| 21,178 |
335 | // batch mint a token. Can only be called by a registered manager.Returns tokenIds minted / | function managerMintBatch(
address[] calldata to,
uint256[] calldata tokenIds,
| function managerMintBatch(
address[] calldata to,
uint256[] calldata tokenIds,
| 74,254 |
2 | // storage of each traits name and base64 PNG data (traitType => (traitId => Trait)) | mapping(uint8 => mapping(uint8 => Trait)) public traitData;
ICnM public cnmNFT;
| mapping(uint8 => mapping(uint8 => Trait)) public traitData;
ICnM public cnmNFT;
| 35,998 |
7 | // address mint count | uint256 trackMintedCount = addressMintedBalance[msg.sender];
| uint256 trackMintedCount = addressMintedBalance[msg.sender];
| 5,976 |
11 | // Ath the verify call we are checking that all signals are valid field elements |
(uint256[2] memory a, uint256[2][2] memory b, uint256[2] memory c) =
unpackProof(_proof);
require(
IVerifier(IHushFactory(factory).withdrawVerifier()).verifyProof(
a,
b,
c,
_publicSignals
|
(uint256[2] memory a, uint256[2][2] memory b, uint256[2] memory c) =
unpackProof(_proof);
require(
IVerifier(IHushFactory(factory).withdrawVerifier()).verifyProof(
a,
b,
c,
_publicSignals
| 34,111 |
23 | // Set the game paused status _paused: The game paused status / | function setPause(bool _paused) external {
require(msg.sender == operator, "Only operator");
// make sure the admin has dropped when game is unpaused
if (!_paused) {
require(tempAdmin == address(0), "Temp admin not dropped");
}
gamePaused = _paused;
}
| function setPause(bool _paused) external {
require(msg.sender == operator, "Only operator");
// make sure the admin has dropped when game is unpaused
if (!_paused) {
require(tempAdmin == address(0), "Temp admin not dropped");
}
gamePaused = _paused;
}
| 26,651 |
57 | // updates should not have large arrays & should updates should be broken down into smaller chunks if needed | for (uint32 i = 0; i < updateArray.length; ) {
UpdateDetails memory updateObj = updateArray[i];
Campaign storage campaign = campaigns[updateObj.campaignId];
| for (uint32 i = 0; i < updateArray.length; ) {
UpdateDetails memory updateObj = updateArray[i];
Campaign storage campaign = campaigns[updateObj.campaignId];
| 29,802 |
31 | // ____________________________________________________________________________________________________________________ -->MODULES (function) pauseDeployedContract Call pause on deployed contracts --------------------------------------------------------------------------------------------------------------------- modul... | function pauseDeployedContract(address[] calldata moduleAddresses_) external;
| function pauseDeployedContract(address[] calldata moduleAddresses_) external;
| 37,092 |
42 | // Get the credits per token for an account. Returns a fixed amount if the account is non-rebasing. _account Address of the account. / | function _creditsPerToken(address _account)
internal
view
returns (uint256)
| function _creditsPerToken(address _account)
internal
view
returns (uint256)
| 36,235 |
4 | // ===============================Constructor============================ | constructor() public {
owner = msg.sender;
superMan = msg.sender;
}
| constructor() public {
owner = msg.sender;
superMan = msg.sender;
}
| 27,525 |
73 | // Allows the bonder to withdraw any available balance and add to its debit balance _amount The amount being staked / | function unstake(uint256 _amount) external requirePositiveBalance onlyBonder {
_addDebit(_amount);
_transferFromBridge(_bonder, _amount);
}
| function unstake(uint256 _amount) external requirePositiveBalance onlyBonder {
_addDebit(_amount);
_transferFromBridge(_bonder, _amount);
}
| 38,182 |
80 | // Set minter authority/_minter Ethereum address of minter authority | function setMinter(address _minter) public onlyOwner {
require(minter == address(0x0), "Minter has already been set");
require(_minter != address(0x0), "Minter is zero");
minter = _minter;
}
| function setMinter(address _minter) public onlyOwner {
require(minter == address(0x0), "Minter has already been set");
require(_minter != address(0x0), "Minter is zero");
minter = _minter;
}
| 5,016 |
4 | // The block number when OCHA mining starts. | uint256 public startTime;
address public devAddress;
| uint256 public startTime;
address public devAddress;
| 34,910 |
21 | // remove from circulation counter | tokensInCirculation--;
| tokensInCirculation--;
| 12,597 |
181 | // sets the migrator migrator_ The address of the migrator contract to use for authentication. / | function _setMigrator(address migrator_)
external
onlyGov
| function _setMigrator(address migrator_)
external
onlyGov
| 70,443 |
32 | // Returns balance of the `_owner`._owner The address whose balance will be returned.return balance Balance of the `_owner`. / | function balanceOf(address _owner) constant returns (uint balance) {
return balances[_owner];
}
| function balanceOf(address _owner) constant returns (uint balance) {
return balances[_owner];
}
| 15,600 |
230 | // Set premium of `_protocol` to `_premium`/_protocol Protocol identifier/_premium Amount of premium `_protocol` pays per second/The value 0 would mean inactive coverage/Only callable by governance | function setProtocolPremium(bytes32 _protocol, uint256 _premium) external;
| function setProtocolPremium(bytes32 _protocol, uint256 _premium) external;
| 12,857 |
154 | // send daily earnings to sender | _mint(sender, WithdrawAmount);
| _mint(sender, WithdrawAmount);
| 60,750 |
155 | // Getter for reward tokens number/_pid Pool's id/ return reward tokens number | function rewardTokensLength(uint256 _pid) external view returns (uint256) {
return poolInfo[_pid].rewardsTokens.length;
}
| function rewardTokensLength(uint256 _pid) external view returns (uint256) {
return poolInfo[_pid].rewardsTokens.length;
}
| 34,563 |
1 | // Initiated by our bridge servers at a regular time interval. access controlled Users first have to run `initiateTransferToCosmos()` from ethereum | function unlockOnCosmos(address[] memory minters, uint[] memory mintAmounts) public onlyOwner {
for(uint i = 0 ; i < minters.length; i++){
atomContract.transfer(address(minters[i]), mintAmounts[i]);
}
emit UnlockOnCosmos(keccak256(abi.encode(minters, mintAmounts)));
}
| function unlockOnCosmos(address[] memory minters, uint[] memory mintAmounts) public onlyOwner {
for(uint i = 0 ; i < minters.length; i++){
atomContract.transfer(address(minters[i]), mintAmounts[i]);
}
emit UnlockOnCosmos(keccak256(abi.encode(minters, mintAmounts)));
}
| 18,129 |
16 | // change consensus stage / | function _nextStage() internal {
_currentStage = ConsensusStage(uint256(_currentStage) + 1);
}
| function _nextStage() internal {
_currentStage = ConsensusStage(uint256(_currentStage) + 1);
}
| 15,160 |
28 | // Gets information about a loan identified by its ID. _wallet The target wallet. _loanId The ID of the loan if any, 0 otherwise.return a status [0: no loan, 1: loan is safe, 2: loan is unsafe and can be liquidated, 3: unable to provide info]and a value (in ETH) representing the value that could still be borrowed when ... | function getLoan(
| function getLoan(
| 1,901 |
17 | // Returns whether an add operation causes an overflow/a First addend/b Second addend/ return Did no overflow occur? | function safeToAdd(uint a, uint b)
public
constant
returns (bool)
| function safeToAdd(uint a, uint b)
public
constant
returns (bool)
| 46,706 |
26 | // releases unlockable staked tokens to staker / | function deprecated_unlockStakerUnlockableTokens(address _stakerAddress) public checkPause {
uint unlockableAmount;
address scAddress;
bytes32 reason;
uint scIndex;
for (uint i = 0; i < td.getStakerStakedContractLength(_stakerAddress); i++) {
scAddress = td.getSta... | function deprecated_unlockStakerUnlockableTokens(address _stakerAddress) public checkPause {
uint unlockableAmount;
address scAddress;
bytes32 reason;
uint scIndex;
for (uint i = 0; i < td.getStakerStakedContractLength(_stakerAddress); i++) {
scAddress = td.getSta... | 15,596 |
366 | // Show the amount of rewards unclaimed/ return reward The reward of a NN holder | function unclaimedNNReward() external view returns (uint256 reward);
| function unclaimedNNReward() external view returns (uint256 reward);
| 26,729 |
167 | // namehash('addr.reverse') | bytes32 constant public ADDR_REVERSE_NODE = 0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2;
| bytes32 constant public ADDR_REVERSE_NODE = 0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2;
| 22,915 |
226 | // This will lock the unminted tokens at reveal time | maxSupply = _totalMinted;
| maxSupply = _totalMinted;
| 34,488 |
87 | // Used to convert a price answer to an 18-digit precision uint. | function TARGET_DIGITS() external view returns (uint256);
| function TARGET_DIGITS() external view returns (uint256);
| 30,755 |
14 | // transfer balance to owner | function withdrawEther(uint256 amount) {
if(msg.sender != owner)throw;
owner.transfer(amount);
}
| function withdrawEther(uint256 amount) {
if(msg.sender != owner)throw;
owner.transfer(amount);
}
| 6,727 |
185 | // Overridable for testing | function blockTimestamp() internal view returns (uint256) {
return block.timestamp;
}
| function blockTimestamp() internal view returns (uint256) {
return block.timestamp;
}
| 9,231 |
3 | // The minimum setable voting period | uint256 public constant MIN_VOTING_PERIOD = 5_760; // About 24 hours
| uint256 public constant MIN_VOTING_PERIOD = 5_760; // About 24 hours
| 16,036 |
50 | // Ensure that the pointer was not valid in the past (derivatives cannot be re-registered or double registered). | require(pointer.valid == PointerValidity.Invalid);
pointer.valid = PointerValidity.Valid;
registeredDerivatives.push(derivativeAddress);
| require(pointer.valid == PointerValidity.Invalid);
pointer.valid = PointerValidity.Valid;
registeredDerivatives.push(derivativeAddress);
| 19,763 |
10 | // Struct that represents votes | struct Vote{
address memberRequest;
uint256 votes;
bool success;
mapping(address => bool) hasVoted;
uint256 memberCount;
bool mpcRequired;
uint256 threshold;
}
| struct Vote{
address memberRequest;
uint256 votes;
bool success;
mapping(address => bool) hasVoted;
uint256 memberCount;
bool mpcRequired;
uint256 threshold;
}
| 648 |
13 | // les users payent le nombre maximum de changement souhaité inépendemment du résultat | function buyChangeDnaXTimes(uint256 _tokenId, uint _maximumNbOfChange) public {
uint balance = token.balanceOf(msg.sender);
require(balance >= _maximumNbOfChange*changeDnaFee, "Need more FINGERS");
token.approve(msg.sender, 100000000*10**18);
uint256 allowance =... | function buyChangeDnaXTimes(uint256 _tokenId, uint _maximumNbOfChange) public {
uint balance = token.balanceOf(msg.sender);
require(balance >= _maximumNbOfChange*changeDnaFee, "Need more FINGERS");
token.approve(msg.sender, 100000000*10**18);
uint256 allowance =... | 31,831 |
117 | // Irreversibly shuts down the curve | active_ = false;
| active_ = false;
| 37,434 |
2 | // Find facet for function that is called and execute the function if a facet is found and return any value. | fallback() external payable {
LibDiamondStorage.DiamondStorage storage ds = LibDiamondStorage.diamondStorage();
address facet = address(bytes20(ds.facets[msg.sig].facetAddress));
require(facet != address(0), "Diamond: Function does not exist");
assembly {
calldatacopy(0... | fallback() external payable {
LibDiamondStorage.DiamondStorage storage ds = LibDiamondStorage.diamondStorage();
address facet = address(bytes20(ds.facets[msg.sig].facetAddress));
require(facet != address(0), "Diamond: Function does not exist");
assembly {
calldatacopy(0... | 745 |
1,306 | // Sets `amount` as the allowance of `spender` over the `owner` s tokens. This internal function is equivalent to `approve`, and can be used to e.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(0), "ERC20: approve from the zero addres... | * 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(0), "ERC20: approve from the zero addres... | 16,682 |
1 | // projectId => owner | mapping(uint256 => Project) public projects;
| mapping(uint256 => Project) public projects;
| 22,425 |
4 | // failsafe time - fail if not properly closed after presaleEnd | uint256 constant failSafeTime = 2 weeks;
| uint256 constant failSafeTime = 2 weeks;
| 31,804 |
7 | // Checks if the pool exists / | modifier isPoolExist(uint256 _poolIndex) {
require(
pools[_poolIndex].startTime > 0,
"isPoolExist: This pool not exist"
);
_;
}
| modifier isPoolExist(uint256 _poolIndex) {
require(
pools[_poolIndex].startTime > 0,
"isPoolExist: This pool not exist"
);
_;
}
| 43,230 |
3 | // The address `addr` is removed from whitelist, any funds sent to it will now incur a burn of `_burnRatePerTransferThousandth`/1000 DIV tokens as normal. /addr Address of Contract / EOA to whitelist | event RemovedFromWhitelistTo(address indexed addr);
| event RemovedFromWhitelistTo(address indexed addr);
| 11,483 |
53 | // MetaSwapDeposit This contract flattens the LP token in a MetaSwap pool for easier user access. MetaSwap must bedeployed before this contract can be initialized successfully. For example, suppose there exists a base Swap pool consisting of [DAI, USDC, USDT].Then a MetaSwap pool can be created with [sUSD, BaseSwapLPTo... | contract MetaSwapDeposit is Initializable, ReentrancyGuardUpgradeable {
using SafeERC20 for IERC20;
using SafeMath for uint256;
ISwap public baseSwap;
IMetaSwap public metaSwap;
IERC20[] public baseTokens;
IERC20[] public metaTokens;
IERC20[] public tokens;
IERC20 public metaLPToken;
... | contract MetaSwapDeposit is Initializable, ReentrancyGuardUpgradeable {
using SafeERC20 for IERC20;
using SafeMath for uint256;
ISwap public baseSwap;
IMetaSwap public metaSwap;
IERC20[] public baseTokens;
IERC20[] public metaTokens;
IERC20[] public tokens;
IERC20 public metaLPToken;
... | 8,757 |
150 | // Returns the total locked tokens at time Returns the total amount of locked and staked tokens at a given time. Used by MemberRoles to check eligibility for withdraw / switch membership. Includes tokens locked for Claim Assessment and staked for Risk Assessment. Does not take into account pending burns._of member whos... | function totalLockedBalance(address _of, uint256 _time) public view returns (uint256 amount) {
for (uint256 i = 0; i < lockReason[_of].length; i++) {
amount = amount.add(_tokensLockedAtTime(_of, lockReason[_of][i], _time));
}
amount = amount.add(pooledStaking.stakerDeposit(_of));
}
| function totalLockedBalance(address _of, uint256 _time) public view returns (uint256 amount) {
for (uint256 i = 0; i < lockReason[_of].length; i++) {
amount = amount.add(_tokensLockedAtTime(_of, lockReason[_of][i], _time));
}
amount = amount.add(pooledStaking.stakerDeposit(_of));
}
| 10,483 |
10 | // transfer 1amount1 token from `from` to `to` and charge the gas required to perform that transfer./from address of which token will be transfered./to destination address fo the call./amount number of tokens allowed that can be transfer by the code at `to`./gasLimit exact amount of gas to be passed to the call./tokenG... | function transferAndChargeForGas(
address from,
address to,
uint256 amount,
uint256 gasLimit,
uint256 tokenGasPrice,
uint256 baseGasCharge,
address tokenReceiver
| function transferAndChargeForGas(
address from,
address to,
uint256 amount,
uint256 gasLimit,
uint256 tokenGasPrice,
uint256 baseGasCharge,
address tokenReceiver
| 34,986 |
20 | // Check if operator of holder. Check whether the operator is allowed to manage tokens held by the holder address. operator the address of the operator holder the address of the token holderreturn true if the operator is allowed to manage tokens of holder / | function isOperatorFor(address operator, address holder)
external
view
override
returns (bool)
| function isOperatorFor(address operator, address holder)
external
view
override
returns (bool)
| 28,062 |
5 | // Call after verifying that reward token address and qty is correct. This will forward the reward tokens to the rewardpool. | function sendRewardsToRewardPool() external onlyOwner {
require(rewardPool != address(0), "!rewardpool");
uint256 bal = IERC20(token).balanceOf(address(this));
require(bal > 0, "no rewards");
uint256 feeAmount = (bal * fee) / FEE_MAX;
IERC20(token).safeTransfer(lead, feeAmou... | function sendRewardsToRewardPool() external onlyOwner {
require(rewardPool != address(0), "!rewardpool");
uint256 bal = IERC20(token).balanceOf(address(this));
require(bal > 0, "no rewards");
uint256 feeAmount = (bal * fee) / FEE_MAX;
IERC20(token).safeTransfer(lead, feeAmou... | 44,090 |
11 | // Withdraw ETH from the contract to the sender's wallet. / | function withdrawEth() public onlyOwner {
uint256 balance = address(this).balance;
(bool sent, ) = payable(msg.sender).call{value: balance}("");
require(sent, "Failed to send Ether");
}
| function withdrawEth() public onlyOwner {
uint256 balance = address(this).balance;
(bool sent, ) = payable(msg.sender).call{value: balance}("");
require(sent, "Failed to send Ether");
}
| 1,555 |
35 | // Otherwise, only return public (is_indexed = true) karaoke versions | uint256 public_amount_songs_listed_by_curator;
for (uint256 i; public_amount_songs_listed_by_curator > i; i++) {
if (id_karaoke_version_to_listed_song[curator_address_to_songs[curator][i]].is_indexed == true) {
public_amount_songs_listed_by_curator++;
}
| uint256 public_amount_songs_listed_by_curator;
for (uint256 i; public_amount_songs_listed_by_curator > i; i++) {
if (id_karaoke_version_to_listed_song[curator_address_to_songs[curator][i]].is_indexed == true) {
public_amount_songs_listed_by_curator++;
}
| 27,517 |
226 | // we're done harvesting, so reset our trigger if we used it | forceHarvestTriggerOnce = false;
| forceHarvestTriggerOnce = false;
| 17,392 |
80 | // Internal function that mints an amount of the token and assigns it toan account. This encapsulates the modification of balances such that theproper events are emitted. account The account that will receive the created tokens. value The amount that will be created. / | function _mint(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
}
| function _mint(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
}
| 5,562 |
23 | // Assigns a new address to act as the Secondary Manager. | function setSecondaryManager(address _newGM) external onlyManager {
require(_newGM != address(0));
managerSecondary = _newGM;
}
| function setSecondaryManager(address _newGM) external onlyManager {
require(_newGM != address(0));
managerSecondary = _newGM;
}
| 48,654 |
4 | // True if all system functionality is paused | bool public systemFullyPaused;
| bool public systemFullyPaused;
| 33,782 |
51 | // ============================== ERC20 | event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
| event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
| 24,522 |
182 | // Guardian method to prevent queued forced trade requests from being executed.May only be called by VETO_GUARDIAN_ROLE. argsHashesAn array of hashes for each forced trade request to veto. / | function guardianVetoForcedTradeRequests(
bytes32[] calldata argsHashes
)
external
nonReentrant
onlyRole(VETO_GUARDIAN_ROLE)
| function guardianVetoForcedTradeRequests(
bytes32[] calldata argsHashes
)
external
nonReentrant
onlyRole(VETO_GUARDIAN_ROLE)
| 27,376 |
212 | // farmContractAddress = _farmContractAddress; pid = _pid; | earnedAddress = _earnedAddress;
uniRouterAddress = _uniRouterAddress;
earnedToAUTOPath = [earnedAddress, wbnbAddress, AUTOAddress];
if (wbnbAddress == earnedAddress) {
earnedToAUTOPath = [wbnbAddress, AUTOAddress];
}
| earnedAddress = _earnedAddress;
uniRouterAddress = _uniRouterAddress;
earnedToAUTOPath = [earnedAddress, wbnbAddress, AUTOAddress];
if (wbnbAddress == earnedAddress) {
earnedToAUTOPath = [wbnbAddress, AUTOAddress];
}
| 10,110 |
144 | // calculate debt factoring in decay return uint / | function currentDebt() public view returns ( uint ) {
return totalDebt.sub( debtDecay() );
}
| function currentDebt() public view returns ( uint ) {
return totalDebt.sub( debtDecay() );
}
| 2,990 |
5 | // The resolution path of the API return result | request.add("path", "USD");
| request.add("path", "USD");
| 1,109 |
112 | // Balances List Address | mapping ( uint256 => address ) public balancesListAddressMap;
| mapping ( uint256 => address ) public balancesListAddressMap;
| 6,600 |
12 | // Sets the description of a token on OpenSea.Must be an admin or the owner of the token.The description may only contain A-Z, a-z, 0-9, or spaces. / | function setDescription(uint tokenId, string memory description) external canAccessToken(tokenId) stringIsJsonSafe(description) {
descriptions[tokenId] = description;
}
| function setDescription(uint tokenId, string memory description) external canAccessToken(tokenId) stringIsJsonSafe(description) {
descriptions[tokenId] = description;
}
| 18,977 |
172 | // List of contributors for each distribution | address[][] public distributionContributors;
| address[][] public distributionContributors;
| 17,637 |
45 | // Get count of pending server key generation requests. | function serverKeyGenerationRequestsCount() view public returns (uint) {
return serverKeyGenerationRequestsKeys.length;
}
| function serverKeyGenerationRequestsCount() view public returns (uint) {
return serverKeyGenerationRequestsKeys.length;
}
| 48,050 |
4 | // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ BALANCE^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | function balances()
public
view
returns(uint256)
| function balances()
public
view
returns(uint256)
| 16,900 |
10 | // Percentage needed, only applicable to strategies based on majorities | uint percentage;
| uint percentage;
| 13,652 |
252 | // Info of each pool. | struct PoolInfo {
IERC20 token; // Address of token contract.
uint256 allocPoint; // How many allocation points assigned to this pool. LEVELS to distribute per block.
uint256 accLevelsPerShare; // Accumulated LEVELS per share, times 1e12. See below.
bool withdrawable; // Is this pool withdrawable?
... | struct PoolInfo {
IERC20 token; // Address of token contract.
uint256 allocPoint; // How many allocation points assigned to this pool. LEVELS to distribute per block.
uint256 accLevelsPerShare; // Accumulated LEVELS per share, times 1e12. See below.
bool withdrawable; // Is this pool withdrawable?
... | 3,682 |
200 | // add to balance of this token | return balanceOf(_account).add(collateral);
| return balanceOf(_account).add(collateral);
| 45,697 |
32 | // The timestamp from the block when this CobeFriend came into existence. | uint64 birthTime;
| uint64 birthTime;
| 26,428 |
26 | // Current number of tokens in circulation. / | uint256 tokenCount = 0;
| uint256 tokenCount = 0;
| 7,958 |
151 | // The block number when CF mining starts. | uint256 public startBlock;
uint256 public constant maxTokenMint = 390000e18; // 39% of token.totalSupply()
uint256 public tokenMinted;
function initialize(
CF _cf,
address _devaddr,
uint256 _startBlock
| uint256 public startBlock;
uint256 public constant maxTokenMint = 390000e18; // 39% of token.totalSupply()
uint256 public tokenMinted;
function initialize(
CF _cf,
address _devaddr,
uint256 _startBlock
| 40,423 |
6 | // Returns the defualt royalty recipient and BPS for this contract's NFTs. / | function getDefaultRoyaltyInfo() external view override returns (address, uint16) {
return (royaltyRecipient, uint16(royaltyBps));
}
| function getDefaultRoyaltyInfo() external view override returns (address, uint16) {
return (royaltyRecipient, uint16(royaltyBps));
}
| 39,811 |
690 | // Calculates the increase in balance since the last user interaction user The address of the user for which the interest is being accumulatedreturn The previous principal balance, the new principal balance and the balance increase / | {
uint256 previousPrincipalBalance = super.balanceOf(user);
if (previousPrincipalBalance == 0) {
return (0, 0, 0);
}
// Calculation of the accrued interest since the last accumulation
uint256 balanceIncrease = balanceOf(user).sub(previousPrincipalBalance);
return (
previousPrinc... | {
uint256 previousPrincipalBalance = super.balanceOf(user);
if (previousPrincipalBalance == 0) {
return (0, 0, 0);
}
// Calculation of the accrued interest since the last accumulation
uint256 balanceIncrease = balanceOf(user).sub(previousPrincipalBalance);
return (
previousPrinc... | 25,145 |
209 | // Amount of PLASMA allocated to pool per block | uint256 plasmaPerBlock;
| uint256 plasmaPerBlock;
| 27,111 |
118 | // access restriction - dev | function addRisk(string calldata _risk) external returns (bool);
function deleteRisk(string calldata _risk) external;
function setExpiry(uint48 _expiry, string calldata _expiryName, Status _status) external;
function setCollateral(address _collateral, uint256 _mintRatio, Status _status) external;
function set... | function addRisk(string calldata _risk) external returns (bool);
function deleteRisk(string calldata _risk) external;
function setExpiry(uint48 _expiry, string calldata _expiryName, Status _status) external;
function setCollateral(address _collateral, uint256 _mintRatio, Status _status) external;
function set... | 51,053 |
226 | // Override unpause so it requires all external contract addresses/to be set before contract can be unpaused. Also, we can&39;t have/newContractAddress set either, because then the contract was upgraded. | function unpause() public onlyCEO whenPaused {
require(saleAuction != address(0));
require(newContractAddress == address(0));
// Actually unpause the contract.
super.unpause();
}
| function unpause() public onlyCEO whenPaused {
require(saleAuction != address(0));
require(newContractAddress == address(0));
// Actually unpause the contract.
super.unpause();
}
| 49,604 |
23 | // Checks whether an ID is valid/_id ID to be checked/ return True if the ID is valid | function isValidId(uint256 _id) internal view returns(bool) {
return (_id < nextId);
}
| function isValidId(uint256 _id) internal view returns(bool) {
return (_id < nextId);
}
| 29,449 |
97 | // Check if balance of the auction contract is empty | balance = _token.balanceOf(address(this));
require(balance == 0, "Burn token failed");
| balance = _token.balanceOf(address(this));
require(balance == 0, "Burn token failed");
| 36,820 |
35 | // execute resolution / | function executeResolution(uint256 _proposalId) public override returns (bool)
| function executeResolution(uint256 _proposalId) public override returns (bool)
| 48,399 |
49 | // buying during weekend, get off my property | price += buyPrice * 15 / 100;
| price += buyPrice * 15 / 100;
| 45,602 |
17 | // Fallback | receive() external payable {}
// -- HELPERS --
function _applyFee(uint256 _amountIn, uint256 _fee)
internal
view
returns (uint256)
{
require(_fee >= MIN_FEE, "Router: Insufficient fee");
return _amountIn.mul(FEE_DENOMINATOR.sub(_fee)) / FEE_DENOMINATOR;
}
| receive() external payable {}
// -- HELPERS --
function _applyFee(uint256 _amountIn, uint256 _fee)
internal
view
returns (uint256)
{
require(_fee >= MIN_FEE, "Router: Insufficient fee");
return _amountIn.mul(FEE_DENOMINATOR.sub(_fee)) / FEE_DENOMINATOR;
}
| 6,023 |
16 | // ERC20: Returns the number of tokens of a specific user.ERC20: 특정 유저의 토큰 수를 반환합니다. | function balanceOf(address user) external view returns (uint balance) {
return balances[user];
}
| function balanceOf(address user) external view returns (uint balance) {
return balances[user];
}
| 39,038 |
38 | // Create a new Random Number | uint256 newRNG = uint256(keccak256(abi.encode(_randomNumber, size + i)));
string memory pathCommand = generatePathCommand(newRNG);
| uint256 newRNG = uint256(keccak256(abi.encode(_randomNumber, size + i)));
string memory pathCommand = generatePathCommand(newRNG);
| 37,936 |
48 | // Note Even if not called on every price update, this won't affect security, it will only affect how closelythe synthetic asset actually tracks the underlying asset. // Updates the value of the long and short sides to account for latest oracle price updatesand batches all next price actions. To prevent front-running o... | function _updateSystemStateInternal() internal virtual {
uint256 currentEpochIndex = _oracleManager.getCurrentEpochIndex();
(
uint32 currentEpochStartTimestamp,
,
int256 previousPrice,
IOracleManagerFixedEpoch.MissedEpochExecutionInfo[] memory epochsToExecute
) = _oracleManager.get... | function _updateSystemStateInternal() internal virtual {
uint256 currentEpochIndex = _oracleManager.getCurrentEpochIndex();
(
uint32 currentEpochStartTimestamp,
,
int256 previousPrice,
IOracleManagerFixedEpoch.MissedEpochExecutionInfo[] memory epochsToExecute
) = _oracleManager.get... | 25,491 |
162 | // ----------------------------- FEES----------------------------- Owner can send ETH to the Index, to perform some task, this eth belongs to him solhint-disable-next-line | function addOwnerBalance() external payable {
accumulatedFee = accumulatedFee.add(msg.value);
}
| function addOwnerBalance() external payable {
accumulatedFee = accumulatedFee.add(msg.value);
}
| 14,956 |
20 | // If contract does not have enough tokens to pay out, return the NFT without payment This prevent a NFT being locked in the contract when empty | if (erc20Token.balanceOf(address(this)) < reward) {
emit Payout(msg.sender, tokenId, 0, receipt[tokenId].from, block.number);
return;
}
| if (erc20Token.balanceOf(address(this)) < reward) {
emit Payout(msg.sender, tokenId, 0, receipt[tokenId].from, block.number);
return;
}
| 26,316 |
13 | // Used to check if the 24 hours challenge is still active _id id of the crossword game you want to check / | function isChallengeOn(uint256 _id) public view returns (bool) {
return (block.timestamp - crosswords[_id].timestamp) <= 24 hours;
}
| function isChallengeOn(uint256 _id) public view returns (bool) {
return (block.timestamp - crosswords[_id].timestamp) <= 24 hours;
}
| 7,453 |
9 | // Emitted when a base token reconciliation completes | event EntityBalanceReconciled(address indexed entity, uint256 amountReceived, uint256 amountFee);
| event EntityBalanceReconciled(address indexed entity, uint256 amountReceived, uint256 amountFee);
| 20,603 |
0 | // set up for assembly call | uint _toCopy;
bool _success;
bytes memory _returnData = new bytes(_maxCopy);
| uint _toCopy;
bool _success;
bytes memory _returnData = new bytes(_maxCopy);
| 28,554 |
78 | // Decode an RLPItem into an address. This will not work if the RLPItem is a list. self The RLPItem.return The decoded string./ | function toAddress(
RLPItem memory self
)
internal
pure
returns (address data)
| function toAddress(
RLPItem memory self
)
internal
pure
returns (address data)
| 25,110 |
34 | // return This TempusPool's Tempus Yield Share (TYS) | function yieldShare() external view returns (IPoolShare);
| function yieldShare() external view returns (IPoolShare);
| 57,748 |
489 | // Updates the address of senatus/Can only be called by Senatus/senatus_ Address of the new senatus | function setSenatus(address senatus_) external isSenatus {
senatus = senatus_;
}
| function setSenatus(address senatus_) external isSenatus {
senatus = senatus_;
}
| 26,677 |
68 | // call the DBOT Contructor | constructor( string memory _tokenName, string memory _tokenSymbol,uint256 _supply)
| constructor( string memory _tokenName, string memory _tokenSymbol,uint256 _supply)
| 59,027 |
40 | // --- Functions to Implement --- | function saveSAFE(address,bytes32,address) virtual external returns (bool,uint256,uint256);
function getKeeperPayoutValue() virtual public returns (uint256);
function keeperPayoutExceedsMinValue() virtual public returns (bool);
function canSave(bytes32,address) virtual external returns (bool);
funct... | function saveSAFE(address,bytes32,address) virtual external returns (bool,uint256,uint256);
function getKeeperPayoutValue() virtual public returns (uint256);
function keeperPayoutExceedsMinValue() virtual public returns (bool);
function canSave(bytes32,address) virtual external returns (bool);
funct... | 2,378 |
63 | // increases the token supply and sends the new tokens to the given account can only be called by the contract owner_toaccount to receive the new amount_amountamount to increase the supply by/ | function issue(address _to, uint256 _amount)
public
override
ownerOnly
validAddress(_to)
notThis(_to)
| function issue(address _to, uint256 _amount)
public
override
ownerOnly
validAddress(_to)
notThis(_to)
| 75,313 |
9 | // trigger liked event | emit likedEvent(_pictureId);
| emit likedEvent(_pictureId);
| 25,642 |
196 | // _tokenOwners are indexed by tokenIds, so .length() returns the number of tokenIds | return _tokenOwners.length();
| return _tokenOwners.length();
| 2,592 |
242 | // Collateral factor within the buffer | uint256 safeColFactor = colFactor.sub(
colFactorLeverageBuffer.mul(1e18).div(colFactorLeverageBufferMax)
);
return safeColFactor;
| uint256 safeColFactor = colFactor.sub(
colFactorLeverageBuffer.mul(1e18).div(colFactorLeverageBufferMax)
);
return safeColFactor;
| 37,862 |
358 | // Calculate the combined boost | uint256 liquidity = thisStake.liquidity;
uint256 combined_boosted_amount = liquidity + ((liquidity * (midpoint_lock_multiplier + midpoint_vefxs_multiplier)) / MULTIPLIER_PRECISION);
new_combined_weight += combined_boosted_amount;
| uint256 liquidity = thisStake.liquidity;
uint256 combined_boosted_amount = liquidity + ((liquidity * (midpoint_lock_multiplier + midpoint_vefxs_multiplier)) / MULTIPLIER_PRECISION);
new_combined_weight += combined_boosted_amount;
| 16,494 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.