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
106
// Set liquidation incentive to new incentive
liquidationIncentiveMantissa = newLiquidationIncentiveMantissa;
liquidationIncentiveMantissa = newLiquidationIncentiveMantissa;
6,159
0
// Source address => (symbol => price)
mapping(address => mapping (string => uint256)) private pricesBySource;
mapping(address => mapping (string => uint256)) private pricesBySource;
38,866
12
// Returns the id of the Aave market to which this contract points to.return The market id /
function getMarketId() external view returns (string memory);
function getMarketId() external view returns (string memory);
25,739
121
// Note: This checks whether an already existing position has a pending withdrawal. This cannot be used on the `create` method because it is possible that `create` is called on a new position (i.e. one without any collateral or tokens outstanding) which would fail the `onlyCollateralizedPosition` modifier on `_getPosit...
function _positionHasNoPendingWithdrawal(address sponsor) internal view { require(_getPositionData(sponsor).withdrawalRequestPassTimestamp == 0, "Pending withdrawal"); }
function _positionHasNoPendingWithdrawal(address sponsor) internal view { require(_getPositionData(sponsor).withdrawalRequestPassTimestamp == 0, "Pending withdrawal"); }
27,528
172
// calculates term2 = term2f
term2 = MathHelpers.getPartialAmountRoundedUp( f.num, f.den, term2 ); return term1.add(term2);
term2 = MathHelpers.getPartialAmountRoundedUp( f.num, f.den, term2 ); return term1.add(term2);
72,251
30
// Sends the entire contract balance to a `recipient`./
function withdraw(address recipient) external nonReentrant onlyRole(FUNDER_ROLE)
function withdraw(address recipient) external nonReentrant onlyRole(FUNDER_ROLE)
42,932
19
// Create a Redeem functionality for the collection Address/redeemCollectionAddress Order struct consists of the listedtoken details/list list struct consists of the
function createRedeem( address redeemCollectionAddress, RedeemDetails memory list
function createRedeem( address redeemCollectionAddress, RedeemDetails memory list
19,338
236
// Finder contract used to look up addresses for UMA system contracts.
FinderInterface public finder;
FinderInterface public finder;
34,805
65
// calculate amount of kcrv to withdraw for amount of _want_
uint256 _kcrv = _amount.mul(1e18).div(ICurveFi(curve).get_virtual_price());
uint256 _kcrv = _amount.mul(1e18).div(ICurveFi(curve).get_virtual_price());
25,085
13
// auth new AUTO_SURPLUS_BUFFER_SETTER_OVERLAY
newAutoSurplusBuffer.addAuthorization(address(newAutoSurplusBufferOverlay));
newAutoSurplusBuffer.addAuthorization(address(newAutoSurplusBufferOverlay));
61,859
51
// `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
result := mload(xor(0x60, returndatasize()))
result := mload(xor(0x60, returndatasize()))
21,277
43
// _interestByLoanDurationType =(_contract.terms.interest30) /(100365);
(, uint256 saInterestByLoanDurationType) = SafeMathUpgradeable .tryDiv(_contract.terms.interest * 30, 365); (, uint256 saPenaltyOfInterestRate) = SafeMathUpgradeable.tryMul( _paymentrequest.remainingPenalty, saInterestByLoanDurationType ...
(, uint256 saInterestByLoanDurationType) = SafeMathUpgradeable .tryDiv(_contract.terms.interest * 30, 365); (, uint256 saPenaltyOfInterestRate) = SafeMathUpgradeable.tryMul( _paymentrequest.remainingPenalty, saInterestByLoanDurationType ...
35,537
163
// Global debt pool tracking
uint[] public debtLedger;
uint[] public debtLedger;
6,090
371
// 1 Bassetratio / ratioScale == x Masset (relative value)If ratio == 10e8 then 1 bAsset = 10 mAssetsA ratio is divised as 10^(18-tokenDecimals)measurementMultiple(relative value of 1 base unit)
uint256 ratio;
uint256 ratio;
80,809
14
// Approve the SoloMargin contract to pull the owed amount + flashFee
IERC20(token).approve(address(soloMargin), amount.add(flashFee));
IERC20(token).approve(address(soloMargin), amount.add(flashFee));
41,369
2
// Fails for {y = >0, msg.sender == owner, x = 0}.
assert(x > 0);
assert(x > 0);
16,206
169
// Calculate the new position unit given total notional values pre and post executing an action that changes CKToken stateThe intention is to make updates to the units without accidentally picking up airdropped assets as well._ckTokenSupply Supply of CKToken in precise units (10^18) _preTotalNotional Total notional amo...
function calculateDefaultEditPositionUnit( uint256 _ckTokenSupply, uint256 _preTotalNotional, uint256 _postTotalNotional, uint256 _prePositionUnit ) internal pure returns (uint256)
function calculateDefaultEditPositionUnit( uint256 _ckTokenSupply, uint256 _preTotalNotional, uint256 _postTotalNotional, uint256 _prePositionUnit ) internal pure returns (uint256)
6,976
200
// This can only be used with trusted contracts
crossTokens(tokenToUse, from, amount, userData);
crossTokens(tokenToUse, from, amount, userData);
9,187
90
// Get the number of wallets tagged as double spenders/ return Number of double spender wallets
function doubleSpenderWalletsCount() public view returns (uint256)
function doubleSpenderWalletsCount() public view returns (uint256)
76,709
0
// Assumption, any new unstake queue will have the same interface
interface IExitQueue { function join(address _exiter, uint256 _amount) external; }
interface IExitQueue { function join(address _exiter, uint256 _amount) external; }
79,557
45
// Destroy tokens amount from another account (Caution!!! the operation is destructive and you can not go back)
function OWN_burnToken(address _from, uint256 _value) onlyOwner public returns (bool success) { require(balances[_from] >= _value); balances[_from] -= _value; totalSupply -= _value; emit Burn(_from, _value); return true; }
function OWN_burnToken(address _from, uint256 _value) onlyOwner public returns (bool success) { require(balances[_from] >= _value); balances[_from] -= _value; totalSupply -= _value; emit Burn(_from, _value); return true; }
57,431
6
// Get the owner
address _owner = _event.owner;
address _owner = _event.owner;
14,589
43
// Return 1inch Token Taker Address /
function getOneInchTokenTaker() internal pure returns (address payable) { return 0xE4C9194962532fEB467DCe8b3d42419641c6eD2E; }
function getOneInchTokenTaker() internal pure returns (address payable) { return 0xE4C9194962532fEB467DCe8b3d42419641c6eD2E; }
30,417
4
// Emits an event when a user purchases a batch with direct shipping/from The address of the user who purchased the batch/shippingHash The double hash of the encrypted user data/calls The array of calls to make to individual collections that host the item
event BatchPurchaseWithShipping(address indexed from, bytes32 indexed shippingHash, BatchPurchaseParams[] calls);
event BatchPurchaseWithShipping(address indexed from, bytes32 indexed shippingHash, BatchPurchaseParams[] calls);
12,210
61
// invest
uint256 NewInvestID; mapping(uint256 => InvestInfo) Invests; mapping(address => uint256) InvestAddrID;
uint256 NewInvestID; mapping(uint256 => InvestInfo) Invests; mapping(address => uint256) InvestAddrID;
22,985
56
// mapping from token address to pool that is selling that token/we maintain two order pools, one for each token that is tradable in the AMM
OrderPool OrderPool0; OrderPool OrderPool1;
OrderPool OrderPool0; OrderPool OrderPool1;
44,691
4
// Convert ETH to Any kind of Tokens .../
function convertETHtoAnyToken(address _tokensOut, address _to) public payable { address[] memory path = new address[](2); path[0] = uniswapRouter.WETH(); path[1] = _tokensOut; uint[] memory amounts = uniswapRouter.getAmountsOut(msg.value, path); emit Logamounts(amounts); uniswapRouter.swapExactETHForTokens...
function convertETHtoAnyToken(address _tokensOut, address _to) public payable { address[] memory path = new address[](2); path[0] = uniswapRouter.WETH(); path[1] = _tokensOut; uint[] memory amounts = uniswapRouter.getAmountsOut(msg.value, path); emit Logamounts(amounts); uniswapRouter.swapExactETHForTokens...
46,789
114
// This is the address of the actual backing asset token/ in the case of ETH, this address will be 0/ return Address of the Backing Token
function backingToken() external view returns (address);
function backingToken() external view returns (address);
80,438
6
// Get the index and append the value.
treeIndex = tree.nodes.length; tree.nodes.push(_value);
treeIndex = tree.nodes.length; tree.nodes.push(_value);
29,090
8
// target amount
uint256 targetAmount;
uint256 targetAmount;
29,643
36
// Returns the token collection name. /
function name() public view virtual override returns (string memory) { return "MOAR by Joan Cornella"; }
function name() public view virtual override returns (string memory) { return "MOAR by Joan Cornella"; }
70,463
10
// Invariant after change
D[1] = getD(newBalances, amp); require(D[1] > D[0]);
D[1] = getD(newBalances, amp); require(D[1] > D[0]);
25,533
2
// reference to the $SHELL contract
SHELL public shell;
SHELL public shell;
6,438
3
// state of mint dynamics
bool public initialSaleIsActive = false; // yeah, yeah, i know bool public burnoffSaleIsActive = false; // yeah, yeah, i know
bool public initialSaleIsActive = false; // yeah, yeah, i know bool public burnoffSaleIsActive = false; // yeah, yeah, i know
15,230
243
// Update lockedTokens amount before using it in computations after.
updateAccounting(msg.sender); uint256 lockedTokens = totalLocked(); uint256 mintedLockedShares = (lockedTokens > 0) ? totalFrozenShares.mul(amount).div(lockedTokens) : amount.mul(_initialSharesPerToken); UnlockSchedule memory schedule; ...
updateAccounting(msg.sender); uint256 lockedTokens = totalLocked(); uint256 mintedLockedShares = (lockedTokens > 0) ? totalFrozenShares.mul(amount).div(lockedTokens) : amount.mul(_initialSharesPerToken); UnlockSchedule memory schedule; ...
13,435
50
// transfer ethereum from contract /
{ _to.transfer(_value); // CHECK THIS return true; }
{ _to.transfer(_value); // CHECK THIS return true; }
55,487
194
// returns the balance of a given reserve token_reserveTokenreserve token contract address return the balance of the given reserve token /
function reserveBalance(IERC20 _reserveToken) public view override returns (uint256) { uint256 reserveId = __reserveIds[_reserveToken]; require(reserveId != 0, "ERR_INVALID_RESERVE"); return reserveBalance(reserveId); }
function reserveBalance(IERC20 _reserveToken) public view override returns (uint256) { uint256 reserveId = __reserveIds[_reserveToken]; require(reserveId != 0, "ERR_INVALID_RESERVE"); return reserveBalance(reserveId); }
26,897
19
// Transfers control of the contract to a newOwner.newOwner The address to transfer ownership to./
function _transferOwnership(address newOwner) internal { require(newOwner != address(0)); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; }
function _transferOwnership(address newOwner) internal { require(newOwner != address(0)); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; }
8,318
68
// Extends OpenZeppelin AccessControl contract with modifiers This contract and AccessControlUpgradeSafe are essentially duplicates. /
contract AccessControl is OZAccessControl { /** @notice access control roles **/ bytes32 public constant CONTRACT_ROLE = keccak256("CONTRACT_ROLE"); bytes32 public constant LP_ROLE = keccak256("LP_ROLE"); bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE"); bytes32 public constant EMERGENCY...
contract AccessControl is OZAccessControl { /** @notice access control roles **/ bytes32 public constant CONTRACT_ROLE = keccak256("CONTRACT_ROLE"); bytes32 public constant LP_ROLE = keccak256("LP_ROLE"); bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE"); bytes32 public constant EMERGENCY...
34,503
4
// holds the current balance of the user for each erc1155TokenId - user => tokenId => balance
mapping(address => mapping(uint256 => uint256)) private erc1155Balance;
mapping(address => mapping(uint256 => uint256)) private erc1155Balance;
65,663
5
// In this IDO, the `asset` MUST conform to `IERC20` /
abstract contract BaseERC20IDO is BaseIDO { using SafeERC20 for IERC20; constructor(address _owner, Config memory config) BaseIDO(_owner, config) { // Empty } /** * @notice Transfers amount of ERC20 `asset` to `to` address. Parameter `tokenIds` is ignored. */ function _offerAsset...
abstract contract BaseERC20IDO is BaseIDO { using SafeERC20 for IERC20; constructor(address _owner, Config memory config) BaseIDO(_owner, config) { // Empty } /** * @notice Transfers amount of ERC20 `asset` to `to` address. Parameter `tokenIds` is ignored. */ function _offerAsset...
29,642
313
// Selector of `log(bool,address,bool,address)`.
mstore(0x00, 0x1c41a336) mstore(0x20, p0) mstore(0x40, p1) mstore(0x60, p2) mstore(0x80, p3)
mstore(0x00, 0x1c41a336) mstore(0x20, p0) mstore(0x40, p1) mstore(0x60, p2) mstore(0x80, p3)
30,589
8
// Mint cost contract
address public mintCostContract;
address public mintCostContract;
79,086
75
// Retrieves the gas price that any assigned reporter will have to pay when reporting / result to a previously posted Witnet data request./Fails if the `_queryId` is not valid or, if it has already been /reported, or deleted. /_queryId The unique query identifier
function readRequestGasPrice(uint256 _queryId) external view override inStatus(_queryId, Witnet.QueryStatus.Posted) returns (uint256)
function readRequestGasPrice(uint256 _queryId) external view override inStatus(_queryId, Witnet.QueryStatus.Posted) returns (uint256)
26,440
56
// Fallback function, works only if ICO is running /
function() payable onlyRunning { var supplied = cat.totalSupply(); var tokens = tokenEmission(msg.value, supplied); // revert if nothing to emit require(tokens > 0); // emit tokens bool success = cat.emit(tokens); assert(success); // transfer new t...
function() payable onlyRunning { var supplied = cat.totalSupply(); var tokens = tokenEmission(msg.value, supplied); // revert if nothing to emit require(tokens > 0); // emit tokens bool success = cat.emit(tokens); assert(success); // transfer new t...
49,270
38
// transfers the governance from one account(`caller`) to another account(`_newOwner`). /
function revokeOwnership(address _newOwner) external returns (bool);
function revokeOwnership(address _newOwner) external returns (bool);
75,451
11
// add buyer manually/Contract owner should only be allowed to call this function
function addBuyer() private onlyOwner { // TODO: add buyer to array of authorized ETH addresses // TODO: Implement event TestDriveReservation }
function addBuyer() private onlyOwner { // TODO: add buyer to array of authorized ETH addresses // TODO: Implement event TestDriveReservation }
53,249
35
// Pre-sale ICO
amountOfIRC = amountOfWei.mul(IRC_PER_ETH_PRE_SALE); absLowTimeBonusLimit = preSaleStartTime + lowTimeBonusLimit; absMidTimeBonusLimit = preSaleStartTime + midTimeBonusLimit; absHighTimeBonusLimit = preSaleStartTime + highTimeBonusLimit; totalIRCAvailable = maxPresaleSupply - totalIRCAllocated;
amountOfIRC = amountOfWei.mul(IRC_PER_ETH_PRE_SALE); absLowTimeBonusLimit = preSaleStartTime + lowTimeBonusLimit; absMidTimeBonusLimit = preSaleStartTime + midTimeBonusLimit; absHighTimeBonusLimit = preSaleStartTime + highTimeBonusLimit; totalIRCAvailable = maxPresaleSupply - totalIRCAllocated;
33,908
2
// Contract constructor, define initial administrator/
constructor() internal { admin = msg.sender; //Set initial admin to contract creator emit AdminedEvent(admin); }
constructor() internal { admin = msg.sender; //Set initial admin to contract creator emit AdminedEvent(admin); }
24,854
15
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
(bool success, ) = recipient.call{ value: amount }("");
26
26
// Sets the address of the L2 Graph Token _l2GRT Address of the GRT contract on L2 /
function setL2TokenAddress(address _l2GRT) external onlyGovernor { require(_l2GRT != address(0), "INVALID_L2_GRT"); l2GRT = _l2GRT; emit L2TokenAddressSet(_l2GRT); }
function setL2TokenAddress(address _l2GRT) external onlyGovernor { require(_l2GRT != address(0), "INVALID_L2_GRT"); l2GRT = _l2GRT; emit L2TokenAddressSet(_l2GRT); }
18,831
69
// PIGGY-MODIFY: Checks if the account should be allowed to borrow the underlying asset of the given market pToken The market to verify the borrow against borrower The account which would borrow the asset borrowAmount The amount of underlying the account would borrowreturn 0 if the borrow is allowed, otherwise a semi-o...
function borrowAllowed(
function borrowAllowed(
13,545
68
// Returns array of owners./ return Array of Safe owners.
function getOwners() public view returns (address[] memory) { address[] memory array = new address[](ownerCount); // populate return array uint256 index = 0; address currentOwner = owners[SENTINEL_OWNERS]; while (currentOwner != SENTINEL_OWNERS) { array[index] = currentOwner; currentO...
function getOwners() public view returns (address[] memory) { address[] memory array = new address[](ownerCount); // populate return array uint256 index = 0; address currentOwner = owners[SENTINEL_OWNERS]; while (currentOwner != SENTINEL_OWNERS) { array[index] = currentOwner; currentO...
30,968
118
// Register the approval (replacing any previous approval).
indexToApproved[tokenId_] = approved_;
indexToApproved[tokenId_] = approved_;
26,576
32
// new implementation
uint256 currentNonce = _useNonce(signer);
uint256 currentNonce = _useNonce(signer);
23,578
23
// Internal function used by function 'tokenURI()' to format words for .json file output /
function getMetaWord(string memory word) internal pure returns(string memory) { string memory length = string(abi.encodePacked("\"", word, "\"")); return length; }
function getMetaWord(string memory word) internal pure returns(string memory) { string memory length = string(abi.encodePacked("\"", word, "\"")); return length; }
31,095
0
// This should be owned by the microservice that is paying for gas.
interface IAxelarGasService { error NothingReceived(); error InvalidAddress(); error NotCollector(); error InvalidAmounts(); event GasPaidForContractCall( address indexed sourceAddress, string destinationChain, string destinationAddress, bytes32 indexed payloadHash, ...
interface IAxelarGasService { error NothingReceived(); error InvalidAddress(); error NotCollector(); error InvalidAmounts(); event GasPaidForContractCall( address indexed sourceAddress, string destinationChain, string destinationAddress, bytes32 indexed payloadHash, ...
25,317
693
// Auxiliary data is not supported
require (withdrawal.extraData.length == 0, "AUXILIARY_DATA_NOT_ALLOWED");
require (withdrawal.extraData.length == 0, "AUXILIARY_DATA_NOT_ALLOWED");
53,260
95
// Wallets
address public marketingWallet = 0xAfE6B307562E3b90a649E423e4Cb17bfF3Df90ea;
address public marketingWallet = 0xAfE6B307562E3b90a649E423e4Cb17bfF3Df90ea;
10,226
44
// ================================================================================== Data Model
function _incrementPoolBalances(uint _baseAmt, uint _tokenAmt) external onlyRouter { baseAmt += _baseAmt; tokenAmt += _tokenAmt; baseAmtStaked += _baseAmt; tokenAmtStaked += _tokenAmt; }
function _incrementPoolBalances(uint _baseAmt, uint _tokenAmt) external onlyRouter { baseAmt += _baseAmt; tokenAmt += _tokenAmt; baseAmtStaked += _baseAmt; tokenAmtStaked += _tokenAmt; }
30,597
28
// Gets DAI from the user's wallet
DaiJoinLike(apt).dai().transferFrom(msg.sender, address(this), wad);
DaiJoinLike(apt).dai().transferFrom(msg.sender, address(this), wad);
39,136
6
// return the beneficiary of the tokens. /
function beneficiary() external view returns (address) { return _beneficiary; }
function beneficiary() external view returns (address) { return _beneficiary; }
44,153
293
// Proposes a price value where caller is the proposer. requester sender of the initial price request. identifier price identifier to identify the existing request. timestamp timestamp to identify the existing request. ancillaryData ancillary data of the price being requested. request price request parameters whose has...
function proposePrice( address requester, bytes32 identifier, uint32 timestamp, bytes memory ancillaryData, Request memory request, int256 proposedPrice
function proposePrice( address requester, bytes32 identifier, uint32 timestamp, bytes memory ancillaryData, Request memory request, int256 proposedPrice
32,589
1
// eth to token
uint amountInMax, address[] calldata path1,
uint amountInMax, address[] calldata path1,
24,168
27
// Returns the contract name hash needed for node's engine.
function contractNameHash() public pure
function contractNameHash() public pure
17,560
11
// Returns information about the value of the transaction.
function _msgValue() internal view virtual returns (uint256) { return msg.value; }
function _msgValue() internal view virtual returns (uint256) { return msg.value; }
4,740
44
// Returns LivepeerToken interface /
function livepeerToken() internal view returns (ILivepeerToken) { return ILivepeerToken(controller.getContract(keccak256("LivepeerToken"))); }
function livepeerToken() internal view returns (ILivepeerToken) { return ILivepeerToken(controller.getContract(keccak256("LivepeerToken"))); }
46,151
5
// VALIDATE
function validateDeposit(string memory user_name, uint[2] memory public_key, uint[2] memory signature) public payable returns(bytes memory, bytes32, bool){ bytes memory encodedABI = abi.encode(user_name, public_key, msg.value); bytes32 shaMSG = sha256(encodedABI); Holder memory holder = hol...
function validateDeposit(string memory user_name, uint[2] memory public_key, uint[2] memory signature) public payable returns(bytes memory, bytes32, bool){ bytes memory encodedABI = abi.encode(user_name, public_key, msg.value); bytes32 shaMSG = sha256(encodedABI); Holder memory holder = hol...
13,815
122
// ERC20 compliant token balance store. This contract serves as the store of balances, allowances, and supply for the ERC20 compliant token. No business logic exists here. This contract contains no business logic and instead is the final destination for any change in balances, allowances, or token supply. This contract...
contract ERC20Store is ERC20ImplUpgradeable { // MEMBERS /// @dev The total token supply. uint256 public totalSupply; /// @dev The mapping of balances. mapping (address => uint256) public balances; /// @dev The mapping of allowances. mapping (address => mapping (address => uint256)) pu...
contract ERC20Store is ERC20ImplUpgradeable { // MEMBERS /// @dev The total token supply. uint256 public totalSupply; /// @dev The mapping of balances. mapping (address => uint256) public balances; /// @dev The mapping of allowances. mapping (address => mapping (address => uint256)) pu...
11,016
6
// Get available mints for a membershipId /
function getAvailableMintsForMembership(uint256 membershipId) public view returns (uint256)
function getAvailableMintsForMembership(uint256 membershipId) public view returns (uint256)
14,990
133
// pay the transfer
tokenToPay.safeTransferFrom(msg.sender, order.maker, transferAmount);
tokenToPay.safeTransferFrom(msg.sender, order.maker, transferAmount);
38,238
93
// Events emitted by a pool/Contains all events emitted by the pool
interface IUniswapV3PoolEvents { /// @notice Emitted exactly once by a pool when #initialize is first called on the pool /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96 /// @param tick The initial tick of the...
interface IUniswapV3PoolEvents { /// @notice Emitted exactly once by a pool when #initialize is first called on the pool /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96 /// @param tick The initial tick of the...
67,361
2
// Database interface
interface DBInterface { function setContractManager(address _contractManager) external; // --------------------Set Functions------------------------ function setAddress(bytes32 _key, address _value) external; function setUint(bytes32 _key, uint _value) external; function setString(bytes...
interface DBInterface { function setContractManager(address _contractManager) external; // --------------------Set Functions------------------------ function setAddress(bytes32 _key, address _value) external; function setUint(bytes32 _key, uint _value) external; function setString(bytes...
25,685
426
// Sets the protocolFeeCollector contract address to 0./Only callable by owner.
function detachProtocolFeeCollector() external onlyOwner { _setProtocolFeeCollectorAddress(address(0)); }
function detachProtocolFeeCollector() external onlyOwner { _setProtocolFeeCollectorAddress(address(0)); }
12,348
6
// constructor must pass the address of the Router and xFUND smartcontracts to the constructor of your contract! Without it, this contractcannot interact with the system, nor request/receive any data.The constructor calls the parent ConsumerBase constructor to set these._router address of the Router smart contract _xfu...
constructor(address _router, address _xfund, address _provider, uint256 _fee)
constructor(address _router, address _xfund, address _provider, uint256 _fee)
44,317
79
// Perform an ERC20 token transfer. Designed to be called by transfer functions possessingthe onlyProxy or optionalProxy modifiers. /
function _transferByProxy( address from, address to, uint value
function _transferByProxy( address from, address to, uint value
23,581
4
// Ref: https:etherscan.io/address/0x8798249c2E607446EfB7Ad49eC89dD1865Ff4272code
interface ISushiBar { function enter(uint256 _amount) external; function leave(uint256 _share) external; }
interface ISushiBar { function enter(uint256 _amount) external; function leave(uint256 _share) external; }
29,055
31
// Gets vote record of proposal. proposalId The proposal UUID. /
function getVoteRecord(uint256 proposalId) public view returns (ProposalVoteRecord memory) { return voteRecords[proposalId]; }
function getVoteRecord(uint256 proposalId) public view returns (ProposalVoteRecord memory) { return voteRecords[proposalId]; }
19,516
13
// constructor, where first user is an administrator /
constructor() public { owner[msg.sender] = ++index; }
constructor() public { owner[msg.sender] = ++index; }
11,721
167
// Move the last token to the slot of the to-delete token
_ownedTokensIndex[lastTokenId] = tokenIndex;
_ownedTokensIndex[lastTokenId] = tokenIndex;
12,021
79
// Get price of DAI in ETH
(, int256 latestPrice, , , ) = oracle.latestRoundData(); uint256 minimumReq = (_amount.mul(1e12).mul(uint256(latestPrice))).div(_BASE); if (_withFactors) { return minimumReq.mul(collatF.a).mul(safetyF.a).div(collatF.b).div(safetyF.b); } else {
(, int256 latestPrice, , , ) = oracle.latestRoundData(); uint256 minimumReq = (_amount.mul(1e12).mul(uint256(latestPrice))).div(_BASE); if (_withFactors) { return minimumReq.mul(collatF.a).mul(safetyF.a).div(collatF.b).div(safetyF.b); } else {
39,532
102
// Underlying asset for this CToken
function underlying() external view returns (address);
function underlying() external view returns (address);
40,452
265
// update states
adjustPositionForLiquidityChanged(_exchange, _trader); PositionResp memory positionResp = internalClosePosition(_exchange, _trader, Decimal.zero(), false); enterRestrictionMode(_exchange); {
adjustPositionForLiquidityChanged(_exchange, _trader); PositionResp memory positionResp = internalClosePosition(_exchange, _trader, Decimal.zero(), false); enterRestrictionMode(_exchange); {
30,848
29
// report
function report(address _from, address _to, bytes _sign) public
function report(address _from, address _to, bytes _sign) public
45,539
51
// Index Of Locates and returns the position of a character within a string_base When being used for a data type this is the extended object otherwise this is the string acting as the haystack to be searched _value The needle to search for, at present this is currentlylimited to one characterreturn int The position of ...
function indexOf(string memory _base, string memory _value) internal pure returns (int256)
function indexOf(string memory _base, string memory _value) internal pure returns (int256)
25,737
527
// Pool Collection interface /
interface IPoolCollection is IVersioned { /** * @dev returns the type of the pool */ function poolType() external pure returns (uint16); /** * @dev returns the default trading fee (in units of PPM) */ function defaultTradingFeePPM() external view returns (uint32); /** * @d...
interface IPoolCollection is IVersioned { /** * @dev returns the type of the pool */ function poolType() external pure returns (uint16); /** * @dev returns the default trading fee (in units of PPM) */ function defaultTradingFeePPM() external view returns (uint32); /** * @d...
3,601
88
// Event emitted when underlying is borrowed /
event Borrow(address borrower, uint borrowAmount, uint accountBorrows, uint totalBorrows);
event Borrow(address borrower, uint borrowAmount, uint accountBorrows, uint totalBorrows);
4,762
6
// Call the implementation. out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
10,213
118
// Sets vesting start date (as unix timestamp). Owner only _vestingStart Unix timestamp. /
function setVestingStart(uint256 _vestingStart) public onlyOwner { require(_vestingStart > 0, "VestedAkro: vestingStart should be > 0"); vestingStart = _vestingStart; }
function setVestingStart(uint256 _vestingStart) public onlyOwner { require(_vestingStart > 0, "VestedAkro: vestingStart should be > 0"); vestingStart = _vestingStart; }
60,140
187
// {ERC20} token, including:This contract uses {AccessControl} to lock permissioned functions using the/ Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROLE`, `PAUSER_ROLE` to theaccount that deploys the contract. See {ERC20-constructor}. /
constructor(string memory contractName, string memory contractSymbol, uint256 initialAmount, uint8 decimals) ERC20(contractName, contractSymbol) { _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); _setupRole(MINTER_ROLE, _msgSender()); _setupRole(PAUSER_ROLE, _msgSender()); _setupDecima...
constructor(string memory contractName, string memory contractSymbol, uint256 initialAmount, uint8 decimals) ERC20(contractName, contractSymbol) { _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); _setupRole(MINTER_ROLE, _msgSender()); _setupRole(PAUSER_ROLE, _msgSender()); _setupDecima...
21,087
182
// Source of liquidity to repay debt from liquidated troves
IStabilityPool internal constant stabilityPool = IStabilityPool(0x66017D22b0f8556afDd19FC67041899Eb65a21bb);
IStabilityPool internal constant stabilityPool = IStabilityPool(0x66017D22b0f8556afDd19FC67041899Eb65a21bb);
7,717
33
// Return the log in base 10, rounded down, of a positive value.Returns 0 if given 0. /
function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; ...
function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; ...
20,639
74
// conduct transfer from Luxarity to address
transferFrom(msg.sender, _buyerAddress, _tokenId);
transferFrom(msg.sender, _buyerAddress, _tokenId);
7,785
42
// Allows anyone to verify the declared timestamp for any given hash. /
function verifyDeclaredTime(bytes32 hash) public view returns (uint32)
function verifyDeclaredTime(bytes32 hash) public view returns (uint32)
10,201
96
// Token for which presale is being done
address public saleToken; uint public saleTokenDec;
address public saleToken; uint public saleTokenDec;
25,034
107
// Get minimum delegation amount
function getMinDelegationAmount() external view returns (uint256)
function getMinDelegationAmount() external view returns (uint256)
17,921
24
// Allows a graph account to publish a new subgraph, which means a new subgraph numberwill be used. _graphAccount Account that is publishing the subgraph _subgraphDeploymentID Subgraph deployment ID of the version, linked to the name _versionMetadata IPFS hash for the subgraph version metadata _subgraphMetadata IPFS ha...
function publishNewSubgraph( address _graphAccount, bytes32 _subgraphDeploymentID, bytes32 _versionMetadata, bytes32 _subgraphMetadata
function publishNewSubgraph( address _graphAccount, bytes32 _subgraphDeploymentID, bytes32 _versionMetadata, bytes32 _subgraphMetadata
31,285
34
// Bid on the auction with the value sent with this transaction./ The value will only be refunded if the auction is not won.
function bid() payable atState(States.AcceptingBids) { require(msg.value > highestBid); if (highestBid != 0) { pendingReturns[highestBidder] = pendingReturns[highestBidder].add(highestBid); } highestBidder = msg.sender; highestBid = msg.value; HighestBidIncreased(msg.sender, msg.value)...
function bid() payable atState(States.AcceptingBids) { require(msg.value > highestBid); if (highestBid != 0) { pendingReturns[highestBidder] = pendingReturns[highestBidder].add(highestBid); } highestBidder = msg.sender; highestBid = msg.value; HighestBidIncreased(msg.sender, msg.value)...
29,775
12
// We verify that beta keys are available
require(betaKeysSold < maxBetaKeys);
require(betaKeysSold < maxBetaKeys);
26,238
116
// Need to make gas fee customizable to future-proof against Ethereum network upgrades.
uint256 public gasForTransfer; uint256 public totalDividendsDistributed;
uint256 public gasForTransfer; uint256 public totalDividendsDistributed;
27,502