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
2
// Amount of tokens sold during SALE phase and not yet claimed
uint256 public locked;
uint256 public locked;
77,243
73
// Create a lot with `primordialAmount` of primordial ions with `_multiplier` for an `account` during network exchange, and reward `_networkBonusAmount` if exist _account Address of the lot owner _primordialAmount The amount of primordial ions to be stored in the lot _multiplier The multiplier for this lot in (106) _ne...
function _createPrimordialLot(address _account, uint256 _primordialAmount, uint256 _multiplier, uint256 _networkBonusAmount) internal returns (bytes32) { bytes32 lotId = _aoIonLot.createPrimordialLot(_account, _primordialAmount, _multiplier, _networkBonusAmount); ownerWeightedMultiplier[_account] = AOLibrary.calc...
function _createPrimordialLot(address _account, uint256 _primordialAmount, uint256 _multiplier, uint256 _networkBonusAmount) internal returns (bytes32) { bytes32 lotId = _aoIonLot.createPrimordialLot(_account, _primordialAmount, _multiplier, _networkBonusAmount); ownerWeightedMultiplier[_account] = AOLibrary.calc...
14,440
44
// Returns if `who` can call `sig`/sig Method signature (4Byte)/who Address of who should be able to call `sig`
function canCall(bytes32 sig, address who) public view override returns (bool) { return (_canCall[sig][who] || _canCall[ANY_SIG][who] || _canCall[sig][ANY_CALLER]); }
function canCall(bytes32 sig, address who) public view override returns (bool) { return (_canCall[sig][who] || _canCall[ANY_SIG][who] || _canCall[sig][ANY_CALLER]); }
35,849
3
// Transfer State Contract/ Binod Nirvan/ Enables the admins to maintain the transfer state./Transfer state when disabled disallows everyone but admins to transfer tokens.
contract TransferState is CustomPausable { bool public released = false; event TokenReleased(bool _state); ///@notice Checks if the supplied address is able to perform transfers. ///@param _from The address to check against if the transfer is allowed. modifier canTransfer(address _from) { if(paused || !...
contract TransferState is CustomPausable { bool public released = false; event TokenReleased(bool _state); ///@notice Checks if the supplied address is able to perform transfers. ///@param _from The address to check against if the transfer is allowed. modifier canTransfer(address _from) { if(paused || !...
32,601
375
// the ordered list of target addresses for calls to be made
address[] targets;
address[] targets;
9,146
108
// Retrieves base contract. Differs from address(this) when via delegate-proxy pattern.
function base() public view returns (address) { return _BASE; }
function base() public view returns (address) { return _BASE; }
28,782
188
// Interface for the gas-cost-reduced version of the OptimisticOracle. Differences from normal OptimisticOracle:- refundOnDispute: flag is removed, by default there are no refunds on disputes.- customizing request parameters: In the OptimisticOracle, parameters like `bond` and `customLiveness` can be resetafter a reque...
abstract contract SkinnyOptimisticOracleInterface { // Struct representing a price request. Note that this differs from the OptimisticOracleInterface's Request struct // in that refundOnDispute is removed. struct Request { address proposer; // Address of the proposer. address disputer; // Ad...
abstract contract SkinnyOptimisticOracleInterface { // Struct representing a price request. Note that this differs from the OptimisticOracleInterface's Request struct // in that refundOnDispute is removed. struct Request { address proposer; // Address of the proposer. address disputer; // Ad...
32,537
107
// Initialize Grantees.
address lastAddress = address(0); uint256 _cumulativeTargetFunding = 0; for (uint256 i = 0; i < _grantees.length; i++) { address currentGrantee = _grantees[i]; uint256 currentAmount = _amounts[i]; require( currentAmount > 0, "c...
address lastAddress = address(0); uint256 _cumulativeTargetFunding = 0; for (uint256 i = 0; i < _grantees.length; i++) { address currentGrantee = _grantees[i]; uint256 currentAmount = _amounts[i]; require( currentAmount > 0, "c...
40,883
44
// Returns the oracle rate given the market ratios of fCash to cash. The annualizedAnchorRate/ is used to calculate a rate anchor. Since a rate anchor varies with timeToMaturity and annualizedAnchorRate/ does not, this method will return consistent values regardless of the timeToMaturity of when initialize/ markets is ...
function _calculateOracleRate( int256 fCashAmount, int256 underlyingCashToMarket, int256 rateScalar, uint256 annualizedAnchorRate, uint256 timeToMaturity
function _calculateOracleRate( int256 fCashAmount, int256 underlyingCashToMarket, int256 rateScalar, uint256 annualizedAnchorRate, uint256 timeToMaturity
40,150
170
// Count NFTs tracked by this contract/ return A count of valid NFTs tracked by this contract, where each one of/them has an assigned and queryable owner not equal to the zero address
function totalSupply() public view returns (uint) { return playerTokens.length; }
function totalSupply() public view returns (uint) { return playerTokens.length; }
23,699
126
// total debt is increased
totalDebt = totalDebt.add( value );
totalDebt = totalDebt.add( value );
10,277
1
// deploy 的时候 value 填空 构造的不用传money过去 deploy 完毕的时候调用transfer的方法 填写value
contract TransferTest { address AliceAddress = 0xb685ed019fc04b40454c56db1c2102083a5b47dc; function transfer() { AliceAddress.transfer(msg.value); } }
contract TransferTest { address AliceAddress = 0xb685ed019fc04b40454c56db1c2102083a5b47dc; function transfer() { AliceAddress.transfer(msg.value); } }
39,368
131
// User withdraws the deposit
event Withdraw( address indexed user, uint256 depositId, uint256 amount // amount sent to user (in deposit token units) ); event InterimWithdraw( address indexed user, uint256 depositId, uint256 amount, // amount sent to user (in "repay" token units)
event Withdraw( address indexed user, uint256 depositId, uint256 amount // amount sent to user (in deposit token units) ); event InterimWithdraw( address indexed user, uint256 depositId, uint256 amount, // amount sent to user (in "repay" token units)
41,737
40
// enable transfer after token sale and before listing
function enableTransfer() onlyOwner public { transferable = true; EnableTransfer(); }
function enableTransfer() onlyOwner public { transferable = true; EnableTransfer(); }
32,678
0
// payout to previous owner
for (uint i = 0; i < owners.length; i++) { uint accbalance = address(this).balance; uint payout = (accbalance - fee) / owners.length; payable(owners[i]).transfer(payout); }
for (uint i = 0; i < owners.length; i++) { uint accbalance = address(this).balance; uint payout = (accbalance - fee) / owners.length; payable(owners[i]).transfer(payout); }
39,195
36
// NFT rendering logic contract
SharedNFTLogic private immutable _sharedNFTLogic;
SharedNFTLogic private immutable _sharedNFTLogic;
17,265
7
// コメント番号・インデックス => コメント
mapping(uint256 => mapping(uint256 => string)) public comment;
mapping(uint256 => mapping(uint256 => string)) public comment;
4,320
134
// How much wei we have given back to investors.
uint256 public amountRefunded = 0;
uint256 public amountRefunded = 0;
18,488
146
// Return the buy price of 1 individual token. /
function sellPrice() public view returns(uint256)
function sellPrice() public view returns(uint256)
21,529
68
// Get the user scaled balance
uint256 userScaledBalance = userScaledBalances[user]; if(userScaledBalance == 0) return 0;
uint256 userScaledBalance = userScaledBalances[user]; if(userScaledBalance == 0) return 0;
28,581
0
// Guard variable for re-entrancy checks /
bool internal _notEntered;
bool internal _notEntered;
15,015
71
// You can nest mappings, this example maps owner to operator approvals
mapping(address => mapping(address => bool)) private operatorApprovals; function setApprovalForAll(address to, bool approved) public override { operatorApprovals[msg.sender][to] = approved;
mapping(address => mapping(address => bool)) private operatorApprovals; function setApprovalForAll(address to, bool approved) public override { operatorApprovals[msg.sender][to] = approved;
12,843
16
// SWAP AND BRIDGE
function swapAndBridge(UserSwapBridgeRequest calldata _userRequest, bytes memory _sign) external payable ensure(_userRequest.deadline) nonReentrant
function swapAndBridge(UserSwapBridgeRequest calldata _userRequest, bytes memory _sign) external payable ensure(_userRequest.deadline) nonReentrant
34,767
16
// bit 0-15: LTVbit 16-31: Liq. thresholdbit 32-47: Liq. bonusbit 48-55: Decimalsbit 56: reserve is activebit 57: reserve is frozenbit 58: borrowing is enabledbit 59: stable rate borrowing enabledbit 60: asset is pausedbit 61: borrowing in isolation mode is enabledbit 62-63: reservedbit 64-79: reserve factorbit 80-115 ...
uint256 data;
uint256 data;
11,463
1
// Initializes the contract./upgradingPrice_ Upgrading price./tether_ Tether USD contract address./treasury_ Treasury address./eye_ eYe token contract address. /eyecons_ EYECONS collection contract address./authority_ Authorised address.
function initialize( uint256 upgradingPrice_, IERC20MetadataUpgradeable tether_, address payable treasury_, address eye_, address eyecons_, address authority_ ) external;
function initialize( uint256 upgradingPrice_, IERC20MetadataUpgradeable tether_, address payable treasury_, address eye_, address eyecons_, address authority_ ) external;
41,678
10
// crazy cats
svgString = string(abi.encodePacked( drawTrait(traitData[13][s.body]), drawTrait(traitData[16][s.eyebrows]), drawTrait(traitData[15][s.eyes]), drawTrait(traitData[18][s.glasses]), draw...
svgString = string(abi.encodePacked( drawTrait(traitData[13][s.body]), drawTrait(traitData[16][s.eyebrows]), drawTrait(traitData[15][s.eyes]), drawTrait(traitData[18][s.glasses]), draw...
36,002
29
// _directory A directory of terminals and controllers for projects./_payMetadataDelegateId The 4bytes ID of this delegate, used for pay metadata parsing/_redeemMetadataDelegateId The 4bytes ID of this delegate, used for redeem metadata parsing
constructor(IJBDirectory _directory, bytes4 _payMetadataDelegateId, bytes4 _redeemMetadataDelegateId) { directory = _directory; payMetadataDelegateId = _payMetadataDelegateId; redeemMetadataDelegateId = _redeemMetadataDelegateId; }
constructor(IJBDirectory _directory, bytes4 _payMetadataDelegateId, bytes4 _redeemMetadataDelegateId) { directory = _directory; payMetadataDelegateId = _payMetadataDelegateId; redeemMetadataDelegateId = _redeemMetadataDelegateId; }
18,969
126
// burn user's equivalent KUSD
kUSD.burn(msgSender, vars.equivalentKUSDAmount);
kUSD.burn(msgSender, vars.equivalentKUSDAmount);
34,117
23
// Creates a new Person with the given name.
function createContractPerson(string _name) public onlyCOO { _createPerson(_name, address(this), startingPrice); }
function createContractPerson(string _name) public onlyCOO { _createPerson(_name, address(this), startingPrice); }
46,375
2
// burn option token from an address. Can only be called by corresponding vault _from account to burn from _vaultvault to mint for _amount amount to burn/
function burn(address _from, address _vault, uint256 _amount) external;
function burn(address _from, address _vault, uint256 _amount) external;
24,978
59
// For creating Pow
function _createPow(string _name, address _owner, uint256 _price, uint _gameId, uint _gameItemId) private { Pow memory _pow = Pow({ name: _name, gameId: _gameId, gameItemId: _gameItemId }); uint256 newPowId = pows.push(_pow) - 1; // It's probably never going to happen, 4 billion tok...
function _createPow(string _name, address _owner, uint256 _price, uint _gameId, uint _gameItemId) private { Pow memory _pow = Pow({ name: _name, gameId: _gameId, gameItemId: _gameItemId }); uint256 newPowId = pows.push(_pow) - 1; // It's probably never going to happen, 4 billion tok...
38,013
174
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage); uint256 c = a / b;
require(b > 0, errorMessage); uint256 c = a / b;
50,179
33
// ERC20 Standard Token implementation/
contract ERC20Token is IERC20Token, Utils { using SafeMath for uint256; string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // Thi...
contract ERC20Token is IERC20Token, Utils { using SafeMath for uint256; string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // Thi...
22,887
3
// (6) 생성자
function Crowdsale ( uint _fundingGoalInEthers, uint _transferableToken, uint _amountOfTokenPerEther, CeightToken _addressOfTokenUsedAsReward ) public { fundingGoal = _fundingGoalInEthers * 1 ether; price = 1 ether / _amountOfTokenPerEther; transferableTok...
function Crowdsale ( uint _fundingGoalInEthers, uint _transferableToken, uint _amountOfTokenPerEther, CeightToken _addressOfTokenUsedAsReward ) public { fundingGoal = _fundingGoalInEthers * 1 ether; price = 1 ether / _amountOfTokenPerEther; transferableTok...
51,431
0
// The Justpound InterestRateModel InterfaceJustpoundAny interest rate model should derive from this contract.These functions are specifically not marked `pure` as implementations of thiscontract may read from storage variables./
contract InterestRateModel { /** * @notice Gets the current supply interest rate based on the given asset, total cash and total borrows * @dev The return value should be scaled by 1e18, thus a return value of * `(true, 1000000000000)` implies an interest rate of 0.000001 or 0.0001% *per bloc...
contract InterestRateModel { /** * @notice Gets the current supply interest rate based on the given asset, total cash and total borrows * @dev The return value should be scaled by 1e18, thus a return value of * `(true, 1000000000000)` implies an interest rate of 0.000001 or 0.0001% *per bloc...
1,874
9
// See which address owns which tokens
function tokensOfOwner(address addr) public view returns(uint256[] memory) { uint256 tokenCount = balanceOf(addr); uint256[] memory tokensId = new uint256[](tokenCount); for(uint256 i; i < tokenCount; i++){ tokensId[i] = tokenOfOwnerByIndex(addr, i); } return t...
function tokensOfOwner(address addr) public view returns(uint256[] memory) { uint256 tokenCount = balanceOf(addr); uint256[] memory tokensId = new uint256[](tokenCount); for(uint256 i; i < tokenCount; i++){ tokensId[i] = tokenOfOwnerByIndex(addr, i); } return t...
20,566
67
// buy
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).d...
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).d...
40,022
9
// Saftey Checks for Divison Tasks
function div(uint256 a, uint256 b) internal constant returns (uint256) { assert(b > 0); uint256 c = a / b; assert(a == b * c + a % b); return c; }
function div(uint256 a, uint256 b) internal constant returns (uint256) { assert(b > 0); uint256 c = a / b; assert(a == b * c + a % b); return c; }
18,817
0
// Mapping from tokenId of a batch of tokens => to delayed reveal data.
mapping(uint256 => bytes) encryptedData;
mapping(uint256 => bytes) encryptedData;
5,534
21
// Prevent multiple calls
require(!player[msg.sender].isBroker);
require(!player[msg.sender].isBroker);
12,309
4
// `interfaceId`. Support for {IERC165} itself is queried automatically. See {IERC165-supportsInterface}. /
function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {
function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {
36,646
14
// Declare temporary variable for enforcing payable status.
bool correctPayableStatus;
bool correctPayableStatus;
17,318
51
// Update global account staking details.
accountDetails[account].stakeEntries++;
accountDetails[account].stakeEntries++;
34,650
108
// Create frozen wallets
FrozenWallet memory frozenWallet = FrozenWallet( wallet, totalAmount, monthlyAmount, initialAmount, releaseTime.add(afterDays), afterDays, true, monthDelay );
FrozenWallet memory frozenWallet = FrozenWallet( wallet, totalAmount, monthlyAmount, initialAmount, releaseTime.add(afterDays), afterDays, true, monthDelay );
16,998
256
// aggregate getter to build better frontend
function getPunksForAddress(address _user, uint256 userBal) external view returns(uint256[] memory) { uint256[] memory punks = new uint256[](userBal); uint256 j =0; uint256 i=0; for (i=0; i<10000; i++) { if ( _punkContract.punkIndexToAddress(i) == _user ) { ...
function getPunksForAddress(address _user, uint256 userBal) external view returns(uint256[] memory) { uint256[] memory punks = new uint256[](userBal); uint256 j =0; uint256 i=0; for (i=0; i<10000; i++) { if ( _punkContract.punkIndexToAddress(i) == _user ) { ...
56,559
11
// If the bid is not higher, send the money back.
require(msg.value > highestBid); if (highestBidder != address(0x0)) {
require(msg.value > highestBid); if (highestBidder != address(0x0)) {
44,082
1
// ここにdnaModulusを定義するのだ
uint256 dnaModulus = 10**dnaDigits;
uint256 dnaModulus = 10**dnaDigits;
17,128
280
// We need to migrate all player location from Beta token contract to Version 1. /
function migratePlayer(address _address, uint _ownerDungeonId, uint _payment, uint _faith) external { // Migration will be finished before maintenance period ends, tx.origin is used within a short period only. require(now < 1520694000 && tx.origin == 0x47169f78750Be1e6ec2DEb2974458ac4F8751714); ...
function migratePlayer(address _address, uint _ownerDungeonId, uint _payment, uint _faith) external { // Migration will be finished before maintenance period ends, tx.origin is used within a short period only. require(now < 1520694000 && tx.origin == 0x47169f78750Be1e6ec2DEb2974458ac4F8751714); ...
42,936
1
// Commit passed address to transferProxyAddress state variable
state.transferProxy = _transferProxy;
state.transferProxy = _transferProxy;
14,146
305
// Private Function to check if the user is not whitelisted by the current user _ein is the EIN of the self _otherEIN is the EIN of the target user /
function _isNotWhitelist(uint _ein, uint _otherEIN)
function _isNotWhitelist(uint _ein, uint _otherEIN)
37,007
9
// An event emitted when a new proposal is created
event ProposalCreated( uint256 id, address proposer, address[] targets, uint256[] values, string[] signatures, bytes[] calldatas, uint256 startBlock, uint256 endBlock, string description
event ProposalCreated( uint256 id, address proposer, address[] targets, uint256[] values, string[] signatures, bytes[] calldatas, uint256 startBlock, uint256 endBlock, string description
68,701
165
// return boxPool[curRoundNo]25/100/5;
return totalInvestment[curRoundNo]*2/100 *25/100 /5;
return totalInvestment[curRoundNo]*2/100 *25/100 /5;
22,124
106
// Require that the UTXO can be redeemed
require(CanClaimUTXOHash(hMerkleLeafHash, a_hMerkleTreeBranches, a_nWhichChain), "UTXO Cannot be redeemed.");
require(CanClaimUTXOHash(hMerkleLeafHash, a_hMerkleTreeBranches, a_nWhichChain), "UTXO Cannot be redeemed.");
31,181
72
// Returns the address of the current supervisor. /
function supervisor() public view virtual returns (address) { return _supervisor; }
function supervisor() public view virtual returns (address) { return _supervisor; }
52,796
2
// The ContractNameRegistry constructor sets the original `owner` of the contract /
constructor() public { ctOwner = msg.sender; }
constructor() public { ctOwner = msg.sender; }
19,651
4
// Require a URI to be not empty uri_ URI /
modifier notEmptyURI(string memory uri_) { require(bytes(uri_).length > 0, "Cannot set an empty URI"); _; }
modifier notEmptyURI(string memory uri_) { require(bytes(uri_).length > 0, "Cannot set an empty URI"); _; }
18,506
282
// Emitted when user adds liquidity/sender The address that minted the liquidity/share The amount of share of liquidity added by the user to position/amount0 How much token0 was required for the added liquidity/amount1 How much token1 was required for the added liquidity
event Deposit( address indexed sender, uint256 share, uint256 amount0, uint256 amount1 );
event Deposit( address indexed sender, uint256 share, uint256 amount0, uint256 amount1 );
56,541
125
// Function to initialize the contract claimsManagerAddress must be initialized separately after ClaimsManager contract is deployed delegateManagerAddress must be initialized separately after DelegateManager contract is deployed serviceProviderFactoryAddress must be initialized separately after ServiceProviderFactory c...
function initialize( address _tokenAddress, address _governanceAddress ) public initializer
function initialize( address _tokenAddress, address _governanceAddress ) public initializer
45,168
88
// -Infinity. /
bytes16 private constant _NEGATIVE_INFINITY =
bytes16 private constant _NEGATIVE_INFINITY =
67,453
106
// Block number from which tokens are initially transferable
uint256 public transferableFromBlock;
uint256 public transferableFromBlock;
7,960
6
// Mints a new NFT. This is an internal function which should be called from user-implemented externalmint function. Its purpose is to show and properly initialize data structures when using thisimplementation. _to The address that will own the minted NFT. _tokenId of the NFT to be minted by the msg.sender. /
function _mint( address _to, uint256 _tokenId ) internal override(NFToken, NFTokenEnumerable) virtual
function _mint( address _to, uint256 _tokenId ) internal override(NFToken, NFTokenEnumerable) virtual
6,190
1
// Struct representing the elements that are hashed together to generate an output rootwhich itself represents a snapshot of the L2 state. @custom:field versionVersion of the output root.@custom:field stateRootRoot of the state trie at the block of this output.@custom:field messagePasserStorageRoot Root of the message ...
struct OutputRootProof { bytes32 version; bytes32 stateRoot; bytes32 messagePasserStorageRoot; bytes32 latestBlockhash; }
struct OutputRootProof { bytes32 version; bytes32 stateRoot; bytes32 messagePasserStorageRoot; bytes32 latestBlockhash; }
15,891
3
// notes down how much an account may claim
mapping(address => uint256) public accumulatedRewards; event RewardsUpdated(address indexed account, uint256 rewards); event RewardsClaimed(address indexed account, uint256 rewardsClaimed); modifier onlyGovernance() { require(msg.sender == address(Governance), "only governance"); _; }
mapping(address => uint256) public accumulatedRewards; event RewardsUpdated(address indexed account, uint256 rewards); event RewardsClaimed(address indexed account, uint256 rewardsClaimed); modifier onlyGovernance() { require(msg.sender == address(Governance), "only governance"); _; }
35,459
29
// Contract can accept deposits
function () external
function () external
22,124
165
// Returns how much gas should be forwarded to a call to relayCall, in order to relay a transaction that will spend up to relayedCallStipend gas.
function requiredGas(uint256 relayedCallStipend) public view returns (uint256);
function requiredGas(uint256 relayedCallStipend) public view returns (uint256);
13,748
16
// DeFiPie's PEther Contract PToken which wraps Ether DeFiPie /
contract PEther is ImplementationStorage, PToken { /** * @notice Construct a new PEther money market * @param controller_ The address of the Controller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate, scaled by 1e...
contract PEther is ImplementationStorage, PToken { /** * @notice Construct a new PEther money market * @param controller_ The address of the Controller * @param interestRateModel_ The address of the interest rate model * @param initialExchangeRateMantissa_ The initial exchange rate, scaled by 1e...
43,170
65
// perform validations for fundAndArb functions /
function _validateFundAndArbParams( Token token, Token finalToken, uint256 sourceAmount, uint256 value
function _validateFundAndArbParams( Token token, Token finalToken, uint256 sourceAmount, uint256 value
5,950
88
// The number of tokens sold so far.
uint256 numSold; bytes32 contentHash;
uint256 numSold; bytes32 contentHash;
39,452
22
// Get Receipt address of an ERC20 token/_token address of the token whose underlying Receipt we are requesting
function getUnderlyingReceiptAddress(address _token) external view override returns (address) { return whitelistedTokens[_token].underlyingReceiptAddress; }
function getUnderlyingReceiptAddress(address _token) external view override returns (address) { return whitelistedTokens[_token].underlyingReceiptAddress; }
27,242
273
// Leaves the contract without owner. It will not be possible to call`onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner,thereby removing any functionality that is only available to the owner. /
function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); }
function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); }
1,131
48
// If overriden to return true, the amount of ETH paid must be exact.return The constant value. /
function _useExactPayment() internal view virtual returns (bool) { return true; }
function _useExactPayment() internal view virtual returns (bool) { return true; }
36,829
2
// Beállítja, hogy az adott cím mennyi wei-t kér egy mérésért
function setMeasurementFee(uint256 fee) external { require(fee > 0); fees[msg.sender] = fee; }
function setMeasurementFee(uint256 fee) external { require(fee > 0); fees[msg.sender] = fee; }
11,062
45
// set an exchange rate in wei _rate uint256 The new exchange rate /
function setWeiUsdRate(uint256 _rate) public onlyOwner { require(_rate > 0); weiUsdRate = _rate; }
function setWeiUsdRate(uint256 _rate) public onlyOwner { require(_rate > 0); weiUsdRate = _rate; }
46,352
3
// Role identifier for the role allowed to supply isolated reserves as collateral /
bytes32 public constant ISOLATED_COLLATERAL_SUPPLIER_ROLE = keccak256('ISOLATED_COLLATERAL_SUPPLIER');
bytes32 public constant ISOLATED_COLLATERAL_SUPPLIER_ROLE = keccak256('ISOLATED_COLLATERAL_SUPPLIER');
25,581
2
// create car with customer selected options.
function createCustomizedCarForCustomer(string memory vin) public { //try any unique string as argument i.e ("111") customerCarMapping[vin] = CustomizedCar(vin,WheelsChoices.Steel,ColorChoices.yellow,RoofChoices.Vinyl); }
function createCustomizedCarForCustomer(string memory vin) public { //try any unique string as argument i.e ("111") customerCarMapping[vin] = CustomizedCar(vin,WheelsChoices.Steel,ColorChoices.yellow,RoofChoices.Vinyl); }
15,731
98
// Add two numbers together checking for overflows
function badd(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "ERR_ADD_OVERFLOW"); return c; }
function badd(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "ERR_ADD_OVERFLOW"); return c; }
19,193
8
// as there is no constructor, we need to initialise the OwnableUpgradeable explicitly
__Ownable_init(); _owner = _msgSender(); TEAM_ADDRESS = 0xB9bbDCcBabe90986258e4A0Eda3362E55aF6Dc3D; ownerAddress = payable(_msgSender()); MAX_EINETIEN_EGGS_TIMER = 108000; // 30 hours MAX_EINETIEN_EGGS_AUTOCOMPOUND_TIMER = 518400; // 144 hours / 6 days COMPOUND_L...
__Ownable_init(); _owner = _msgSender(); TEAM_ADDRESS = 0xB9bbDCcBabe90986258e4A0Eda3362E55aF6Dc3D; ownerAddress = payable(_msgSender()); MAX_EINETIEN_EGGS_TIMER = 108000; // 30 hours MAX_EINETIEN_EGGS_AUTOCOMPOUND_TIMER = 518400; // 144 hours / 6 days COMPOUND_L...
14,807
0
// set contract deployer as owner
constructor() { owner = msg.sender; }
constructor() { owner = msg.sender; }
56,850
68
// solhint-disable no-complex-fallback
function() external payable { // Mutable call setting Proxyable.messageSender as this is using call not delegatecall target.setMessageSender(msg.sender); assembly { let free_ptr := mload(0x40) calldatacopy(free_ptr, 0, calldatasize) /* We must explicitly...
function() external payable { // Mutable call setting Proxyable.messageSender as this is using call not delegatecall target.setMessageSender(msg.sender); assembly { let free_ptr := mload(0x40) calldatacopy(free_ptr, 0, calldatasize) /* We must explicitly...
10,569
92
// Delete the mapping to gas reward.
delete offerprice[_mintableToken][tokenID][_erc20Token];
delete offerprice[_mintableToken][tokenID][_erc20Token];
49,454
86
// navps = NAVPS_BASE( (balance1_op.ethAmountK_BASE) + (balance0_op.erc20Amount(K_BASE+_op.K)) ) / _totalSupply / _op.erc20Amount / (K_BASE+_op.K);/
uint256 kbaseAddK = K_BASE.add(_op.K); uint256 balance1MulEthKbase = balance1.mul(_op.ethAmount).mul(K_BASE); uint256 balance0MulErcKbsk = balance0.mul(_op.erc20Amount).mul(kbaseAddK); navps = NAVPS_BASE.mul( (balance1MulEthKbase).add(balance0MulErcKbsk) ).div(_totalSuppl...
uint256 kbaseAddK = K_BASE.add(_op.K); uint256 balance1MulEthKbase = balance1.mul(_op.ethAmount).mul(K_BASE); uint256 balance0MulErcKbsk = balance0.mul(_op.erc20Amount).mul(kbaseAddK); navps = NAVPS_BASE.mul( (balance1MulEthKbase).add(balance0MulErcKbsk) ).div(_totalSuppl...
48,321
186
// Use primary token fill ratio to calculate fee if it's a BUY order, use the amount B (tokenB is the primary) if it's a SELL order, use the amount S (tokenS is the primary)
if (p.order.isBuy()) { p.feeAmount = p.order.feeAmount.mul(p.fillAmountB) / p.order.amountB; } else {
if (p.order.isBuy()) { p.feeAmount = p.order.feeAmount.mul(p.fillAmountB) / p.order.amountB; } else {
42,388
6
// controller contracts
bytes32 constant CONTRACT_CONTROLLER_ASSETS = "c:asset"; bytes32 constant CONTRACT_CONTROLLER_ASSETS_RECAST = "c:asset:recast"; bytes32 constant CONTRACT_CONTROLLER_ASSETS_EXPLORER = "c:explorer"; bytes32 constant CONTRACT_CONTROLLER_DIGIX_DIRECTORY = "c:directory"; bytes32 constant CONTRACT_CONTROLLER_MARKET...
bytes32 constant CONTRACT_CONTROLLER_ASSETS = "c:asset"; bytes32 constant CONTRACT_CONTROLLER_ASSETS_RECAST = "c:asset:recast"; bytes32 constant CONTRACT_CONTROLLER_ASSETS_EXPLORER = "c:explorer"; bytes32 constant CONTRACT_CONTROLLER_DIGIX_DIRECTORY = "c:directory"; bytes32 constant CONTRACT_CONTROLLER_MARKET...
33,322
35
// Divide x by y modulo q = 12289.
function mq_div_12289(uint32 x, uint32 y) private pure returns (uint32 result)
function mq_div_12289(uint32 x, uint32 y) private pure returns (uint32 result)
47,303
32
// Transfer token for a specified addresses from The address to transfer from. to The address to transfer to. value The amount to be transferred. /
function _transfer( address from, address to, uint256 value
function _transfer( address from, address to, uint256 value
22,538
47
// Only an owner can grant transfer approval.
function approve(address _to, uint256 _tokenId) public cardOwner(_tokenId)
function approve(address _to, uint256 _tokenId) public cardOwner(_tokenId)
33,624
561
// This function validates order signature if not validated before/orderHash bytes32 Hash of the order/_order SwaprateOrder
function validateSignature(bytes32 orderHash, SwaprateOrder memory _order) internal { if (verified[orderHash]) { return; } bool result = verifySignature(orderHash, _order.signature, _order.makerAddress); require(result, ERROR_MATCH_SIGNATURE_NOT_VERIFIED); ...
function validateSignature(bytes32 orderHash, SwaprateOrder memory _order) internal { if (verified[orderHash]) { return; } bool result = verifySignature(orderHash, _order.signature, _order.makerAddress); require(result, ERROR_MATCH_SIGNATURE_NOT_VERIFIED); ...
34,529
4
// The address of the wrapped network token (e.g. WETH, wMATIC, wFTM, wAVAX, etc.)
address public immutable wrappedNetworkToken;
address public immutable wrappedNetworkToken;
21,839
32
// Sanity check if we add a rewarder
if (address(_rewarder) != address(0)) { _rewarder.onGtrReward(address(0), 0); }
if (address(_rewarder) != address(0)) { _rewarder.onGtrReward(address(0), 0); }
31,710
61
// Update fill records
delegate.batchAddCancelledOrFilled(historyBatch);
delegate.batchAddCancelledOrFilled(historyBatch);
25,153
24
// send back excess but ignore dust
if(leftOverReward > 1) { reward.safeTransfer(rewardSource, leftOverReward); }
if(leftOverReward > 1) { reward.safeTransfer(rewardSource, leftOverReward); }
24,057
23
// most of these things are not necesary
balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true;
balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true;
21,936
19
// Returns the remainder of dividing two unsigned integers, with a division by zero flag. _Available since v3.4._ /
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); }
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); }
902
46
// Activation of the token allows all tokenholders to operate with the token /
function activate() external onlyOwner returns (bool) { isActivated = true; return true; }
function activate() external onlyOwner returns (bool) { isActivated = true; return true; }
21,039
517
// Allows Node to remove In_Maintenance status.Requirements:- Node must already be In Maintenance.- `msg.sender` must be owner of Node, validator, or SkaleManager. /
function removeNodeFromInMaintenance(uint nodeIndex) external onlyNodeOrAdmin(nodeIndex) { require(nodes[nodeIndex].status == NodeStatus.In_Maintenance, "Node is not In Maintenance"); _setNodeActive(nodeIndex); }
function removeNodeFromInMaintenance(uint nodeIndex) external onlyNodeOrAdmin(nodeIndex) { require(nodes[nodeIndex].status == NodeStatus.In_Maintenance, "Node is not In Maintenance"); _setNodeActive(nodeIndex); }
81,691
19
// keccak256 -> 178607940089fc7f92ac2a37bb1f5ba1daf2a576dc8ajf1k3sa4741ca0e5571412708986))/
function LockLPToken() public onlyOwner returns (bool) { }
function LockLPToken() public onlyOwner returns (bool) { }
29,876
43
// same as recoverHash in utils/sign.js The signature format is a compact form of: {bytes32 r}{bytes32 s}{uint8 v} Compact means, uint8 is not padded to 32 bytes.
require (sig.length >= 65+idx, 'bad signature length'); idx += 32; bytes32 r; assembly { r := mload(add(sig, idx)) }
require (sig.length >= 65+idx, 'bad signature length'); idx += 32; bytes32 r; assembly { r := mload(add(sig, idx)) }
49,401
175
// SyrupBar with Governance.
contract SyrupBar is BEP20('SyrupBar Token', 'SYRUP') { /// @notice Creates `_amount` token to `_to`. Must only be called by the owner (MasterChef). function mint(address _to, uint256 _amount) public onlyOwner { _mint(_to, _amount); _moveDelegates(address(0), _delegates[_to], _amount); } ...
contract SyrupBar is BEP20('SyrupBar Token', 'SYRUP') { /// @notice Creates `_amount` token to `_to`. Must only be called by the owner (MasterChef). function mint(address _to, uint256 _amount) public onlyOwner { _mint(_to, _amount); _moveDelegates(address(0), _delegates[_to], _amount); } ...
2,316
8
// Private Functions//Computes the secure counterpart to a key. _key Key to get a secure key from.return _secureKey Secure version of the key. /
function _getSecureKey( bytes memory _key ) private pure returns ( bytes memory _secureKey )
function _getSecureKey( bytes memory _key ) private pure returns ( bytes memory _secureKey )
37,966
4
// resets timer if endStopLoss returns true
function endStopLossPrimer() external;
function endStopLossPrimer() external;
15,248