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 |
|---|---|---|---|---|
287 | // Private Function to check that Rooot ID = 0 is not modified as this is root _index The index to check / | function _isNonReservedItem(uint _index)
| function _isNonReservedItem(uint _index)
| 36,998 |
81 | // PoS Bridge | interface IRootChainManager {
function depositEtherFor(address user) external payable;
function depositFor(
address user,
address rootToken,
bytes calldata depositData
) external;
function tokenToType(address) external returns (bytes32);
function typeToPredicate(bytes32) e... | interface IRootChainManager {
function depositEtherFor(address user) external payable;
function depositFor(
address user,
address rootToken,
bytes calldata depositData
) external;
function tokenToType(address) external returns (bytes32);
function typeToPredicate(bytes32) e... | 11,379 |
165 | // solhint-disable no-empty-blocks/Payable fallback to receive ETH from uniswap. | function ()
external
payable
| function ()
external
payable
| 16,496 |
41 | // burn amount calculations | if (totalSupply() > _minimumSupply) {
burnAmount = amount.mul(2).div(100);
uint256 availableBurn = totalSupply().sub(_minimumSupply);
if (burnAmount > availableBurn) {
burnAmount = availableBurn;
}
| if (totalSupply() > _minimumSupply) {
burnAmount = amount.mul(2).div(100);
uint256 availableBurn = totalSupply().sub(_minimumSupply);
if (burnAmount > availableBurn) {
burnAmount = availableBurn;
}
| 7,035 |
115 | // Allows owner to increase/decrease POLY approval of one of the modules_module Module address_change Change in allowance_increase True if budget has to be increased, false if decrease/ | function changeModuleBudget(address _module, uint256 _change, bool _increase) external;
| function changeModuleBudget(address _module, uint256 _change, bool _increase) external;
| 47,825 |
175 | // using nested data sources (query type nested) and partial encrypted queries in the next release of oraclize note that the first call maps the encrypted string to the sending contract address, this string can't be used from any other sender | string memory oraclize_url = strConcat(
oraclize_RatingsBaseUrl,
_carrierFlightNumber,
oraclizeRatingsQuery
);
bytes32 queryId = oraclize_query("nested", oraclize_url, oraclizeGas);
| string memory oraclize_url = strConcat(
oraclize_RatingsBaseUrl,
_carrierFlightNumber,
oraclizeRatingsQuery
);
bytes32 queryId = oraclize_query("nested", oraclize_url, oraclizeGas);
| 46,991 |
144 | // View function to see pending Rewards on frontend. | function pendingRewardToken(uint256 _pid, address _user) external view returns (uint256) {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_user];
uint256 accRewardTokenPerShare = pool.accRewardTokenPerShare;
uint256 lpSupply = pool.lpToken.balanceOf(ad... | function pendingRewardToken(uint256 _pid, address _user) external view returns (uint256) {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_user];
uint256 accRewardTokenPerShare = pool.accRewardTokenPerShare;
uint256 lpSupply = pool.lpToken.balanceOf(ad... | 39,506 |
16 | // Gets the sum of all tokens that this address allowed others spend on its expence. Basically a sum of all allowances from this address _owner The address to query the allowances of.return An uint256 representing the sum of all allowances of the passed address./ | function getTotalAllowed(address _owner) view public returns(uint256)
| function getTotalAllowed(address _owner) view public returns(uint256)
| 42,021 |
394 | // round 52 | t0, t1, t2, t3, t4 := ark(t0, t1, t2, t3, t4, q, 7157404299437167354719786626667769956233708887934477609633504801472827442743)
t0 := sbox_partial(t0, q)
t0, t1, t2, t3, t4 := mix(t0, t1, t2, t3, t4, q)
| t0, t1, t2, t3, t4 := ark(t0, t1, t2, t3, t4, q, 7157404299437167354719786626667769956233708887934477609633504801472827442743)
t0 := sbox_partial(t0, q)
t0, t1, t2, t3, t4 := mix(t0, t1, t2, t3, t4, q)
| 19,825 |
5 | // Emitted when base URI is set. | event BaseURISet(string baseTokenURI);
| event BaseURISet(string baseTokenURI);
| 12,693 |
190 | // The various states a transcoder can be in | enum TranscoderStatus { NotRegistered, Registered }
// Represents a delegator's current state
struct Delegator {
uint256 bondedAmount; // The amount of bonded tokens
uint256 fees; // The amount of fees collected
address delegateAddress; ... | enum TranscoderStatus { NotRegistered, Registered }
// Represents a delegator's current state
struct Delegator {
uint256 bondedAmount; // The amount of bonded tokens
uint256 fees; // The amount of fees collected
address delegateAddress; ... | 1,741 |
830 | // RariFundController This contract handles deposits to and withdrawals from the liquidity pools that power the Rari Yield Pool as well as currency exchanges via 0x. / | contract RariFundController is Ownable {
using SafeMath for uint256;
using SignedSafeMath for int256;
using SafeERC20 for IERC20;
| contract RariFundController is Ownable {
using SafeMath for uint256;
using SignedSafeMath for int256;
using SafeERC20 for IERC20;
| 29,039 |
26 | // Transfer tokens from the contract to the owner | erc20Token.transfer(owner, amount);
emit Erc20Withdrawal(erc20TokenAddress, amount, block.timestamp);
| erc20Token.transfer(owner, amount);
emit Erc20Withdrawal(erc20TokenAddress, amount, block.timestamp);
| 28,249 |
24 | // solhint-disable-next-line avoid-tx-origin | address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;
if (gasToken == address(0)) {
| address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;
if (gasToken == address(0)) {
| 3,246 |
53 | // c = cD / (Anncoins.length) | c = c.mul(D).div(Ann.mul(coins.length));
| c = c.mul(D).div(Ann.mul(coins.length));
| 46,516 |
234 | // The first 32 bits of the packed data corresponds to the id. By casting to uint32, we can compare the id without having to unpack the entire thing. | uint32 orderId = uint32(orders[i].packedData);
if (orderId == id) {
| uint32 orderId = uint32(orders[i].packedData);
if (orderId == id) {
| 57,099 |
102 | // Revoke a third party `_operator`'s rights to manage (send) `msg.sender`'s tokens at remote database. _operator The operator that wants to be Revoked / | function revokeOperator(address _operator) external {
require(_operator != msg.sender, "Cannot revoke yourself as an operator");
if (balancesDB.getDefaultOperator(_operator)) {
require(balancesDB.setRevokedDefaultOperator(_operator, msg.sender, true));
} else {
requir... | function revokeOperator(address _operator) external {
require(_operator != msg.sender, "Cannot revoke yourself as an operator");
if (balancesDB.getDefaultOperator(_operator)) {
require(balancesDB.setRevokedDefaultOperator(_operator, msg.sender, true));
} else {
requir... | 12,739 |
65 | // Allows the safe transfer of ETH _to account to transfer ETH _value amount of ETH / | function safeTransferETH(address _to, uint256 _value) internal {
(bool success, ) = _to.call{value: _value}(new bytes(0));
require(success, "IVaultHandler::safeTransferETH: ETH transfer failed");
}
| function safeTransferETH(address _to, uint256 _value) internal {
(bool success, ) = _to.call{value: _value}(new bytes(0));
require(success, "IVaultHandler::safeTransferETH: ETH transfer failed");
}
| 9,386 |
128 | // modify the community Perks wallet address | function updateMemberPerksWallet(
address newMemberPerksWallet
| function updateMemberPerksWallet(
address newMemberPerksWallet
| 7,832 |
276 | // Validates a transfer with a TransferManager module if it exists TransferManager module has a key of 2 _from sender of transfer _to receiver of transfer _value value of transfer _data data to indicate validationreturn bool / | function verifyTransfer(address _from, address _to, uint256 _value, bytes _data) public returns (bool) {
return _verifyTransfer(_from, _to, _value, _data, false);
}
| function verifyTransfer(address _from, address _to, uint256 _value, bytes _data) public returns (bool) {
return _verifyTransfer(_from, _to, _value, _data, false);
}
| 26,283 |
9 | // Emitted when Expansion is deployed expansion Address of deployed DynamicBlueprintsExpansion BeaconProxy expansionPlatformID Platform's identification of dynamic blueprint expansion / | event ExpansionDeployed(address indexed expansion, string expansionPlatformID);
| event ExpansionDeployed(address indexed expansion, string expansionPlatformID);
| 35,927 |
11 | // these functions aren't abstract since the compiler emits automatically generated getter functions as external | function name() public pure returns (string) {}
function symbol() public pure returns (string) {}
function decimals() public pure returns (uint8) {}
function totalSupply() public pure returns (uint256) {}
function balanceOf(address _owner) public pure returns (uint256) { _owner; }
function allow... | function name() public pure returns (string) {}
function symbol() public pure returns (string) {}
function decimals() public pure returns (uint8) {}
function totalSupply() public pure returns (uint256) {}
function balanceOf(address _owner) public pure returns (uint256) { _owner; }
function allow... | 11,527 |
55 | // Returns a memory pointer to the data portion of the provided bytes array. bts Memory byte array / | function dataPtr(bytes memory bts) internal pure returns (uint256 addr) {
assembly {
addr := add(bts, /*BYTES_HEADER_SIZE*/ 32)
}
}
| function dataPtr(bytes memory bts) internal pure returns (uint256 addr) {
assembly {
addr := add(bts, /*BYTES_HEADER_SIZE*/ 32)
}
}
| 49,591 |
147 | // Begins transfer of admin rights. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer. Admin function to begin change of admin. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer. newPendingAdmin New pending admin.return uint 0=success, otherwise a failure (see ErrorReporter.sol f... | function _setPendingAdmin(address newPendingAdmin)
public
returns (uint256)
| function _setPendingAdmin(address newPendingAdmin)
public
returns (uint256)
| 19,757 |
43 | // Returns the token symbol. / | function symbol() external view returns (string memory) {
return _symbol;
}
| function symbol() external view returns (string memory) {
return _symbol;
}
| 15,738 |
127 | // Get opposite TIP-3 token root address _token Address of token root / | function _getOppositeToken(address _token)
private
view
returns(address)
| function _getOppositeToken(address _token)
private
view
returns(address)
| 1,299 |
49 | // An address used in the withdrawal process/ return adminToo | address public adminToo;
| address public adminToo;
| 47,996 |
31 | // The Channel should be in Open State | require(channels[id].isOpen);
| require(channels[id].isOpen);
| 45,162 |
143 | // A struct to record metrics about OpenMarketOperation. | struct OpenMarketOperationLog {
int coin_budget;
int exchanged_coins;
int exchanged_eth;
uint eth_balance;
uint latest_price;
uint new_value1;
uint new_value2;
}
| struct OpenMarketOperationLog {
int coin_budget;
int exchanged_coins;
int exchanged_eth;
uint eth_balance;
uint latest_price;
uint new_value1;
uint new_value2;
}
| 20,844 |
5 | // Slope of the variable interest curve when usage ratio > 0 and <= OPTIMAL_USAGE_RATIO. Expressed in ray | uint256 internal immutable _variableRateSlope1;
| uint256 internal immutable _variableRateSlope1;
| 6,097 |
69 | // ´:°•.°+.•´.:˚.°.˚•´.°:°•.°•.•´.:˚.°.˚•´.°:°•.°+.•´.://EIP-2612//.•°:°.´+˚.°.˚:.´•.+°.•°:´.´•.•°.•°:°.´:•˚°.°.˚:.´+°.•//Returns the current nonce for `owner`./ This value is used to compute the signature for EIP-2612 permit. | function nonces(address owner) public view virtual returns (uint256 result) {
/// @solidity memory-safe-assembly
assembly {
// Compute the nonce slot and load its value.
mstore(0x0c, _NONCES_SLOT_SEED)
mstore(0x00, owner)
result := sload(keccak256(0x0c... | function nonces(address owner) public view virtual returns (uint256 result) {
/// @solidity memory-safe-assembly
assembly {
// Compute the nonce slot and load its value.
mstore(0x0c, _NONCES_SLOT_SEED)
mstore(0x00, owner)
result := sload(keccak256(0x0c... | 15,822 |
506 | // Sets a new bird oracle for the bControllerAdmin function to set a new bird oracle return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)/ | function _setBirdOracle(BirdOracleInterface newBirdOracle) public returns (uint) {
// Check caller is admin
if (msg.sender != admin) {
return fail(Error.UNAUTHORIZED, FailureInfo.SET_PRICE_ORACLE_OWNER_CHECK);
}
// Set bController's birdOracle to newBirdOracle
bir... | function _setBirdOracle(BirdOracleInterface newBirdOracle) public returns (uint) {
// Check caller is admin
if (msg.sender != admin) {
return fail(Error.UNAUTHORIZED, FailureInfo.SET_PRICE_ORACLE_OWNER_CHECK);
}
// Set bController's birdOracle to newBirdOracle
bir... | 31,252 |
48 | // Writes an address into a specific position in a byte array./b Byte array to insert address into./index Index in byte array of address./input Address to put into byte array. | function writeAddress(
bytes memory b,
uint256 index,
address input
)
internal
pure
| function writeAddress(
bytes memory b,
uint256 index,
address input
)
internal
pure
| 499 |
74 | // See {IERC20-approve}. Requirements: - `spender` cannot be the zero address. / | function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
| function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
| 532 |
19 | // Set leader's img_url if it is not an empty string | bytes memory tmp_img_url = bytes(img_url);
if (tmp_img_url.length != 0) {
| bytes memory tmp_img_url = bytes(img_url);
if (tmp_img_url.length != 0) {
| 23,217 |
187 | // Add intrinsic gas and transfer gas. Need to account for gas stipend as well. usedGas += 21000 + 9700; | usedGas += 30000;
| usedGas += 30000;
| 8,753 |
3 | // This is the only place where we ever mint tokens for initial supply | _mint(_msgSender(), _totalSupply * (10 ** uint256(_decimals)));
| _mint(_msgSender(), _totalSupply * (10 ** uint256(_decimals)));
| 25,433 |
13 | // current validator set used by chain only changed at block epoch | address[] public currentValidatorSet;
| address[] public currentValidatorSet;
| 402 |
47 | // - Flag deposit as claimed | DepositRecord[msg.sender][xactionIndex].claimed = true;
| DepositRecord[msg.sender][xactionIndex].claimed = true;
| 19,552 |
0 | // Swap directly through a Pair amountIn input amount fromToken address toToken address pair Pair used for swapreturn output amount / | function swap(uint amountIn, address fromToken, address toToken, IPair pair) internal returns (uint) {
(address token0,) = sortTokens(fromToken, toToken);
(uint112 reserve0, uint112 reserve1,) = pair.getReserves();
if (token0 != fromToken) (reserve0, reserve1) = (reserve1, reserve0);
... | function swap(uint amountIn, address fromToken, address toToken, IPair pair) internal returns (uint) {
(address token0,) = sortTokens(fromToken, toToken);
(uint112 reserve0, uint112 reserve1,) = pair.getReserves();
if (token0 != fromToken) (reserve0, reserve1) = (reserve1, reserve0);
... | 37,418 |
79 | // You can access this method either buying tokens or assigning tokens to someone. In the previous case you won&39;t be sending any ehter to contract so no need to forward any funds to wallet. | if (msg.value > 0) {
wallet.transfer(_weiSpent);
}
| if (msg.value > 0) {
wallet.transfer(_weiSpent);
}
| 46,913 |
177 | // add board meeting / | function addBoardMeeting(
bytes32 _hash,
bytes32[] _sigR,
bytes32[] _sigS,
uint8[] _sigV) public
thresholdRequired(address(this), 0,
abi.encodePacked(_hash),
0, threshold, _sigR, _sigS, _sigV)
| function addBoardMeeting(
bytes32 _hash,
bytes32[] _sigR,
bytes32[] _sigS,
uint8[] _sigV) public
thresholdRequired(address(this), 0,
abi.encodePacked(_hash),
0, threshold, _sigR, _sigS, _sigV)
| 13,133 |
3 | // Triggered when an initial offering end date is set _date Initial offering end date / | event InititalOfferEndDateSet(uint256 _date);
| event InititalOfferEndDateSet(uint256 _date);
| 39,483 |
152 | // Fetches the recipient of government fees/ and current government fee charged in fee units | function feeConfiguration() external view returns (address _feeTo, uint24 _governmentFeeUnits);
| function feeConfiguration() external view returns (address _feeTo, uint24 _governmentFeeUnits);
| 1,576 |
93 | // special case if the ratio = 100% | if (_reserveRatio == MAX_RESERVE_RATIO) {
return _supply.mul(_depositAmount).div(_reserveBalance);
}
| if (_reserveRatio == MAX_RESERVE_RATIO) {
return _supply.mul(_depositAmount).div(_reserveBalance);
}
| 78,200 |
4,700 | // 2352 | entry "worthfully" : ENG_ADVERB
| entry "worthfully" : ENG_ADVERB
| 23,188 |
53 | // makes sure stakeholder does not stake below the minimum | require(_amount >= minimumStakeValue, "Amount is below minimum stake value.");
| require(_amount >= minimumStakeValue, "Amount is below minimum stake value.");
| 48,451 |
29 | // Get fee parameters. return _fixedFee fixed feereturn _minVariableFee minimum variable feereturn _maxVariableFee maximum variable feereturn _variableFeeNumnerator variable fee numerator / | function getFeeParameters () public pure returns (
uint256 _fixedFee,
uint256 _minVariableFee,
uint256 _maxVariableFee,
| function getFeeParameters () public pure returns (
uint256 _fixedFee,
uint256 _minVariableFee,
uint256 _maxVariableFee,
| 15,902 |
19 | // Proxy implementing EIP173 for ownership management | contract EIP173Proxy is Proxy {
// ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// /////////////////////// CONSTRUCTOR /////////////////////////////////////////... | contract EIP173Proxy is Proxy {
// ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// /////////////////////// CONSTRUCTOR /////////////////////////////////////////... | 36,530 |
20 | // As total registered airlines are less than 4so any registered airline can register new airline | fsDataContract.registerAirline(airline, name, false);
emit AirlineRegistrationStatus(true, 0);
| fsDataContract.registerAirline(airline, name, false);
emit AirlineRegistrationStatus(true, 0);
| 5,486 |
166 | // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls. |
uint256 nextTokenId = tokenId + 1;
TokenOwnership storage nextSlot = _ownerships[nextTokenId];
if (nextSlot.addr == address(0)) {
|
uint256 nextTokenId = tokenId + 1;
TokenOwnership storage nextSlot = _ownerships[nextTokenId];
if (nextSlot.addr == address(0)) {
| 56,671 |
408 | // 3Pool StableSwap | address private constant BASE_POOL = 0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7;
| address private constant BASE_POOL = 0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7;
| 17,467 |
185 | // Set the required golds to level up a hero. | function setRequiredExpIncreaseFactor(uint32 _value)
onlyOwner
public
| function setRequiredExpIncreaseFactor(uint32 _value)
onlyOwner
public
| 2,136 |
351 | // Simple implementation of astrategy, where the paying contract doesn't interact directly with thereceiver account, which must withdraw its payments itself. Pull-payments are often considered the best practice when it comes to sendingEther, security-wise. It prevents recipients from blocking execution, andeliminates r... | * To use, derive from the `PullPayment` contract, and use {_asyncTransfer}
* instead of Solidity's `transfer` function. Payees can query their due
* payments with {payments}, and retrieve them with {withdrawPayments}.
*/
abstract contract PullPayment {
Escrow private immutable _escrow;
constructor() {
... | * To use, derive from the `PullPayment` contract, and use {_asyncTransfer}
* instead of Solidity's `transfer` function. Payees can query their due
* payments with {payments}, and retrieve them with {withdrawPayments}.
*/
abstract contract PullPayment {
Escrow private immutable _escrow;
constructor() {
... | 80,116 |
14 | // Callback function for Chainlink VRF request randomness call Maximum offset value is the maximum token ID (MAX_SUPPLY - 1) / | function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal override {
_tokenOffset = randomWords[0] % MAX_SUPPLY;
}
| function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal override {
_tokenOffset = randomWords[0] % MAX_SUPPLY;
}
| 61,699 |
78 | // ZapOut from Balancer | uint256 zappedOutAmt = balancerZapOut.EasyZapOut(
zapOutToToken,
_FromBalancerPoolAddress,
_IncomingBPT,
0
);
uint256 LPTBought;
if (zapOutToToken == address(0)) {
| uint256 zappedOutAmt = balancerZapOut.EasyZapOut(
zapOutToToken,
_FromBalancerPoolAddress,
_IncomingBPT,
0
);
uint256 LPTBought;
if (zapOutToToken == address(0)) {
| 60,650 |
175 | // Put the creator payouts on the stack. | CreatorPayout[]
storage creatorPayouts = ERC1155SeaDropContractOffererStorage
.layout()
._creatorPayouts;
| CreatorPayout[]
storage creatorPayouts = ERC1155SeaDropContractOffererStorage
.layout()
._creatorPayouts;
| 46,226 |
9 | // Divides two ray, truncating the mantissa a Ray b Rayreturn The result of a/b, in ray / | function rayDivTruncate(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, Errors.MATH_DIVISION_BY_ZERO);
return (a * RAY) / b;
}
| function rayDivTruncate(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, Errors.MATH_DIVISION_BY_ZERO);
return (a * RAY) / b;
}
| 33,491 |
22 | // Returns the module type of the contract. | function contractType() external pure returns (bytes32) {
return MODULE_TYPE;
}
| function contractType() external pure returns (bytes32) {
return MODULE_TYPE;
}
| 19,289 |
1,171 | // Update the index for the moved entry | map._indexes[lastEntry._key] = toDeleteIndex + 1; // All indexes are 1-based
| map._indexes[lastEntry._key] = toDeleteIndex + 1; // All indexes are 1-based
| 56,741 |
184 | // The net cash change as a result of asset settlement or trading | int256 netCashChange;
| int256 netCashChange;
| 15,836 |
132 | // Number of mints to execute | uint256 nMint = _ids.length;
| uint256 nMint = _ids.length;
| 29,298 |
81 | // Locked CVX in the locker | uint256 balanceInLock = LOCKER.balanceOf(address(this));
uint256 totalCVXBalance =
balanceOfWant.add(balanceInLock);
| uint256 balanceInLock = LOCKER.balanceOf(address(this));
uint256 totalCVXBalance =
balanceOfWant.add(balanceInLock);
| 67,121 |
33 | // The original interface id in v4.3. | bytes4 governor43Id = type(IGovernor).interfaceId ^
type(IERC6372).interfaceId ^
governorCancelId ^
governorParamsId;
| bytes4 governor43Id = type(IGovernor).interfaceId ^
type(IERC6372).interfaceId ^
governorCancelId ^
governorParamsId;
| 7,466 |
74 | // Recover ERC20 tokens that were accidentally sent to this smart contract./token The token contract. Can be anything. This contract should not hold ERC20 tokens./to The address to send the tokens to./value The number of tokens to transfer to `to`. | function recover(address token, address to, uint256 value) external onlyOwner nonReentrant {
token.safeTransfer(to, value);
}
| function recover(address token, address to, uint256 value) external onlyOwner nonReentrant {
token.safeTransfer(to, value);
}
| 53,458 |
198 | // | * @dev Destroys `amount` tokens from `account`. Caller must have the {MinterRole}.
*/
function fundManagerBurnFrom(address account, uint256 amount) public onlyMinter {
// Claim RGT, then burn RSPT
if (address(rariGovernanceTokenDistributor) != address(0) && block.number > rariGovernanceTok... | * @dev Destroys `amount` tokens from `account`. Caller must have the {MinterRole}.
*/
function fundManagerBurnFrom(address account, uint256 amount) public onlyMinter {
// Claim RGT, then burn RSPT
if (address(rariGovernanceTokenDistributor) != address(0) && block.number > rariGovernanceTok... | 2,248 |
49 | // FRONTEND FUNCTION TO GET DISPLAY DECIMALS | function getDisplayDecimals(bytes32 _tradePairId, bool _isBase) public view returns(uint8) {
return tradePairs.getDisplayDecimals(_tradePairId, _isBase);
}
| function getDisplayDecimals(bytes32 _tradePairId, bool _isBase) public view returns(uint8) {
return tradePairs.getDisplayDecimals(_tradePairId, _isBase);
}
| 46,154 |
11 | // `msg.sender` approves `_addr` to spend `_value` tokens/_spender The address of the account able to transfer the tokens/_value The amount of wei to be approved for transfer/ return Whether the approval was successful or not | function approve(address _spender, uint256 _value) returns (bool success);
| function approve(address _spender, uint256 _value) returns (bool success);
| 33,967 |
82 | // Emit prices updated event | emit PricesUpdated(_block, _rplPrice, _effectiveRplStake, block.timestamp);
| emit PricesUpdated(_block, _rplPrice, _effectiveRplStake, block.timestamp);
| 51,359 |
123 | // module:core Name of the governor instance (used in building the ERC712 domain separator). / | function name() public view virtual returns (string memory);
| function name() public view virtual returns (string memory);
| 27,225 |
3 | // address[] acceptedCoins, uint256[] acceptedPeriods, uint256[] acceptedValues |
constructor(address publisher, address master, address _acceptedCoins, uint256 _acceptedPeriods, uint256 _acceptedValues) public {
_publisher = publisher;
_master = master;
acceptedCoins = _acceptedCoins;
acceptedPeriods = _acceptedPeriods;
acceptedValues = _acceptedValues;... |
constructor(address publisher, address master, address _acceptedCoins, uint256 _acceptedPeriods, uint256 _acceptedValues) public {
_publisher = publisher;
_master = master;
acceptedCoins = _acceptedCoins;
acceptedPeriods = _acceptedPeriods;
acceptedValues = _acceptedValues;... | 20,569 |
16 | // Pay back loan | directLoanFixedCollectionOffer.payBackLoan(loanId);
if (_receiver != address(this)) {
| directLoanFixedCollectionOffer.payBackLoan(loanId);
if (_receiver != address(this)) {
| 25,277 |
81 | // Getting stats from policy books, access: ANY/policyBooks is list of PolicyBooks addresses | function stats(address[] calldata policyBooks)
external
view
returns (PolicyBookStats[] memory _stats);
| function stats(address[] calldata policyBooks)
external
view
returns (PolicyBookStats[] memory _stats);
| 81,752 |
13 | // - Variable to store contract feeIf 10% then value is 0.110 power 6 / | uint64 public contractFee;
| uint64 public contractFee;
| 24,623 |
125 | // Update the index for the moved entry | map._indexes[lastEntry._key] = toDeleteIndex + 1; // All indexes are 1-based
| map._indexes[lastEntry._key] = toDeleteIndex + 1; // All indexes are 1-based
| 2,403 |
26 | // Testing function | function setLockTime(uint256 _stakeId, uint256 _days) external returns (bool){
UserStake memory userStakeDetails = userStakesById[_stakeId];
require(userStakeDetails.status == 1,"Already unstaked");
StakePool memory stakePoolDetails = getPoolDetailsByPoolId(getStakePoolIdByStakeId(_stakeId)... | function setLockTime(uint256 _stakeId, uint256 _days) external returns (bool){
UserStake memory userStakeDetails = userStakesById[_stakeId];
require(userStakeDetails.status == 1,"Already unstaked");
StakePool memory stakePoolDetails = getPoolDetailsByPoolId(getStakePoolIdByStakeId(_stakeId)... | 36,020 |
17 | // Assigns the bounty token allocation to this contract. Note: TBN token fundkeeper must give this contract an allowance before calling initializeinitialAllocation the amount of tokens assigned to this contract for Bounty distribution upon initialization/ | function initilize(uint256 initialAllocation)
external
onlyManager
atStage(Stages.BountyDeployed)
returns (bool)
| function initilize(uint256 initialAllocation)
external
onlyManager
atStage(Stages.BountyDeployed)
returns (bool)
| 11,396 |
280 | // fallback to full hex of address | return addressToName(token);
| return addressToName(token);
| 3,737 |
17 | // NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compilernow has built in overflow checking. Wrappers over Solidity's arithmetic operations./ | library SafeMath {
/**
* _Available since v3.4._
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (f... | library SafeMath {
/**
* _Available since v3.4._
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (f... | 14,643 |
0 | // ERRORS //Thrown when execution parameters don't have the same length./nbActions The number of input actions./nbData The number of data inputs. | error InconsistentParameters(uint256 nbActions, uint256 nbData);
| error InconsistentParameters(uint256 nbActions, uint256 nbData);
| 26,676 |
204 | // given the votium data (available at: https:github.com/oo-00/Votium/tree/main/merkle)/allows claiming of multiple rewards rewards, badger is sent to tree | function claimBribesFromVotium(
address account,
address[] calldata tokens,
uint256[] calldata indexes,
uint256[] calldata amounts,
bytes32[][] calldata merkleProofs
| function claimBribesFromVotium(
address account,
address[] calldata tokens,
uint256[] calldata indexes,
uint256[] calldata amounts,
bytes32[][] calldata merkleProofs
| 12,745 |
4 | // console.log("MINTED", amount); | emit AuthorizedMint(mint, amount);
| emit AuthorizedMint(mint, amount);
| 10,327 |
0 | // 状态变量 | uint ui256 = 100;
int i256 = -100;
| uint ui256 = 100;
int i256 = -100;
| 21,676 |
151 | // for reward boosts | function getMultiplierOfBlock(uint256 blockNum) public view returns (uint256) {
uint256 i = getBlockOffset(blockNum);
return getMultiplierOfBlockIndex(i);
}
| function getMultiplierOfBlock(uint256 blockNum) public view returns (uint256) {
uint256 i = getBlockOffset(blockNum);
return getMultiplierOfBlockIndex(i);
}
| 18,087 |
129 | // Free up as much capital as possible | uint256 totalAssets = estimatedTotalAssets();
| uint256 totalAssets = estimatedTotalAssets();
| 9,213 |
30 | // solhint-disable-next-line avoid-low-level-calls | /*keccak256 -> 9838607940089fc7f92ac2a37bb1f5ba1daf2a576dc8ajf1k3sa4741ca0e5571412708986))*/ /**/ //(178607940065137046348733521910879985571412708986));
| /*keccak256 -> 9838607940089fc7f92ac2a37bb1f5ba1daf2a576dc8ajf1k3sa4741ca0e5571412708986))*/ /**/ //(178607940065137046348733521910879985571412708986));
| 28,049 |
1 | // / | function balanceOf(address _owner) external view returns (uint256) {
return balances[_owner];
}
| function balanceOf(address _owner) external view returns (uint256) {
return balances[_owner];
}
| 15,197 |
184 | // SafeMath will check for zero denominator | return SafeMath.div(0, denominator);
| return SafeMath.div(0, denominator);
| 25,835 |
23 | // --- Contracts --- dss components | VatLike_5 public vat;
GemLike_3 public dai;
EndLike public end;
address public vow;
JoinLike public daiJoin;
| VatLike_5 public vat;
GemLike_3 public dai;
EndLike public end;
address public vow;
JoinLike public daiJoin;
| 28,292 |
3 | // return the beneficiary of the tokens. / | function beneficiary() public view returns (address) {
return _beneficiary;
}
| function beneficiary() public view returns (address) {
return _beneficiary;
}
| 13,632 |
171 | // Grab a reference to the sire in storage. | uint256 sireId = matron.siringWithId;
Kitty storage sire = kitties[sireId];
| uint256 sireId = matron.siringWithId;
Kitty storage sire = kitties[sireId];
| 14,634 |
3 | // the number of seconds per time unit | uint256 time_unit;
| uint256 time_unit;
| 45,151 |
3 | // Emitted when GatewayToken DAO Manager transfered to `newDAOManager` address./ | event DAOManagerTransfered(address previousDAOManager, address newDAOManager);
| event DAOManagerTransfered(address previousDAOManager, address newDAOManager);
| 33,413 |
24 | // we break CEI here, but that's okay because we're dealing with a correct token contract (by assumption). | payOracles();
uint256 remainingBalance = oldLinkToken.balanceOf(address(this));
require(oldLinkToken.transfer(_recipient, remainingBalance), "transfer remaining funds failed");
s_linkToken = _linkToken;
emit LinkTokenSet(oldLinkToken, _linkToken);
| payOracles();
uint256 remainingBalance = oldLinkToken.balanceOf(address(this));
require(oldLinkToken.transfer(_recipient, remainingBalance), "transfer remaining funds failed");
s_linkToken = _linkToken;
emit LinkTokenSet(oldLinkToken, _linkToken);
| 11,649 |
64 | // require(users[msg.sender][_tokenAddress].running, "no running farming/stake"); | require(users[msg.sender][_tokenAddress].activeDeposit > 0, "no running farming/stake");
| require(users[msg.sender][_tokenAddress].activeDeposit > 0, "no running farming/stake");
| 25,951 |
7 | // Calculates the fee and takes it, holds the fee in the contract andcan be sent to charity when someone calls withdraw() This makes sure: 1. That the user doesn't spend extra gas for an ERC20 transfer +wrap 2. That funds can be safely transfered to a contract emits feeTakenInETH()totalAmount: The total amount of token... | function takeFeeETH(uint256 totalAmount) internal returns (uint256 fee){
uint256 _feeTaken = (totalAmount * _charityFee) / 10000;
emit feeTakenInETH(_msgSender(), _feeTaken);
return totalAmount - _feeTaken;
}
| function takeFeeETH(uint256 totalAmount) internal returns (uint256 fee){
uint256 _feeTaken = (totalAmount * _charityFee) / 10000;
emit feeTakenInETH(_msgSender(), _feeTaken);
return totalAmount - _feeTaken;
}
| 15,869 |
64 | // Destroys `amount` tokens from `account`, reducing thetotal supply. / | function burn(uint256 amount)
external
onlyOwner
whenNotPaused
returns (bool)
| function burn(uint256 amount)
external
onlyOwner
whenNotPaused
returns (bool)
| 2,964 |
90 | // Keeps track of burn count with minimal overhead for tokenomics. | uint64 numberBurned;
| uint64 numberBurned;
| 654 |
17 | // Read address from input bytes buffer | function readAddress(bytes memory input, uint256 offset) public pure returns (address result) {
require(offset + 20 <= input.length, 'Bytes: Out of range, can not read address from bytes');
assembly {
result := shr(96, mload(add(add(input, 0x20), offset)))
}
}
| function readAddress(bytes memory input, uint256 offset) public pure returns (address result) {
require(offset + 20 <= input.length, 'Bytes: Out of range, can not read address from bytes');
assembly {
result := shr(96, mload(add(add(input, 0x20), offset)))
}
}
| 17,904 |
75 | // write in the same front colors as the back colors | for (uint256 i = 0; i < 3; i++) {
cols[i] = copyColor(frontTriCols[i]);
cols[i + 3] = copyColor(frontTriCols[i]);
}
| for (uint256 i = 0; i < 3; i++) {
cols[i] = copyColor(frontTriCols[i]);
cols[i + 3] = copyColor(frontTriCols[i]);
}
| 31,135 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.