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 |
|---|---|---|---|---|
0 | // address => id | mapping(address => uint) public accountIdByAddress; //// Association account address and his id
| mapping(address => uint) public accountIdByAddress; //// Association account address and his id
| 18,202 |
0 | // LendingPoolAddressesProviderRegistry contract Main registry of LendingPoolAddressesProvider of multiple OmniDex protocol's markets- Used for indexing purposes of OmniDex protocol's markets- The id assigned to a LendingPoolAddressesProvider refers to the market it is connected with,for example with `0` for the OmniDe... | interface ILendingPoolAddressesProviderRegistry {
event AddressesProviderRegistered(address indexed newAddress);
event AddressesProviderUnregistered(address indexed newAddress);
function getAddressesProvidersList() external view returns (address[] memory);
function getAddressesProviderIdByAddress(address addr... | interface ILendingPoolAddressesProviderRegistry {
event AddressesProviderRegistered(address indexed newAddress);
event AddressesProviderUnregistered(address indexed newAddress);
function getAddressesProvidersList() external view returns (address[] memory);
function getAddressesProviderIdByAddress(address addr... | 26,469 |
229 | // utility to remove liquidity from a converter_converter converter_poolAmountamount of pool tokens to remove_reserveToken1 reserve token 1_reserveToken2 reserve token 2/ | function removeLiquidity(
ILiquidityPoolV1Converter _converter,
uint256 _poolAmount,
IERC20Token _reserveToken1,
IERC20Token _reserveToken2)
internal
| function removeLiquidity(
ILiquidityPoolV1Converter _converter,
uint256 _poolAmount,
IERC20Token _reserveToken1,
IERC20Token _reserveToken2)
internal
| 41,464 |
4 | // Helps initialize a dispute by assigning it a disputeIdwhen a miner returns a false on the validate array(in Zap.ProofOfWork) it sends theinvalidated value information to POS voting _requestId being disputed _timestamp being disputed _minerIndex the index of the miner that submitted the value being disputed. Since ea... | function beginDispute(
uint256 _requestId,
uint256 _timestamp,
uint256 _minerIndex
| function beginDispute(
uint256 _requestId,
uint256 _timestamp,
uint256 _minerIndex
| 26,451 |
103 | // If price > anchorPrice(1 + maxSwing) Set price = anchorPrice(1 + maxSwing) | if (greaterThanExp(price, max)) {
return (Error.NO_ERROR, true, max);
}
| if (greaterThanExp(price, max)) {
return (Error.NO_ERROR, true, max);
}
| 12,182 |
83 | // housekeeping event | event ResetHeaderBlock(address indexed proposer, uint256 indexed headerBlockId);
| event ResetHeaderBlock(address indexed proposer, uint256 indexed headerBlockId);
| 25,727 |
126 | // This function allows users to retireve all information about a staker_staker address of staker inquiring about return uint current state of staker return uint startDate of staking/ | function getStakerInfo(TellorStorage.TellorStorageStruct storage self, address _staker) internal view returns (uint256, uint256) {
return (self.stakerDetails[_staker].currentStatus, self.stakerDetails[_staker].startDate);
}
| function getStakerInfo(TellorStorage.TellorStorageStruct storage self, address _staker) internal view returns (uint256, uint256) {
return (self.stakerDetails[_staker].currentStatus, self.stakerDetails[_staker].startDate);
}
| 26,039 |
253 | // 60% chance that sideWeapon/armGuards/shoulderGuard will appear | uint256(keccak256(abi.encodePacked(encodedProp, _range))) % 100 > 60
) {
| uint256(keccak256(abi.encodePacked(encodedProp, _range))) % 100 > 60
) {
| 21,569 |
68 | // Swap contract for multisignature bridge | contract SwapContract is AccessControl, Pausable, ECDSAOffsetRecovery {
using SafeERC20 for IERC20;
bytes32 public constant OWNER_ROLE = keccak256("OWNER_ROLE");
bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE");
bytes32 public constant RELAYER_ROLE = keccak256("RELAYER_ROLE");
bytes... | contract SwapContract is AccessControl, Pausable, ECDSAOffsetRecovery {
using SafeERC20 for IERC20;
bytes32 public constant OWNER_ROLE = keccak256("OWNER_ROLE");
bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE");
bytes32 public constant RELAYER_ROLE = keccak256("RELAYER_ROLE");
bytes... | 80,395 |
245 | // Variable | uint256 public maxSupply = 555;
string public baseURI;
string public notRevealedURI = "https://assets.jokercharlie.com/jccgenesis/default.json";
string public baseExtension = ".json";
bool public revealed;
address public metadataContract;
address public lockerContract;
| uint256 public maxSupply = 555;
string public baseURI;
string public notRevealedURI = "https://assets.jokercharlie.com/jccgenesis/default.json";
string public baseExtension = ".json";
bool public revealed;
address public metadataContract;
address public lockerContract;
| 30,725 |
111 | // oods_coefficients[89]/ mload(add(context, 0x64e0)), res += c_90(f_7(x) - f_7(g^19z)) / (x - g^19z). | res := add(
res,
mulmod(mulmod(/*(x - g^19 * z)^(-1)*/ mload(add(denominatorsPtr, 0x260)),
| res := add(
res,
mulmod(mulmod(/*(x - g^19 * z)^(-1)*/ mload(add(denominatorsPtr, 0x260)),
| 28,860 |
166 | // Called when BondOperation's bond budget is updated at the beginning of the epoch. Parameters ---------------- |epoch_id|: The epoch ID. |bond_budget|: The bond budget. |total_bond_supply|: The total bond supply. |valid_bond_supply|: The valid bond supply. Returns ---------------- None. | function updateBondBudget(uint epoch_id, int bond_budget,
uint total_bond_supply, uint valid_bond_supply)
| function updateBondBudget(uint epoch_id, int bond_budget,
uint total_bond_supply, uint valid_bond_supply)
| 20,854 |
133 | // AIX generated so far is 51% of total | uint256 tokenCap = aix.totalSupply().mul(100).div(51);
| uint256 tokenCap = aix.totalSupply().mul(100).div(51);
| 34,797 |
64 | // Calculate receipt tokens for a given amount of deposit tokens If contract is empty, use 1:1 ratio Could return zero shares for very low amounts of deposit tokens amount deposit tokensreturn receipt tokens / | function getSharesForDepositTokens(uint amount) public view returns (uint) {
if (totalSupply.mul(totalDeposits) == 0) {
return amount;
}
return amount.mul(totalSupply).div(totalDeposits);
}
| function getSharesForDepositTokens(uint amount) public view returns (uint) {
if (totalSupply.mul(totalDeposits) == 0) {
return amount;
}
return amount.mul(totalSupply).div(totalDeposits);
}
| 19,036 |
61 | // An event to make the transfer easy to find on the blockchain | emit Transfer(_from, _to, _amount);
| emit Transfer(_from, _to, _amount);
| 15,674 |
137 | // Update star info | mapping(address => bool) private _operators;
| mapping(address => bool) private _operators;
| 54,376 |
154 | // Delete the slot where the moved entry was stored | map._entries.pop();
| map._entries.pop();
| 366 |
36 | // Change the member's public key. | members_[addressToMember_[msg.sender]].pubkey = _newMemberKey;
| members_[addressToMember_[msg.sender]].pubkey = _newMemberKey;
| 83,435 |
2 | // Balances KNOW for each account | mapping(address => uint256) balances;
| mapping(address => uint256) balances;
| 9,289 |
12 | // now we loop into storage to look after campaign and populate that var | for(uint i = 0; i < numberOfCampaigns; i++) {
Campaign storage item = campaigns[i];
allCampaigns[i] = item;
}
| for(uint i = 0; i < numberOfCampaigns; i++) {
Campaign storage item = campaigns[i];
allCampaigns[i] = item;
}
| 24,945 |
4 | // Fallback function to add funds to the pool without playing / | receive() external payable {
require(msg.value > 0, "Requires some value to fund the prize pool");
}
| receive() external payable {
require(msg.value > 0, "Requires some value to fund the prize pool");
}
| 29,725 |
51 | // Paybacks Vault's type underlying to activeProvider _repayAmount: token amount of underlying to repay, or pass -1 to repay full ammount | * Emits a {Repay} event.
*/
function payback(int256 _repayAmount) public payable override {
// If call from Normal User do typical, otherwise Fliquidator
if (msg.sender != _fujiAdmin.getFliquidator()) {
updateF1155Balances();
uint256 userDebtBalance = IFujiERC1155(fujiERC1155).balanceOf(msg... | * Emits a {Repay} event.
*/
function payback(int256 _repayAmount) public payable override {
// If call from Normal User do typical, otherwise Fliquidator
if (msg.sender != _fujiAdmin.getFliquidator()) {
updateF1155Balances();
uint256 userDebtBalance = IFujiERC1155(fujiERC1155).balanceOf(msg... | 78,978 |
1 | // The minimum setable proposal threshold | uint256 public constant MIN_PROPOSAL_THRESHOLD_BPS = 1; // 1 basis point or 0.01%
| uint256 public constant MIN_PROPOSAL_THRESHOLD_BPS = 1; // 1 basis point or 0.01%
| 19,268 |
10 | // The ```RemoveFromDelegateCallAllowlist``` event is emitted when governance removes a contract from the allowlist/contractAddress The address of the contract removed | event RemoveFromDelegateCallAllowlist(address contractAddress);
| event RemoveFromDelegateCallAllowlist(address contractAddress);
| 34,441 |
55 | // modifier created to prevent short address attack problems. / | modifier onlyPayloadSize(uint size) {
assert(msg.data.length >= size + 4);
_;
}
| modifier onlyPayloadSize(uint size) {
assert(msg.data.length >= size + 4);
_;
}
| 32,906 |
94 | // Constructor, takes token wallet address. tokenWallet Address holding the tokens, which has approved allowance to the crowdsale / | constructor (address tokenWallet) public {
require(tokenWallet != address(0));
_tokenWallet = tokenWallet;
}
| constructor (address tokenWallet) public {
require(tokenWallet != address(0));
_tokenWallet = tokenWallet;
}
| 19,546 |
7 | // Boolean flag to be read by the snapshot contract in order to decide if the validator set needs to be changed or not (i.e if a validator is going to be removed or added). | bool internal _isMaintenanceScheduled;
| bool internal _isMaintenanceScheduled;
| 19,398 |
32 | // Batch set vehicle properties | function setCarIndexs(uint256[18] memory ids,uint256[18] memory fertilities,uint256[18] memory carries) private {
for(uint256 i=0;i<ids.length;i++){
setCarIndex(i,ids[i],fertilities[i],carries[i]);
}
}
| function setCarIndexs(uint256[18] memory ids,uint256[18] memory fertilities,uint256[18] memory carries) private {
for(uint256 i=0;i<ids.length;i++){
setCarIndex(i,ids[i],fertilities[i],carries[i]);
}
}
| 59,926 |
41 | // AdminUpgradeabilityProxy Extends from BaseAdminUpgradeabilityProxy with a constructor for initializing the implementation, admin, and init data. / | contract AdminUpgradeabilityProxy is BaseAdminUpgradeabilityProxy, UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the pr... | contract AdminUpgradeabilityProxy is BaseAdminUpgradeabilityProxy, UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the pr... | 7,782 |
45 | // mint coins immediately that aren't for crowdsale | mint(affiliate, affiliateTokens);
mint(contingency, contingencyTokens);
mint(advisor, advisorTokens);
mint(team, teamTokensPerWallet);
mint(teamY1, teamTokensPerWallet); // These will be locked for transfer until 01/01/2019 00:00:00
mint(teamY2, teamTokensPerWallet); // T... | mint(affiliate, affiliateTokens);
mint(contingency, contingencyTokens);
mint(advisor, advisorTokens);
mint(team, teamTokensPerWallet);
mint(teamY1, teamTokensPerWallet); // These will be locked for transfer until 01/01/2019 00:00:00
mint(teamY2, teamTokensPerWallet); // T... | 41,625 |
5 | // add a and b and then subtract c/ | function addThenSubUInt(uint a, uint b, uint c) internal pure returns (MathError, uint) {
(MathError err0, uint sum) = addUInt(a, b);
if (err0 != MathError.NO_ERROR) {
return (err0, 0);
}
return subUInt(sum, c);
}
| function addThenSubUInt(uint a, uint b, uint c) internal pure returns (MathError, uint) {
(MathError err0, uint sum) = addUInt(a, b);
if (err0 != MathError.NO_ERROR) {
return (err0, 0);
}
return subUInt(sum, c);
}
| 4,724 |
98 | // Calculate x - y.Special values behave in the following way: NaN - x = NaN for any x.Infinity - x = Infinity for any finite x.-Infinity - x = -Infinity for any finite x.Infinity - -Infinity = Infinity.-Infinity - Infinity = -Infinity.Infinity - Infinity = -Infinity - -Infinity = NaN.x quadruple precision number y qua... | function sub(bytes16 x, bytes16 y) internal pure returns (bytes16) {
unchecked {return add(x, y ^ 0x80000000000000000000000000000000);}
}
| function sub(bytes16 x, bytes16 y) internal pure returns (bytes16) {
unchecked {return add(x, y ^ 0x80000000000000000000000000000000);}
}
| 20,743 |
68 | // exclude owner and this contract from fee | _isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
| _isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
| 1,269 |
56 | // Equivalent to contains(set, value) To delete an element from the _values array in O(1), we swap the element to delete with the last one in the array, and then remove the last element (sometimes called as 'swap and pop'). This modifies the order of the array, as noted in {at}. |
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
if (lastIndex != toDeleteIndex) {
bytes32 lastvalue = set._values[lastIndex];
|
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
if (lastIndex != toDeleteIndex) {
bytes32 lastvalue = set._values[lastIndex];
| 3,144 |
54 | // 获取授权信息 | * @param {Object} address
*/
function allowance(address tokenOwner, address spender) public view returns(uint remaining) {
return allowed[tokenOwner][spender];
}
| * @param {Object} address
*/
function allowance(address tokenOwner, address spender) public view returns(uint remaining) {
return allowed[tokenOwner][spender];
}
| 18,908 |
79 | // Storing an initial non-zero value makes deployment a bit more expensive, but in exchange the refund on every call to nonReentrant will be lower in amount. Since refunds are capped to a percetange of the total transaction's gas, it is best to keep them low in cases like this one, to increase the likelihood of the ful... | _notEntered = true;
| _notEntered = true;
| 13,303 |
5 | // owner The address of the account owning tokens/spender The address of the account able to transfer the tokens/ return Amount of remaining tokens allowed to spent | function allowance(address owner, address spender) public view returns (uint256 remaining);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
| function allowance(address owner, address spender) public view returns (uint256 remaining);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
| 17,906 |
12 | // Creates a new token category. metadataHash Hash of metadata about the token categorywhich can be distributed on IPFS. / | function createCategory(bytes32 metadataHash) external onlyOwner {
uint256 categoryID = ++categoryIndex;
emit CategoryAdded(categoryID, metadataHash);
}
| function createCategory(bytes32 metadataHash) external onlyOwner {
uint256 categoryID = ++categoryIndex;
emit CategoryAdded(categoryID, metadataHash);
}
| 8,971 |
108 | // Monetary dYdX Library for types involving money / | library Monetary {
/*
* The price of a base-unit of an asset.
*/
struct Price {
uint256 value;
}
/*
* Total value of an some amount of an asset. Equal to (price * amount).
*/
struct Value {
uint256 value;
}
}
| library Monetary {
/*
* The price of a base-unit of an asset.
*/
struct Price {
uint256 value;
}
/*
* Total value of an some amount of an asset. Equal to (price * amount).
*/
struct Value {
uint256 value;
}
}
| 59,118 |
120 | // Creates `amount` tokens and assigns them to `account`, increasingthe total supply. / | function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "VegionToken: mint to the zero address");
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
| function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "VegionToken: mint to the zero address");
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
| 80,322 |
985 | // Increase token allowance to enable the optimistic oracle reward transfer. | FixedPoint.Unsigned memory reward = _computeFinalFees();
collateralCurrency.safeIncreaseAllowance(address(optimisticOracle), reward.rawValue);
optimisticOracle.requestPrice(
_transformPriceIdentifier(requestedTime),
requestedTime,
_getAncillaryData(),
... | FixedPoint.Unsigned memory reward = _computeFinalFees();
collateralCurrency.safeIncreaseAllowance(address(optimisticOracle), reward.rawValue);
optimisticOracle.requestPrice(
_transformPriceIdentifier(requestedTime),
requestedTime,
_getAncillaryData(),
... | 21,698 |
7 | // Used to disable lock before migrating keys and/or destroying contract.Throws if called by other than a lock manager.Throws if lock contract has already been disabled./ | function disableLock() external;
| function disableLock() external;
| 32,204 |
0 | // Auction ends in last 3hrs when this random number is observed | uint256 constant auctionLengthInHours = 72;
| uint256 constant auctionLengthInHours = 72;
| 55,788 |
61 | // KEEP THIS FUNCTION IN CASE THE CONTRACT KEEPS LEFTOVER ETHER! | function withdrawEther() public onlyOwner {
address self = address(this); // workaround for a possible solidity bug
uint256 balance = self.balance;
address(OWNER).transfer(balance);
}
| function withdrawEther() public onlyOwner {
address self = address(this); // workaround for a possible solidity bug
uint256 balance = self.balance;
address(OWNER).transfer(balance);
}
| 9,575 |
28 | // Return all ETH and tokens to original multisig and then suicide | function abort() public onlyAdmins {
require(returnToSender());
selfdestruct(multisig);
}
| function abort() public onlyAdmins {
require(returnToSender());
selfdestruct(multisig);
}
| 35,171 |
88 | // index 0 to save the left token num | lockedAllRewards[msg.sender][idx].alloc[0] = lockedAllRewards[msg.sender][idx].alloc[0].add(amount.sub(divAmount));
uint256 i=2;
| lockedAllRewards[msg.sender][idx].alloc[0] = lockedAllRewards[msg.sender][idx].alloc[0].add(amount.sub(divAmount));
uint256 i=2;
| 68,787 |
85 | // Creates total supply of 500 000 tokens. | _initialSupply = 1000000 * 10 ** _decimals;
_totalSupply = _totalSupply.add(_initialSupply);
_balances[msg.sender] = _balances[msg.sender].add(_initialSupply);
emit Transfer(address(0), msg.sender, _initialSupply);
| _initialSupply = 1000000 * 10 ** _decimals;
_totalSupply = _totalSupply.add(_initialSupply);
_balances[msg.sender] = _balances[msg.sender].add(_initialSupply);
emit Transfer(address(0), msg.sender, _initialSupply);
| 3,451 |
60 | // add ln(2)k5e182192 | r += 16597577552685614221487285958193947469193820559219878177908093499208371 * k;
| r += 16597577552685614221487285958193947469193820559219878177908093499208371 * k;
| 1,861 |
33 | // total token supply | uint public totalSupply;
| uint public totalSupply;
| 2,104 |
156 | // Updates the endTimestamp propety with the new _end value | function setEndTimestamp(uint256 _end) external onlyAdmin returns (bool) {
require(_end > startTimestamp);
uint256 _oldValue = endTimestamp;
endTimestamp = _end;
EndTimestampUpdated(msg.sender, _oldValue, endTimestamp);
return true;
}
| function setEndTimestamp(uint256 _end) external onlyAdmin returns (bool) {
require(_end > startTimestamp);
uint256 _oldValue = endTimestamp;
endTimestamp = _end;
EndTimestampUpdated(msg.sender, _oldValue, endTimestamp);
return true;
}
| 5,816 |
306 | // BToken initialize does the bulk of the work | super.initialize(bController_, interestRateModel_, initialExchangeRateMantissa_, name_, symbol_, decimals_);
| super.initialize(bController_, interestRateModel_, initialExchangeRateMantissa_, name_, symbol_, decimals_);
| 26,379 |
168 | // See {IERC20Burnable-burn(uint256)}. | function burn(uint256 amount) public virtual override returns (bool) {
_burn(_msgSender(), amount);
return true;
}
| function burn(uint256 amount) public virtual override returns (bool) {
_burn(_msgSender(), amount);
return true;
}
| 23,398 |
10 | // adds the monetary policy contracts, hop, backstep etc | function setMonetaryPolicyContract(address con_address) public onlyByOracle {
frax_monetary_policy_contracts[con_address] = true;
}
| function setMonetaryPolicyContract(address con_address) public onlyByOracle {
frax_monetary_policy_contracts[con_address] = true;
}
| 3,998 |
295 | // Tell whether an action's dispute can be ruled_actionId Identification number of the action return True if the action's dispute can be ruled, false otherwise/ | function canRuleDispute(uint256 _actionId) external view returns (bool) {
(, Challenge storage challenge, ) = _getChallengedAction(_actionId);
return _isDisputed(challenge);
}
| function canRuleDispute(uint256 _actionId) external view returns (bool) {
(, Challenge storage challenge, ) = _getChallengedAction(_actionId);
return _isDisputed(challenge);
}
| 19,847 |
148 | // a library for performing various math operations | library Math {
using SafeMathUpgradeable for uint256;
function max(uint256 x, uint256 y) internal pure returns (uint256) {
return x < y ? y : x;
}
function min(uint256 x, uint256 y) internal pure returns (uint256) {
return x < y ? x : y;
}
// babylonian method (https://en.wiki... | library Math {
using SafeMathUpgradeable for uint256;
function max(uint256 x, uint256 y) internal pure returns (uint256) {
return x < y ? y : x;
}
function min(uint256 x, uint256 y) internal pure returns (uint256) {
return x < y ? x : y;
}
// babylonian method (https://en.wiki... | 10,724 |
39 | // Returns the claim condition at the given uid. | function getClaimConditionById(uint256 _tokenId, uint256 _conditionId)
external
view
returns (ClaimCondition memory condition)
| function getClaimConditionById(uint256 _tokenId, uint256 _conditionId)
external
view
returns (ClaimCondition memory condition)
| 24,768 |
34 | // Divides one `Unsigned` by an `Unsigned` and "ceil's" the quotient, reverting on overflow or division by 0. a a FixedPoint numerator. b a FixedPoint denominator.return the quotient of `a` divided by `b`. / | function divCeil(Unsigned memory a, Unsigned memory b) internal pure returns (Unsigned memory) {
uint256 aScaled = a.rawValue.mul(FP_SCALING_FACTOR);
uint256 divFloor = aScaled.div(b.rawValue);
uint256 mod = aScaled.mod(b.rawValue);
if (mod != 0) {
return Unsigned(divFloo... | function divCeil(Unsigned memory a, Unsigned memory b) internal pure returns (Unsigned memory) {
uint256 aScaled = a.rawValue.mul(FP_SCALING_FACTOR);
uint256 divFloor = aScaled.div(b.rawValue);
uint256 mod = aScaled.mod(b.rawValue);
if (mod != 0) {
return Unsigned(divFloo... | 19,181 |
23 | // a reserved symbol means the route is already chosen | address token = symbolRoute[_hashSymbol];
if (token != address(0)) return false;
| address token = symbolRoute[_hashSymbol];
if (token != address(0)) return false;
| 23,531 |
0 | // 当天公司已经发出去币的数量 | uint256 oneDaySendCoin = 0;
event Transfer(address indexed to, uint256 value);
mapping (address => uint256) public exchangeCoin;
mapping (address => uint256) public balanceOf;
| uint256 oneDaySendCoin = 0;
event Transfer(address indexed to, uint256 value);
mapping (address => uint256) public exchangeCoin;
mapping (address => uint256) public balanceOf;
| 33,107 |
16 | // withdraws unlockable balance to receiver | vlCvx.withdrawExpiredLocksTo(receiver);
| vlCvx.withdrawExpiredLocksTo(receiver);
| 25,110 |
37 | // first scenario - this is not the first tx in the current block | if (currentBlockData.lastBlock == currentBlock) {
if (uint(currentBlockData.lastRateUpdateBlock) == rateUpdateBlock) {
| if (currentBlockData.lastBlock == currentBlock) {
if (uint(currentBlockData.lastRateUpdateBlock) == rateUpdateBlock) {
| 58,911 |
7 | // ERC20 token address | address token;
| address token;
| 151 |
28 | // Retreive insurance details patient_id patient id/ | {
insurance memory i = insurancelist[patient_id];
return (
i.applicable,
i.policy_no,
i.insurer,
i.policy_type,
i.policy_limit
);
}
| {
insurance memory i = insurancelist[patient_id];
return (
i.applicable,
i.policy_no,
i.insurer,
i.policy_type,
i.policy_limit
);
}
| 17,519 |
31 | // Returns the amount of tokens in existence | function totalSupply() external view returns (uint);
| function totalSupply() external view returns (uint);
| 30,656 |
17 | // Team Wallet | walletsAllocation[0x9f83a70b2F40c5fC3068bb4d6F72B36aCEb7EAFE] = walletDetail(1e9 * 10 ** uint(decimals), true);
| walletsAllocation[0x9f83a70b2F40c5fC3068bb4d6F72B36aCEb7EAFE] = walletDetail(1e9 * 10 ** uint(decimals), true);
| 37,724 |
39 | // TAX SELLERS 28% WHO SELL WITHIN 24 HOURS | if (_buyMap[from] != 0 &&
(_buyMap[from] + (24 hours) >= block.timestamp)) {
_feeAddr1 = 1;
_feeAddr2 = 28;
} else {
| if (_buyMap[from] != 0 &&
(_buyMap[from] + (24 hours) >= block.timestamp)) {
_feeAddr1 = 1;
_feeAddr2 = 28;
} else {
| 47,144 |
263 | // if yes, reset reallocation index | reallocationIndex = 0;
| reallocationIndex = 0;
| 34,742 |
56 | // Returns the implementation address for a given contract name, provided by the `ImplementationProvider`. contractName Name of the contract.return Address where the contract is implemented. / | function getImplementation(string contractName) public view returns (address) {
return getProvider().getImplementation(contractName);
}
| function getImplementation(string contractName) public view returns (address) {
return getProvider().getImplementation(contractName);
}
| 26,674 |
2 | // `Initializer Event` | event CampaignOwnerSet(address user);
| event CampaignOwnerSet(address user);
| 8,696 |
162 | // Deposit LP tokens to MasterChef for RASP allocation. | function deposit(uint256 _pid, uint256 _amount) public nonReentrant {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
updatePool(_pid);
if (user.amount > 0) {
uint256 pending = user.amount.mul(pool.accRaspPerShare).div(1e18).sub... | function deposit(uint256 _pid, uint256 _amount) public nonReentrant {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
updatePool(_pid);
if (user.amount > 0) {
uint256 pending = user.amount.mul(pool.accRaspPerShare).div(1e18).sub... | 30,302 |
3 | // Append signer address at the end to extract it from calling context | (bool success, bytes memory returndata) = address(this).call(
abi.encodePacked(_abiEncoded, _signer)
);
if (success) {
return returndata;
}
| (bool success, bytes memory returndata) = address(this).call(
abi.encodePacked(_abiEncoded, _signer)
);
if (success) {
return returndata;
}
| 55,035 |
16 | // emit event for modifying the position (add the fee to margin) | emit PositionModified(position.id, account, position.margin, position.size, 0, price, fundingIndex, 0);
| emit PositionModified(position.id, account, position.margin, position.size, 0, price, fundingIndex, 0);
| 43,828 |
139 | // When data `bytes` is not exactly 3 bytes long it is padded with `=` characters at the end | switch mod(mload(data), 3)
case 1 {
mstore8(sub(resultPtr, 1), 0x3d)
mstore8(sub(resultPtr, 2), 0x3d)
}
| switch mod(mload(data), 3)
case 1 {
mstore8(sub(resultPtr, 1), 0x3d)
mstore8(sub(resultPtr, 2), 0x3d)
}
| 53,620 |
7 | // Calculates floor(xy / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0with further edits by Uniswap Labs also under MIT license. / | function mulDiv(
uint256 x,
uint256 y,
uint256 denominator
| function mulDiv(
uint256 x,
uint256 y,
uint256 denominator
| 3,738 |
396 | // usdt | underlyingIndex = 2;
precisionDiv = 1e12;
| underlyingIndex = 2;
precisionDiv = 1e12;
| 17,464 |
82 | // apply a bonus if any (10SET) | uint256 tokensWithoutBonus = limitedInvestValue.mul(price).div(1 ether);
uint256 tokensWithBonus = tokensWithoutBonus;
if (milestone.bonus > 0) {
tokensWithBonus = tokensWithoutBonus.add(tokensWithoutBonus.mul(milestone.bonus).div(percentRate));
}
| uint256 tokensWithoutBonus = limitedInvestValue.mul(price).div(1 ether);
uint256 tokensWithBonus = tokensWithoutBonus;
if (milestone.bonus > 0) {
tokensWithBonus = tokensWithoutBonus.add(tokensWithoutBonus.mul(milestone.bonus).div(percentRate));
}
| 37,885 |
780 | // Our extension node is not identical to the remainder. We've hit the end of this path updates will need to modify this extension. | currentNodeID = bytes32(RLP_NULL);
break;
| currentNodeID = bytes32(RLP_NULL);
break;
| 56,985 |
3 | // See {IERC777Recipient-tokensReceived}. / | function tokensReceived(
address,
address,
address,
uint256,
bytes calldata,
bytes calldata
| function tokensReceived(
address,
address,
address,
uint256,
bytes calldata,
bytes calldata
| 59,276 |
114 | // allows to manage locking of vote-escrowed tokens, and staking/unstaking/ governance tokens from a pre-defined contract in order to eventually allow voting./ Examples: ANGLE <> veANGLE, AAVE <> stkAAVE, CVX <> vlCVX, CRV > cvxCRV. | bytes32 internal constant METAGOVERNANCE_TOKEN_STAKING =
keccak256("METAGOVERNANCE_TOKEN_STAKING");
| bytes32 internal constant METAGOVERNANCE_TOKEN_STAKING =
keccak256("METAGOVERNANCE_TOKEN_STAKING");
| 81,614 |
51 | // How much ETH each address has invested to this crowdsale | mapping (address => uint256) public investedAmountOf;
| mapping (address => uint256) public investedAmountOf;
| 2,613 |
4 | // The log passed from L2/l2ShardId The shard identifier, 0 - rollup, 1 - porter. All other values are not used but are reserved for the future/isService A boolean flag that is part of the log along with `key`, `value`, and `sender` address./ This field is required formally but does not have any special meaning./txNumb... | struct L2Log {
uint8 l2ShardId;
bool isService;
uint16 txNumberInBlock;
address sender;
bytes32 key;
bytes32 value;
}
| struct L2Log {
uint8 l2ShardId;
bool isService;
uint16 txNumberInBlock;
address sender;
bytes32 key;
bytes32 value;
}
| 27,702 |
28 | // Transfer NFT to buyer | for (uint256 i; i < listing.nfts.length; i++) {
if (_supportsInterface(listing.nfts[i], INTERFACE_ID_ERC721)) {
IERC721(listing.nfts[i]).safeTransferFrom(
owner,
_msgSender(),
listing.tokenIds[i]
);
... | for (uint256 i; i < listing.nfts.length; i++) {
if (_supportsInterface(listing.nfts[i], INTERFACE_ID_ERC721)) {
IERC721(listing.nfts[i]).safeTransferFrom(
owner,
_msgSender(),
listing.tokenIds[i]
);
... | 64,341 |
34 | // Decrease the amount of tokens that an owner allowed to a spender.approve should be called when allowed_[_spender] == 0. To decrementallowed value is better to use this function to avoid 2 calls (and wait untilthe first transaction is mined)From MonolithDAO Token.solEmits an Approval event. spender The address which ... | function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return ... | function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return ... | 207 |
9 | // set nfts | tradeInfo[offerID].offer = offer;
tradeInfo[offerID]._for = _for;
| tradeInfo[offerID].offer = offer;
tradeInfo[offerID]._for = _for;
| 24,014 |
31 | // mint to account | _mint(account, maxCount);
| _mint(account, maxCount);
| 23,330 |
176 | // function to calculate the interest using a compounded interest rateformula _rate the interest rate, in ray _lastUpdateTimestamp the timestamp of the last update of theinterestreturn the interest rate compounded during the timeDelta, in ray / | ) internal view returns (uint256) {
//solium-disable-next-line
uint256 timeDifference =
block.timestamp.sub(uint256(_lastUpdateTimestamp));
uint256 ratePerSecond = _rate.div(SECONDS_PER_YEAR);
return ratePerSecond.add(WadRayMath.ray()).rayPow(timeDifference);
}
| ) internal view returns (uint256) {
//solium-disable-next-line
uint256 timeDifference =
block.timestamp.sub(uint256(_lastUpdateTimestamp));
uint256 ratePerSecond = _rate.div(SECONDS_PER_YEAR);
return ratePerSecond.add(WadRayMath.ray()).rayPow(timeDifference);
}
| 9,559 |
63 | // ========== CONSTRUCTOR ========== /both the same in this case (liquidity pool tokens or LPT) but the reward actually given is converted to SQUAWK by removing the rewarded liquidity and buying SQUAWK with the ETH to raise its price (along with the price of the LPT) | rewardsToken = IERC20(0xf27eE90c7856f67891c05e33B3a523Acf762F47D);
stakingToken = IERC20(0xf27eE90c7856f67891c05e33B3a523Acf762F47D);
| rewardsToken = IERC20(0xf27eE90c7856f67891c05e33B3a523Acf762F47D);
stakingToken = IERC20(0xf27eE90c7856f67891c05e33B3a523Acf762F47D);
| 59,410 |
37 | // Claim vested tokenswho The address to claim on behalf of/ | function claimTokens(address who) public nonReentrant {
require(currentEscrowSlot[who] > 0, "StakingRewardsEscrow/invalid-address");
require(oldestEscrowSlot[who] < currentEscrowSlot[who], "StakingRewardsEscrow/no-slot-to-claim");
uint256 lastSlotToClaim = (subtract(currentEscrowSlot[who], ... | function claimTokens(address who) public nonReentrant {
require(currentEscrowSlot[who] > 0, "StakingRewardsEscrow/invalid-address");
require(oldestEscrowSlot[who] < currentEscrowSlot[who], "StakingRewardsEscrow/no-slot-to-claim");
uint256 lastSlotToClaim = (subtract(currentEscrowSlot[who], ... | 4,498 |
72 | // Nodes 32 bytes or larger are hashed. | nodeID = Lib_RLPReader.readBytes(_node);
| nodeID = Lib_RLPReader.readBytes(_node);
| 37,946 |
251 | // OUSD Token Contract ERC20 compatible contract for OUSD Implements an elastic supply Origin Protocol Inc / | import { SafeMath } from "@openzeppelin/contracts/utils/math/SafeMath.sol";
import { Address } from "@openzeppelin/contracts/utils/Address.sol";
import { Initializable } from "../utils/Initializable.sol";
import { InitializableERC20Detailed } from "../utils/InitializableERC20Detailed.sol";
import { StableMath } from "... | import { SafeMath } from "@openzeppelin/contracts/utils/math/SafeMath.sol";
import { Address } from "@openzeppelin/contracts/utils/Address.sol";
import { Initializable } from "../utils/Initializable.sol";
import { InitializableERC20Detailed } from "../utils/InitializableERC20Detailed.sol";
import { StableMath } from "... | 60,763 |
23 | // Returns total remaining tokens from public mint. / | function totalRemaining() public view returns (uint256) {
return (SUPPLY-1) - _totalPublicMinted.current();
}
| function totalRemaining() public view returns (uint256) {
return (SUPPLY-1) - _totalPublicMinted.current();
}
| 39,693 |
204 | // Gets the instance of Set valuer on Controller. Note: SetValuer is stored as index 2 on the Controller / | function getSetValuer(IController _controller) internal view returns (ISetValuer) {
return ISetValuer(_controller.resourceId(SET_VALUER_RESOURCE_ID));
}
| function getSetValuer(IController _controller) internal view returns (ISetValuer) {
return ISetValuer(_controller.resourceId(SET_VALUER_RESOURCE_ID));
}
| 43,693 |
28 | // Put a message in the L2 inbox that can be reexecuted for some fixed amount of time if it reverts Advanced usage only (does not rewrite aliases for excessFeeRefundAddress and callValueRefundAddress). createRetryableTicket method is the recommended standard. destAddr destination L2 contract address l2CallValue call va... | function unsafeCreateRetryableTicket(
address destAddr,
uint256 l2CallValue,
uint256 maxSubmissionCost,
address excessFeeRefundAddress,
address callValueRefundAddress,
uint256 maxGas,
uint256 gasPriceBid,
bytes calldata data
| function unsafeCreateRetryableTicket(
address destAddr,
uint256 l2CallValue,
uint256 maxSubmissionCost,
address excessFeeRefundAddress,
address callValueRefundAddress,
uint256 maxGas,
uint256 gasPriceBid,
bytes calldata data
| 47,619 |
275 | // Icecream Cones contract Extends ERC721 Non-Fungible Token Standard basic implementation / | contract IcecreamCones is ERC721, Ownable {
using SafeMath for uint256;
address dv = 0xd7DBe51f9EBf734A5fd55C18002a063c6881d8b4;
address sco = 0x387cbA805A719A1613488E489a8E7F0DE63aed14;
address wmm = 0x9e0Ec64BEaa066E241c6309dE19B6e50AFf996c6;
address jj = 0xdc977BE65dFc2e5464b86891Ed571Bea593Ca2... | contract IcecreamCones is ERC721, Ownable {
using SafeMath for uint256;
address dv = 0xd7DBe51f9EBf734A5fd55C18002a063c6881d8b4;
address sco = 0x387cbA805A719A1613488E489a8E7F0DE63aed14;
address wmm = 0x9e0Ec64BEaa066E241c6309dE19B6e50AFf996c6;
address jj = 0xdc977BE65dFc2e5464b86891Ed571Bea593Ca2... | 44,802 |
29 | // Get an identifiaction contract for a given dweller dweller The address of the dweller we're looking up / | function getDwellerId(address dweller)
public
view
returns(address dwellerId)
| function getDwellerId(address dweller)
public
view
returns(address dwellerId)
| 18,870 |
79 | // Crowdsale finish time | uint public finishTime;
| uint public finishTime;
| 18,905 |
25 | // Sending to NFT: | _sendToNFT(immediateOwner, to, parentId, destinationId, tokenId, data);
| _sendToNFT(immediateOwner, to, parentId, destinationId, tokenId, data);
| 9,322 |
179 | // Extract ERC721 tokens which were accidentally sent to the contract to a list of accounts.Warning: this function should be overriden for contracts which are supposed to hold ERC721 tokensso that the extraction is limited to only tokens sent accidentally. Reverts if the sender is not the contract owner. Reverts if `ac... | function recoverERC721s(
address[] calldata accounts,
address[] calldata contracts,
uint256[] calldata tokenIds
| function recoverERC721s(
address[] calldata accounts,
address[] calldata contracts,
uint256[] calldata tokenIds
| 11,001 |
87 | // increase payment received amount | paymentReceived[_msgSender()] += paymentAmount;
| paymentReceived[_msgSender()] += paymentAmount;
| 15,578 |
4 | // Struct used for "robust" swaps that may have partial fills buying NFTs out of a pool swapInfo Swap info with pool and and Nfts being traded maxCost The maximum amount of tokens you are willing to pay for the Nfts total / | struct RobustSwap {
IDittoPool pool;
uint256[] nftIds;
uint256 maxCost;
bytes swapData;
}
| struct RobustSwap {
IDittoPool pool;
uint256[] nftIds;
uint256 maxCost;
bytes swapData;
}
| 30,475 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.