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 |
|---|---|---|---|---|
84 | // players, if you registered a profile, before a game was released, orset the all bool to false when you registered, use this function to pushyour profile to a single game.also, if you&39;veupdated your name, youcan use this to push your name to games of your choosing.-functionhash- 0x81c5b206 _gameID game id / | function addMeToGame(uint256 _gameID)
isHuman()
public
| function addMeToGame(uint256 _gameID)
isHuman()
public
| 28,596 |
32 | // Record the calling contract address. | contractAddresses[contractId] = msg.sender;
| contractAddresses[contractId] = msg.sender;
| 38 |
12 | // tokenOwner 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 tokenOwner, address spender) public view returns (uint remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
| function allowance(address tokenOwner, address spender) public view returns (uint remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
| 21,926 |
165 | // Add a contract address to the non rebasing exception list. I.e. theaddress's balance will be part of rebases so the account will be exposedto upside and downside. / | function rebaseOptIn() public nonReentrant {
require(_isNonRebasingAccount(msg.sender), "Account has not opted out");
// Convert balance into the same amount at the current exchange rate
uint256 newCreditBalance = _creditBalances[msg.sender]
.mul(rebasingCreditsPerToken)
... | function rebaseOptIn() public nonReentrant {
require(_isNonRebasingAccount(msg.sender), "Account has not opted out");
// Convert balance into the same amount at the current exchange rate
uint256 newCreditBalance = _creditBalances[msg.sender]
.mul(rebasingCreditsPerToken)
... | 5,352 |
21 | // Simple ERC2981 NFT Royalty Standard implementation./Solady (https:github.com/vectorized/solady/blob/main/src/tokens/ERC2981.sol)/Modified from OpenZeppelin (https:github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/common/ERC2981.sol) | abstract contract ERC2981 {
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* CUSTOM ERRORS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev The royalty fee numerator exceeds the fee denominator.
error Royalt... | abstract contract ERC2981 {
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* CUSTOM ERRORS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev The royalty fee numerator exceeds the fee denominator.
error Royalt... | 29,613 |
14 | // Multiplies two exponentials, returning a new exponential. / | function mulExp(Exp memory a, Exp memory b) internal pure returns (MathError, Exp memory) {
(MathError err0, uint256 doubleScaledProduct) = a.mantissa.mulUInt(b.mantissa);
if (err0 != MathError.NO_ERROR) {
return (err0, Exp({mantissa: 0}));
}
// We add half the scale before dividing so that we ... | function mulExp(Exp memory a, Exp memory b) internal pure returns (MathError, Exp memory) {
(MathError err0, uint256 doubleScaledProduct) = a.mantissa.mulUInt(b.mantissa);
if (err0 != MathError.NO_ERROR) {
return (err0, Exp({mantissa: 0}));
}
// We add half the scale before dividing so that we ... | 1,957 |
12 | // Admin withdraw in case of misplaced funds | function withdraw(address token, address recipient) external onlyOwner {
if (token == address(0)) {
// Send ETH
payable(recipient).transfer(address(this).balance);
return;
}
IERC20(token).safeTransfer(recipient, IERC20(token).balanceOf(address(this)));
}
| function withdraw(address token, address recipient) external onlyOwner {
if (token == address(0)) {
// Send ETH
payable(recipient).transfer(address(this).balance);
return;
}
IERC20(token).safeTransfer(recipient, IERC20(token).balanceOf(address(this)));
}
| 17,023 |
58 | // 报价通道配置 | struct ChannelConfig {
// 计价代币地址, 0表示eth
address token0;
// 计价代币单位
uint96 unit;
// 矿币地址如果和token0或者token1是一种币,可能导致挖矿资产被当成矿币挖走
// 出矿代币地址
address reward;
// 每个区块的标准出矿量
uint96 rewardPerBlock;
// 矿币总量
//uint96 vault;
// 管理... | struct ChannelConfig {
// 计价代币地址, 0表示eth
address token0;
// 计价代币单位
uint96 unit;
// 矿币地址如果和token0或者token1是一种币,可能导致挖矿资产被当成矿币挖走
// 出矿代币地址
address reward;
// 每个区块的标准出矿量
uint96 rewardPerBlock;
// 矿币总量
//uint96 vault;
// 管理... | 30,430 |
97 | // Approve or remove `operator` as an operator for the caller.Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. Requirements: - The `operator` cannot be the caller. Emits an {ApprovalForAll} event. / | function setApprovalForAll(address operator, bool _approved) external;
| function setApprovalForAll(address operator, bool _approved) external;
| 2,285 |
0 | // _pool Uniswap V3 pool for which liquidity is managed_owner Owner of the Hypervisor | constructor(
address _visr,
address _owner
| constructor(
address _visr,
address _owner
| 29,711 |
5 | // Builds a domain separator using the current chainId and contract address. | function _buildDomainSeparator(bytes32 typeHash, bytes32 nameHash) private view returns (bytes32) {
return keccak256(abi.encode(typeHash, nameHash, block.chainid, address(this)));
}
| function _buildDomainSeparator(bytes32 typeHash, bytes32 nameHash) private view returns (bytes32) {
return keccak256(abi.encode(typeHash, nameHash, block.chainid, address(this)));
}
| 2,421 |
42 | // increment the round id | ++roundId;
| ++roundId;
| 3,032 |
16 | // Contract will be used as proxy implementation. _messageService The address of the MessageService contract. _tokenBeacon The address of the tokenBeacon. _sourceChainId The source chain id of the current layer _targetChainId The target chaind id of the targeted layer _reservedTokens The list of reserved tokens to be s... | function initialize(
address _securityCouncil,
address _messageService,
address _tokenBeacon,
uint256 _sourceChainId,
uint256 _targetChainId,
address[] calldata _reservedTokens
| function initialize(
address _securityCouncil,
address _messageService,
address _tokenBeacon,
uint256 _sourceChainId,
uint256 _targetChainId,
address[] calldata _reservedTokens
| 18,078 |
12 | // allows owner to burn tokens that are not sold in a crowdsale | function burnTokens(uint256 _value) public onlyOwner {
require(balances[msg.sender] >= _value && _value > 0 );
_totalSupply = _totalSupply.sub(_value);
balances[msg.sender] = balances[msg.sender].sub(_value);
}
| function burnTokens(uint256 _value) public onlyOwner {
require(balances[msg.sender] >= _value && _value > 0 );
_totalSupply = _totalSupply.sub(_value);
balances[msg.sender] = balances[msg.sender].sub(_value);
}
| 878 |
81 | // BurnableToken | function burn(uint256 _amount) public returns (bool);
| function burn(uint256 _amount) public returns (bool);
| 22,700 |
44 | // Helper function to withdraw from the `bentoBox`. | function _bentoWithdraw(
bytes memory data,
uint256 value1,
uint256 value2
| function _bentoWithdraw(
bytes memory data,
uint256 value1,
uint256 value2
| 52,288 |
2 | // Whether it is initialized | bool public isInitialized;
| bool public isInitialized;
| 52,800 |
164 | // Note: make sure this doesn't return Challenge.UNREACHABLE_ASSERTION (currently 0) | return keccak256(abi.encodePacked(_arbGasUsed, _restHash));
| return keccak256(abi.encodePacked(_arbGasUsed, _restHash));
| 35,815 |
4 | // Whitelist/contains a list of wallets allowed to perform a certain operation | contract Whitelist is Ownable {
mapping(address => bool) internal wallets;
/// @notice events of approval and revoking wallets
event ApproveWallet(address);
event RevokeWallet(address);
/// @notice approves wallet
/// @param _wallet the wallet to approve
function approveWallet(address _wal... | contract Whitelist is Ownable {
mapping(address => bool) internal wallets;
/// @notice events of approval and revoking wallets
event ApproveWallet(address);
event RevokeWallet(address);
/// @notice approves wallet
/// @param _wallet the wallet to approve
function approveWallet(address _wal... | 27,432 |
10 | // The addresses who have helped to sustain this MoneyPool. NOTE: Using arrays may be bad practice and/or expensive | address[] sustainers;
| address[] sustainers;
| 18,943 |
220 | // PigstyChef is the master of Sushi. He can make Sushi and he is a fair guy. Note that it's ownable and the owner wields tremendous power. The ownership will be transferred to a governance smart contract once SUSHI is sufficiently distributed and the community can show to govern itself. Have fun reading it. Hopefully ... | contract PigstyChef is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// Info of each user.
struct UserInfo {
uint256 amount; // How many LP tokens the user has provided.
uint256 rewardDebt; // Reward debt. See explanation below.
//
// We do some fancy... | contract PigstyChef is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// Info of each user.
struct UserInfo {
uint256 amount; // How many LP tokens the user has provided.
uint256 rewardDebt; // Reward debt. See explanation below.
//
// We do some fancy... | 17,271 |
9 | // Set the royalty recipient. newDefaultRoyaltiesReceipientAddress The address of the new royalty receipient. / | function setDefaultRoyaltiesReceipientAddress(
address payable newDefaultRoyaltiesReceipientAddress
) external onlyOwner {
require(
newDefaultRoyaltiesReceipientAddress != address(0),
"invalid address"
);
_setDefaultRoyalty(
newDefaultRoyalties... | function setDefaultRoyaltiesReceipientAddress(
address payable newDefaultRoyaltiesReceipientAddress
) external onlyOwner {
require(
newDefaultRoyaltiesReceipientAddress != address(0),
"invalid address"
);
_setDefaultRoyalty(
newDefaultRoyalties... | 22,889 |
10 | // 玩家在每局比赛中的信息 | struct PlayerRounds {
uint256 eth; // 本局投入的eth成本
mapping (uint256 => uint256) plyrTmKeys; // teamid => keys
bool withdrawn; // 这轮收益是否已提现
}
| struct PlayerRounds {
uint256 eth; // 本局投入的eth成本
mapping (uint256 => uint256) plyrTmKeys; // teamid => keys
bool withdrawn; // 这轮收益是否已提现
}
| 67,347 |
253 | // Accrue interest then return the up-to-date exchange ratereturn Calculated exchange rate scaled by 1e18 / | function exchangeRateCurrent() public nonReentrant returns (uint256) {
require(accrueInterest() == uint256(Error.NO_ERROR), "accrue interest failed");
return exchangeRateStored();
}
| function exchangeRateCurrent() public nonReentrant returns (uint256) {
require(accrueInterest() == uint256(Error.NO_ERROR), "accrue interest failed");
return exchangeRateStored();
}
| 33,152 |
9 | // kill the contract and send the ether to the authority | contractEnded(block.timestamp, tradeId);
suicide(authority);
| contractEnded(block.timestamp, tradeId);
suicide(authority);
| 18,276 |
5 | // Updates an element in the list. list A storage pointer to the underlying list. key The element key. previousKey The key of the element that comes before the updated element. nextKey The key of the element that comes after the updated element. / | function update(List storage list, bytes32 key, bytes32 previousKey, bytes32 nextKey) internal {
require(
key != bytes32(0) && key != previousKey && key != nextKey && contains(list, key),
"key on in list"
);
remove(list, key);
insert(list, key, previousKey, nextKey);
}
| function update(List storage list, bytes32 key, bytes32 previousKey, bytes32 nextKey) internal {
require(
key != bytes32(0) && key != previousKey && key != nextKey && contains(list, key),
"key on in list"
);
remove(list, key);
insert(list, key, previousKey, nextKey);
}
| 36,725 |
83 | // maximum investors that this contract can hold / | uint public maxInvestors;
| uint public maxInvestors;
| 41,718 |
46 | // get ETH Address / | function getCETHAddress() public pure returns (address) {
return 0x4Ddc2D193948926D02f9B1fE9e1daa0718270ED5;
}
| function getCETHAddress() public pure returns (address) {
return 0x4Ddc2D193948926D02f9B1fE9e1daa0718270ED5;
}
| 35,103 |
287 | // Silence compiler warning. The NatSpecrequires the parameter to be named. While not used at the moment, future versions of the paymaster may conditionally forward payments depending on the destination domain. | _destinationDomain;
emit GasPayment(_outbox, _leafIndex, msg.value);
| _destinationDomain;
emit GasPayment(_outbox, _leafIndex, msg.value);
| 613 |
19 | // 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. / | function sub(
uint256 a,
uint256 b,
string memory errorMessage
| function sub(
uint256 a,
uint256 b,
string memory errorMessage
| 14,699 |
2 | // Beneficiary of tokens after they are released. | address private immutable _beneficiary;
| address private immutable _beneficiary;
| 26,834 |
163 | // See {IERC721-getApproved}. / | function getApproved(uint256 tokenId) public view override returns (address) {
require(_exists(tokenId), "ERC721A: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
| function getApproved(uint256 tokenId) public view override returns (address) {
require(_exists(tokenId), "ERC721A: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
| 864 |
45 | // Set SaleCap | function setSaleCap(uint256 _saleCap) public onlyOwner {
require(balances[0xb1].add(balances[tokenWallet]).sub(_saleCap) >= 0);
uint256 amount = 0;
//Check SaleCap
if (balances[tokenWallet] > _saleCap) {
amount = balances[tokenWallet].sub(_saleCap);
balances[0... | function setSaleCap(uint256 _saleCap) public onlyOwner {
require(balances[0xb1].add(balances[tokenWallet]).sub(_saleCap) >= 0);
uint256 amount = 0;
//Check SaleCap
if (balances[tokenWallet] > _saleCap) {
amount = balances[tokenWallet].sub(_saleCap);
balances[0... | 20,264 |
1 | // -0. / | bytes16 private constant NEGATIVE_ZERO = 0x80000000000000000000000000000000;
| bytes16 private constant NEGATIVE_ZERO = 0x80000000000000000000000000000000;
| 8,254 |
80 | // CAKE tokens created per block. | uint256 public rewardPerBlock;
| uint256 public rewardPerBlock;
| 54,957 |
20 | // Returns the set of filtered codeHashes for a given address or its subscription.Note that order is not guaranteed as updates are made. / | function filteredCodeHashes(address addr) external returns (bytes32[] memory);
| function filteredCodeHashes(address addr) external returns (bytes32[] memory);
| 23,189 |
8 | // Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. / | event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
| event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
| 1,173 |
137 | // Reverts if proxy delegatecalls to unexistent method. | fallback() external payable {
revert("WitnetRequestBoardUpgradableBase: not implemented");
}
| fallback() external payable {
revert("WitnetRequestBoardUpgradableBase: not implemented");
}
| 22,382 |
13 | // --- Naming --- | function setName(string calldata name_) external isAuthorized canChangeData {
name = name_;
DOMAIN_SEPARATOR = keccak256(abi.encode(
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
keccak256(bytes(name)),
... | function setName(string calldata name_) external isAuthorized canChangeData {
name = name_;
DOMAIN_SEPARATOR = keccak256(abi.encode(
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
keccak256(bytes(name)),
... | 23,723 |
83 | // Set the expected next function - VAL_SET | mstore(0x100, 3)
| mstore(0x100, 3)
| 8,669 |
0 | // Returns the addition of two unsigned integers, with an overflow flag. _Available since v3.4._ / | function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
| function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
| 33,364 |
332 | // After a redemption happens, transfer the newly minted FXS and owed collateral from this pool contract to the user. Redemption is split into two functions to prevent flash loans from being able to take out FRAX/collateral from the system, use an AMM to trade the new price, and then mint back into the system. | function collectRedemption() external {
require((lastRedeemed[msg.sender].add(redemption_delay)) <= block.number, "Must wait for redemption_delay blocks before collecting redemption");
bool sendFXS = false;
bool sendCollateral = false;
uint FXSAmount;
uint CollateralAmount;
... | function collectRedemption() external {
require((lastRedeemed[msg.sender].add(redemption_delay)) <= block.number, "Must wait for redemption_delay blocks before collecting redemption");
bool sendFXS = false;
bool sendCollateral = false;
uint FXSAmount;
uint CollateralAmount;
... | 21,978 |
711 | // withdraw collateral from cdp | drawCollateral(address(manager), _cdpId, _joinAddr, maxColl);
| drawCollateral(address(manager), _cdpId, _joinAddr, maxColl);
| 49,413 |
50 | // ----------------------------------------------------------------------------Pausable tokenStandardToken modified with pausable transfers. ---------------------------------------------------------------------------- | contract PausableToken is StandardToken, Pausable, BlackList {
function transfer(address _to, uint256 _value) public whenNotPaused CheckBlackList returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused CheckBlack... | contract PausableToken is StandardToken, Pausable, BlackList {
function transfer(address _to, uint256 _value) public whenNotPaused CheckBlackList returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused CheckBlack... | 22,277 |
98 | // ========== STATE VARIABLES ========== / uniswap | address public token0;
address public token1;
IUniswapV2Pair public pair;
| address public token0;
address public token1;
IUniswapV2Pair public pair;
| 3,115 |
84 | // minimum ETH investment amount | uint private minimalContribution;
bool releasedTokens;
| uint private minimalContribution;
bool releasedTokens;
| 4,705 |
31 | // Bidder -> topLevel Owner, pay top level owner fee | SafeERC20.safeTransferFrom(token, bidder, topLevelOwner, topLevelFee);
| SafeERC20.safeTransferFrom(token, bidder, topLevelOwner, topLevelFee);
| 28,022 |
143 | // ERC20 token - Burnable - Snapshot - EIP712 - human readable signed messages - ERC677 - transfer and call - approve tokens and call a function on another contract in one transaction | contract TstToken is ERC20Snapshot, AccessControl, EIP712Base {
uint256 public constant INITIAL_SUPPLY = 1000000000 * 10**18; //1,000,000,000 tokens (18 decimals)
bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE");
constructor(address to) ERC20("Tst Token", "TST") {
_mint(to, INITIAL... | contract TstToken is ERC20Snapshot, AccessControl, EIP712Base {
uint256 public constant INITIAL_SUPPLY = 1000000000 * 10**18; //1,000,000,000 tokens (18 decimals)
bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE");
constructor(address to) ERC20("Tst Token", "TST") {
_mint(to, INITIAL... | 9,632 |
28 | // Gov Events // Event emitted when pendingGov is changed / | event NewPendingGov(address oldPendingGov, address newPendingGov);
| event NewPendingGov(address oldPendingGov, address newPendingGov);
| 4,070 |
7 | // require(msg.value == amount(1 ether), "oui"); | require(amount < 11);
uint256 newId;
for(uint256 i = 0; i < amount; i++) {
if(arrayIds[counter] != 10000) {
newId = arrayIds[counter];
}else {
| require(amount < 11);
uint256 newId;
for(uint256 i = 0; i < amount; i++) {
if(arrayIds[counter] != 10000) {
newId = arrayIds[counter];
}else {
| 1,771 |
18 | // Returns a claim by IDreturn (topic, scheme, issuer, signature, data, uri) tuple with claim data / | function get(Claims storage self, bytes32 _claimId)
public
view
returns (
uint256 topic,
uint256 scheme,
address issuer,
bytes signature,
bytes data,
string uri
| function get(Claims storage self, bytes32 _claimId)
public
view
returns (
uint256 topic,
uint256 scheme,
address issuer,
bytes signature,
bytes data,
string uri
| 26,874 |
41 | // Reset all the balances to 0 and the state to false. / | function clean() public
| function clean() public
| 45,557 |
35 | // // Activates/Adds a particular User's Address in the Protocol.Keeps track of the Total User Count Executes its main actions only if the User is not activated yet. Does nothing if an address has already been added._user address of the userreturn userAlreadyAdded returns whether or not a user is already added. / | function _addUser(address _user) private returns (bool userAlreadyAdded) {
if (users[_user].userActivated) {
userAlreadyAdded = true;
} else {
// Activates the user
users[_user].userStartBlock = block.number;
users[_user].userActivated = true;
... | function _addUser(address _user) private returns (bool userAlreadyAdded) {
if (users[_user].userActivated) {
userAlreadyAdded = true;
} else {
// Activates the user
users[_user].userStartBlock = block.number;
users[_user].userActivated = true;
... | 8,094 |
47 | // set last index to receiver | _owners.push(to);
emit Transfer(address(0), to, _currentIndex + (qty - 1));
| _owners.push(to);
emit Transfer(address(0), to, _currentIndex + (qty - 1));
| 3,222 |
11 | // Generate randomly the skin colors/tokenId the current tokenId/seed Used for the initialization of the number generator./ return the skin item id | function generateSkinId(uint256 tokenId, uint256 seed) external view returns (uint8);
| function generateSkinId(uint256 tokenId, uint256 seed) external view returns (uint8);
| 46,353 |
80 | // % to swap & send to marketing wallet | uint256 public defaultMarketingFee = 7;
uint256 public _marketingFee = defaultMarketingFee;
uint256 private _previousMarketingFee = _marketingFee;
uint256 public _marketingFee4Sellers = 7;
bool public feesOnSellersAndBuyers = true;
uint256 public _maxTxAmount = _tTotal.div(1).div(49);
uin... | uint256 public defaultMarketingFee = 7;
uint256 public _marketingFee = defaultMarketingFee;
uint256 private _previousMarketingFee = _marketingFee;
uint256 public _marketingFee4Sellers = 7;
bool public feesOnSellersAndBuyers = true;
uint256 public _maxTxAmount = _tTotal.div(1).div(49);
uin... | 10,486 |
45 | // TOTAL_GONS is a multiple of INITIAL_FRAGMENTS_SUPPLY so that _gonsPerFragment is an integer. Use the highest value that fits in a uint256 for max granularity. | uint256 private constant TOTAL_GONS = MAX_UINT256 - (MAX_UINT256 % INITIAL_FRAGMENTS_SUPPLY);
| uint256 private constant TOTAL_GONS = MAX_UINT256 - (MAX_UINT256 % INITIAL_FRAGMENTS_SUPPLY);
| 7,197 |
57 | // This call should always revert to decode the actual asset deltas from the revert reason | switch success
case 0 {
| switch success
case 0 {
| 2,267 |
1 | // Maps execution ids to its registry app metadata | mapping (bytes32 => Registry) public registry_instance_info;
| mapping (bytes32 => Registry) public registry_instance_info;
| 48,730 |
25 | // Get the vault's old ICR before the adjustment, and what its new ICR will be after the adjustment | vars.oldICR = OrumMath._computeCR(vars.coll, vars.debt, vars.price);
vars.newICR = _getNewICRFromVaultChange(vars.coll, vars.debt, vars.collChange, vars.isCollIncrease, vars.netDebtChange, _isDebtIncrease, vars.ROSEFee, vars.price);
assert(_collWithdrawal <= vars.coll);
| vars.oldICR = OrumMath._computeCR(vars.coll, vars.debt, vars.price);
vars.newICR = _getNewICRFromVaultChange(vars.coll, vars.debt, vars.collChange, vars.isCollIncrease, vars.netDebtChange, _isDebtIncrease, vars.ROSEFee, vars.price);
assert(_collWithdrawal <= vars.coll);
| 31,267 |
169 | // A mapping from token to last price | mapping (uint256 => uint256) public tokenToLastPrice;
function getCountdowns() public view returns(uint256[5]) {
return countdowns;
}
| mapping (uint256 => uint256) public tokenToLastPrice;
function getCountdowns() public view returns(uint256[5]) {
return countdowns;
}
| 6,951 |
229 | // console.log("\tlength=%d limist=%d", donationLotteryUsers.length, donationLotteryMinLimit); | if (donationLotteryUsers.length < donationLotteryMinLimit){
return;
}
| if (donationLotteryUsers.length < donationLotteryMinLimit){
return;
}
| 68,738 |
52 | // CG: Get the specific bid and validate that it does belong to the sender. | Bid storage bid = node.bids[_bidId];
require(bid.bidder == msg.sender, "ABQDAO/only-bidder-may-request-refund");
| Bid storage bid = node.bids[_bidId];
require(bid.bidder == msg.sender, "ABQDAO/only-bidder-may-request-refund");
| 54,728 |
93 | // Gets the token namereturn string representing the token name / | function name() external view returns (string) {
return name_;
}
| function name() external view returns (string) {
return name_;
}
| 37,972 |
34 | // Validate address array is not empty and contains no duplicate elements.AArray of addresses / | function _validateLengthAndUniqueness(address[] memory A) internal pure {
require(A.length > 0, "Array length must be > 0");
require(!hasDuplicate(A), "Cannot duplicate addresses");
}
| function _validateLengthAndUniqueness(address[] memory A) internal pure {
require(A.length > 0, "Array length must be > 0");
require(!hasDuplicate(A), "Cannot duplicate addresses");
}
| 38,732 |
341 | // length of each staking period in seconds. 7 days = 604,800; 3 months = 7,862,400 | uint256 public constant DURATION = 1 weeks;
| uint256 public constant DURATION = 1 weeks;
| 23,834 |
294 | // Sets the decimals of the underlying asset of the reserve self The reserve configuration decimals The decimals / | {
require(decimals <= MAX_VALID_DECIMALS, Errors.RC_INVALID_DECIMALS);
self.data = (self.data & DECIMALS_MASK) | (decimals << RESERVE_DECIMALS_START_BIT_POSITION);
}
| {
require(decimals <= MAX_VALID_DECIMALS, Errors.RC_INVALID_DECIMALS);
self.data = (self.data & DECIMALS_MASK) | (decimals << RESERVE_DECIMALS_START_BIT_POSITION);
}
| 15,317 |
70 | // Unstake an exact qty of units | function unstakeExact(uint units, address token) public returns (bool success) {
address payable pool = getPool(token);
address payable member = msg.sender;
(uint _outputBase, uint _outputToken) = _DAO().UTILS().getPoolShare(token, units);
totalStaked = totalStaked.sub(_outputBase);
... | function unstakeExact(uint units, address token) public returns (bool success) {
address payable pool = getPool(token);
address payable member = msg.sender;
(uint _outputBase, uint _outputToken) = _DAO().UTILS().getPoolShare(token, units);
totalStaked = totalStaked.sub(_outputBase);
... | 30,601 |
124 | // solhint-disable-next-line not-rely-on-time | require(now > auctions[_pepeId].auctionEnd);//can only start new auction if no other is active
PepeAuction memory auction;
auction.seller = _seller;
auction.pepeId = _pepeId;
| require(now > auctions[_pepeId].auctionEnd);//can only start new auction if no other is active
PepeAuction memory auction;
auction.seller = _seller;
auction.pepeId = _pepeId;
| 16,361 |
9 | // dETH brought back to registry | event dETHDepositedIntoRegistry(address indexed depositor, uint256 amount);
| event dETHDepositedIntoRegistry(address indexed depositor, uint256 amount);
| 17,038 |
19 | // On initialization, we lock _getMinimumBpt() by minting it for the zero address. This BPT acts as a minimum as it will never be burned, which reduces potential issues with rounding, and also prevents the Pool from ever being fully drained. | _require(bptAmountOut >= _getMinimumBpt(), Errors.MINIMUM_BPT);
_mintPoolTokens(address(0), _getMinimumBpt());
_mintPoolTokens(recipient, bptAmountOut - _getMinimumBpt());
| _require(bptAmountOut >= _getMinimumBpt(), Errors.MINIMUM_BPT);
_mintPoolTokens(address(0), _getMinimumBpt());
_mintPoolTokens(recipient, bptAmountOut - _getMinimumBpt());
| 8,983 |
39 | // eth:dge1, give ctoken ok ban | // function myaddLiquidityETHBackCtoken(address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to) public payable returns(uint256 _amountCt, uint _amountToken, uint _amountETH, uint _liquidity) {
// (uint amountToken, uint amountETH, uint liquidity) = myaddLiquidityETH(to... | // function myaddLiquidityETHBackCtoken(address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to) public payable returns(uint256 _amountCt, uint _amountToken, uint _amountETH, uint _liquidity) {
// (uint amountToken, uint amountETH, uint liquidity) = myaddLiquidityETH(to... | 9,400 |
53 | // Clear approvals from the previous owner | _approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
for (uint i=0; i<_tokensOfOwners[from].length; i++) {
if(_tokensOfOwners[from][i]==tokenId){
delete _tokensOfOwner... | _approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
for (uint i=0; i<_tokensOfOwners[from].length; i++) {
if(_tokensOfOwners[from][i]==tokenId){
delete _tokensOfOwner... | 6,731 |
47 | // m_Users[user].GroupID=group; | return m_Group_Sum[group];
| return m_Group_Sum[group];
| 22,165 |
22 | // add to reward contract | address rewards = t.rewardAddress;
if(rewards == address(0)) continue;
IERC20(token).safeTransfer(rewards, amount);
IRewards(rewards).queueNewRewards(amount);
| address rewards = t.rewardAddress;
if(rewards == address(0)) continue;
IERC20(token).safeTransfer(rewards, amount);
IRewards(rewards).queueNewRewards(amount);
| 15,895 |
54 | // https:docs.synthetix.io/contracts/RewardsDistributionRecipient | contract RewardsDistributionRecipient is Owned {
address public rewardsDistribution;
function notifyRewardAmount(uint256 reward) external;
modifier onlyRewardsDistribution() {
require(msg.sender == rewardsDistribution, "Caller is not RewardsDistribution contract");
_;
}
function s... | contract RewardsDistributionRecipient is Owned {
address public rewardsDistribution;
function notifyRewardAmount(uint256 reward) external;
modifier onlyRewardsDistribution() {
require(msg.sender == rewardsDistribution, "Caller is not RewardsDistribution contract");
_;
}
function s... | 16,348 |
412 | // for distribute wpc | IPiggyDistribution piggyDistribution;
mapping(address => uint256) public mintCaps;
| IPiggyDistribution piggyDistribution;
mapping(address => uint256) public mintCaps;
| 9,558 |
38 | // return an adresses "cold wallet" status / | function isColdWallet(address _addr) external returns (uint256);
| function isColdWallet(address _addr) external returns (uint256);
| 32,763 |
114 | // 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;
|
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
| 80 |
504 | // Verify that the message's signer is the owner of the order | require(messageHash.recover(signature) == owner(), "Invalid signature");
require(!seenNonces[msg.sender][nonce], "Used nonce");
seenNonces[msg.sender][nonce] = true;
_;
| require(messageHash.recover(signature) == owner(), "Invalid signature");
require(!seenNonces[msg.sender][nonce], "Used nonce");
seenNonces[msg.sender][nonce] = true;
_;
| 18,462 |
8 | // глагол:проходить{ вид:несоверш },Беседа проходила в дружественной атмосфере. | rus_verbs:подать{}, // Автор подал своих героев в реалистических тонах.
| rus_verbs:подать{}, // Автор подал своих героев в реалистических тонах.
| 25,145 |
4 | // In order to keep backwards compatibility we have kept the userseed field around. We remove the use of it because given that the blockhashenters later, it overrides whatever randomness the used seed provides.Given that it adds no security, and can easily lead to misunderstandings,we have removed it from usage and can... | uint256 private constant USER_SEED_PLACEHOLDER = 0;
| uint256 private constant USER_SEED_PLACEHOLDER = 0;
| 6,692 |
85 | // _onum = uint8((uint256(keccak256(abi.encodePacked(block.number, block.difficulty, block.timestamp, _account)))).div(1e75)); |
_onum = uint8(uint256(keccak256(abi.encodePacked(
block.timestamp + block.difficulty +
((uint256(keccak256(abi.encodePacked(block.coinbase)))) / (block.timestamp)) +
block.gaslimit +
((uint256(keccak256(abi.encodePacked(_accou... |
_onum = uint8(uint256(keccak256(abi.encodePacked(
block.timestamp + block.difficulty +
((uint256(keccak256(abi.encodePacked(block.coinbase)))) / (block.timestamp)) +
block.gaslimit +
((uint256(keccak256(abi.encodePacked(_accou... | 8,492 |
102 | // Token transfer/ Note: additional requirements are enforces within internal function./_to Ethereum address of token recipient/_valueToken amount to transfer/ returnAlways true | function transfer(address _to, uint _value) public returns (bool) {
return _transfer(msg.sender, _to, _value);
}
| function transfer(address _to, uint _value) public returns (bool) {
return _transfer(msg.sender, _to, _value);
}
| 5,033 |
19 | // read version of update | uint256 cnBlock = blockNumber();
uint256 accRewardPerToken = _accRewardPerToken;
| uint256 cnBlock = blockNumber();
uint256 accRewardPerToken = _accRewardPerToken;
| 45,309 |
3 | // hash without seal for signature check | bytes32 bare_hash = keccak256(abi.encodePacked(blocks[i].p0_bare, rlp));
address validator = GetValidator(bytesToUint(blocks[i].timestamp));
CheckSignature(validator, bare_hash, blocks[i].signature);
| bytes32 bare_hash = keccak256(abi.encodePacked(blocks[i].p0_bare, rlp));
address validator = GetValidator(bytesToUint(blocks[i].timestamp));
CheckSignature(validator, bare_hash, blocks[i].signature);
| 20,600 |
48 | // load those bytes into returnValue | returnValue := mload(0x0)
| returnValue := mload(0x0)
| 35,062 |
3 | // triggered when the upgrading process is done | event ConverterUpgrade(address indexed _oldConverter, address indexed _newConverter);
| event ConverterUpgrade(address indexed _oldConverter, address indexed _newConverter);
| 17,707 |
1 | // Este _ significa dizer para a EVM (Ethereum Virtual Machine) continuar a executar o que vem na sequencia na clausula caso o requirimento acima tenha sido atendido | _;
| _;
| 1,885 |
0 | // string private _baseURIextended; | string public notRevealedUri;
address public owner_address;
address public admin_address;
address public sysadm_address;
bool public revealed = false;
| string public notRevealedUri;
address public owner_address;
address public admin_address;
address public sysadm_address;
bool public revealed = false;
| 28,925 |
21 | // the first parameter (toAddress) is used to ensure transactions in safe mode only go to a signer if in safe mode, we should use normal sendMultiSig to recover, so this check will always fail if in safe mode | require(!safeMode, "Batch in safe mode");
address otherSigner = verifyMultiSig(
address(0x0),
operationHash,
signature,
expireTime,
sequenceId
);
batchTransfer(recipients, values);
| require(!safeMode, "Batch in safe mode");
address otherSigner = verifyMultiSig(
address(0x0),
operationHash,
signature,
expireTime,
sequenceId
);
batchTransfer(recipients, values);
| 21,230 |
33 | // operation events | event CollectFee(address addr, uint feeInWei, uint feeBalanceInWei);
event UpdateOracle(address newOracleAddress);
event UpdateFeeCollector(address updater, address newFeeCollector);
| event CollectFee(address addr, uint feeInWei, uint feeBalanceInWei);
event UpdateOracle(address newOracleAddress);
event UpdateFeeCollector(address updater, address newFeeCollector);
| 55,025 |
586 | // withdrawel of rest | function withdraw() public payable onlyOwner {
uint256 restAmount = address(this).balance - accountOne - accountTwo;
if(restAmount >= 0) {
require(payable(msg.sender).send(restAmount));
}
}
| function withdraw() public payable onlyOwner {
uint256 restAmount = address(this).balance - accountOne - accountTwo;
if(restAmount >= 0) {
require(payable(msg.sender).send(restAmount));
}
}
| 59,022 |
12 | // Event emitted when new DepositController address is set newController New DepositController address / | event DepositControllerChanged(IDepositController indexed newController);
| event DepositControllerChanged(IDepositController indexed newController);
| 19,480 |
34 | // Adjust the yield asset balance associated with this address. | YieldIndex storage yIndex = yieldIndexMap[_address];
| YieldIndex storage yIndex = yieldIndexMap[_address];
| 22,592 |
122 | // Verifies that an order signature is valid./pubKey Public address of signer./hash Signed Keccak-256 hash./v ECDSA signature parameter v./r ECDSA signature parameters r./s ECDSA signature parameters s./ return Validity of order signature. | function isValidSignature(
address pubKey,
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s)
public
constant
returns (bool)
| function isValidSignature(
address pubKey,
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s)
public
constant
returns (bool)
| 16,289 |
5 | // Sales info for token purchases | IFixedPriceToken.SaleInfo public saleInfo;
| IFixedPriceToken.SaleInfo public saleInfo;
| 29,005 |
31 | // Set new Stake Creator address. _stakeCreator The address of the new Stake Creator. / | function setNewStakeCreator(address _stakeCreator) external onlyOwner {
require(_stakeCreator != address(0), 'Do not use 0 address');
stakeCreator = _stakeCreator;
}
| function setNewStakeCreator(address _stakeCreator) external onlyOwner {
require(_stakeCreator != address(0), 'Do not use 0 address');
stakeCreator = _stakeCreator;
}
| 36,278 |
112 | // Hash(current computed hash + current element of the proof) | computedHash = _efficientHash(computedHash, proofElement);
| computedHash = _efficientHash(computedHash, proofElement);
| 39,352 |
19 | // Handle after direct SGR transfer operation. _sender The address of the sender. _to The address of the destination account. _value The SGR transferred amount. _transferResult The transfer result.return is success result. / | function afterTransfer(address _sender, address _to, uint256 _value, bool _transferResult) external returns (bool);
| function afterTransfer(address _sender, address _to, uint256 _value, bool _transferResult) external returns (bool);
| 33,140 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.