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
79
// this is a buy, so we need to check if the amount is below the max limit
require(amount <= maxTransactionAmount); require(amount + balanceOf(to) <= maxWallet);
require(amount <= maxTransactionAmount); require(amount + balanceOf(to) <= maxWallet);
21,820
18
// _freeze internal function to freeze an account /
function _freeze (address target, bool froze ) internal { frozen[target]=froze; Frozen(target, froze); }
function _freeze (address target, bool froze ) internal { frozen[target]=froze; Frozen(target, froze); }
849
30
// Initialize, called once
constructor ( IProtocolFactory _factory, IERC20 daiToken_ ) public Ownable()
constructor ( IProtocolFactory _factory, IERC20 daiToken_ ) public Ownable()
40,794
97
// Infinite approve
IERC20(_token).safeApprove(address(_masterchef), uint256(-1));
IERC20(_token).safeApprove(address(_masterchef), uint256(-1));
3,012
8
// (4) 회원 등급용 구조체
struct MemberStatus { string name; // 등급명 uint256 times; // 최저 거래 회수 uint256 sum; // 최저 거래 금액 int8 rate; // 캐시백 비율 }
struct MemberStatus { string name; // 등급명 uint256 times; // 최저 거래 회수 uint256 sum; // 최저 거래 금액 int8 rate; // 캐시백 비율 }
22,968
521
// check that there is enough room for new participants
require(pvpQueueSize < pvpQueue.length);
require(pvpQueueSize < pvpQueue.length);
79,000
7
// See {IRoyaltyEngineV1-getRoyalty} /
function getRoyalty(address tokenAddress, uint256 tokenId, uint256 value) public override returns (address payable[] memory recipients, uint256[] memory amounts) {
function getRoyalty(address tokenAddress, uint256 tokenId, uint256 value) public override returns (address payable[] memory recipients, uint256[] memory amounts) {
25,790
11
// newChar.classId = newClass.classId;
_mint(msg.sender, 1); _setTokenURI( tokenId, "ipfs://QmUyWmpry8Sri9BmsHSQMDBPtnPZkoX6GS7w8ZizpnFX7v" ); characters[numCharacters] = newChar;
_mint(msg.sender, 1); _setTokenURI( tokenId, "ipfs://QmUyWmpry8Sri9BmsHSQMDBPtnPZkoX6GS7w8ZizpnFX7v" ); characters[numCharacters] = newChar;
21,206
13
// record that voter has voted
voters[msg.sender] = true;
voters[msg.sender] = true;
5,109
227
// Gets the settlement price of a settled auction gnosisEasyAuction The address of the Gnosis Easy Auction contractreturn settlementPrice Auction settlement price /
function getAuctionSettlementPrice( address gnosisEasyAuction, uint256 optionAuctionID
function getAuctionSettlementPrice( address gnosisEasyAuction, uint256 optionAuctionID
59,853
36
// Remove from admins object
delete admins[_address];
delete admins[_address];
18,806
123
// 60 0x37 | PUSH1 0x37| 0x37 extra 0 0 0 0| [0, cds) = calldata0x37 (55) is runtime size - data 36| CALLDATASIZE| cds 0x37 extra 0 0 0 0| [0, cds) = calldata 39| CODECOPY| 0 0 0 0 | [0, cds) = calldata, [cds, cds+0x37) = extraData 36| CALLDATASIZE| cds 0 0 0 0 | [0, cds) = calldata, [cds, cds+0x37) = extraData 61 extra| PUSH2 extra | extra cds 0 0 0 0 | [0, cds) = calldata, [cds, cds+0x37) = extraData
mstore( add(ptr, 0x15), 0x6037363936610000000000000000000000000000000000000000000000000000 ) mstore(add(ptr, 0x1b), shl(240, extraLength))
mstore( add(ptr, 0x15), 0x6037363936610000000000000000000000000000000000000000000000000000 ) mstore(add(ptr, 0x1b), shl(240, extraLength))
10,674
65
// NFT data
uint32 characterId; uint32 favCoinId; uint32 metaId; uint32 unlockTime; uint256 lockAmount;
uint32 characterId; uint32 favCoinId; uint32 metaId; uint32 unlockTime; uint256 lockAmount;
16,360
56
// Emits a {Approval} event. /
function _approve( address to, uint256 tokenId, address owner ) private { _tokenApprovals[tokenId] = to; emit Approval(owner, to, tokenId); }
function _approve( address to, uint256 tokenId, address owner ) private { _tokenApprovals[tokenId] = to; emit Approval(owner, to, tokenId); }
863
201
// The character should be avaiable. (Should have already returned from the dungeons, arenas, etc.)
require(_heroInstance.availableAt <= now);
require(_heroInstance.availableAt <= now);
57,860
1
// Set default security token parameters _name Name of the security token _ticker Ticker name of the security _totalSupply Total amount of tokens being created _decimals Decimals for token _owner Ethereum address of the security token owner _maxPoly Amount of maximum poly issuer want to raise _lockupPeriod Length of time raised POLY will be locked up for dispute _quorum Percent of initial investors required to freeze POLY raise _polyTokenAddress Ethereum address of the POLY token contract _polyCustomersAddress Ethereum address of the PolyCustomers contract _polyComplianceAddress Ethereum address of the PolyCompliance contract /
function SecurityToken( string _name, string _ticker, uint256 _totalSupply, uint8 _decimals, address _owner, uint256 _maxPoly, uint256 _lockupPeriod, uint8 _quorum, address _polyTokenAddress,
function SecurityToken( string _name, string _ticker, uint256 _totalSupply, uint8 _decimals, address _owner, uint256 _maxPoly, uint256 _lockupPeriod, uint8 _quorum, address _polyTokenAddress,
36,293
23
// Default Safe signature validation (approved hashes / threshold signatures) safe The safe being asked to validate the signature _hash Hash of the data that is signed signature The signature to be verified /
function defaultIsValidSignature(Safe safe, bytes32 _hash, bytes memory signature) internal view returns (bytes4 magic) { bytes memory messageData = EIP712.encodeMessageData( safe.domainSeparator(), SAFE_MSG_TYPEHASH, abi.encode(keccak256(abi.encode(_hash))) ); bytes32 messageHash = keccak256(messageData); if (signature.length == 0) { // approved hashes require(safe.signedMessages(messageHash) != 0, "Hash not approved"); } else { // threshold signatures safe.checkSignatures(messageHash, messageData, signature); } magic = ERC1271.isValidSignature.selector; }
function defaultIsValidSignature(Safe safe, bytes32 _hash, bytes memory signature) internal view returns (bytes4 magic) { bytes memory messageData = EIP712.encodeMessageData( safe.domainSeparator(), SAFE_MSG_TYPEHASH, abi.encode(keccak256(abi.encode(_hash))) ); bytes32 messageHash = keccak256(messageData); if (signature.length == 0) { // approved hashes require(safe.signedMessages(messageHash) != 0, "Hash not approved"); } else { // threshold signatures safe.checkSignatures(messageHash, messageData, signature); } magic = ERC1271.isValidSignature.selector; }
20,173
134
// ======== VIEW FUNCTIONS ======== //determine maximum barter size return uint /
function maxPayout() public view returns ( uint ) { return IERC20( USV ).totalSupply().mul( terms.maxPayout ).div( 100000 ); }
function maxPayout() public view returns ( uint ) { return IERC20( USV ).totalSupply().mul( terms.maxPayout ).div( 100000 ); }
47,161
20
// 通道上发生了惩罚事件,受益人是谁. Event to reveal the beneficiary who will get all the tokens deposited in this channel, when the other node attempts to do fraudulent behavior.
event ChannelPunished( bytes32 indexed channel_identifier, address beneficiary );
event ChannelPunished( bytes32 indexed channel_identifier, address beneficiary );
45,131
85
// timestamp when token release is enabled
uint256 private _releaseTime; constructor( IERC20 token, address beneficiary
uint256 private _releaseTime; constructor( IERC20 token, address beneficiary
4,569
49
// returns the current committee/ used also by the rewards and fees contracts
function getCommitteeInfo() external view returns (address[] memory addrs, uint256[] memory weights, address[] memory orbsAddrs, bool[] memory certification, bytes4[] memory ips);
function getCommitteeInfo() external view returns (address[] memory addrs, uint256[] memory weights, address[] memory orbsAddrs, bool[] memory certification, bytes4[] memory ips);
24,104
13
// uint256 amount,
uint256 pid
uint256 pid
32,596
54
// Claimed Tokens
uint256 claimedStake; uint256 claimedRewards; for(uint256 i=0; i<allStakeHolders.length; i++) { if(StakeHolders[allStakeHolders[i]].isClaimed == false) { notClaimedStake = notClaimedStake.add(StakeHolders[allStakeHolders[i]].amount); notClaimedRewards = notClaimedRewards.add(StakeHolders[allStakeHolders[i]].rewards); } else if (StakeHolders[allStakeHolders[i]].isClaimed == true) {
uint256 claimedStake; uint256 claimedRewards; for(uint256 i=0; i<allStakeHolders.length; i++) { if(StakeHolders[allStakeHolders[i]].isClaimed == false) { notClaimedStake = notClaimedStake.add(StakeHolders[allStakeHolders[i]].amount); notClaimedRewards = notClaimedRewards.add(StakeHolders[allStakeHolders[i]].rewards); } else if (StakeHolders[allStakeHolders[i]].isClaimed == true) {
27,205
301
// Turbo Clerk/Transmissions11/Fee determination module for Turbo Safes.
contract TurboClerk is Auth, ENSReverseRecordAuth { /*/////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ /// @notice Creates a new Turbo Clerk contract. /// @param _owner The owner of the Clerk. /// @param _authority The Authority of the Clerk. constructor(address _owner, Authority _authority) Auth(_owner, _authority) {} /*/////////////////////////////////////////////////////////////// DEFAULT FEE CONFIGURATION //////////////////////////////////////////////////////////////*/ /// @notice The default fee on Safe interest taken by the protocol. /// @dev A fixed point number where 1e18 represents 100% and 0 represents 0%. uint256 public defaultFeePercentage; /// @notice Emitted when the default fee percentage is updated. /// @param newDefaultFeePercentage The new default fee percentage. event DefaultFeePercentageUpdated(address indexed user, uint256 newDefaultFeePercentage); /// @notice Sets the default fee percentage. /// @param newDefaultFeePercentage The new default fee percentage. function setDefaultFeePercentage(uint256 newDefaultFeePercentage) external requiresAuth { // A fee percentage over 100% makes no sense. require(newDefaultFeePercentage <= 1e18, "FEE_TOO_HIGH"); // Update the default fee percentage. defaultFeePercentage = newDefaultFeePercentage; emit DefaultFeePercentageUpdated(msg.sender, newDefaultFeePercentage); } /*/////////////////////////////////////////////////////////////// CUSTOM FEE CONFIGURATION //////////////////////////////////////////////////////////////*/ /// @notice Maps collaterals to their custom fees on interest taken by the protocol. /// @dev A fixed point number where 1e18 represents 100% and 0 represents 0%. mapping(ERC20 => uint256) public getCustomFeePercentageForCollateral; /// @notice Maps Safes to their custom fees on interest taken by the protocol. /// @dev A fixed point number where 1e18 represents 100% and 0 represents 0%. mapping(TurboSafe => uint256) public getCustomFeePercentageForSafe; /// @notice Emitted when a collateral's custom fee percentage is updated. /// @param collateral The collateral who's custom fee percentage was updated. /// @param newFeePercentage The new custom fee percentage. event CustomFeePercentageUpdatedForCollateral( address indexed user, ERC20 indexed collateral, uint256 newFeePercentage ); /// @notice Sets a collateral's custom fee percentage. /// @param collateral The collateral to set the custom fee percentage for. /// @param newFeePercentage The new custom fee percentage for the collateral. function setCustomFeePercentageForCollateral(ERC20 collateral, uint256 newFeePercentage) external requiresAuth { // A fee percentage over 100% makes no sense. require(newFeePercentage <= 1e18, "FEE_TOO_HIGH"); // Update the custom fee percentage for the Safe. getCustomFeePercentageForCollateral[collateral] = newFeePercentage; emit CustomFeePercentageUpdatedForCollateral(msg.sender, collateral, newFeePercentage); } /// @notice Emitted when a Safe's custom fee percentage is updated. /// @param safe The Safe who's custom fee percentage was updated. /// @param newFeePercentage The new custom fee percentage. event CustomFeePercentageUpdatedForSafe(address indexed user, TurboSafe indexed safe, uint256 newFeePercentage); /// @notice Sets a Safe's custom fee percentage. /// @param safe The Safe to set the custom fee percentage for. /// @param newFeePercentage The new custom fee percentage for the Safe. function setCustomFeePercentageForSafe(TurboSafe safe, uint256 newFeePercentage) external requiresAuth { // A fee percentage over 100% makes no sense. require(newFeePercentage <= 1e18, "FEE_TOO_HIGH"); // Update the custom fee percentage for the Safe. getCustomFeePercentageForSafe[safe] = newFeePercentage; emit CustomFeePercentageUpdatedForSafe(msg.sender, safe, newFeePercentage); } /*/////////////////////////////////////////////////////////////// ACCOUNTING LOGIC //////////////////////////////////////////////////////////////*/ /// @notice Returns the fee on interest taken by the protocol for a Safe. /// @param safe The Safe to get the fee percentage for. /// @param collateral The collateral/asset of the Safe. /// @return The fee percentage for the Safe. function getFeePercentageForSafe(TurboSafe safe, ERC20 collateral) external view returns (uint256) { // Get the custom fee percentage for the Safe. uint256 customFeePercentageForSafe = getCustomFeePercentageForSafe[safe]; // If a custom fee percentage is set for the Safe, return it. if (customFeePercentageForSafe != 0) return customFeePercentageForSafe; // Get the custom fee percentage for the collateral type. uint256 customFeePercentageForCollateral = getCustomFeePercentageForCollateral[collateral]; // If a custom fee percentage is set for the collateral, return it. if (customFeePercentageForCollateral != 0) return customFeePercentageForCollateral; // Otherwise, return the default fee percentage. return defaultFeePercentage; } }
contract TurboClerk is Auth, ENSReverseRecordAuth { /*/////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ /// @notice Creates a new Turbo Clerk contract. /// @param _owner The owner of the Clerk. /// @param _authority The Authority of the Clerk. constructor(address _owner, Authority _authority) Auth(_owner, _authority) {} /*/////////////////////////////////////////////////////////////// DEFAULT FEE CONFIGURATION //////////////////////////////////////////////////////////////*/ /// @notice The default fee on Safe interest taken by the protocol. /// @dev A fixed point number where 1e18 represents 100% and 0 represents 0%. uint256 public defaultFeePercentage; /// @notice Emitted when the default fee percentage is updated. /// @param newDefaultFeePercentage The new default fee percentage. event DefaultFeePercentageUpdated(address indexed user, uint256 newDefaultFeePercentage); /// @notice Sets the default fee percentage. /// @param newDefaultFeePercentage The new default fee percentage. function setDefaultFeePercentage(uint256 newDefaultFeePercentage) external requiresAuth { // A fee percentage over 100% makes no sense. require(newDefaultFeePercentage <= 1e18, "FEE_TOO_HIGH"); // Update the default fee percentage. defaultFeePercentage = newDefaultFeePercentage; emit DefaultFeePercentageUpdated(msg.sender, newDefaultFeePercentage); } /*/////////////////////////////////////////////////////////////// CUSTOM FEE CONFIGURATION //////////////////////////////////////////////////////////////*/ /// @notice Maps collaterals to their custom fees on interest taken by the protocol. /// @dev A fixed point number where 1e18 represents 100% and 0 represents 0%. mapping(ERC20 => uint256) public getCustomFeePercentageForCollateral; /// @notice Maps Safes to their custom fees on interest taken by the protocol. /// @dev A fixed point number where 1e18 represents 100% and 0 represents 0%. mapping(TurboSafe => uint256) public getCustomFeePercentageForSafe; /// @notice Emitted when a collateral's custom fee percentage is updated. /// @param collateral The collateral who's custom fee percentage was updated. /// @param newFeePercentage The new custom fee percentage. event CustomFeePercentageUpdatedForCollateral( address indexed user, ERC20 indexed collateral, uint256 newFeePercentage ); /// @notice Sets a collateral's custom fee percentage. /// @param collateral The collateral to set the custom fee percentage for. /// @param newFeePercentage The new custom fee percentage for the collateral. function setCustomFeePercentageForCollateral(ERC20 collateral, uint256 newFeePercentage) external requiresAuth { // A fee percentage over 100% makes no sense. require(newFeePercentage <= 1e18, "FEE_TOO_HIGH"); // Update the custom fee percentage for the Safe. getCustomFeePercentageForCollateral[collateral] = newFeePercentage; emit CustomFeePercentageUpdatedForCollateral(msg.sender, collateral, newFeePercentage); } /// @notice Emitted when a Safe's custom fee percentage is updated. /// @param safe The Safe who's custom fee percentage was updated. /// @param newFeePercentage The new custom fee percentage. event CustomFeePercentageUpdatedForSafe(address indexed user, TurboSafe indexed safe, uint256 newFeePercentage); /// @notice Sets a Safe's custom fee percentage. /// @param safe The Safe to set the custom fee percentage for. /// @param newFeePercentage The new custom fee percentage for the Safe. function setCustomFeePercentageForSafe(TurboSafe safe, uint256 newFeePercentage) external requiresAuth { // A fee percentage over 100% makes no sense. require(newFeePercentage <= 1e18, "FEE_TOO_HIGH"); // Update the custom fee percentage for the Safe. getCustomFeePercentageForSafe[safe] = newFeePercentage; emit CustomFeePercentageUpdatedForSafe(msg.sender, safe, newFeePercentage); } /*/////////////////////////////////////////////////////////////// ACCOUNTING LOGIC //////////////////////////////////////////////////////////////*/ /// @notice Returns the fee on interest taken by the protocol for a Safe. /// @param safe The Safe to get the fee percentage for. /// @param collateral The collateral/asset of the Safe. /// @return The fee percentage for the Safe. function getFeePercentageForSafe(TurboSafe safe, ERC20 collateral) external view returns (uint256) { // Get the custom fee percentage for the Safe. uint256 customFeePercentageForSafe = getCustomFeePercentageForSafe[safe]; // If a custom fee percentage is set for the Safe, return it. if (customFeePercentageForSafe != 0) return customFeePercentageForSafe; // Get the custom fee percentage for the collateral type. uint256 customFeePercentageForCollateral = getCustomFeePercentageForCollateral[collateral]; // If a custom fee percentage is set for the collateral, return it. if (customFeePercentageForCollateral != 0) return customFeePercentageForCollateral; // Otherwise, return the default fee percentage. return defaultFeePercentage; } }
30,321
0
// Creates an instance of `TokenPaymentSplitter` where each account in `payees` is assigned the numberof shares at the matching position in the `shares` array. All addresses in `payees` must be non-zero. Both arrays must have the same non-zero length, and there must be noduplicates in `payees`. /
constructor(address[] memory payees, uint256[] memory shares_) payable { require( payees.length == shares_.length, "PaymentSplitter: payees and shares length mismatch" ); require(payees.length > 0, "PaymentSplitter: no payees"); for (uint256 i = 0; i < payees.length; i++) { _addPayee(payees[i], shares_[i]); } }
constructor(address[] memory payees, uint256[] memory shares_) payable { require( payees.length == shares_.length, "PaymentSplitter: payees and shares length mismatch" ); require(payees.length > 0, "PaymentSplitter: no payees"); for (uint256 i = 0; i < payees.length; i++) { _addPayee(payees[i], shares_[i]); } }
50,198
51
// note: it would also tabulate time held in stewardship by smart contract
timeHeld[tokenId][_currentPatron] = timeHeld[tokenId][_currentPatron] .add((timeLastCollected[tokenId].sub(timeAcquired[tokenId]))); assetToken.transferFrom(_currentOwner, _newOwner, tokenId); currentPatron[tokenId] = _newOwner; price[tokenId] = _newPrice; timeAcquired[tokenId] = now; patrons[tokenId][_newOwner] = true;
timeHeld[tokenId][_currentPatron] = timeHeld[tokenId][_currentPatron] .add((timeLastCollected[tokenId].sub(timeAcquired[tokenId]))); assetToken.transferFrom(_currentOwner, _newOwner, tokenId); currentPatron[tokenId] = _newOwner; price[tokenId] = _newPrice; timeAcquired[tokenId] = now; patrons[tokenId][_newOwner] = true;
12,192
65
// Function to deactivate a vault strategy./_managementFeeAddress Address of the Management Fee Strategy.
function removeManagementFeeStrategies(address _vaultAddress, address _managementFeeAddress) public
function removeManagementFeeStrategies(address _vaultAddress, address _managementFeeAddress) public
40,265
87
// `approve` is not supported in this contract /
function approve(address, uint256) public pure override returns (bool) { revert("Operation Not Supported"); }
function approve(address, uint256) public pure override returns (bool) { revert("Operation Not Supported"); }
14,512
1
// Returns weighted rate
function getWeightedRate() external view returns (uint256);
function getWeightedRate() external view returns (uint256);
17,588
1,082
// Helper to decode the encoded call arguments
function __decodeCallArgs(bytes memory _encodedCallArgs) private pure returns ( address incomingAsset_, uint256 minIncomingAssetAmount_, address outgoingAsset_, uint256 outgoingAssetAmount_ ) {
function __decodeCallArgs(bytes memory _encodedCallArgs) private pure returns ( address incomingAsset_, uint256 minIncomingAssetAmount_, address outgoingAsset_, uint256 outgoingAssetAmount_ ) {
44,503
36
// Returns token balance of user. 1 token = 1/10^18 RMC/_user Address of user
function balanceOf(address _user) public returns(uint balance) { return balances[_user]; }
function balanceOf(address _user) public returns(uint balance) { return balances[_user]; }
13,405
10
// =MIN(2^(daysLate+3)/window-1,99)
uint256 daysLate = secsLate / SECONDS_IN_DAY; if (daysLate > WITHDRAWAL_WINDOW_DAYS - 1) return MAX_PENALTY_PCT; uint256 penalty = (uint256(1) << (daysLate + 3)) / WITHDRAWAL_WINDOW_DAYS - 1; return Math.min(penalty, MAX_PENALTY_PCT);
uint256 daysLate = secsLate / SECONDS_IN_DAY; if (daysLate > WITHDRAWAL_WINDOW_DAYS - 1) return MAX_PENALTY_PCT; uint256 penalty = (uint256(1) << (daysLate + 3)) / WITHDRAWAL_WINDOW_DAYS - 1; return Math.min(penalty, MAX_PENALTY_PCT);
8,653
27
// Transfers a specific NFT (`tokenId`) from one account (`from`) toanother (`to`). Requirements:- If the caller is not `from`, it must be approved to move this NFT byeither `approve` or `setApproveForAll`. /
function transferFrom(address from, address to, uint256 tokenId) public; function approve(address to, uint256 tokenId) public; function getApproved(uint256 tokenId) public view returns (address operator); function setApprovalForAll(address operator, bool _approved) public;
function transferFrom(address from, address to, uint256 tokenId) public; function approve(address to, uint256 tokenId) public; function getApproved(uint256 tokenId) public view returns (address operator); function setApprovalForAll(address operator, bool _approved) public;
18,187
56
// _maxTxAmount = 11012109;
tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
52,823
5
// Emitted when a user delegates their entire wallet
event DelegateForAll(address vault, address delegate, bool value);
event DelegateForAll(address vault, address delegate, bool value);
14,194
69
// Set providers to the Vault _providers: new providers' addresses /
function setProviders(address[] calldata _providers) external isAuthorized { providers = _providers; }
function setProviders(address[] calldata _providers) external isAuthorized { providers = _providers; }
54,771
17
// Total number of tokens in circulation/
uint256 public totalSupply;
uint256 public totalSupply;
6,563
161
// import {ERC20, IERC20} from "contracts/common/UpgradeableERC20.sol"; import {ITrueLender2, ILoanToken2} from "contracts/truefi2/interface/ITrueLender2.sol"; import {ITrueFiPoolOracle} from "contracts/truefi2/interface/ITrueFiPoolOracle.sol"; import {I1Inch3} from "contracts/truefi2/interface/I1Inch3.sol"; import {ISAFU} from "contracts/truefi2/interface/ISAFU.sol";
function initialize( ERC20 _token, ERC20 _stakingToken, ITrueLender2 _lender, I1Inch3 __1Inch, ISAFU safu, address __owner ) external; function token() external view returns (ERC20);
function initialize( ERC20 _token, ERC20 _stakingToken, ITrueLender2 _lender, I1Inch3 __1Inch, ISAFU safu, address __owner ) external; function token() external view returns (ERC20);
20,957
18
// Custom super token created eventtoken Newly created custom super token address/
event CustomSuperTokenCreated(ISuperToken indexed token);
event CustomSuperTokenCreated(ISuperToken indexed token);
25,675
22
// The proxy this contract exists behind. // The caller of the proxy, passed through to this contract.Note that every function using this member must apply the onlyProxy oroptionalProxy modifiers, otherwise their invocations can use stale values. /
constructor(address payable _proxy) internal { // This contract is abstract, and thus cannot be instantiated directly require(owner != address(0), "Owner must be set"); proxy = Proxy(_proxy); emit ProxyUpdated(_proxy); }
constructor(address payable _proxy) internal { // This contract is abstract, and thus cannot be instantiated directly require(owner != address(0), "Owner must be set"); proxy = Proxy(_proxy); emit ProxyUpdated(_proxy); }
2,404
95
// Set Flat Kick Incentive (tip) to 500 NOTE: PECU rejected the incentive update to 500. https:forum.makerdao.com/t/tusd-offloading-flat-kick-incentive-change/14645
DssExecLib.setKeeperIncentiveFlatRate(_ilk, 0);
DssExecLib.setKeeperIncentiveFlatRate(_ilk, 0);
26,269
274
// All three of these values are immutable: they can only be set once during construction./_name Erc20 name of this token./_symbol Erc20 symbol of this token./_decimals Erc20 decimal precision of this token.
constructor( string memory _name, string memory _symbol, uint8 _decimals
constructor( string memory _name, string memory _symbol, uint8 _decimals
18,034
36
// withdraw amount for a specific use case
require(msg.sender == creator, "your not the creator"); require(state == State.Successful); if (creator.send(_amount)) { withDrawDetail memory tmp = withDrawDetail(_amount, _useCase, now); withDrawDetailList.push(tmp); return true; } else {
require(msg.sender == creator, "your not the creator"); require(state == State.Successful); if (creator.send(_amount)) { withDrawDetail memory tmp = withDrawDetail(_amount, _useCase, now); withDrawDetailList.push(tmp); return true; } else {
41,844
7
// VIEW FUNCTIONS /
function getRewardsTokenContract() external view returns (IERC20) { return rewardsToken; }
function getRewardsTokenContract() external view returns (IERC20) { return rewardsToken; }
68,284
7
// For the proxy tokens
function underlyingAsset() external view returns (address);
function underlyingAsset() external view returns (address);
32,600
545
// Updates all of the pools.
function _updatePools() internal { for (uint256 _poolId = 0; _poolId < _pools.length(); _poolId++) { Pool.Data storage _pool = _pools.get(_poolId); _pool.update(_ctx); } }
function _updatePools() internal { for (uint256 _poolId = 0; _poolId < _pools.length(); _poolId++) { Pool.Data storage _pool = _pools.get(_poolId); _pool.update(_ctx); } }
28,609
77
// Emits a {Transfer} event with `from` set to the zero address. Requirements: - `to` cannot be the zero address./
function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); }
function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); }
16,166
850
// Create a new pinned instance of an app linked to this kernelCreate a new non-upgradeable instance of `_appId` app linked to the Kernel, setting its code to `_appBase`._appId Identifier for app_appBase Address of the app's base implementation return AppProxy instance/
function newPinnedAppInstance(bytes32 _appId, address _appBase) public auth(APP_MANAGER_ROLE, arr(KERNEL_APP_BASES_NAMESPACE, _appId)) returns (ERCProxy appProxy)
function newPinnedAppInstance(bytes32 _appId, address _appBase) public auth(APP_MANAGER_ROLE, arr(KERNEL_APP_BASES_NAMESPACE, _appId)) returns (ERCProxy appProxy)
14,501
21
// 1. if auction not ended just revert
if( block.timestamp < myAuction.blockDeadline ) revert();
if( block.timestamp < myAuction.blockDeadline ) revert();
89
246
// 7 day sma
uint256 sevenSMA = getLatestSevenSMA(); uint256 priceRef = 0; for (uint32 i = 0; i < _priceKey.length; ++i) { if (sevenSMA >= _priceKey[i]) { priceRef = _pricePercentageMapping[_priceKey[i]]; }
uint256 sevenSMA = getLatestSevenSMA(); uint256 priceRef = 0; for (uint32 i = 0; i < _priceKey.length; ++i) { if (sevenSMA >= _priceKey[i]) { priceRef = _pricePercentageMapping[_priceKey[i]]; }
31,359
16
// function numSettling - READ ONLY - Get number of races currently being settled.return count as number of races currently being settled. A race is being settled, if at least one settlement transaction has occured,and the race is still not fully settled. Each race requires 7 settlements total.The higher the number, the relatively safer it is to attempt settlementgiven more races that need settlement at that time. Assume competition. /
function numSettling() external view returns(uint256 count);
function numSettling() external view returns(uint256 count);
36,504
193
// 0% collateral-backed
function mintAlgorithmicDEI( uint256 deus_amount_d18, uint256 deus_current_price, uint256 expireBlock, bytes[] calldata sigs
function mintAlgorithmicDEI( uint256 deus_amount_d18, uint256 deus_current_price, uint256 expireBlock, bytes[] calldata sigs
35,473
32
// Depending on whether this is a finalizing burn or not, the amount of locked/unlocked PRPS is determined differently.
if (finalizing) {
if (finalizing) {
5,122
60
// Returns the balance of the pool Must be implemented by the strategy /
function balanceOfPool() public view virtual override returns (uint256);
function balanceOfPool() public view virtual override returns (uint256);
41,810
4
// isLotteryClosed = false;
21,286
6
// Mint NFT token and create FT accordingly _name - Name for FT _symbol - Symbol for FT _decimals - Precision amount for FT _tokenOwner - Address of FT owner _fungibleTokenSupply - Max token supply for FT /
function mint( string _name, string _symbol, uint256 _decimals, address _tokenOwner, uint256 _fungibleTokenSupply ) public returns (uint256)
function mint( string _name, string _symbol, uint256 _decimals, address _tokenOwner, uint256 _fungibleTokenSupply ) public returns (uint256)
31,135
3
// Emitted when a subgraph is denied for claiming rewards. /
event RewardsDenylistUpdated(bytes32 indexed subgraphDeploymentID, uint256 sinceBlock);
event RewardsDenylistUpdated(bytes32 indexed subgraphDeploymentID, uint256 sinceBlock);
50,395
6
// Allows current owner to transfer control of the contract to a newOwner. newOwner The address to transfer ownership to. newOwnerWallet The address to transfer ownership to. /
function transferOwnership(address newOwner, address newOwnerWallet) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; ownerWallet = newOwnerWallet; }
function transferOwnership(address newOwner, address newOwnerWallet) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; ownerWallet = newOwnerWallet; }
31,321
4
// returns `2 ^ f` by calculating `e ^ (fln(2))`, where `e` is Euler's number:- Rewrite the input as a sum of binary exponents and a single residual r, as small as possible- The exponentiation of each binary exponent is given (pre-calculated)- The exponentiation of r is calculated via Taylor series for e^x, where x = r- The exponentiation of the input is calculated by multiplying the intermediate results above- For example: e^5.521692859 = e^(4 + 1 + 0.5 + 0.021692859) = e^4e^1e^0.5e^0.021692859 /
function exp2(Fraction memory f) internal pure returns (Fraction memory) { uint256 x = MathEx.mulDivF(LN2, f.n, f.d); uint256 y; uint256 z; uint256 n; if (x >= (ONE << 4)) { revert Overflow(); } unchecked { z = y = x % (ONE >> 3); // get the input modulo 2^(-3) z = (z * y) / ONE; n += z * 0x10e1b3be415a0000; // add y^02 * (20! / 02!) z = (z * y) / ONE; n += z * 0x05a0913f6b1e0000; // add y^03 * (20! / 03!) z = (z * y) / ONE; n += z * 0x0168244fdac78000; // add y^04 * (20! / 04!) z = (z * y) / ONE; n += z * 0x004807432bc18000; // add y^05 * (20! / 05!) z = (z * y) / ONE; n += z * 0x000c0135dca04000; // add y^06 * (20! / 06!) z = (z * y) / ONE; n += z * 0x0001b707b1cdc000; // add y^07 * (20! / 07!) z = (z * y) / ONE; n += z * 0x000036e0f639b800; // add y^08 * (20! / 08!) z = (z * y) / ONE; n += z * 0x00000618fee9f800; // add y^09 * (20! / 09!) z = (z * y) / ONE; n += z * 0x0000009c197dcc00; // add y^10 * (20! / 10!) z = (z * y) / ONE; n += z * 0x0000000e30dce400; // add y^11 * (20! / 11!) z = (z * y) / ONE; n += z * 0x000000012ebd1300; // add y^12 * (20! / 12!) z = (z * y) / ONE; n += z * 0x0000000017499f00; // add y^13 * (20! / 13!) z = (z * y) / ONE; n += z * 0x0000000001a9d480; // add y^14 * (20! / 14!) z = (z * y) / ONE; n += z * 0x00000000001c6380; // add y^15 * (20! / 15!) z = (z * y) / ONE; n += z * 0x000000000001c638; // add y^16 * (20! / 16!) z = (z * y) / ONE; n += z * 0x0000000000001ab8; // add y^17 * (20! / 17!) z = (z * y) / ONE; n += z * 0x000000000000017c; // add y^18 * (20! / 18!) z = (z * y) / ONE; n += z * 0x0000000000000014; // add y^19 * (20! / 19!) z = (z * y) / ONE; n += z * 0x0000000000000001; // add y^20 * (20! / 20!) n = n / 0x21c3677c82b40000 + y + ONE; // divide by 20! and then add y^1 / 1! + y^0 / 0! if ((x & (ONE >> 3)) != 0) n = (n * 0x1c3d6a24ed82218787d624d3e5eba95f9) / 0x18ebef9eac820ae8682b9793ac6d1e776; // multiply by e^(2^-3) if ((x & (ONE >> 2)) != 0) n = (n * 0x18ebef9eac820ae8682b9793ac6d1e778) / 0x1368b2fc6f9609fe7aceb46aa619baed4; // multiply by e^(2^-2) if ((x & (ONE >> 1)) != 0) n = (n * 0x1368b2fc6f9609fe7aceb46aa619baed5) / 0x0bc5ab1b16779be3575bd8f0520a9f21f; // multiply by e^(2^-1) if ((x & (ONE << 0)) != 0) n = (n * 0x0bc5ab1b16779be3575bd8f0520a9f21e) / 0x0454aaa8efe072e7f6ddbab84b40a55c9; // multiply by e^(2^+0) if ((x & (ONE << 1)) != 0) n = (n * 0x0454aaa8efe072e7f6ddbab84b40a55c5) / 0x00960aadc109e7a3bf4578099615711ea; // multiply by e^(2^+1) if ((x & (ONE << 2)) != 0) n = (n * 0x00960aadc109e7a3bf4578099615711d7) / 0x0002bf84208204f5977f9a8cf01fdce3d; // multiply by e^(2^+2) if ((x & (ONE << 3)) != 0) n = (n * 0x0002bf84208204f5977f9a8cf01fdc307) / 0x0000003c6ab775dd0b95b4cbee7e65d11; // multiply by e^(2^+3) } return Fraction({ n: n, d: ONE }); }
function exp2(Fraction memory f) internal pure returns (Fraction memory) { uint256 x = MathEx.mulDivF(LN2, f.n, f.d); uint256 y; uint256 z; uint256 n; if (x >= (ONE << 4)) { revert Overflow(); } unchecked { z = y = x % (ONE >> 3); // get the input modulo 2^(-3) z = (z * y) / ONE; n += z * 0x10e1b3be415a0000; // add y^02 * (20! / 02!) z = (z * y) / ONE; n += z * 0x05a0913f6b1e0000; // add y^03 * (20! / 03!) z = (z * y) / ONE; n += z * 0x0168244fdac78000; // add y^04 * (20! / 04!) z = (z * y) / ONE; n += z * 0x004807432bc18000; // add y^05 * (20! / 05!) z = (z * y) / ONE; n += z * 0x000c0135dca04000; // add y^06 * (20! / 06!) z = (z * y) / ONE; n += z * 0x0001b707b1cdc000; // add y^07 * (20! / 07!) z = (z * y) / ONE; n += z * 0x000036e0f639b800; // add y^08 * (20! / 08!) z = (z * y) / ONE; n += z * 0x00000618fee9f800; // add y^09 * (20! / 09!) z = (z * y) / ONE; n += z * 0x0000009c197dcc00; // add y^10 * (20! / 10!) z = (z * y) / ONE; n += z * 0x0000000e30dce400; // add y^11 * (20! / 11!) z = (z * y) / ONE; n += z * 0x000000012ebd1300; // add y^12 * (20! / 12!) z = (z * y) / ONE; n += z * 0x0000000017499f00; // add y^13 * (20! / 13!) z = (z * y) / ONE; n += z * 0x0000000001a9d480; // add y^14 * (20! / 14!) z = (z * y) / ONE; n += z * 0x00000000001c6380; // add y^15 * (20! / 15!) z = (z * y) / ONE; n += z * 0x000000000001c638; // add y^16 * (20! / 16!) z = (z * y) / ONE; n += z * 0x0000000000001ab8; // add y^17 * (20! / 17!) z = (z * y) / ONE; n += z * 0x000000000000017c; // add y^18 * (20! / 18!) z = (z * y) / ONE; n += z * 0x0000000000000014; // add y^19 * (20! / 19!) z = (z * y) / ONE; n += z * 0x0000000000000001; // add y^20 * (20! / 20!) n = n / 0x21c3677c82b40000 + y + ONE; // divide by 20! and then add y^1 / 1! + y^0 / 0! if ((x & (ONE >> 3)) != 0) n = (n * 0x1c3d6a24ed82218787d624d3e5eba95f9) / 0x18ebef9eac820ae8682b9793ac6d1e776; // multiply by e^(2^-3) if ((x & (ONE >> 2)) != 0) n = (n * 0x18ebef9eac820ae8682b9793ac6d1e778) / 0x1368b2fc6f9609fe7aceb46aa619baed4; // multiply by e^(2^-2) if ((x & (ONE >> 1)) != 0) n = (n * 0x1368b2fc6f9609fe7aceb46aa619baed5) / 0x0bc5ab1b16779be3575bd8f0520a9f21f; // multiply by e^(2^-1) if ((x & (ONE << 0)) != 0) n = (n * 0x0bc5ab1b16779be3575bd8f0520a9f21e) / 0x0454aaa8efe072e7f6ddbab84b40a55c9; // multiply by e^(2^+0) if ((x & (ONE << 1)) != 0) n = (n * 0x0454aaa8efe072e7f6ddbab84b40a55c5) / 0x00960aadc109e7a3bf4578099615711ea; // multiply by e^(2^+1) if ((x & (ONE << 2)) != 0) n = (n * 0x00960aadc109e7a3bf4578099615711d7) / 0x0002bf84208204f5977f9a8cf01fdce3d; // multiply by e^(2^+2) if ((x & (ONE << 3)) != 0) n = (n * 0x0002bf84208204f5977f9a8cf01fdc307) / 0x0000003c6ab775dd0b95b4cbee7e65d11; // multiply by e^(2^+3) } return Fraction({ n: n, d: ONE }); }
30,009
99
// Modify Reward Unlock Rate for KittieFightToken and SuperDaoToken for any month (from 0 to 5)within the program duration (a period of 6 months) _month uint256 the month (from 0 to 5) for which the unlock rate is to be modified _rateuint256 the unlock rate forKTY bool true if this modification is for KittieFightToken, false if it is for SuperDaoTokenThis function can only be carreid out by the owner of this contract. /
function setRewardUnlockRate(uint256 _month, uint256 _rate, bool forKTY) public onlyOwner { if (forKTY) { KTYunlockRates[_month] = _rate; } else { SDAOunlockRates[_month] = _rate; } }
function setRewardUnlockRate(uint256 _month, uint256 _rate, bool forKTY) public onlyOwner { if (forKTY) { KTYunlockRates[_month] = _rate; } else { SDAOunlockRates[_month] = _rate; } }
44,110
11
// Proposers must have previously staked at the BondManager
require( IBondManager(resolve("BondManager")).isCollateralized(msg.sender), "Proposer does not have enough collateral posted" ); require(_batch.length > 0, "Cannot submit an empty state batch."); require( getTotalElements() + _batch.length <= ICanonicalTransactionChain(resolve("CanonicalTransactionChain")).getTotalElements(),
require( IBondManager(resolve("BondManager")).isCollateralized(msg.sender), "Proposer does not have enough collateral posted" ); require(_batch.length > 0, "Cannot submit an empty state batch."); require( getTotalElements() + _batch.length <= ICanonicalTransactionChain(resolve("CanonicalTransactionChain")).getTotalElements(),
9,840
6
// bytes10(dd.diversifier) ++ bytes32(dd.pk) ++ bytes8(dd.deposit)
let offset := mul(i, 50) mstore(add(input, add(64, offset)), diversifier) mstore(add(input, add(82, offset)), deposit) mstore(add(input, add(74, offset)), pk)
let offset := mul(i, 50) mstore(add(input, add(64, offset)), diversifier) mstore(add(input, add(82, offset)), deposit) mstore(add(input, add(74, offset)), pk)
28,667
15
// MerkleProof Merkle proof verification based on /
library MerkleProof { /** * @dev Verifies a Merkle proof proving the existence of a leaf in a Merkle tree. Assumes that each pair of leaves * and each pair of pre-images are sorted. * @param proof Merkle proof containing sibling hashes on the branch from the leaf to the root of the Merkle tree * @param root Merkle root * @param leaf Leaf of Merkle tree */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { bytes32 proofElement = proof[i]; if (computedHash < proofElement) { // Hash(current computed hash + current element of the proof) computedHash = keccak256(abi.encodePacked(computedHash, proofElement)); } else { // Hash(current element of the proof + current computed hash) computedHash = keccak256(abi.encodePacked(proofElement, computedHash)); } } // Check if the computed hash (root) is equal to the provided root return computedHash == root; } }
library MerkleProof { /** * @dev Verifies a Merkle proof proving the existence of a leaf in a Merkle tree. Assumes that each pair of leaves * and each pair of pre-images are sorted. * @param proof Merkle proof containing sibling hashes on the branch from the leaf to the root of the Merkle tree * @param root Merkle root * @param leaf Leaf of Merkle tree */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { bytes32 proofElement = proof[i]; if (computedHash < proofElement) { // Hash(current computed hash + current element of the proof) computedHash = keccak256(abi.encodePacked(computedHash, proofElement)); } else { // Hash(current element of the proof + current computed hash) computedHash = keccak256(abi.encodePacked(proofElement, computedHash)); } } // Check if the computed hash (root) is equal to the provided root return computedHash == root; } }
12,993
36
// uint64 fromContract;does not need to be send
bytes4 fromChainNet; uint8 fromChainId;
bytes4 fromChainNet; uint8 fromChainId;
24,639
225
// pay 2% out to community rewards
uint256 _com = _eth / 50; uint256 _p3d; if (!address(Jekyll_Island_Inc).call.value(_com)(bytes4(keccak256("deposit()")))) {
uint256 _com = _eth / 50; uint256 _p3d; if (!address(Jekyll_Island_Inc).call.value(_com)(bytes4(keccak256("deposit()")))) {
3,544
66
// Stake the transferred tokens
_stake(_indexer, _tokens);
_stake(_indexer, _tokens);
19,642
122
// External view function to check whether the caller is the currentrole holder. role The role to check for.return A boolean indicating if the caller has the specified role. /
function isRole(Role role) external view returns (bool hasRole) { hasRole = _isRole(role); }
function isRole(Role role) external view returns (bool hasRole) { hasRole = _isRole(role); }
21,439
1
// _exeID ID of the executable to check.This function will check that the specified proposal has reached quorum, and that it has passed. If the proposal has not reached quorum or has not passed this will return false. The reason we use Exe IDs here and not Prop IDs is that executables may be valid for execution outside of a proposal (e.g an approved recurring payment). If the exe is tied to a proposal the coordinator will be able to look up and verify it's executable status. /
function isExecutable(bytes32 _exeID) external view returns (bool); function setExecute(bytes32 _exeID) external;
function isExecutable(bytes32 _exeID) external view returns (bool); function setExecute(bytes32 _exeID) external;
49,736
52
// Return WhiteList
function getWhiteList() external view onlyOwner returns (address[] memory)
function getWhiteList() external view onlyOwner returns (address[] memory)
23,451
60
// See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is notrequired by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address.- `sender` must have a balance of at least `amount`.- the caller must have allowance for ``sender``'s tokens of at least`amount`. /
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; }
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; }
48
105
// An abbreviated name for NFTokens. /
string internal nftSymbol;
string internal nftSymbol;
2,285
333
// Set the swap fee on the underlying pool Keep the local version and core in sync (see below) bPool is a contract interface; function calls on it are external swapFee in Wei /
function setSwapFee(uint256 swapFee) external virtual logs lock onlyOwner needsBPool
function setSwapFee(uint256 swapFee) external virtual logs lock onlyOwner needsBPool
6,439
24
// =========== admin ==========
function ratioSync() external; function retrieve( address payable to, address token, uint256 amount ) external; function reset( address assetTo,
function ratioSync() external; function retrieve( address payable to, address token, uint256 amount ) external; function reset( address assetTo,
5,694
255
// Any calls to nonReentrant after this point will fail
_notEntered = false; _;
_notEntered = false; _;
39,779
66
// Divides x between y, assuming they are both fixed point with 27 digits.
function divd(uint256 x, uint256 y) internal pure returns (uint256) { return x.mul(UNIT).div(y); }
function divd(uint256 x, uint256 y) internal pure returns (uint256) { return x.mul(UNIT).div(y); }
23,731
8
// The basic fundraiser initialization method._startTime The start time of the fundraiser - Unix timestamp. _endTime The end time of the fundraiser - Unix timestamp. _conversionRate The number of tokens create for 1 ETH funded. _beneficiary The address which will receive the funds gathered by the fundraiser. /
function initializeBasicFundraiser( uint256 _startTime, uint256 _endTime, uint256 _conversionRate, address _beneficiary )
function initializeBasicFundraiser( uint256 _startTime, uint256 _endTime, uint256 _conversionRate, address _beneficiary )
35,432
11
// optionnal check for convenience check if there is enough native token to cover the bridging fees
if (fee > address(this).balance) { revert ErrNotEnoughNativeTokenToCoverFee(); }
if (fee > address(this).balance) { revert ErrNotEnoughNativeTokenToCoverFee(); }
40,156
621
// zx = baseReserves - baseAmount
uint256 zx = uint256(baseReserves) - uint256(baseAmount); require(zx <= MAX, "YieldMath: Too much base out");
uint256 zx = uint256(baseReserves) - uint256(baseAmount); require(zx <= MAX, "YieldMath: Too much base out");
43,986
11
// The % of primary sales collected by the contract as fees.
uint128 public platformFeeBps;
uint128 public platformFeeBps;
4,290
58
// check actions in finishMintingStruct requestscheck for empty struct /
if (finishMintingStruct.initiator != address(0)){
if (finishMintingStruct.initiator != address(0)){
11,265
34
// Set the global debt ceiling +100 M for gem-A
VatAbstract(MCD_VAT).file("Line", VatAbstract(MCD_VAT).Line() + desc.line * SharedStructs.MILLION * SharedStructs.RAD);
VatAbstract(MCD_VAT).file("Line", VatAbstract(MCD_VAT).Line() + desc.line * SharedStructs.MILLION * SharedStructs.RAD);
39,950
7
// nonces[_keyHash] must stay in sync with VRFCoordinator.nonces[_keyHash][this], which was incremented by the above successful LINK.transferAndCall (in VRFCoordinator.randomnessRequest). This provides protection against the user repeating their input seed, which would result in a predictable/duplicate output, if multiple such requests appeared in the same block.
nonces[_keyHash] = nonces[_keyHash].add(1); return makeRequestId(_keyHash, vRFSeed);
nonces[_keyHash] = nonces[_keyHash].add(1); return makeRequestId(_keyHash, vRFSeed);
10,857
286
// assert(ceil(rest / bondPrice) <= allowance);
return bond.transferFrom(sender, recipient, rest.divRoundUp(bondPrice));
return bond.transferFrom(sender, recipient, rest.divRoundUp(bondPrice));
7,184
4
// The duration of voting on a proposal, in blocks
function votingPeriod() public pure returns (uint) { return 1_80; } // ~7 days in blocks (assuming 15s blocks)
function votingPeriod() public pure returns (uint) { return 1_80; } // ~7 days in blocks (assuming 15s blocks)
13,005
466
// dflKeeperFactorMantissa must be little equal this value
uint internal constant dflKeeperFactorMaxMantissa = 0.9e18; // 0.9
uint internal constant dflKeeperFactorMaxMantissa = 0.9e18; // 0.9
31,032
13
// Returns an array of public key bytes32 held by this identity. /
function getKeysByPurpose(uint256 _purpose) external view returns (bytes32[] memory keys);
function getKeysByPurpose(uint256 _purpose) external view returns (bytes32[] memory keys);
513
133
// Reverts if sender does not have the trader role associated. /
modifier onlyTrader() { require(isTrader(msg.sender), "TraderOperatorable: caller is not trader"); _; }
modifier onlyTrader() { require(isTrader(msg.sender), "TraderOperatorable: caller is not trader"); _; }
22,276
16
// End execution early if tx is mined too early
uint256 targetEpochStartTime = getEpochStartTime(_targetEpoch);
uint256 targetEpochStartTime = getEpochStartTime(_targetEpoch);
31,951
164
// A map from the account owner to accountID + 1
mapping (address => uint24) ownerToAccountId; mapping (address => uint16) tokenToTokenId;
mapping (address => uint24) ownerToAccountId; mapping (address => uint16) tokenToTokenId;
28,585
9
// Sets a new URI for all token types, by relying on the token type ID substitution mechanism _newURI New URI for all tokens /
function setURI( string memory _newURI
function setURI( string memory _newURI
26,395
6
// Support unvarified content /
function support(uint256 asset) external { }
function support(uint256 asset) external { }
39,033
3
// Track the provenance hash for guaranteeing metadata order/ for random reveals.
bytes32 internal _provenanceHash;
bytes32 internal _provenanceHash;
12,542
26
// uint fee = (_value.mul(basisPointsRate)).div(10000); if (fee > maximumFee) { fee = maximumFee; }
if (_allowance < MAX_UINT) { allowed[_from][msg.sender] = _allowance.sub(_value); }
if (_allowance < MAX_UINT) { allowed[_from][msg.sender] = _allowance.sub(_value); }
35,827
51
// Distributes NFTs and bidded amount after auction deadline is reached. /
function endAuction(uint256 positionId) external positionInState(positionId, PositionState.Auction) nonReentrant
function endAuction(uint256 positionId) external positionInState(positionId, PositionState.Auction) nonReentrant
19,705
21
// The timestamp after which minting may occur
uint public mintingAllowedAfter;
uint public mintingAllowedAfter;
2,051
2
// create a function the reads the mood from the smart contract
function getMood() public view returns(string memory){ return mood; }
function getMood() public view returns(string memory){ return mood; }
21,841
16
// 保存总奖励金额
fissionFunderTotalBalance[fissionWinners[_stepIndex][i]] = fissionRewardAmount[_stepIndex][fissionWinners[_stepIndex][i]]; totalFissionReward[_stepIndex] += fissionRewards[_stepIndex][i];
fissionFunderTotalBalance[fissionWinners[_stepIndex][i]] = fissionRewardAmount[_stepIndex][fissionWinners[_stepIndex][i]]; totalFissionReward[_stepIndex] += fissionRewards[_stepIndex][i];
20,345
46
// These function will transfer all token back to Pool contract _tokenAddress BEP-20 token address /
function transferPool(address payable _tokenAddress) external isAllowed { IBEP20 token = IBEP20(_tokenAddress); token.transfer(poolAddress, token.balanceOf(address(this))); }
function transferPool(address payable _tokenAddress) external isAllowed { IBEP20 token = IBEP20(_tokenAddress); token.transfer(poolAddress, token.balanceOf(address(this))); }
20,008
121
// can later be changed with {transferOwnership}./ Changed _owner from 'private' to 'internal' /
address internal _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
address internal _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
24,006
18
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
prod0 := div(prod0, twos)
274