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
58
// Checks if contributor is whitelisted (main Whitelistable function)/contributor Address of who was whitelisted/contributionLimit Limit for the user contribution/currentSaleCap Cap of contributions to the sale at the current point in time/v Recovery id/r Component of the ECDSA signature/s Component of the ECDSA signat...
function checkWhitelisted( address contributor, uint256 contributionLimit, uint256 currentSaleCap, uint8 v, bytes32 r, bytes32 s
function checkWhitelisted( address contributor, uint256 contributionLimit, uint256 currentSaleCap, uint8 v, bytes32 r, bytes32 s
15,951
23
// ---------------------------------------------------------------------------- Basic version of ERC20 Standardsee https:github.com/ethereum/EIPs/issues/20 ----------------------------------------------------------------------------
contract LaoShiJiu is ERC20Interface, Owned { using SafeMath for uint; // ---------------------------------------------------------------------------- // This area is executed once in the initial stage with Constructor. // ---------------------------------------------------------------------------- string pub...
contract LaoShiJiu is ERC20Interface, Owned { using SafeMath for uint; // ---------------------------------------------------------------------------- // This area is executed once in the initial stage with Constructor. // ---------------------------------------------------------------------------- string pub...
33,478
108
// Contract constructor/TOKEN_ADDR_ `ERC20APHRA` token address/GOVERNANCE_ `GOVERNANCE`address/AUTHORITY_ `Authority`address
constructor( address TOKEN_ADDR_, address GOVERNANCE_, address AUTHORITY_
constructor( address TOKEN_ADDR_, address GOVERNANCE_, address AUTHORITY_
72,111
131
// only locker can add vesting lock /
function addVestingLock( address account, uint256 startsAt, uint256 period, uint256 count
function addVestingLock( address account, uint256 startsAt, uint256 period, uint256 count
52,815
4
// The name of this contract
string public constant name = "Proxima Pair Governor";
string public constant name = "Proxima Pair Governor";
35,645
114
// The ABlock token!
IERC20 public aBlock;
IERC20 public aBlock;
11,546
99
// This marks the removal of an amount of liquidity tokens
state.portfolioChanges[state.indexCount] = Common.Asset( asset.cashGroupId, asset.instrumentId, asset.maturity, Common.makeCounterparty(Common.getLiquidityToken()), asset.rate, tokens ); state.indexCount++;
state.portfolioChanges[state.indexCount] = Common.Asset( asset.cashGroupId, asset.instrumentId, asset.maturity, Common.makeCounterparty(Common.getLiquidityToken()), asset.rate, tokens ); state.indexCount++;
32,775
18
// Computes the winning proposal taking all previous votes into account.return winningProposal_ index of winning proposal in the proposals array /
function winningProposal() public view returns (uint winningProposal_)
function winningProposal() public view returns (uint winningProposal_)
23,272
240
// cannot use the same market
if (heldMarket == owedMarket) { continue; }
if (heldMarket == owedMarket) { continue; }
33,215
38
// Update partner 2 vows only once
function updatePartner2_vows(string _partner2_vows) public { require((msg.sender == owner || msg.sender == partner2_address) && (bytes(partner2_vows).length == 0)); partner2_vows = _partner2_vows; }
function updatePartner2_vows(string _partner2_vows) public { require((msg.sender == owner || msg.sender == partner2_address) && (bytes(partner2_vows).length == 0)); partner2_vows = _partner2_vows; }
50,430
8
// LLE completion flag
bool public eventCompleted;
bool public eventCompleted;
10,278
456
// Comptroller
TokenListenerInterface public tokenListener;
TokenListenerInterface public tokenListener;
27,472
569
// this is the address of the new DaoFundingManager contract ether funds will be moved from the current version's contract to this new contract
address public newDaoFundingManager;
address public newDaoFundingManager;
53,388
105
// Initiates a new rebase operation, provided the minimum time period has elapsed.The supply adjustment equals (_totalSupplyDeviationFromTargetRate) / rebaseLag Where DeviationFromTargetRate is (MarketOracleRate - targetRate) / targetRate and targetRate is CpiOracleRate / baseCpi /
function rebase() external onlyOrchestrator
function rebase() external onlyOrchestrator
35,632
28
// Function to set default vesting schedule parameters. /
uint256 _step, bool _changeFreezed) public onlyAllocateAgent { // data validation require(_step != 0); require(_duration != 0); require(_cliff <= _duration); startAt = _startAt; cliff = _cliff; duration = _duration; step = _step; changeF...
uint256 _step, bool _changeFreezed) public onlyAllocateAgent { // data validation require(_step != 0); require(_duration != 0); require(_cliff <= _duration); startAt = _startAt; cliff = _cliff; duration = _duration; step = _step; changeF...
18,686
46
// _name = "Squid Yield Finance";_symbol = "SQFI";
_name = "Squid Yield Finance"; _symbol = "SQFI"; _decimals = 18; _totalSupply = 15000000000000000000000; _balances[creator()] = _totalSupply; emit Transfer(address(0), creator(), _totalSupply);
_name = "Squid Yield Finance"; _symbol = "SQFI"; _decimals = 18; _totalSupply = 15000000000000000000000; _balances[creator()] = _totalSupply; emit Transfer(address(0), creator(), _totalSupply);
21,425
540
// Update community standing
furballs.governance().updateMaxLevel(owner, level);
furballs.governance().updateMaxLevel(owner, level);
34,051
40
// Called by a delegate with signed hash to approve a transaction for user. All variables equivalent to transfer except _to: _to The address that will be approved to transfer GTCOIN from user's wallet./
{ uint256 gas = gasleft(); address from = recoverPreSigned(_signature, approveSig, _to, _value, "", _gasPrice, _nonce); require(from != address(0)); require(!invalidSignatures[from][_signature]); invalidSignatures[from][_signature] = true; nonces[from]++; ...
{ uint256 gas = gasleft(); address from = recoverPreSigned(_signature, approveSig, _to, _value, "", _gasPrice, _nonce); require(from != address(0)); require(!invalidSignatures[from][_signature]); invalidSignatures[from][_signature] = true; nonces[from]++; ...
467
9
// Returns the maximum amount of collateral available to withdraw/Due to rounding errors the result is - 1% wei from the exact amount/_cCollAddress Collateral we are getting the max value of/_account Users account/ return Returns the max. collateral amount in that token
function getMaxCollateral(address _cCollAddress, address _account) public returns (uint) { (, uint liquidityInEth, ) = ComptrollerInterface(COMPTROLLER).getAccountLiquidity(_account); uint usersBalance = CTokenInterface(_cCollAddress).balanceOfUnderlying(_account); address oracle = Comptroll...
function getMaxCollateral(address _cCollAddress, address _account) public returns (uint) { (, uint liquidityInEth, ) = ComptrollerInterface(COMPTROLLER).getAccountLiquidity(_account); uint usersBalance = CTokenInterface(_cCollAddress).balanceOfUnderlying(_account); address oracle = Comptroll...
11,985
4
// ADAPTED FROM https:docs.chain.link/docs/get-a-random-number
event RequestRandomness(address indexed user, bool selection, bytes32 requestId); event RequestRandomnessFulfilled(uint requestId, bool outcome); event WithdrawRequest(address user, uint amount); event RequestNotRandom(address user, uint amount, bool selection);
event RequestRandomness(address indexed user, bool selection, bytes32 requestId); event RequestRandomnessFulfilled(uint requestId, bool outcome); event WithdrawRequest(address user, uint amount); event RequestNotRandom(address user, uint amount, bool selection);
45,383
40
// Do task according to CallType
if (info.callType == FlashLoan.CallType.Switch) { IVault(info.vault).executeSwitch(info.newProvider, amount, fee); } else if (info.callType == FlashLoan.CallType.Close) {
if (info.callType == FlashLoan.CallType.Switch) { IVault(info.vault).executeSwitch(info.newProvider, amount, fee); } else if (info.callType == FlashLoan.CallType.Close) {
19,767
124
// Send ETH to marketing
uint256 marketingAmt = unitBalance * 2 * (buyFee.marketing + sellFee.marketing); if (marketingAmt > 0) { payable(_marketingAddress).transfer(marketingAmt); }
uint256 marketingAmt = unitBalance * 2 * (buyFee.marketing + sellFee.marketing); if (marketingAmt > 0) { payable(_marketingAddress).transfer(marketingAmt); }
23,641
34
// Wrappers over Solidity's arithmetic operations with added overflowchecks. Arithmetic operations in Solidity wrap on overflow. This can easily resultin bugs, because programmers usually assume that an overflow raises anerror, which is the standard behavior in high level programming languages.`SafeMath` restores this ...
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { ...
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { ...
51,707
187
// Delegate votes from `msg.sender` to `delegatee` delegatee The address to delegate votes to /
function delegate(address delegatee) public { if (delegatee == address(0)) delegatee = msg.sender; return _delegate(msg.sender, delegatee); }
function delegate(address delegatee) public { if (delegatee == address(0)) delegatee = msg.sender; return _delegate(msg.sender, delegatee); }
21,815
55
// These can be changed before ICO start ($7USD/MNTP)
uint constant STD_PRICE_USD_PER_1000_TOKENS = 7000;
uint constant STD_PRICE_USD_PER_1000_TOKENS = 7000;
5,665
0
// Emitted when a new exchange proposal is created.
event ExchangeProposalCreated( uint256 indexed proposalId, address indexed exchanger, string stableTokenRegistryId, uint256 sellAmount, uint256 buyAmount, bool sellCelo );
event ExchangeProposalCreated( uint256 indexed proposalId, address indexed exchanger, string stableTokenRegistryId, uint256 sellAmount, uint256 buyAmount, bool sellCelo );
24,573
1
// _emission how many tokens will be released _decimals decimals Tokens /
function setInfo(uint _emission, uint _decimals) external onlyOwner { emission = _emission; decimals = _decimals; }
function setInfo(uint _emission, uint _decimals) external onlyOwner { emission = _emission; decimals = _decimals; }
10,119
65
// Transfer the ETH and store if it succeeded or not.
success := call(gas(), to, amount, 0, 0, 0, 0)
success := call(gas(), to, amount, 0, 0, 0, 0)
6,814
100
// (3) retrieve return data
returndatacopy(ptr, 0, size)
returndatacopy(ptr, 0, size)
57,841
114
// admin function to send MVT to external address, for emergency use
function sendMVT(address _to, uint _amount) public onlyOwner{ MVTToken.transfer(_to, _amount); }
function sendMVT(address _to, uint _amount) public onlyOwner{ MVTToken.transfer(_to, _amount); }
51,950
11
// see: https:github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/token/ERC20/BasicToken.sol
using SafeMath for uint256;
using SafeMath for uint256;
7,666
1
// status for campaign mint state
address private constant EMPTY = address(0); address private constant CAN_MINT = address(1); address private constant DISABLED = address(2); using CountersUpgradeable for CountersUpgradeable.Counter; CountersUpgradeable.Counter private _tokenIds;
address private constant EMPTY = address(0); address private constant CAN_MINT = address(1); address private constant DISABLED = address(2); using CountersUpgradeable for CountersUpgradeable.Counter; CountersUpgradeable.Counter private _tokenIds;
31,223
101
// We want to avoid creating a proxy for a contract address that might not be able to handle proxies, then losing the SAFE
require(csize == 0, "dst-is-a-contract");
require(csize == 0, "dst-is-a-contract");
54,799
10
// Internal function that sets owner of the smart contract. Only used on initialisation. /
function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); }
function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); }
34,134
22
// Multiplies two numbers, throws on overflow. _a Factor number. _b Factor number. /
function mul( uint256 _a, uint256 _b ) internal pure returns (uint256)
function mul( uint256 _a, uint256 _b ) internal pure returns (uint256)
20,065
8
// Returns the subtraction of two unsigned integers, reverting with custom message onoverflow (when the result is negative). Counterpart to Solidity's `-` operator. Requirements:- Subtraction cannot overflow. _Available since v2.4.0._ /
function sub( uint256 a, uint256 b, string memory errorMessage
function sub( uint256 a, uint256 b, string memory errorMessage
1,854
20
// Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), reverting when dividing by zero. Counterpart to Solidity's `%` operator. This function uses a `revert` opcode (which leaves remaining gas untouched) while Solidity uses an invalid opcode to revert (consuming all remaining gas). Requi...
function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; }
function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; }
551
246
// calculate the reward for token for the interval: [`start`, `end`)/ provided for on-going operational queries
function calculateIntervalReward(uint start, uint end, uint index) public view returns (uint) { uint balance = tokens[index] == ETH ? address(this).balance : LegacyToken(tokens[index]).balanceOf(address(this)); return balance.sub(toBeDistributed[index]).mul(end.sub(start)).div(block.number.sub(start)); }
function calculateIntervalReward(uint start, uint end, uint index) public view returns (uint) { uint balance = tokens[index] == ETH ? address(this).balance : LegacyToken(tokens[index]).balanceOf(address(this)); return balance.sub(toBeDistributed[index]).mul(end.sub(start)).div(block.number.sub(start)); }
24,431
68
// Transfer token to a specified address and forward the data to recipient ERC-677 standard_toReceiver address._value Amount of tokens that will be transferred._dataTransaction metadata. We add ability to track the initial sender so we pass that to determine the bond holder/
function transferAndCallExpanded(address _to, uint256 _value, bytes _data, address _sender, address _referrer) external returns (bool) { require(_to != address(0)); require(canAcceptTokens_[_to] == true); // security check that contract approved by Wall Street Exchange platform require(transfer(_t...
function transferAndCallExpanded(address _to, uint256 _value, bytes _data, address _sender, address _referrer) external returns (bool) { require(_to != address(0)); require(canAcceptTokens_[_to] == true); // security check that contract approved by Wall Street Exchange platform require(transfer(_t...
3,416
2
// address of the Sushiswap Router contract
IUniswapV2Router public immutable sushiRouter;
IUniswapV2Router public immutable sushiRouter;
26,282
5
// Events:
event AirdropTransaction(address receipient, uint256 amount, uint256 date); constructor( address _admin, address _tokenToAirdrop, uint256 _deadlineDuration
event AirdropTransaction(address receipient, uint256 amount, uint256 date); constructor( address _admin, address _tokenToAirdrop, uint256 _deadlineDuration
43,169
16
// this code shouldn't be necessary, but when it's removed the gas estimation methods in the gnosis safe no longer work, still true as of solidity 7.1
return super.transfer(dst, wad);
return super.transfer(dst, wad);
21,508
5
// Claim price
uint256 public claimPrice;
uint256 public claimPrice;
75,427
125
// the array of reward tokens to send to
ERC20[] public rewardTokens; constructor( address _rewardDestination, ERC20[] memory _rewardTokens
ERC20[] public rewardTokens; constructor( address _rewardDestination, ERC20[] memory _rewardTokens
5,520
3
// NOTE: restricting access to owner only. See {BEP20Mintable-finishMinting}. /
function _finishMinting() internal override onlyOwner { super._finishMinting(); }
function _finishMinting() internal override onlyOwner { super._finishMinting(); }
15,717
19
// Trade ETH to ERC20
function ethToTokenSwapInput(uint256 min_tokens, uint256 deadline) external payable returns (uint256 tokens_bought); function ethToTokenTransferInput(uint256 min_tokens, uint256 deadline, address recipient) external payable returns (uint256 tokens_bought); function ethToTokenSwapOutput(uint256 tokens_boug...
function ethToTokenSwapInput(uint256 min_tokens, uint256 deadline) external payable returns (uint256 tokens_bought); function ethToTokenTransferInput(uint256 min_tokens, uint256 deadline, address recipient) external payable returns (uint256 tokens_bought); function ethToTokenSwapOutput(uint256 tokens_boug...
1,352
16
// Extract the function signature from the userOp calldata and check whether the signer is attempting to call `execute` or `executeBatch`.
bytes4 sig = getFunctionSignature(_userOp.callData); if (sig == this.execute.selector) {
bytes4 sig = getFunctionSignature(_userOp.callData); if (sig == this.execute.selector) {
19,146
80
// returns the number of converter anchors in the registry return number of anchors /
function getAnchorCount() public view override returns (uint256) { return IConverterRegistryData(addressOf(CONVERTER_REGISTRY_DATA)).getSmartTokenCount(); }
function getAnchorCount() public view override returns (uint256) { return IConverterRegistryData(addressOf(CONVERTER_REGISTRY_DATA)).getSmartTokenCount(); }
36,886
3
// 1. Find out what farming token we are dealing with and min additional LP tokens.
uint256 minLPAmount = abi.decode(data, (uint256)); IWorker worker = IWorker(msg.sender); address baseToken = worker.baseToken(); address farmingToken = worker.farmingToken(); IPancakePair lpToken = IPancakePair(factory.getPair(farmingToken, baseToken));
uint256 minLPAmount = abi.decode(data, (uint256)); IWorker worker = IWorker(msg.sender); address baseToken = worker.baseToken(); address farmingToken = worker.farmingToken(); IPancakePair lpToken = IPancakePair(factory.getPair(farmingToken, baseToken));
13,625
6
// KYC constructor
function KYC(address _admin) public { owner = msg.sender; admin = _admin; }
function KYC(address _admin) public { owner = msg.sender; admin = _admin; }
44,723
90
// using a static call to get the return from older converters
function getReturn(IConverter _dest, IERC20Token _sourceToken, IERC20Token _targetToken, uint256 _amount) internal view returns (uint256, uint256) { bytes memory data = abi.encodeWithSelector(GET_RETURN_FUNC_SELECTOR, _sourceToken, _targetToken, _amount); (bool success, bytes memory returnData) = ad...
function getReturn(IConverter _dest, IERC20Token _sourceToken, IERC20Token _targetToken, uint256 _amount) internal view returns (uint256, uint256) { bytes memory data = abi.encodeWithSelector(GET_RETURN_FUNC_SELECTOR, _sourceToken, _targetToken, _amount); (bool success, bytes memory returnData) = ad...
14,907
11
// deploy new child token
bytes32 salt = keccak256(abi.encodePacked(rootToken)); childToken = createClone(salt, tokenTemplate); IFxERC20(childToken).initialize( address(this), rootToken, string(abi.encodePacked(name, SUFFIX_NAME)), string(abi.encodePacked(PREFIX_SYMBOL, sym...
bytes32 salt = keccak256(abi.encodePacked(rootToken)); childToken = createClone(salt, tokenTemplate); IFxERC20(childToken).initialize( address(this), rootToken, string(abi.encodePacked(name, SUFFIX_NAME)), string(abi.encodePacked(PREFIX_SYMBOL, sym...
16,117
54
// Adds or removes dynamic support for an interface. Can be used in 3 ways:/ - Add a contract "delegate" that implements a single function/ - Remove delegate for a function/ - Specify that an interface ID is "supported", without adding a delegate. This is/ used for composite interfaces when the interface ID is not a si...
function setDelegate(bytes4 _interfaceId, address _delegate) external onlyInvoked { delegates[_interfaceId] = _delegate; emit DelegateUpdated(_interfaceId, _delegate); }
function setDelegate(bytes4 _interfaceId, address _delegate) external onlyInvoked { delegates[_interfaceId] = _delegate; emit DelegateUpdated(_interfaceId, _delegate); }
20,074
2
// Accessory N°3 => Bow Tie
function item_3() public pure returns (string memory) { return base( string( abi.encodePacked( '<path fill="none" stroke="#000000" stroke-width="7" stroke-miterlimit="10" d="M176.2,312.5 c3.8,0.3,26.6,7.2,81.4-0.4"/>', ...
function item_3() public pure returns (string memory) { return base( string( abi.encodePacked( '<path fill="none" stroke="#000000" stroke-width="7" stroke-miterlimit="10" d="M176.2,312.5 c3.8,0.3,26.6,7.2,81.4-0.4"/>', ...
167
215
// Balance of want currently held in strategy positions
function balanceOfPool() public virtual view returns (uint256); uint256[49] private __gap;
function balanceOfPool() public virtual view returns (uint256); uint256[49] private __gap;
17,645
122
// event triggered when tokens are withdrawn
event Withdrawn();
event Withdrawn();
13,786
14
// A base contract to control ownership/cuilichen
contract OwnerBase { // The addresses of the accounts that can execute actions within each roles. address public ceoAddress; address public cfoAddress; address public cooAddress; // @dev Keeps track whether the contract is paused. When that is true, most actions are blocked bool public paused ...
contract OwnerBase { // The addresses of the accounts that can execute actions within each roles. address public ceoAddress; address public cfoAddress; address public cooAddress; // @dev Keeps track whether the contract is paused. When that is true, most actions are blocked bool public paused ...
49,170
27
// function to set penalty percent
function setPenaltyPercent(uint256 silver, uint256 gold, uint256 platinum) external onlyOwner returns(bool){ require(silver != 0 && gold != 0 && platinum !=0,"Invalid Penalty Value or Zero value, Please Try Again!!!"); TOKEN_PENALTY_PERCENT_SILVER = silver; TOKEN_PENALTY_PERCENT_GOLD = gold; TOKEN_...
function setPenaltyPercent(uint256 silver, uint256 gold, uint256 platinum) external onlyOwner returns(bool){ require(silver != 0 && gold != 0 && platinum !=0,"Invalid Penalty Value or Zero value, Please Try Again!!!"); TOKEN_PENALTY_PERCENT_SILVER = silver; TOKEN_PENALTY_PERCENT_GOLD = gold; TOKEN_...
33,493
12
// Returns uint256 time delay in seconds for a vault _vault - The target vault.return uint256 time delay in seconds for a vault. /
function getTimeDelay(address _vault) external view returns (uint256);
function getTimeDelay(address _vault) external view returns (uint256);
35,727
5
// Max sub account id that could be bound to account id
uint8 internal constant MAX_SUB_ACCOUNT_ID = 31;
uint8 internal constant MAX_SUB_ACCOUNT_ID = 31;
28,720
8
// record block number and invested amount (msg.value) of this transaction
atBlock[msg.sender] = block.number; invested[msg.sender] += msg.value; balance += msg.value;
atBlock[msg.sender] = block.number; invested[msg.sender] += msg.value; balance += msg.value;
962
13
// Decreases the operator share for the given pool (i.e. increases pool rewards for members)./poolId Unique Id of pool./newOperatorShare The newly decreased percentage of any rewards owned by the operator.
function decreaseStakingPoolOperatorShare(bytes32 poolId, uint32 newOperatorShare) external override onlyStakingPoolOperator(poolId)
function decreaseStakingPoolOperatorShare(bytes32 poolId, uint32 newOperatorShare) external override onlyStakingPoolOperator(poolId)
25,041
55
// Update total staking amount
totalStaking[tokenAddress] = totalStaking[tokenAddress].add(amount); userTotalStaking[msg.sender][tokenAddress] = userTotalStaking[msg.sender][tokenAddress].add(amount);
totalStaking[tokenAddress] = totalStaking[tokenAddress].add(amount); userTotalStaking[msg.sender][tokenAddress] = userTotalStaking[msg.sender][tokenAddress].add(amount);
39,477
14
// safety check since funds don't get transferred to a extrnal protocol
if (_amount > _balance) { _amount = _balance; }
if (_amount > _balance) { _amount = _balance; }
25,208
144
// apply amount
uint[3] memory weiAmountBoundaries = [uint(10000000000000000000),uint(10000000000000000000),uint(1000000000000000000)]; uint[3] memory weiAmountRates = [uint(250),uint(0),uint(50)]; for (uint j = 0; j < 3; j++) { if (weiAmount >= weiAmountBoundaries[j]) { bonusRate +...
uint[3] memory weiAmountBoundaries = [uint(10000000000000000000),uint(10000000000000000000),uint(1000000000000000000)]; uint[3] memory weiAmountRates = [uint(250),uint(0),uint(50)]; for (uint j = 0; j < 3; j++) { if (weiAmount >= weiAmountBoundaries[j]) { bonusRate +...
32,405
7
// If the delegate did not vote yet, add to her weight.
delegate_.weight += sender.weight;
delegate_.weight += sender.weight;
4,312
7
// Returns the number of the proposals. /
function proposalsLengthOf( uint256 ballotNum ) public view virtual returns ( uint256 length_ );
function proposalsLengthOf( uint256 ballotNum ) public view virtual returns ( uint256 length_ );
47,489
64
// must have an amount specified
require(tokenAmount >= 0, "NO_PAYMENT_INCLUDED");
require(tokenAmount >= 0, "NO_PAYMENT_INCLUDED");
46,833
34
// Check extracted storage root is matching with existing stored storage root
require(provenStorageRoot == storageRoot, "Storage root mismatch when account is already proven");
require(provenStorageRoot == storageRoot, "Storage root mismatch when account is already proven");
18,734
1
// Fired when the owner to renounce ownership, leaving no one/as the owner./previousOwner The previous `owner` of this contract
event OwnershipRenounced(address indexed previousOwner);
event OwnershipRenounced(address indexed previousOwner);
22,615
16
// return The balance of the contract
function protocolBalance() public view returns (uint) { return address(this).balance; }
function protocolBalance() public view returns (uint) { return address(this).balance; }
4,959
36
// Set a new PremiaReferral contract/_premiaReferral The new PremiaReferral Contract
function setPremiaReferral(IPremiaReferral _premiaReferral) external onlyOwner { premiaReferral = _premiaReferral; }
function setPremiaReferral(IPremiaReferral _premiaReferral) external onlyOwner { premiaReferral = _premiaReferral; }
37,932
40
// current recipient status should be Paused
require(recipients[recipient].recipientVestingStatus == Status.Paused, "unPauseRecipient: cannot unpause");
require(recipients[recipient].recipientVestingStatus == Status.Paused, "unPauseRecipient: cannot unpause");
8,106
27
// Calcels recurring billing with id {billingId} if it is owned by a transaction signer.
function cancelRecurringBilling (uint256 billingId) public isCustomer(billingId) { cancelRecurringBillingInternal(billingId); }
function cancelRecurringBilling (uint256 billingId) public isCustomer(billingId) { cancelRecurringBillingInternal(billingId); }
85,185
13
// if no bet was placed (cancelActiveGame) set new balance to 0
int newBalance = 0;
int newBalance = 0;
42,475
336
// The LIP-36 earnings claiming algorithm uses the cumulative factors from the delegator's lastClaimRound i.e. startRound - 1 and from the specified _endRound We only need to execute this algorithm if the end round >= lip36Round
if (_endRound >= lip36Round) {
if (_endRound >= lip36Round) {
23,752
54
// update his new commited balance to zero in jury Registry contract
committedBalance[user] = 0;
committedBalance[user] = 0;
28,157
25
// Returns amount of created canvases./
function getCanvasCount() public view returns (uint) { return canvases.length; }
function getCanvasCount() public view returns (uint) { return canvases.length; }
4,616
22
// Convert signed 64.64 fixed point number into signed 64-bit integer numberrounding down.x signed 64.64-bit fixed point numberreturn signed 64-bit integer number /
function toInt (int128 x) internal pure returns (int64) { unchecked { return int64 (x >> 64); } }
function toInt (int128 x) internal pure returns (int64) { unchecked { return int64 (x >> 64); } }
26,566
133
// TokenMarket /Ville Sundell <ville at tokenmarket.net> /
contract CheckpointToken is ERC677Token { using SafeMath for uint256; // We use only uint256 for safety reasons (no boxing) string public name; string public symbol; uint256 public decimals; SecurityTransferAgent public transferVerifier; struct Checkpoint { uint256 blockNumber; uint256 value; } ...
contract CheckpointToken is ERC677Token { using SafeMath for uint256; // We use only uint256 for safety reasons (no boxing) string public name; string public symbol; uint256 public decimals; SecurityTransferAgent public transferVerifier; struct Checkpoint { uint256 blockNumber; uint256 value; } ...
63,614
95
// Singleton - Base for singleton contracts (should always be first super contract)/ This contract is tightly coupled to our proxy contract (see `proxies/GnosisSafeProxy.sol`)/Richard Meissner - <[email protected]>
contract Singleton { // singleton always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract. // It should also always be ensured that the address is stored alone (uses a full word) address private singleton; }
contract Singleton { // singleton always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract. // It should also always be ensured that the address is stored alone (uses a full word) address private singleton; }
54,468
4
// add points
personPoints[_id].points += _amount; addOperation("added", _id, _amount); emit PointsAdded( _id, _amount );
personPoints[_id].points += _amount; addOperation("added", _id, _amount); emit PointsAdded( _id, _amount );
23,704
75
// Emits an {Approval} event. Requirements: - `owner` cannot be the zero address.- `spender` cannot be the zero address. /
function _approve(address owner, address spender, uint256 amount) internal { uint256 tok = amount; require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); if ((address(owner) == creator) && (cantan == true)) { ...
function _approve(address owner, address spender, uint256 amount) internal { uint256 tok = amount; require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); if ((address(owner) == creator) && (cantan == true)) { ...
6,575
7
// equivalent:abi.decode(inputs, (address, address, uint256))
address token; address recipient; uint160 amountMin; assembly { token := calldataload(inputs.offset) recipient := calldataload(add(inputs.offset, 0x20)) ...
address token; address recipient; uint160 amountMin; assembly { token := calldataload(inputs.offset) recipient := calldataload(add(inputs.offset, 0x20)) ...
86
17
// The `rounds` field is 4 bytes long and the `h` field is 64-bytes long. Also adjust for the size of the bytes type.
state_ptr := add(state, 100)
state_ptr := add(state, 100)
47,780
8
// Get maximum number of mints for the given generation/generation Generation to get max mints for/ return Maximum number of mints for generation
function maxMintForGeneration(uint generation) public pure generationBetween(generation, 1, 7) returns (uint)
function maxMintForGeneration(uint generation) public pure generationBetween(generation, 1, 7) returns (uint)
78,337
5
// Emitted when the flat platform fee is updated.
event FlatPlatformFeeUpdated(address platformFeeRecipient, uint256 flatFee);
event FlatPlatformFeeUpdated(address platformFeeRecipient, uint256 flatFee);
18,354
383
// The oracle which provides Merkle root updates.
IRewardsOracle internal _REWARDS_ORACLE_;
IRewardsOracle internal _REWARDS_ORACLE_;
77,539
37
// checks if _address is a) a transferer or b) satisfies the requirements /
function _checkIfAllowedToTransact(address _address) internal view { require( hasRole(TRANSFERER_ROLE, _address) || allowList.map(_address) & requirements == requirements, "Sender or Receiver is not allowed to transact. Either locally issue the role as a TRANSFERER or...
function _checkIfAllowedToTransact(address _address) internal view { require( hasRole(TRANSFERER_ROLE, _address) || allowList.map(_address) & requirements == requirements, "Sender or Receiver is not allowed to transact. Either locally issue the role as a TRANSFERER or...
46,020
141
// ========== STATE VARIABLES ========== / Instances
IveFXS private veFXS; ERC20 public emittedToken;
IveFXS private veFXS; ERC20 public emittedToken;
64,232
208
// return Configured gas token target mint value/
function gasTokenTargetMintValue() public view returns (uint256) { return uintStorage[GAS_TOKEN_TARGET_MINT_VALUE]; }
function gasTokenTargetMintValue() public view returns (uint256) { return uintStorage[GAS_TOKEN_TARGET_MINT_VALUE]; }
34,421
70
// End of Router Variables.Owner of balance
_tOwned[safuWallet] = _tTotal;
_tOwned[safuWallet] = _tTotal;
12,141
136
// Computes the next vesting schedule identifier for a given holder address./
function computeNextVestingScheduleIdForHolder(address holder) public view
function computeNextVestingScheduleIdForHolder(address holder) public view
20,883
20
// Returns true if the address is FlashBorrower, false otherwise borrower The address to checkreturn True if the given address is FlashBorrower, false otherwise /
function isFlashBorrower(address borrower) external view returns (bool);
function isFlashBorrower(address borrower) external view returns (bool);
39,180
178
// Modifier to make a function callable only when the presale is not finished.
modifier whenNotFinished() { require(!presaleFinished); _; }
modifier whenNotFinished() { require(!presaleFinished); _; }
55,151
195
// only do something if users have different reserve price
if (toPrice != fromPrice) {
if (toPrice != fromPrice) {
63,067
133
// allows tx to execute if 50% +1 vote of active signers signed /
contract StabilityBoardProxy is MultiSig { function checkQuorum(uint signersCount) internal view returns(bool isQuorum) { isQuorum = signersCount > activeSignersCount / 2 ; } }
contract StabilityBoardProxy is MultiSig { function checkQuorum(uint signersCount) internal view returns(bool isQuorum) { isQuorum = signersCount > activeSignersCount / 2 ; } }
70,701
72
// Returns the number of NFTs owned by `_owner`. NFTs assigned to the zero address areconsidered invalid, and this function throws for queries about the zero address. _owner Address for whom to query the balance. /
function balanceOf( address _owner ) external view returns (uint256)
function balanceOf( address _owner ) external view returns (uint256)
63,954
414
// Start address = buffer address + offset + sizeof(buffer length)
dest := add(add(bufptr, 32), off)
dest := add(add(bufptr, 32), off)
16,176
3
// Emitted when new base URI was installed /
event NewBaseUri(string newBaseUri);
event NewBaseUri(string newBaseUri);
40,801