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 |
|---|---|---|---|---|
57 | // attempt to add borrower to the market | Error err = addToMarketInternal(CToken(msg.sender), borrower);
if (err != Error.NO_ERROR) {
return uint(err);
}
| Error err = addToMarketInternal(CToken(msg.sender), borrower);
if (err != Error.NO_ERROR) {
return uint(err);
}
| 3,912 |
37 | // Makes a swap request. contractAddress1 The contract address of the first token. contractAddress2 The contract address of the second token. token1 The token Id of the token whose owner is making the request. token2 The token Id of the token being requested for the swap. / | function makeSwapRequest(
address contractAddress1,
address contractAddress2,
uint256 token1,
uint256 token2
)
public
onlyOwnerOfToken(contractAddress1, token1)
nonReentrant
whenNotPaused
| function makeSwapRequest(
address contractAddress1,
address contractAddress2,
uint256 token1,
uint256 token2
)
public
onlyOwnerOfToken(contractAddress1, token1)
nonReentrant
whenNotPaused
| 23,776 |
3 | // be specified by overriding the virtual {_implementation} function.Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to adifferent contract through the {_delegate} function./ Delegates the current call to `implementation`. This function does not return to it... | function _delegate(address implementation) internal virtual {
| function _delegate(address implementation) internal virtual {
| 16,608 |
2 | // get user's vote power staking balance at given blockNumber user The address of specific user blockNumber The blockNumber as index. / ------------------------------------------------------------------------ Note: if the blockNumber is less than the current block number, function will return current vote power. ------... | function getVotePower(address user, uint blockNumber) public view returns (uint) {}
| function getVotePower(address user, uint blockNumber) public view returns (uint) {}
| 51,628 |
269 | // Monday, December 20, 2021 12:00:00 AM, 1639958400 | uint256 public SALE_START;
uint256 public PRESALE;
| uint256 public SALE_START;
uint256 public PRESALE;
| 43,506 |
167 | // ZEUSToken with Governance. | contract ZEUSToken is ERC20("ZEUSToken", "ZEUS"), Ownable {
/// @notice Creates `_amount` token to `_to`. Must only be called by the owner (MasterChef).
function mint(address _to, uint256 _amount) public onlyOwner {
_mint(_to, _amount);
_moveDelegates(address(0), _delegates[_to], _amount);
}... | contract ZEUSToken is ERC20("ZEUSToken", "ZEUS"), Ownable {
/// @notice Creates `_amount` token to `_to`. Must only be called by the owner (MasterChef).
function mint(address _to, uint256 _amount) public onlyOwner {
_mint(_to, _amount);
_moveDelegates(address(0), _delegates[_to], _amount);
}... | 30,053 |
23 | // dataset | if (ids.hasDataset) // only check if dataset is enabled
{
ids.datasetHash = _datasetorder.hash();
ids.datasetOwner = Dataset(_datasetorder.dataset).m_owner();
require(m_presigned[ids.datasetHash] || verifySignature(ids.datasetOwner, ids.datasetHash, _datasetorder.sign));
}
| if (ids.hasDataset) // only check if dataset is enabled
{
ids.datasetHash = _datasetorder.hash();
ids.datasetOwner = Dataset(_datasetorder.dataset).m_owner();
require(m_presigned[ids.datasetHash] || verifySignature(ids.datasetOwner, ids.datasetHash, _datasetorder.sign));
}
| 32,542 |
1 | // How much WETH tokens to keep? | uint256 public keepWETH = 2000;
uint256 public constant keepWETHMax = 10000;
constructor(
address _governance,
address _strategist,
address _controller,
address _timelock
)
public
| uint256 public keepWETH = 2000;
uint256 public constant keepWETHMax = 10000;
constructor(
address _governance,
address _strategist,
address _controller,
address _timelock
)
public
| 42,378 |
47 | // Mapping from token ID to index of the owner tokens list | mapping(uint256 => uint256) private _ownedTokensIndex;
| mapping(uint256 => uint256) private _ownedTokensIndex;
| 8,019 |
2 | // Sets the config / | function setConfig(bytes32 poolId, bytes calldata config) external;
| function setConfig(bytes32 poolId, bytes calldata config) external;
| 29,164 |
30 | // Returns the backing amount history of a user/ | // function getAmount() public constant returns (uint[]) {
// return votes[msg.sender].amount;
// }
| // function getAmount() public constant returns (uint[]) {
// return votes[msg.sender].amount;
// }
| 18,506 |
26 | // Allow fund transfers to DAO contract. | receive() external payable {
// do nothing
}
| receive() external payable {
// do nothing
}
| 13,208 |
44 | // get affiliate ID from aff Code | _affID = pIDxAddr_[_affCode];
| _affID = pIDxAddr_[_affCode];
| 44,816 |
15 | // Ensure that only the creator can call this function | require(msg.sender == creator, "Only the creator can retrieve assets");
IERC20 asset = IERC20(assetAddress);
uint256 balance = asset.balanceOf(address(this));
| require(msg.sender == creator, "Only the creator can retrieve assets");
IERC20 asset = IERC20(assetAddress);
uint256 balance = asset.balanceOf(address(this));
| 5,014 |
396 | // 9 total active currencies possible (2 bytes each) | bytes18 activeCurrencies;
| bytes18 activeCurrencies;
| 10,908 |
1 | // Returns amount of CELO that can be claimed for savingsAmount SavingsCELO tokens./savingsAmount amount of sCELO tokens./ return amount of CELO tokens. | function savingsToCELO(uint256 savingsAmount) external view returns (uint256);
| function savingsToCELO(uint256 savingsAmount) external view returns (uint256);
| 27,475 |
246 | // This invariant is used only to compute the final balance when calculating the protocol fees. These are rounded down, so we round the invariant up. | _updateLastInvariant(StableMath._calculateInvariant(currentAmp, balances, true), currentAmp);
| _updateLastInvariant(StableMath._calculateInvariant(currentAmp, balances, true), currentAmp);
| 44,451 |
203 | // Listing must be in apply stage or already on the whitelist | require(appWasMade(_listingHash) || listing.whitelisted);
| require(appWasMade(_listingHash) || listing.whitelisted);
| 5,318 |
119 | // View function to see pending ERC20s for a user. | function pending(uint256 _pid, address _user) external view returns (uint256) {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_user];
uint256 accERC20PerShare = pool.accERC20PerShare;
uint256 lpSupply = pool.lpToken.balanceOf(address(this));
... | function pending(uint256 _pid, address _user) external view returns (uint256) {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_user];
uint256 accERC20PerShare = pool.accERC20PerShare;
uint256 lpSupply = pool.lpToken.balanceOf(address(this));
... | 7,687 |
68 | // update the total quantity of tickets that have been entered for this raffle item | raffleItem.totalEntered = totalEntered + ticketItem.ticketQuantity;
| raffleItem.totalEntered = totalEntered + ticketItem.ticketQuantity;
| 13,422 |
101 | // Constructor. beneficiary The beneficiary of the deposits. / | constructor (address payable beneficiary) public {
require(beneficiary != address(0));
_beneficiary = beneficiary;
_state = State.Active;
}
| constructor (address payable beneficiary) public {
require(beneficiary != address(0));
_beneficiary = beneficiary;
_state = State.Active;
}
| 33,401 |
6 | // Background N°7 => Artistic | function item_7() public pure returns (string memory) {
return
base(
string(
abi.encodePacked(
'<g id="Artistic"><radialGradient id="radial-gradient" cx="210" cy="-1171.6" r="210" gradientTransform="matrix(1, 0, 0, -1, 0, -961.6)" gradi... | function item_7() public pure returns (string memory) {
return
base(
string(
abi.encodePacked(
'<g id="Artistic"><radialGradient id="radial-gradient" cx="210" cy="-1171.6" r="210" gradientTransform="matrix(1, 0, 0, -1, 0, -961.6)" gradi... | 13,431 |
13 | // Removes a verified recipient./Can only be called by contract owner./_address The address of the verified recipient that is to be removed. | function removeVerifiedRecipient(address _address)
public
onlyOwner
| function removeVerifiedRecipient(address _address)
public
onlyOwner
| 50,269 |
67 | // nix/store/jhkj8my1hkpiklhhkl8xyzpxwpzix5fj-geb-uniswap-median/dapp/geb-uniswap-median/src/univ3/libraries/FullMath.sol SPDX-License-Identifier: MIT/ pragma solidity >=0.4.0; //Contains 512-bit math functions/Facilitates multiplication and division that can have overflow of an intermediate value without any loss of p... | library FullMath {
/// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
/// @param a The multiplicand
/// @param b The multiplier
/// @param denominator The divisor
/// @return result The 256-bit result
/// @dev Credit to Remco Bloemen u... | library FullMath {
/// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
/// @param a The multiplicand
/// @param b The multiplier
/// @param denominator The divisor
/// @return result The 256-bit result
/// @dev Credit to Remco Bloemen u... | 72,874 |
231 | // if we don't set reserve here withdrawer will be sent our full balance | return (_amountNeeded,0);
| return (_amountNeeded,0);
| 61,491 |
6 | // Send buyer newly minted tokens | token.mint(msg.sender, _amount);
| token.mint(msg.sender, _amount);
| 27,291 |
49 | // Check if the guard value has its original value | require(_guardValue == 0, "REENTRANCY");
| require(_guardValue == 0, "REENTRANCY");
| 32,080 |
3 | // read function to see the list of candidates | function getCandidates() external view returns(candidateDetails[] memory) {
return candidates;
}
| function getCandidates() external view returns(candidateDetails[] memory) {
return candidates;
}
| 24,797 |
25 | // Refunds the creation of the wallet when provided with a valid signature from the wallet owner. _wallet The wallet created _owner The owner address _refundAmount The amount to refund _refundToken The token to use for the refund _ownerSignature A signature from the wallet owner approving the refund amount and token./ | function validateAndRefund(
address _wallet,
address _owner,
uint256 _refundAmount,
address _refundToken,
bytes memory _ownerSignature
)
internal
| function validateAndRefund(
address _wallet,
address _owner,
uint256 _refundAmount,
address _refundToken,
bytes memory _ownerSignature
)
internal
| 21,279 |
25 | // The percentage fee charged for operations. | uint256 public operationFee = 2;
uint256 private _previousOperationFee = operationFee;
| uint256 public operationFee = 2;
uint256 private _previousOperationFee = operationFee;
| 31,482 |
20 | // Constructor _guardian The guardian address / | constructor(address _guardian) {
require(
_guardian != address(0),
| constructor(address _guardian) {
require(
_guardian != address(0),
| 5,114 |
153 | // Check after the hook | require(_amount > 0 && _amount <= balances[msg.sender] && originalAmount <= balances[msg.sender], "E3");
totalSupply -= originalAmount * supplyScalingFactor;
balances[msg.sender] -= originalAmount;
stakingToken.safeTransfer(msg.sender, _amount);
emit Withdrawn(msg.sender, _amount... | require(_amount > 0 && _amount <= balances[msg.sender] && originalAmount <= balances[msg.sender], "E3");
totalSupply -= originalAmount * supplyScalingFactor;
balances[msg.sender] -= originalAmount;
stakingToken.safeTransfer(msg.sender, _amount);
emit Withdrawn(msg.sender, _amount... | 24,733 |
38 | // Handle dapp relations for the bridges | function setDappRelation(address _dapp, address _customInterface) public onlyOwner {
dappRelations[_dapp] = _customInterface;
}
| function setDappRelation(address _dapp, address _customInterface) public onlyOwner {
dappRelations[_dapp] = _customInterface;
}
| 51,659 |
20 | // Token MetadatatokenURIs[tokenId] = Strings.strConcat(baseTokenURI(), "QmdDW36bvr2W6ua4FxnT8bKysXhYEUo7QbLTbkGW4Foxr8"); | tokenURIs[tokenId] = Strings.strConcat(baseTokenURI(), ipfsHash);
emit Transfer(address(0), msg.sender, tokenId);
| tokenURIs[tokenId] = Strings.strConcat(baseTokenURI(), ipfsHash);
emit Transfer(address(0), msg.sender, tokenId);
| 17,648 |
28 | // ICAP registry contract. | RegistryICAPInterface public registryICAP;
| RegistryICAPInterface public registryICAP;
| 28,999 |
6 | // Deposits an `amount` of underlying asset into the reserve, receiving in return overlying aTokens.- E.g. User deposits 100 USDC and gets in return 100 aUSDC asset The address of the underlying asset to deposit amount The amount to be deposited onBehalfOf The address that will receive the aTokens, same as msg.sender i... | ) external override whenNotPaused {
DataTypes.ReserveData storage reserve = _reserves[asset];
ValidationLogic.validateDeposit(reserve, amount);
address aToken = reserve.aTokenAddress;
reserve.updateState();
reserve.updateInterestRates(asset, aToken, amount, 0);
IERC20(asset).safeTransferFr... | ) external override whenNotPaused {
DataTypes.ReserveData storage reserve = _reserves[asset];
ValidationLogic.validateDeposit(reserve, amount);
address aToken = reserve.aTokenAddress;
reserve.updateState();
reserve.updateInterestRates(asset, aToken, amount, 0);
IERC20(asset).safeTransferFr... | 21,085 |
38 | // Liquidity mining participants or Stater NFT holders will be able to get some discount requester The address of the requester / | function calculateDiscount(address requester) public view returns(uint256){
for (uint i = 0; i < staterNftTokenIdArray.length; ++i)
if ( IERC1155(nftAddress).balanceOf(requester,staterNftTokenIdArray[i]) > 0 )
return uint256(100).div(discountNft);
for (uint256 i = 0; i < geyserAddressArray.length; +... | function calculateDiscount(address requester) public view returns(uint256){
for (uint i = 0; i < staterNftTokenIdArray.length; ++i)
if ( IERC1155(nftAddress).balanceOf(requester,staterNftTokenIdArray[i]) > 0 )
return uint256(100).div(discountNft);
for (uint256 i = 0; i < geyserAddressArray.length; +... | 60,870 |
13 | // Only the administrator (OpenSea) can set feeBps. | if (msg.sender != administrator) {
| if (msg.sender != administrator) {
| 11,857 |
284 | // No need to verify amount > 0, a deposit with amount = 0 can be used to undo cancellation. |
require(vaultId <= MAX_VAULT_ID, "OUT_OF_RANGE_VAULT_ID");
|
require(vaultId <= MAX_VAULT_ID, "OUT_OF_RANGE_VAULT_ID");
| 2,390 |
144 | // get current chainid | function getChainID() internal view returns (uint256) {
uint256 id;
assembly {
id := chainid()
}
return id;
}
| function getChainID() internal view returns (uint256) {
uint256 id;
assembly {
id := chainid()
}
return id;
}
| 32,527 |
24 | // Reserve a room if available. Fail if the given day to book is "maxDays"after the current day._roomId Room ID _slotIdxSlot _time Day to reserve in unix epoch format. Can be any second of the day. / | function reserve(uint64 _roomId, uint64 _slotIdx, uint64 _time) public noEmptyRoom(_roomId) {
uint64 reservationDay = getDay(_time);
reserveInternal(_roomId, _slotIdx, reservationDay);
mintGasToken(reservationDay, _slotIdx, _roomId);
}
| function reserve(uint64 _roomId, uint64 _slotIdx, uint64 _time) public noEmptyRoom(_roomId) {
uint64 reservationDay = getDay(_time);
reserveInternal(_roomId, _slotIdx, reservationDay);
mintGasToken(reservationDay, _slotIdx, _roomId);
}
| 35,513 |
124 | // Gets hash of an order for `eth_sign` | function hashOrder(
uint8 _order, address _token, uint _nonce, uint _price, uint _amount,
uint _expire
| function hashOrder(
uint8 _order, address _token, uint _nonce, uint _price, uint _amount,
uint _expire
| 41,749 |
495 | // Minimal allowed Hf after increasing borrow amount | uint256 public override minHealthFactor;
| uint256 public override minHealthFactor;
| 28,813 |
8 | // The address that receives all primary sales value. | address primarySaleRecipient;
| address primarySaleRecipient;
| 14,337 |
181 | // The block number when AKITA mining starts. | uint256 public startBlock;
event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount);
constructor(
AkitaToken _akita,
address ... | uint256 public startBlock;
event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount);
constructor(
AkitaToken _akita,
address ... | 18,282 |
77 | // adds a list of beneficiaries | function addBeneficiaries(address[] memory _beneficiaries, VestingPeriod[] memory _vestingPeriods)
external
onlyAdmin
setupOnly
| function addBeneficiaries(address[] memory _beneficiaries, VestingPeriod[] memory _vestingPeriods)
external
onlyAdmin
setupOnly
| 34,315 |
21 | // Block Limit Passed : block.number >= AnswerBlockNumber + BLOCK_LIMIT 3 | if (currBlockStatus == BlockStatus.BlockLimitPassed) {
| if (currBlockStatus == BlockStatus.BlockLimitPassed) {
| 11,253 |
62 | // Since the proof has already verified, that both blocks have been issued by the same validator, it doesn't matter which one is used here to recover the address. | address validator =
EquivocationInspector.getSignerAddress(
_rlpUnsignedHeaderOne,
_signatureOne
);
depositContract.slash(validator);
| address validator =
EquivocationInspector.getSignerAddress(
_rlpUnsignedHeaderOne,
_signatureOne
);
depositContract.slash(validator);
| 30,927 |
43 | // Is a given id retired? / | function retired(uint256 id) public view virtual returns (bool) {
return _supplyInfo[id].retired;
}
| function retired(uint256 id) public view virtual returns (bool) {
return _supplyInfo[id].retired;
}
| 83,187 |
31 | // constructor / | constructor(address addressDev, address addressAd) {
require(addressDev != address(0), "constructor: dev address error");
require(addressAd != address(0), "constructor: airdrop address error");
require(
addressDev != addressAd,
"constructor: dev and airdrop not same"
... | constructor(address addressDev, address addressAd) {
require(addressDev != address(0), "constructor: dev address error");
require(addressAd != address(0), "constructor: airdrop address error");
require(
addressDev != addressAd,
"constructor: dev and airdrop not same"
... | 67,082 |
217 | // return Returns index and isIn for the first occurrence starting from/ end | function indexOfFromEnd(address[] memory A, address a) internal pure returns (uint256, bool) {
uint256 length = A.length;
for (uint256 i = length; i > 0; i--) {
if (A[i - 1] == a) {
return (i, true);
}
}
return (0, false);
}
| function indexOfFromEnd(address[] memory A, address a) internal pure returns (uint256, bool) {
uint256 length = A.length;
for (uint256 i = length; i > 0; i--) {
if (A[i - 1] == a) {
return (i, true);
}
}
return (0, false);
}
| 7,121 |
6 | // Returns bank node lending pool token upBeacon contract/ return upBeaconBankNodeLendingPoolToken bank node lending pool token upBeacon contract | function upBeaconBankNodeLendingPoolToken() external view returns (UpgradeableBeacon);
| function upBeaconBankNodeLendingPoolToken() external view returns (UpgradeableBeacon);
| 9,236 |
0 | // Whitelist for presale changes. | function addToWhitelist(address[] calldata entries) external onlyOwner {
for(uint256 i = 0; i < entries.length; i++) {
address entry = entries[i];
require(entry != address(0), "NULL_ADDRESS");
require(!_whitelist[entry], "DUPLICATE_ENTRY");
_whitelist[entry] =... | function addToWhitelist(address[] calldata entries) external onlyOwner {
for(uint256 i = 0; i < entries.length; i++) {
address entry = entries[i];
require(entry != address(0), "NULL_ADDRESS");
require(!_whitelist[entry], "DUPLICATE_ENTRY");
_whitelist[entry] =... | 20,449 |
1 | // Constants / | uint public constant MONTH = 30 * 1 days;
| uint public constant MONTH = 30 * 1 days;
| 3,403 |
139 | // RunnerToken with Governance. | contract RunnerToken is BEP20('Runner Token', 'Runner') {
/// @notice Creates `_amount` token to `_to`. Must only be called by the owner (MasterChef).
function mint(address _to, uint256 _amount) public onlyOwner {
_mint(_to, _amount);
_moveDelegates(address(0), _delegates[_to], _amount);
}
... | contract RunnerToken is BEP20('Runner Token', 'Runner') {
/// @notice Creates `_amount` token to `_to`. Must only be called by the owner (MasterChef).
function mint(address _to, uint256 _amount) public onlyOwner {
_mint(_to, _amount);
_moveDelegates(address(0), _delegates[_to], _amount);
}
... | 21,656 |
16 | // MARK: ERC721 Enumerable | function totalSupply() public view returns (uint256) {
uint256 _total = 0;
for (uint256 i = 0; i < _tokenId; i++) {
if (_owners[i] != address(0)) {
_total++;
}
}
return _total;
}
| function totalSupply() public view returns (uint256) {
uint256 _total = 0;
for (uint256 i = 0; i < _tokenId; i++) {
if (_owners[i] != address(0)) {
_total++;
}
}
return _total;
}
| 48,194 |
97 | // unpack the packed bet to get to know its amount, options chosen and whether it should play for Jackpot | (GameOption gameOptions, uint amount, bool isJackpot) = packedBet.unpack();
| (GameOption gameOptions, uint amount, bool isJackpot) = packedBet.unpack();
| 37,531 |
14 | // https:github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.mddecimals function decimals() constant returns (uint8 decimals) | uint8 public decimals = 0;
| uint8 public decimals = 0;
| 49,007 |
18 | // Events // Initial / | uint _estimatesActualBefore) ROSBridge(msg.sender) {
homebaseLatitude = _homebaseLatitude;
homebaseLongitude = _homebaseLongitude;
estimatesActualBefore = _estimatesActualBefore * 1 minutes;
}
| uint _estimatesActualBefore) ROSBridge(msg.sender) {
homebaseLatitude = _homebaseLatitude;
homebaseLongitude = _homebaseLongitude;
estimatesActualBefore = _estimatesActualBefore * 1 minutes;
}
| 21,742 |
260 | // Number of nTokens held by the account | uint80 nTokenBalance;
| uint80 nTokenBalance;
| 15,897 |
91 | // By this mechanism, any occurrence of the `\{id\}` substring in either theURI or any of the amounts in the JSON file at said URI will be replaced byclients with the token type ID. interpreted by clients asfor token type ID 0x4cce0. See {uri}. Because these URIs cannot be meaningfully represented by the {URI} event,th... | function _setURI(string memory newuri) internal virtual {
_uri = newuri;
}
| function _setURI(string memory newuri) internal virtual {
_uri = newuri;
}
| 8,315 |
11 | // Returns the stake that a user has. | function stakes(address user) external returns (uint128, uint64);
| function stakes(address user) external returns (uint128, uint64);
| 38,586 |
4 | // Useful enum, for initial field filling. / | enum Direction {// x, y
UP, // [ 0, 1 ]
RIGHT, // [ 1, 0 ]
DOWN, // [ 0, -1 ]
LEFT // [-1, 0 ]
}
| enum Direction {// x, y
UP, // [ 0, 1 ]
RIGHT, // [ 1, 0 ]
DOWN, // [ 0, -1 ]
LEFT // [-1, 0 ]
}
| 25,439 |
32 | // solium-disable-next-line security/no-block-members | block.timestamp < crowdsales[_token].closingTime,
"Failed to buy token due to crowdsale is closed."
);
deposits[msg.sender][_token] = (
deposits[msg.sender][_token].add(msg.value)
);
crowdsales[_token].raised = crowdsales[_token].raised.add(msg.value)... | block.timestamp < crowdsales[_token].closingTime,
"Failed to buy token due to crowdsale is closed."
);
deposits[msg.sender][_token] = (
deposits[msg.sender][_token].add(msg.value)
);
crowdsales[_token].raised = crowdsales[_token].raised.add(msg.value)... | 31,467 |
24 | // Gets the number of emergency pause has been toggled. | function getEmergencyPausedLength() public view returns(uint len) {
len = emergencyPaused.length;
}
| function getEmergencyPausedLength() public view returns(uint len) {
len = emergencyPaused.length;
}
| 36,604 |
77 | // at launch if the transfer delay is enabled, ensure the block timestamps for purchasers is set -- during launch. | if (transferDelayEnabled) {
if (
to != owner() &&
to != address(uniswapV2Router) &&
to != address(uniswapV2Pair)
) {
require(
_holderLastTra... | if (transferDelayEnabled) {
if (
to != owner() &&
to != address(uniswapV2Router) &&
to != address(uniswapV2Pair)
) {
require(
_holderLastTra... | 25,782 |
57 | // manually set rates for each pool / | function setRates(
uint256 _enclaveRate,
uint256 _summitRate,
uint256 _anoRate
) external onlyOwner {
_poolConfig[0].rate = _enclaveRate;
_poolConfig[1].rate = _summitRate;
_poolConfig[2].rate = _anoRate;
}
| function setRates(
uint256 _enclaveRate,
uint256 _summitRate,
uint256 _anoRate
) external onlyOwner {
_poolConfig[0].rate = _enclaveRate;
_poolConfig[1].rate = _summitRate;
_poolConfig[2].rate = _anoRate;
}
| 33,776 |
37 | // Transfer tokens to the DAO | lockTokens(msg.sender, votes);
uint256 votesAccepted;
if (!votings[proposalId].voted[msg.sender]) {
| lockTokens(msg.sender, votes);
uint256 votesAccepted;
if (!votings[proposalId].voted[msg.sender]) {
| 4,184 |
21 | // The start collateral ratio to enter recap mode, multiplied by 1e18. | uint64 recapRatio;
| uint64 recapRatio;
| 28,338 |
15 | // building the jackpot (they will increase the value for the person seeing the crash coming) | if (profitFromCrash < 1000 * 10**18) {
profitFromCrash += amount * 5/100;
}
| if (profitFromCrash < 1000 * 10**18) {
profitFromCrash += amount * 5/100;
}
| 9,926 |
59 | // Remove his state to empty member | address2Member[targetMember] = Member(
{
memberAddress: address(0),
memberSince: block.timestamp,
votingPower: 0,
name: "0x0"
}
| address2Member[targetMember] = Member(
{
memberAddress: address(0),
memberSince: block.timestamp,
votingPower: 0,
name: "0x0"
}
| 15,389 |
221 | // NFT Info | string public baseURI;
uint256 public mintPrice = 79000000000000000;
uint256 public maxSupply;
uint256 public whitelistMintLimit;
uint256 public totalMinted;
| string public baseURI;
uint256 public mintPrice = 79000000000000000;
uint256 public maxSupply;
uint256 public whitelistMintLimit;
uint256 public totalMinted;
| 50,184 |
259 | // internal helper to execute a single transaction of a proposal/special execution is done if target is a method in the DAO controller | function _executeTransaction(
address target,
uint256 value,
string memory signature,
bytes memory data
| function _executeTransaction(
address target,
uint256 value,
string memory signature,
bytes memory data
| 65,504 |
21 | // Get Uint value from InstaMemory Contract./ | function getUint(uint getId, uint val) internal returns (uint returnVal) {
returnVal = getId == 0 ? val : MemoryInterface(getMemoryAddr()).getUint(getId);
}
| function getUint(uint getId, uint val) internal returns (uint returnVal) {
returnVal = getId == 0 ? val : MemoryInterface(getMemoryAddr()).getUint(getId);
}
| 28,918 |
46 | // event for token purchase logging purchaser who paid for the tokens beneficiary who got the tokens value weis paid for purchase bonusPercent free tokens percantage for the phase amount amount of tokens purchased / | event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 bonusPercent, uint256 amount);
| event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 bonusPercent, uint256 amount);
| 36,228 |
328 | // We solve the 0^0 indetermination by making it equal one. | return uint256(ONE_18);
| return uint256(ONE_18);
| 1,680 |
1 | // To be raised when a ruling is given. _arbitrator The arbitrator giving the ruling. _disputeID ID of the dispute in the Arbitrator contract. _ruling The ruling which was given. / |
event Ruling(IArbitrator indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);
|
event Ruling(IArbitrator indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);
| 1,670 |
104 | // IERC1363Receiver Interface Interface for any contract that wants to support transferAndCall or transferFromAndCall from ERC1363 token contracts as defined in / | interface IERC1363Receiver {
/**
* @notice Handle the receipt of ERC1363 tokens
* @dev Any ERC1363 smart contract calls this function on the recipient
* after a `transfer` or a `transferFrom`. This function MAY throw to revert and reject the
* transfer. Return of other than the magic value MUST ... | interface IERC1363Receiver {
/**
* @notice Handle the receipt of ERC1363 tokens
* @dev Any ERC1363 smart contract calls this function on the recipient
* after a `transfer` or a `transferFrom`. This function MAY throw to revert and reject the
* transfer. Return of other than the magic value MUST ... | 5,096 |
160 | // Trigger countdown if new reserve price is greater than any current bids | if (reserveAuction.bid >= _reservePrice) {
reserveAuction.biddingEnd = uint128(block.timestamp) + reserveAuctionLengthOnceReserveMet;
}
| if (reserveAuction.bid >= _reservePrice) {
reserveAuction.biddingEnd = uint128(block.timestamp) + reserveAuctionLengthOnceReserveMet;
}
| 18,106 |
219 | // Check that mom and dad are both owned by caller, or that the dad has given breeding permission to caller (i.e. mom's owner). Will fail for _dadId = 0 | require(_isBreedingPermitted(_dadId, _momId));
| require(_isBreedingPermitted(_dadId, _momId));
| 64,462 |
2 | // holds some useful pieces of information related to an item which can be reviewed by registered reviewers present in dApp ecosystem | struct Thing {
bytes32 id;
string name;
string description;
uint8 rate;
uint256 rateCount;
mapping(address => uint8) rates;
uint256 reviewCount;
mapping(address => string) reviews;
}
| struct Thing {
bytes32 id;
string name;
string description;
uint8 rate;
uint256 rateCount;
mapping(address => uint8) rates;
uint256 reviewCount;
mapping(address => string) reviews;
}
| 19,367 |
2 | // Configurable permissionless curve lp token wrapper. | address curveTokenWrapper;
| address curveTokenWrapper;
| 82,078 |
4 | // current implementation cannot be initialized more than once: | require(_state().base != base(), "WitnetRequestBoardTrustableBase: already initialized");
| require(_state().base != base(), "WitnetRequestBoardTrustableBase: already initialized");
| 13,761 |
292 | // Update withdraw batch | if (pendingSharesToWithdraw > 0) {
batch.withdrawnReceived = processInfo.totalWithdrawReceived;
batch.withdrawnShares = pendingSharesToWithdraw;
strategyTotalShares -= pendingSharesToWithdraw;
| if (pendingSharesToWithdraw > 0) {
batch.withdrawnReceived = processInfo.totalWithdrawReceived;
batch.withdrawnShares = pendingSharesToWithdraw;
strategyTotalShares -= pendingSharesToWithdraw;
| 21,648 |
22 | // Take a fee rate and calculate the potentially discounted rate for this trader based onHOT token ownership.trader The address of the trader who made the order. rate The raw rate which we will discount if needed. isParticipantRelayer Whether this relayer is participating in hot discount.return The final potentially di... | function getFinalFeeRate(
Store.State storage state,
address trader,
uint256 rate,
bool isParticipantRelayer
)
private
view
returns(uint256)
| function getFinalFeeRate(
Store.State storage state,
address trader,
uint256 rate,
bool isParticipantRelayer
)
private
view
returns(uint256)
| 5,690 |
13 | // Auction state. The price goes down 10% every `CEO_auction_blocks` blocks | CEO_price = _calcDiscount();
| CEO_price = _calcDiscount();
| 48,557 |
25 | // Utilization rate is 0 when there are no borrows | if (borrows == 0) {
return 0;
}
| if (borrows == 0) {
return 0;
}
| 10,705 |
0 | // Converts `n` to a string using LibUintToString and /measures the gas cost./n The integer to convert./ return str `n` as a decimal string./ return gasCost The gas cost of the conversion. | function testToString(uint256 n)
public
view
returns (string memory str, uint256 gasCost)
| function testToString(uint256 n)
public
view
returns (string memory str, uint256 gasCost)
| 35,205 |
39 | // Execute a multi-signature transaction from this wallet using 2 signers: one from msg.sender and the other from ecrecover.Sequence IDs are numbers starting from 1. They are used to prevent replay attacks and may not be repeated.toAddress the destination address to send an outgoing transaction value the amount in Wei ... | function sendMultiSig(
address toAddress,
uint256 value,
bytes calldata data,
uint256 expireTime,
uint256 sequenceId,
bytes calldata signature
| function sendMultiSig(
address toAddress,
uint256 value,
bytes calldata data,
uint256 expireTime,
uint256 sequenceId,
bytes calldata signature
| 35,397 |
174 | // Function for designer group update _address Address of designer to be updated _uri ipfs uri for designer to be updated _tokenIds Array of token ids to be updated / | function updateDesignerGroup(address _address, string calldata _uri, uint256[] calldata _tokenIds) external {
require(accessControls.hasAdminRole(_msgSender()), "DigitalaxIndex.updateDesignerGroup: Sender must be admin");
designerGroupSet[_address] = DesignerGroup(_uri, TokenIdSet(_tokenIds));
... | function updateDesignerGroup(address _address, string calldata _uri, uint256[] calldata _tokenIds) external {
require(accessControls.hasAdminRole(_msgSender()), "DigitalaxIndex.updateDesignerGroup: Sender must be admin");
designerGroupSet[_address] = DesignerGroup(_uri, TokenIdSet(_tokenIds));
... | 13,180 |
243 | // Deposit pubdata | struct Deposit {
uint32 accountId;
uint16 tokenId;
uint128 amount;
address owner;
}
| struct Deposit {
uint32 accountId;
uint16 tokenId;
uint128 amount;
address owner;
}
| 29,807 |
16 | // Calculate token fee based off total token deposit | uint tokenFee = MathUpgradeable.mulDiv(
totalDeposited,
percentLockPrice,
10000
);
| uint tokenFee = MathUpgradeable.mulDiv(
totalDeposited,
percentLockPrice,
10000
);
| 13,422 |
177 | // check if the scheme is registered | if (_isSchemeRegistered(_scheme) == false) {
return false;
}
| if (_isSchemeRegistered(_scheme) == false) {
return false;
}
| 27,265 |
8 | // / | struct ProposalData {
uint256 index;
string title;
string content;
string[] options;
address[] voters;
uint256[] weights;
bool opened;
uint256[] result;
}
| struct ProposalData {
uint256 index;
string title;
string content;
string[] options;
address[] voters;
uint256[] weights;
bool opened;
uint256[] result;
}
| 14,998 |
176 | // Allows strategist to utilize Aave V2 flashloans while rebalancing the cellar. / | function executeOperation(
address[] calldata assets,
uint256[] calldata amounts,
| function executeOperation(
address[] calldata assets,
uint256[] calldata amounts,
| 3,910 |
68 | // contract responsible for funds accounting | LightFundsRegistry public m_funds;
| LightFundsRegistry public m_funds;
| 42,888 |
38 | // Upgrade the backing implementation of the proxy and call a functionon the new implementation.This is useful to initialize the proxied contract. newImplementation Address of the new implementation. data Data to send as msg.data in the low level call.It should include the signature and the parameters of the function t... | function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
| function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
| 6,442 |
2 | // Max supply of 5555 tokens | uint256 public constant MAX_SUPPLY = 5555;
| uint256 public constant MAX_SUPPLY = 5555;
| 2,508 |
93 | // Disable solium check because of https:github.com/duaraghav8/Solium/issues/175 solium-disable-next-line operator-whitespace | return (
spender == owner ||
getApproved(tokenId) == spender ||
isApprovedForAll(owner, spender)
);
| return (
spender == owner ||
getApproved(tokenId) == spender ||
isApprovedForAll(owner, spender)
);
| 39,602 |
26 | // Setup the owner role | _setupRole(DEFAULT_ADMIN_ROLE, _initialOwner);
| _setupRole(DEFAULT_ADMIN_ROLE, _initialOwner);
| 26,553 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.