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 |
|---|---|---|---|---|
247 | // order.orderInterceptor | offset := mul(and(mload(add(tablesPtr, 22)), 0xFFFF), 4)
mstore(
add(order, 416),
and(mload(add(add(data, 20), offset)), 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)
)
| offset := mul(and(mload(add(tablesPtr, 22)), 0xFFFF), 4)
mstore(
add(order, 416),
and(mload(add(add(data, 20), offset)), 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)
)
| 3,005 |
29 | // Checks if address is an owner / | function isOwner(address possibleOwner) onlyOwner returns (bool) {
return owners[possibleOwner];
}
| function isOwner(address possibleOwner) onlyOwner returns (bool) {
return owners[possibleOwner];
}
| 57,325 |
22 | // Emitted when the tokens have passed their release date and have been returned to the original owner. | event TokensReleased(address indexed who, uint256 tokens);
| event TokensReleased(address indexed who, uint256 tokens);
| 38,497 |
3 | // New implementations always get set via the settor (post-initialize) | _setImplementation(implementation_, false, becomeImplementationData);
| _setImplementation(implementation_, false, becomeImplementationData);
| 13,267 |
120 | // vesting allocates from the reserve fund | allocateVestable(FOUNDER_ADDRESS1, 9000000000, 365, PRIME_VESTING_DATE);
allocateVestable(FOUNDER_ADDRESS2, 9000000000, 365, PRIME_VESTING_DATE);
allocateVestable(FOUNDER_ADDRESS3, 7000000000, 365, PRIME_VESTING_DATE);
| allocateVestable(FOUNDER_ADDRESS1, 9000000000, 365, PRIME_VESTING_DATE);
allocateVestable(FOUNDER_ADDRESS2, 9000000000, 365, PRIME_VESTING_DATE);
allocateVestable(FOUNDER_ADDRESS3, 7000000000, 365, PRIME_VESTING_DATE);
| 70,764 |
6 | // A function that wraps ERC1155s shareToken into ERC20sRequirements:-msg.sender has setApprovalForAll to this contract _tokenId token id associated with a outcome of a market _symbol symbol used for ERC20 for these shares _account account the newly minted ERC20s will go to _amountamount of tokens to be wrapped / | function wrapShares(
IParaShareToken _shareToken,
uint256 _tokenId,
string memory _symbol,
address _account,
uint256 _amount
| function wrapShares(
IParaShareToken _shareToken,
uint256 _tokenId,
string memory _symbol,
address _account,
uint256 _amount
| 31,492 |
16 | // first we need to transfer the amount in tokens from the msg.sender to this contractthis contract will have the amount of in tokens | IERC20(_tokenIn).transferFrom(msg.sender, address(this), _amountIn);
| IERC20(_tokenIn).transferFrom(msg.sender, address(this), _amountIn);
| 6,393 |
96 | // deposit(address token, address _from, uint256 _value) | bool res = depositTokenLogic(_token, msg.sender, value);
emit DepositToken(msg.sender, value, _token, _targetAddress, chain, msg.value);
return res;
| bool res = depositTokenLogic(_token, msg.sender, value);
emit DepositToken(msg.sender, value, _token, _targetAddress, chain, msg.value);
return res;
| 37,795 |
353 | // system is live | require(live == 1, "Vat/not-live");
Urn memory urn = urns[i][u];
Ilk memory ilk = ilks[i];
| require(live == 1, "Vat/not-live");
Urn memory urn = urns[i][u];
Ilk memory ilk = ilks[i];
| 47,024 |
91 | // require(_tokenAddr != trustedRewardTokenAddress && _tokenAddr != trustedDepositTokenAddress, "Cannot send out reward tokens or staking tokens!"); |
require(_tokenAddr != trustedDepositTokenAddress, "Admin cannot transfer out deposit tokens from this vault!");
require((_tokenAddr != trustedRewardTokenAddress) || (now > adminClaimableTime), "Admin cannot Transfer out Reward Tokens Yet!");
require(Token(_tokenAddr).transfer(_to, _amount), "Co... |
require(_tokenAddr != trustedDepositTokenAddress, "Admin cannot transfer out deposit tokens from this vault!");
require((_tokenAddr != trustedRewardTokenAddress) || (now > adminClaimableTime), "Admin cannot Transfer out Reward Tokens Yet!");
require(Token(_tokenAddr).transfer(_to, _amount), "Co... | 3,677 |
342 | // Set base token uri for an extension / | function _setBaseTokenURIExtension(string calldata uri, bool identical) internal {
_extensionBaseURI[msg.sender] = uri;
_extensionBaseURIIdentical[msg.sender] = identical;
}
| function _setBaseTokenURIExtension(string calldata uri, bool identical) internal {
_extensionBaseURI[msg.sender] = uri;
_extensionBaseURIIdentical[msg.sender] = identical;
}
| 25,104 |
97 | // Modifier to check if msg.sender is payer Revert if msg.sender is not payer _requestId id of the request / | modifier onlyRequestPayer(bytes32 _requestId)
| modifier onlyRequestPayer(bytes32 _requestId)
| 40,123 |
16 | // Function to get the amount donated by a donor to a project. | function getDonationAmount(uint256 projectId, address donor) public view returns (uint256) {
require(projectId < projects.length, "Invalid project ID");
return projects[projectId].donations[donor]; // Return the donated amount.
}
| function getDonationAmount(uint256 projectId, address donor) public view returns (uint256) {
require(projectId < projects.length, "Invalid project ID");
return projects[projectId].donations[donor]; // Return the donated amount.
}
| 1,749 |
8 | // delete flowRate of this token from old receiver ignores minting case | _reduceFlow(oldReceiver, flowRates[tokenId]);
| _reduceFlow(oldReceiver, flowRates[tokenId]);
| 16,836 |
141 | // old underwriter tokens are burned in favor of new minted in a new asset pool | underwriterToken.burnFrom(msg.sender, covAmount);
| underwriterToken.burnFrom(msg.sender, covAmount);
| 43,791 |
2 | // Prevent overflow when dividing INT256_MIN by -1 https:github.com/RequestNetwork/requestNetwork/issues/43 | require(!(a == -2**255 && b == -1) && (b > 0));
return a / b;
| require(!(a == -2**255 && b == -1) && (b > 0));
return a / b;
| 35,699 |
1 | // Enumerable address list, It contains the list of allowed wrapped positions that are covered by this contract Criteria to choose the wrapped position are - a). Wrapped position should have same underlying/base token (i.e ETH, BTC, USDC). b). Should have the similar risk profiles. | EnumerableSet.AddressSet private _allowedWrappedPositions;
| EnumerableSet.AddressSet private _allowedWrappedPositions;
| 4,302 |
32 | // Set the address of the contract authorised to call distributeReward() _authority Address of the authorised calling contract. / | function setAuthority(address _authority) public onlyOwner {
authority = _authority;
}
| function setAuthority(address _authority) public onlyOwner {
authority = _authority;
}
| 47,360 |
183 | // Get balance of the desired account address of the given token/token The token address to be checked/account The address to be checked/ return The token balance of the desired account address | function uniBalanceOf(IERC20 token, address account) internal view returns (uint256) {
if (isETH(token)) {
return account.balance;
} else {
return token.balanceOf(account);
}
}
| function uniBalanceOf(IERC20 token, address account) internal view returns (uint256) {
if (isETH(token)) {
return account.balance;
} else {
return token.balanceOf(account);
}
}
| 45,103 |
4 | // A instance has upgraded by proxying to a new implementation, with some migration arguments.instance_ The address of the proxy contract.fromVersion_The initial implementation version being proxied.toVersion_The new implementation version being proxied.migrationArguments_ The arguments used to migrate, if any. / | event InstanceUpgraded(address indexed instance_, uint256 indexed fromVersion_, uint256 indexed toVersion_, bytes migrationArguments_);
| event InstanceUpgraded(address indexed instance_, uint256 indexed fromVersion_, uint256 indexed toVersion_, bytes migrationArguments_);
| 11,644 |
3 | // Events |
event Staked(address indexed user, uint256 indexed validatorId, uint256 currentEpoch);
event Unstaked(address indexed user, uint256 indexed validatorId, uint256 currentEpoch);
event InitUnstake(address indexed user, uint256 indexed validatorId, uint256 currentEpoch);
event SignerChanged(address indexed newSign... |
event Staked(address indexed user, uint256 indexed validatorId, uint256 currentEpoch);
event Unstaked(address indexed user, uint256 indexed validatorId, uint256 currentEpoch);
event InitUnstake(address indexed user, uint256 indexed validatorId, uint256 currentEpoch);
event SignerChanged(address indexed newSign... | 39,000 |
45 | // Add initial addresses to the whitelist./_addresses are the Ethereum addresses to be whitelisted. | function setWhitelist(address[] calldata _addresses) external onlyOwnerOrSelf hasNoOwnerOrZeroAddress(_addresses) {
// Require that the whitelist has not been initialized.
require(!isSetWhitelist, "whitelist initialized");
// Add each of the provided addresses to the whitelist.
for (... | function setWhitelist(address[] calldata _addresses) external onlyOwnerOrSelf hasNoOwnerOrZeroAddress(_addresses) {
// Require that the whitelist has not been initialized.
require(!isSetWhitelist, "whitelist initialized");
// Add each of the provided addresses to the whitelist.
for (... | 35,292 |
9 | // add trait to zilla permanently | nftContract.addToSpecialTraits(nftTokenId, traitId);
emit GenesisFusedWithTrait(_msgSender(), nftTokenId, traitId);
| nftContract.addToSpecialTraits(nftTokenId, traitId);
emit GenesisFusedWithTrait(_msgSender(), nftTokenId, traitId);
| 9,358 |
5 | // ===================================== proof of stake (defaults at 1 token) | uint256 public stakingRequirement = 1e18;
| uint256 public stakingRequirement = 1e18;
| 7,879 |
218 | // unpause / | function unPause() public onlyOwner {
super._unpause();
}
| function unPause() public onlyOwner {
super._unpause();
}
| 53,617 |
3 | // Add link to begining of list |
list.links[linkID].next = list.tail;
list.links[linkID].time = block.timestamp;
list.links[linkID].value = data;
list.links[linkID].editor = msg.sender;
list.links[linkID].status = 1;
if (list.tail != 0) list.links[list.tail].prev = linkID;
list.tail = linkID;
|
list.links[linkID].next = list.tail;
list.links[linkID].time = block.timestamp;
list.links[linkID].value = data;
list.links[linkID].editor = msg.sender;
list.links[linkID].status = 1;
if (list.tail != 0) list.links[list.tail].prev = linkID;
list.tail = linkID;
| 14,695 |
3 | // lets the owner change the current conjure implementationoofImplementation_ the address of the new implementation/ | function newOOFImplementation(address oofImplementation_) external {
require(msg.sender == factoryOwner, "Only factory owner");
require(oofImplementation_ != address(0), "No zero address for oofImplementation_");
oofImplementation = oofImplementation_;
emit NewOOFImplementation(oofI... | function newOOFImplementation(address oofImplementation_) external {
require(msg.sender == factoryOwner, "Only factory owner");
require(oofImplementation_ != address(0), "No zero address for oofImplementation_");
oofImplementation = oofImplementation_;
emit NewOOFImplementation(oofI... | 17,412 |
27 | // 1 eth ~ 10 eth, 10% chance | randNum = rand(1, 10000);
if(randNum <= 100) airdropped = true;
| randNum = rand(1, 10000);
if(randNum <= 100) airdropped = true;
| 27,924 |
35 | // Contract address of the interest setter for this market | address interestSetter;
| address interestSetter;
| 14,914 |
2 | // log info | struct LogInfo {
// current time
uint now_;
// information
string info_;
}
| struct LogInfo {
// current time
uint now_;
// information
string info_;
}
| 45,088 |
23 | // Mutable call setting Proxyable.messageSender as this is using call not delegatecall | target.setMessageSender(msg.sender);
assembly {
let free_ptr := mload(0x40)
calldatacopy(free_ptr, 0, calldatasize)
| target.setMessageSender(msg.sender);
assembly {
let free_ptr := mload(0x40)
calldatacopy(free_ptr, 0, calldatasize)
| 16,784 |
159 | // isRequestingEscapeTo(): returns true if _point has an outstandingescape request targetting _sponsor | function isRequestingEscapeTo(uint32 _point, uint32 _sponsor)
view
public
returns (bool equals)
| function isRequestingEscapeTo(uint32 _point, uint32 _sponsor)
view
public
returns (bool equals)
| 43,399 |
55 | // 'Boardroom: Cannot allocate when totalSupply is 0' | if (totalSupply == 0) return;
| if (totalSupply == 0) return;
| 25,271 |
0 | // @inheritdoc IERC1155 / | function balanceOf(address account, uint256 id)
public
view
virtual
returns (uint256)
{
return _balanceOf(account, id);
}
| function balanceOf(address account, uint256 id)
public
view
virtual
returns (uint256)
{
return _balanceOf(account, id);
}
| 30,658 |
136 | // Optional | string memory _chain,
bytes memory _payload
)
| string memory _chain,
bytes memory _payload
)
| 41,341 |
244 | // Set the status and the return data / revert reason from the call. | ok[i] = callResults[i].ok;
returnData[i] = callResults[i].returnData;
| ok[i] = callResults[i].ok;
returnData[i] = callResults[i].returnData;
| 9,815 |
5 | // Remove the ownership by setting the owner address to null,after calling this function, all onlyOwner function will be be able to be called by anyone anymore,the contract will achieve truly decentralisation./ | function removeOwnership() onlyOwner public {
owner = 0x0;
}
| function removeOwnership() onlyOwner public {
owner = 0x0;
}
| 41,263 |
8 | // We found a loop in the delegation, not allowed. | require(to != msg.sender, "Found loop in delegation.");
| require(to != msg.sender, "Found loop in delegation.");
| 16,936 |
31 | // n.b. that the operator takes the gem and might not be the same operator who brought the gem | function free(uint256 wad) external operator {
require(wad <= 2**255, "RwaUrn/overflow");
vat.frob(gemJoin.ilk(), address(this), address(this), address(this), -int(wad), 0);
gemJoin.exit(msg.sender, wad);
emit Free(msg.sender, wad);
}
| function free(uint256 wad) external operator {
require(wad <= 2**255, "RwaUrn/overflow");
vat.frob(gemJoin.ilk(), address(this), address(this), address(this), -int(wad), 0);
gemJoin.exit(msg.sender, wad);
emit Free(msg.sender, wad);
}
| 71,708 |
5 | // Applying amount should be lower than maximum | require(_amount <= 2000 * 2.72 ^ (Accounts[_address].Rating/1000) && _amount > 0);
| require(_amount <= 2000 * 2.72 ^ (Accounts[_address].Rating/1000) && _amount > 0);
| 27,879 |
60 | // Gets the balance of the specified address. _owner : The address to query the the balance of. returnuint256 : Represents the amount owned by the passed address./ | function balanceOf(address _owner) external view returns (uint256) {
return balances[_owner];
}
| function balanceOf(address _owner) external view returns (uint256) {
return balances[_owner];
}
| 48,585 |
22 | // View the amount of dividend in wei that an address has earned in total./accumulativeDividendOf(_owner) = withdrawableDividendOf(_owner) + withdrawnDividendOf(_owner)/_owner The address of a token holder./ return The amount of dividend in wei that `_owner` has earned in total. | function accumulativeDividendOf(address _owner) external view returns(uint256);
| function accumulativeDividendOf(address _owner) external view returns(uint256);
| 3,824 |
3 | // Adds account to blacklist _account The address to blacklist / | function blacklist(address _account) external onlyBlacklister {
blacklisted[_account] = true;
emit Blacklisted(_account);
}
| function blacklist(address _account) external onlyBlacklister {
blacklisted[_account] = true;
emit Blacklisted(_account);
}
| 15,087 |
19 | // Updates the address of the emission manager/emissionManager The address of the new EmissionManager | function setEmissionManager(address emissionManager) external;
| function setEmissionManager(address emissionManager) external;
| 16,281 |
17 | // Deploys contracts which auto-forwards any ETH sent to it to a list of recipientsconsidering their percent share of the payment received. Uses create2 counterfactual addresses so that the destination is known from the terms of the split. / | contract PercentSplitETH is Initializable {
using AddressUpgradeable for address payable;
using AddressUpgradeable for address;
using BytesLibrary for bytes;
using SafeMath for uint256;
struct Share {
address payable recipient;
uint256 percentInBasisPoints;
}
uint256 internal constant BASIS_POI... | contract PercentSplitETH is Initializable {
using AddressUpgradeable for address payable;
using AddressUpgradeable for address;
using BytesLibrary for bytes;
using SafeMath for uint256;
struct Share {
address payable recipient;
uint256 percentInBasisPoints;
}
uint256 internal constant BASIS_POI... | 57,995 |
281 | // TODO: Approved Minters only | function mint(address recipient, uint256 tokenId, uint256 speciesId, uint256 lifespan) public onlyMinter {
_mintWithMetadata(recipient, tokenId, speciesId, lifespan);
}
| function mint(address recipient, uint256 tokenId, uint256 speciesId, uint256 lifespan) public onlyMinter {
_mintWithMetadata(recipient, tokenId, speciesId, lifespan);
}
| 36,511 |
221 | // Transfer core ERC20 coin from sender | require(IERC20(coreFundAsset).transferFrom(msg.sender, address(this), depositAmount),
"TRANSFER_FROM_ISSUE");
| require(IERC20(coreFundAsset).transferFrom(msg.sender, address(this), depositAmount),
"TRANSFER_FROM_ISSUE");
| 43,553 |
41 | // Get the price of a underlying asset _iToken The iToken to get the underlying price ofreturn The underlying asset price mantissa (scaled by 1e18). Zero means the price is unavailable and whether the price is valid. / | function getUnderlyingPriceAndStatus(IiToken _iToken)
external
view
returns (uint256, bool);
function getAssetPriceStatus(IiToken _iToken) external view returns (bool);
| function getUnderlyingPriceAndStatus(IiToken _iToken)
external
view
returns (uint256, bool);
function getAssetPriceStatus(IiToken _iToken) external view returns (bool);
| 48,500 |
43 | // pragma solidity >=0.5.15 <0.6.0; // pragma experimental ABIEncoderV2; // import "./../../lib/tinlake/src/lender/reserve.sol"; / | contract MigratedReserve is Reserve {
bool public done;
address public migratedFrom;
constructor(address currency) Reserve(currency) public {}
function migrate(address clone_) public auth {
require(!done, "migration already finished");
done = true;
migratedFrom = clone_;
... | contract MigratedReserve is Reserve {
bool public done;
address public migratedFrom;
constructor(address currency) Reserve(currency) public {}
function migrate(address clone_) public auth {
require(!done, "migration already finished");
done = true;
migratedFrom = clone_;
... | 30,404 |
13 | // Returns the corresponding signature for a specified digital fingerprint | function getSignature(string digitalFingerprint) constant returns(string){
return fingerprintSignatureMapping[sha3(digitalFingerprint)];
}
| function getSignature(string digitalFingerprint) constant returns(string){
return fingerprintSignatureMapping[sha3(digitalFingerprint)];
}
| 43,146 |
101 | // Amount of time during which rewards will be distributed | uint256 duration;
| uint256 duration;
| 39,870 |
3 | // counter to track payment of annuity / | uint public counter = 0;
| uint public counter = 0;
| 22,607 |
93 | // 0x V3 | mapping(Token => bool) zeroExV3Allowances;
| mapping(Token => bool) zeroExV3Allowances;
| 26,223 |
10 | // Delegate all of `account`'s voting units to `delegatee`. | * Emits events {DelegateChanged} and {DelegateVotesChanged}.
*/
function _delegate(address account, address delegatee) internal virtual {
address oldDelegate = delegates(account);
_delegation[account] = delegatee;
emit DelegateChanged(account, oldDelegate, delegatee);
_mov... | * Emits events {DelegateChanged} and {DelegateVotesChanged}.
*/
function _delegate(address account, address delegatee) internal virtual {
address oldDelegate = delegates(account);
_delegation[account] = delegatee;
emit DelegateChanged(account, oldDelegate, delegatee);
_mov... | 39,756 |
184 | // Require that at least the amount filling is available to trade | require(_trade.amountRemaining >= _amount);
| require(_trade.amountRemaining >= _amount);
| 47,961 |
92 | // Over-subscribed--return error | return ErrorCode.ERR_CONSTRUCT;
| return ErrorCode.ERR_CONSTRUCT;
| 31,504 |
71 | // Public functions //Allows verified creation of multisignature wallet./_owners List of initial owners./_required Number of required confirmations./_dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis./ return Returns wallet address. | function create(address[] _owners, uint _required, uint _dailyLimit)
public
returns (address wallet)
| function create(address[] _owners, uint _required, uint _dailyLimit)
public
returns (address wallet)
| 56,608 |
13 | // Guard variable for re-entrancy checks. Not currently used / | bool internal _notEntered;
| bool internal _notEntered;
| 15,595 |
88 | // Moves `value` AnyswapV3ERC20 token from account (`from`) to account (`to`) using allowance mechanism./ `value` is then deducted from caller account's allowance, unless set to `type(uint256).max`./ A transfer to `address(0)` triggers an ETH withdraw matching the sent AnyswapV3ERC20 token in favor of caller. | /// Emits {Approval} event to reflect reduced allowance `value` for caller account to spend from account (`from`),
/// unless allowance is set to `type(uint256).max`
/// Emits {Transfer} event.
/// Returns boolean value indicating whether operation succeeded.
/// Requirements:
/// - `from` acc... | /// Emits {Approval} event to reflect reduced allowance `value` for caller account to spend from account (`from`),
/// unless allowance is set to `type(uint256).max`
/// Emits {Transfer} event.
/// Returns boolean value indicating whether operation succeeded.
/// Requirements:
/// - `from` acc... | 20,751 |
28 | // Emits when an address is granted an ability. _target Address to which we are granting abilities. _abilities Number representing bitfield of abilities we are granting. / | event GrantAbilities(
address indexed _target,
| event GrantAbilities(
address indexed _target,
| 42,004 |
4 | // After a lock expires, a user calls to `initiateExitStream` and the withdrawable tokens are streamed out linearly over the following week. This array is used to track data related to the exit stream. | mapping(address => StreamData) public exitStream;
IERC20 public SEX;
uint256 public immutable startTime;
uint256 constant WEEK = 86400 * 7;
uint256 public immutable MAX_LOCK_WEEKS;
event NewLock(address indexed user, uint256 amount, uint256 lockWeeks);
| mapping(address => StreamData) public exitStream;
IERC20 public SEX;
uint256 public immutable startTime;
uint256 constant WEEK = 86400 * 7;
uint256 public immutable MAX_LOCK_WEEKS;
event NewLock(address indexed user, uint256 amount, uint256 lockWeeks);
| 27,094 |
41 | // Update referral commission rate by the owner | function setReferralCommissionRate(uint16 _referralCommissionRate) external onlyOwner {
require(_referralCommissionRate <= MAXIMUM_REFERRAL_COMMISSION_RATE, "setReferralCommissionRate: invalid referral commission rate basis points");
referralCommissionRate = _referralCommissionRate;
}
| function setReferralCommissionRate(uint16 _referralCommissionRate) external onlyOwner {
require(_referralCommissionRate <= MAXIMUM_REFERRAL_COMMISSION_RATE, "setReferralCommissionRate: invalid referral commission rate basis points");
referralCommissionRate = _referralCommissionRate;
}
| 421 |
108 | // Returns a Fraction128 that is equal to ab. aThe first Fraction128bThe second Fraction128returnThe result (product) / | function mul(
Fraction.Fraction128 memory a,
Fraction.Fraction128 memory b
)
internal
pure
returns (Fraction.Fraction128 memory)
| function mul(
Fraction.Fraction128 memory a,
Fraction.Fraction128 memory b
)
internal
pure
returns (Fraction.Fraction128 memory)
| 17,734 |
8 | // set value of MyStruct to x and store it at slot i | _get(i).value = x;
| _get(i).value = x;
| 37,164 |
136 | // Add converter feed observation | (uint256 priceFeedValue, bool hasValidValue) = converterFeed.getResultWithValidity();
require(hasValidValue, "UniswapConsecutiveSlotsPriceFeedMedianizer/invalid-converter-price-feed");
uint256 newTimeAdjustedPrice = multiply(priceFeedValue, timeElapsedSinceLatest);
| (uint256 priceFeedValue, bool hasValidValue) = converterFeed.getResultWithValidity();
require(hasValidValue, "UniswapConsecutiveSlotsPriceFeedMedianizer/invalid-converter-price-feed");
uint256 newTimeAdjustedPrice = multiply(priceFeedValue, timeElapsedSinceLatest);
| 70,338 |
17 | // string memory a = "json(https:api-testnet.bscscan.com/api?module=account&action=tokenbalance&contractaddress=0x"; | string memory a = "json(https://api.bscscan.com/api?module=account&action=tokenbalance&contractaddress=0x";
string memory b = "&address=0x";
string memory c = "&tag=latest).result";
string memory s = strConcat(a,_address2hex(tokenForeign),b,_address2hex(user),c);
bytes32 myid = p... | string memory a = "json(https://api.bscscan.com/api?module=account&action=tokenbalance&contractaddress=0x";
string memory b = "&address=0x";
string memory c = "&tag=latest).result";
string memory s = strConcat(a,_address2hex(tokenForeign),b,_address2hex(user),c);
bytes32 myid = p... | 37,450 |
13 | // Kiem tra xem co dung nguoi van chuyen khong, CHI CHO PHEP NGUOI VAN CHUYEN GOI HAM NAY | require (msg.sender == TaiKhoanVanChuyen);
| require (msg.sender == TaiKhoanVanChuyen);
| 9,218 |
375 | // Get the time remaining in the current epoch.NOTE: Reverts if epoch zero has not started. return The number of seconds until the next epoch. / | function getTimeRemainingInCurrentEpoch()
public
view
returns (uint256)
| function getTimeRemainingInCurrentEpoch()
public
view
returns (uint256)
| 43,943 |
41 | // DebtTx storage debtTx = self.mapHashXDebtTxs[xHash]; | require(debtTx.baseTx.status == TxStatus.None, "Debt tx exists");
debtTx.baseTx.smgID = destSmgID;
debtTx.baseTx.status = status;//TxStatus.Locked;
debtTx.baseTx.lockedTime = lockedTime;
debtTx.baseTx.beginLockedTime = now;
debtTx.srcSmgID = srcSmgID;
self.mapHa... | require(debtTx.baseTx.status == TxStatus.None, "Debt tx exists");
debtTx.baseTx.smgID = destSmgID;
debtTx.baseTx.status = status;//TxStatus.Locked;
debtTx.baseTx.lockedTime = lockedTime;
debtTx.baseTx.beginLockedTime = now;
debtTx.srcSmgID = srcSmgID;
self.mapHa... | 66,122 |
160 | // Deposit LP tokens to MasterChef for EGG allocation. | function deposit(uint256 _pid, uint256 _amount) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
updatePool(_pid);
if (user.amount > 0) {
uint256 pending = user.amount.mul(pool.accEggPerShare).div(1e12).sub(user.rewardDe... | function deposit(uint256 _pid, uint256 _amount) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
updatePool(_pid);
if (user.amount > 0) {
uint256 pending = user.amount.mul(pool.accEggPerShare).div(1e12).sub(user.rewardDe... | 6,001 |
13 | // Set the deployer as the controller. | _controller = msg.sender;
| _controller = msg.sender;
| 15,864 |
4 | // Stores up to 52 encrypted cards of a full deck for a player. The player must have been specified during initialization, must have agreed, and must be at phase 1. This function may be invoked multiple times by the same player during the encryption phase if transactions need to be broken up into smaler units.dataAddr ... | function storeEncryptedDeck(address dataAddr, uint256[] memory cards) public {
PokerHandData dataStorage = PokerHandData(dataAddr);
if (dataStorage.agreed(msg.sender) != true) {
revert();
}
if (dataStorage.phases(msg.sender) > 1) {
revert();
}
dataStorage.set_encrypt... | function storeEncryptedDeck(address dataAddr, uint256[] memory cards) public {
PokerHandData dataStorage = PokerHandData(dataAddr);
if (dataStorage.agreed(msg.sender) != true) {
revert();
}
if (dataStorage.phases(msg.sender) > 1) {
revert();
}
dataStorage.set_encrypt... | 47,225 |
24 | // boundaries for auction prices (current pricemultiplier) | boundaries = _getBoundaries(
ethUsdcPrice.mul(priceMultiplier),
osqthEthPrice.mul(priceMultiplier),
isPosIVbump,
expIVbump
);
| boundaries = _getBoundaries(
ethUsdcPrice.mul(priceMultiplier),
osqthEthPrice.mul(priceMultiplier),
isPosIVbump,
expIVbump
);
| 41,789 |
23 | // EVENTS / Airline Events: | event AirlineRegistered(address indexed _address, uint256 votes);
| event AirlineRegistered(address indexed _address, uint256 votes);
| 18,063 |
21 | // Reports the answer provided by the arbitrator to a specified question. The Realitio contract validates the input parameters passed to this method,so making this publicly accessible is safe. _questionID The ID of the question. _lastHistoryHash The history hash given with the last answer to the question in the Realiti... | function reportArbitrationAnswer(
bytes32 _questionID,
bytes32 _lastHistoryHash,
bytes32 _lastAnswerOrCommitmentID,
address _lastAnswerer
| function reportArbitrationAnswer(
bytes32 _questionID,
bytes32 _lastHistoryHash,
bytes32 _lastAnswerOrCommitmentID,
address _lastAnswerer
| 30,449 |
16 | // NOTE: These methods need to be altered for the storageNow invoke the rules | for (uint idx = 0; idx < targetRuleSet.evalRuleList.length; idx++) {
WonkaRule storage tempRule = targetRuleSet.evaluativeRules[targetRuleSet.evalRuleList[idx]];
tempResult = executeWithReport(ruler, tempRule, ruleReport);
if (failImmediately)
r... | for (uint idx = 0; idx < targetRuleSet.evalRuleList.length; idx++) {
WonkaRule storage tempRule = targetRuleSet.evaluativeRules[targetRuleSet.evalRuleList[idx]];
tempResult = executeWithReport(ruler, tempRule, ruleReport);
if (failImmediately)
r... | 26,559 |
36 | // substract value in staking | userTotalStaking[msg.sender].totalStaking = userTotalStaking[msg.sender].totalStaking.sub(amount);
| userTotalStaking[msg.sender].totalStaking = userTotalStaking[msg.sender].totalStaking.sub(amount);
| 57,366 |
58 | // 取出nest | function drainNest(address to, uint256 amount, address gov) external;
| function drainNest(address to, uint256 amount, address gov) external;
| 169 |
20 | // LP-DEA-USDC Time controller | contract TimeController{
using SafeMath for uint256;
IUniswapV2Router01 public uniswapRouter = IUniswapV2Router01(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
IERC20 public lpToken = IERC20(0x83973dcaa04A6786ecC0628cc494a089c1AEe947);
IERC20 public usdcToken = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48)... | contract TimeController{
using SafeMath for uint256;
IUniswapV2Router01 public uniswapRouter = IUniswapV2Router01(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
IERC20 public lpToken = IERC20(0x83973dcaa04A6786ecC0628cc494a089c1AEe947);
IERC20 public usdcToken = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48)... | 36,042 |
25 | // Set the price to 0.00034 ETH/CLOUT$0.10 per | if (totalSupply < 25000)
{
rate = 0.00034*1 ether;
}
| if (totalSupply < 25000)
{
rate = 0.00034*1 ether;
}
| 16,388 |
118 | // set control variable adjustment_addition bool_increment uint_target uint_buffer uint / | function setAdjustment (
bool _addition,
uint _increment,
uint _target,
uint _buffer
| function setAdjustment (
bool _addition,
uint _increment,
uint _target,
uint _buffer
| 11,760 |
26 | // start private sale / | function startPrivateSale() public onlyOwner {
_mode = 1;
}
| function startPrivateSale() public onlyOwner {
_mode = 1;
}
| 65,795 |
53 | // Keeps track of the start time of ownership with minimal overhead for tokenomics. | uint64 startTimestamp;
| uint64 startTimestamp;
| 71,377 |
390 | // Check that caller is admin or this contract is initializing itself asthe new implementation.There should be no way to satisfy msg.sender == comptrollerImplementaitonwithout tx.origin also being admin, but both are included for extra safety / | function adminOrInitializing() internal view returns (bool) {
bool initializing = (
msg.sender == comptrollerImplementation
&&
//solium-disable-next-line security/no-tx-origin
tx.origin == admin
);
bool isAdmin = msg.sender == a... | function adminOrInitializing() internal view returns (bool) {
bool initializing = (
msg.sender == comptrollerImplementation
&&
//solium-disable-next-line security/no-tx-origin
tx.origin == admin
);
bool isAdmin = msg.sender == a... | 6,198 |
91 | // To update the fund receiving wallet _wallet address of wallet to update / | function changeFundWallet(address _wallet) external onlyOwner {
require(_wallet != address(0), "Invalid parameters");
fundReceiver = _wallet;
}
| function changeFundWallet(address _wallet) external onlyOwner {
require(_wallet != address(0), "Invalid parameters");
fundReceiver = _wallet;
}
| 40,972 |
178 | // We check the supply > 0 as on L2, we may not yet have up-to-date rates for sETH. | if (etherCollateralTotalIssuedSynths > 0) {
(uint sETHRate, bool sETHRateIsInvalid) = exchangeRates().rateAndInvalid(sETH);
isInvalid = isInvalid || sETHRateIsInvalid;
excludedDebt = excludedDebt.add(etherCollateralTotalIssuedSynths.multiplyDecimalRound(sETHRate)); // Ether-b... | if (etherCollateralTotalIssuedSynths > 0) {
(uint sETHRate, bool sETHRateIsInvalid) = exchangeRates().rateAndInvalid(sETH);
isInvalid = isInvalid || sETHRateIsInvalid;
excludedDebt = excludedDebt.add(etherCollateralTotalIssuedSynths.multiplyDecimalRound(sETHRate)); // Ether-b... | 28,133 |
4 | // For erc20/: Event declarations / | event LogLock(
address _from,
address _to,
address _token,
string _symbol,
uint256 _value,
uint256 _nonce,
string _chainName
);
| event LogLock(
address _from,
address _to,
address _token,
string _symbol,
uint256 _value,
uint256 _nonce,
string _chainName
);
| 27,328 |
36 | // _token is address of Mintable token/_size initial size of token bucket/_rate initial refill rate (tokens/sec) | constructor (address _token, uint256 _size, uint256 _rate) public {
token = IMintableToken(_token);
size = _size;
rate = _rate;
leftOnLastMint = _size;
}
| constructor (address _token, uint256 _size, uint256 _rate) public {
token = IMintableToken(_token);
size = _size;
rate = _rate;
leftOnLastMint = _size;
}
| 32,312 |
82 | // refund coins from HTLC transaction, which is used for storeman redeem(outbound)/xHTLC random number | function redeemUserTx(Data storage self, bytes32 x)
external
returns(bytes32 xHash)
| function redeemUserTx(Data storage self, bytes32 x)
external
returns(bytes32 xHash)
| 36,137 |
7 | // Multiplies a value by a base value (result is rounded up). / | function baseMulRoundUp(
uint256 value,
uint256 baseValue
)
internal
pure
returns (uint256)
| function baseMulRoundUp(
uint256 value,
uint256 baseValue
)
internal
pure
returns (uint256)
| 7,679 |
4 | // store values | liquidityToken = _liquidityToken;
rewardToken = _rewardToken;
flashLoanPool = _flashLoanPool;
rewarderPool = _rewarderPool;
| liquidityToken = _liquidityToken;
rewardToken = _rewardToken;
flashLoanPool = _flashLoanPool;
rewarderPool = _rewarderPool;
| 5,586 |
139 | // 储备量0,1,配对合约中的余额-储备量 | amountInput = input == token0
? pair.balanceOfIndex(0).sub(reserve0)
: pair.balanceOfIndex(1).sub(reserve1);
| amountInput = input == token0
? pair.balanceOfIndex(0).sub(reserve0)
: pair.balanceOfIndex(1).sub(reserve1);
| 15,705 |
80 | // Featuring reduced masternode costpeoplespyramid.surge.sh People&39;s COIN Join us to the MOOOOOOOOON! -> What? | * Incorporated the strong points of different POW{x}, best config:
* [✓] 15% dividends for token purchase, shared among all token holders.
* [✓] 10% dividends for token transfer, shared among all token holders.
* [✓] 25% dividends for token selling.
* [✓] 7% dividends is given to referrer.
* [✓] 50 tokens to activate M... | * Incorporated the strong points of different POW{x}, best config:
* [✓] 15% dividends for token purchase, shared among all token holders.
* [✓] 10% dividends for token transfer, shared among all token holders.
* [✓] 25% dividends for token selling.
* [✓] 7% dividends is given to referrer.
* [✓] 50 tokens to activate M... | 18,701 |
168 | // Airdrop Function | function teamMint(address _to, uint _quantity) external onlyOwner {
require(totalSupply() + _quantity <= MaxSupply, "Reached max Supply");
_safeMint(_to, _quantity);
}
| function teamMint(address _to, uint _quantity) external onlyOwner {
require(totalSupply() + _quantity <= MaxSupply, "Reached max Supply");
_safeMint(_to, _quantity);
}
| 28,216 |
40 | // Transfers ownership of the contract to a new account. newOwner The new owner of the Vault. Can only be called by the current owner via the factory.A transfer of ownership of the vault is triggered by a transferof ownership of the accompanying ERC721 Vault NFT, issued by the factory.Owner of Vault NFT = owner of vaul... | function transferOwnership(address newOwner) external onlyFactory {
if (newOwner == address(0)) {
revert("V_TO: INVALID_RECIPIENT");
}
| function transferOwnership(address newOwner) external onlyFactory {
if (newOwner == address(0)) {
revert("V_TO: INVALID_RECIPIENT");
}
| 15,070 |
34 | // Allows to transfer out the ether balance that was forced into this contract, e.g with `selfdestruct` / | function withdrawEther() onlyOwner public {
uint256 totalBalance = address(this).balance;
require(totalBalance > 0);
owner.transfer(totalBalance);
emit WithdrawnEther(owner, totalBalance);
}
| function withdrawEther() onlyOwner public {
uint256 totalBalance = address(this).balance;
require(totalBalance > 0);
owner.transfer(totalBalance);
emit WithdrawnEther(owner, totalBalance);
}
| 45,497 |
14 | // https:ethereum.stackexchange.com/questions/884/how-to-convert-an-address-to-bytes-in-solidity?noredirect=1&lq=1 | function addressToBytes(address _a) internal pure returns (bytes memory b) {
b = new bytes(32);
assembly {
mstore(add(b, 32), _a)
}
}
| function addressToBytes(address _a) internal pure returns (bytes memory b) {
b = new bytes(32);
assembly {
mstore(add(b, 32), _a)
}
}
| 42,710 |
238 | // Call masterMinter()return masterMinter / | function masterMinter() external view returns (address) {
return FiatTokenV1(_proxy).masterMinter();
}
| function masterMinter() external view returns (address) {
return FiatTokenV1(_proxy).masterMinter();
}
| 39,879 |
183 | // Use maxMaxTotalMintableByWallet as sentry for add/update or delete. | bool addOrUpdate = signedMintValidationParams
.maxMaxTotalMintableByWallet > 0;
if (addOrUpdate) {
signedMintValidationParamsMap[signer] = signedMintValidationParams;
if (signedMintValidationParamsDoNotExist) {
enumeratedStorage.push(signer);
... | bool addOrUpdate = signedMintValidationParams
.maxMaxTotalMintableByWallet > 0;
if (addOrUpdate) {
signedMintValidationParamsMap[signer] = signedMintValidationParams;
if (signedMintValidationParamsDoNotExist) {
enumeratedStorage.push(signer);
... | 38,036 |
377 | // set swap route | if (route.length > 0) {
strategyFactory.setRoute(route);
}
| if (route.length > 0) {
strategyFactory.setRoute(route);
}
| 4,577 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.