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 |
|---|---|---|---|---|
75 | // register pools | mapping (address => bool) public _pools;
| mapping (address => bool) public _pools;
| 36,962 |
12 | // Random Number Generator returning the blockhash with a backup behaviour. Allows saving the random number for use in the future.It allows the contract to still access the blockhash even after 256 blocks. The first party to call the save function gets the reward. If no one calls the contract within 256 blocks, the contract fallback in returning the blockhash of the previous block. / | contract BlockHashRNGFallback is BlockHashRNG {
/** @dev Save the random number for this blockhash and give the reward to the caller.
* @param _block Block the random number is linked to.
*/
function saveRN(uint _block) public {
if (_block<block.number && randomNumber[_block]==0) {// If the random number is not already set and can be.
if (blockhash(_block)!=0x0) // Normal case.
randomNumber[_block]=uint(blockhash(_block));
else // The contract was not called in time. Fallback to returning previous blockhash.
randomNumber[_block]=uint(blockhash(block.number-1));
}
if (randomNumber[_block] != 0) { // If the random number is set.
uint rewardToSend=reward[_block];
reward[_block]=0;
msg.sender.send(rewardToSend); // Note that the use of send is on purpose as we don't want to block in case the msg.sender has a fallback issue.
}
}
} | contract BlockHashRNGFallback is BlockHashRNG {
/** @dev Save the random number for this blockhash and give the reward to the caller.
* @param _block Block the random number is linked to.
*/
function saveRN(uint _block) public {
if (_block<block.number && randomNumber[_block]==0) {// If the random number is not already set and can be.
if (blockhash(_block)!=0x0) // Normal case.
randomNumber[_block]=uint(blockhash(_block));
else // The contract was not called in time. Fallback to returning previous blockhash.
randomNumber[_block]=uint(blockhash(block.number-1));
}
if (randomNumber[_block] != 0) { // If the random number is set.
uint rewardToSend=reward[_block];
reward[_block]=0;
msg.sender.send(rewardToSend); // Note that the use of send is on purpose as we don't want to block in case the msg.sender has a fallback issue.
}
}
} | 41,108 |
27 | // Store each round an account holds validation rewards | uint256[] rewards;
| uint256[] rewards;
| 67,581 |
2,332 | // repay dai debt cdp |
paybackDebt(_cdpId, ilk, _loanAmount, owner);
maxColl = _collateral > maxColl ? maxColl : _collateral;
|
paybackDebt(_cdpId, ilk, _loanAmount, owner);
maxColl = _collateral > maxColl ? maxColl : _collateral;
| 711 |
39 | // Tax receiver data | mapping (bytes32 => mapping(uint256 => TaxReceiver)) public secondaryTaxReceivers;
| mapping (bytes32 => mapping(uint256 => TaxReceiver)) public secondaryTaxReceivers;
| 54,558 |
14 | // Get Burn amount (4%) | uint256 burnAmount = amount.mul(BURN_PERCENT.div(100));
super._burn(from, burnAmount);
emit Burned(from, burnAmount);
| uint256 burnAmount = amount.mul(BURN_PERCENT.div(100));
super._burn(from, burnAmount);
emit Burned(from, burnAmount);
| 13,549 |
254 | // If there is no mint/redeem, and the new total balance >= old one, then the weight must be non-increasing and thus there is no penalty. | if (amounts[i] == 0 && newTotalBalance >= oldTotalBalance) {
continue;
}
| if (amounts[i] == 0 && newTotalBalance >= oldTotalBalance) {
continue;
}
| 79,276 |
4 | // Mark it claimed and send the token. setAddressClaimed(msg.sender); | SuperWaleMustapha.transfer(msg.sender, _amount);
| SuperWaleMustapha.transfer(msg.sender, _amount);
| 38,288 |
41 | // EIP-2981 royalties implementation | function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
override
returns (address receiver, uint256 royaltyAmount)
| function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
override
returns (address receiver, uint256 royaltyAmount)
| 40,369 |
112 | // protect against price manipulation | uint max = totalDebt.mul(delta) / DELTA_MIN;
if (totalUnderlying <= max) {
| uint max = totalDebt.mul(delta) / DELTA_MIN;
if (totalUnderlying <= max) {
| 21,406 |
6 | // total number of tokens that has been staked by all the users. | uint128 totalTokensStaked;
| uint128 totalTokensStaked;
| 6,335 |
67 | // Team allocation percentages (F3D, P3D) + (Pot , Referrals, Community)解读:TeamFee, PotSplit 第一个参数都是分给现在key holder的比例, 第二个是给Pow3D的比例 Referrals / Community rewards are mathematically designed to come from the winner&39;s share of the pot. | fees_[0] = F3Ddatasets.TeamFee(80,0); //10% to pot, 8% to aff, 2% to com
| fees_[0] = F3Ddatasets.TeamFee(80,0); //10% to pot, 8% to aff, 2% to com
| 50,273 |
11 | // Just for testing whether the parallel revert function is working well, no practical use | function transferWithRevert(string from, string to, uint256 num) public
| function transferWithRevert(string from, string to, uint256 num) public
| 4,205 |
196 | // Require permitted Oracle | require(permittedAddresses.isMatchTypes(_newOracle, 5), "WRONG_ADDRESS");
| require(permittedAddresses.isMatchTypes(_newOracle, 5), "WRONG_ADDRESS");
| 43,534 |
60 | // score is no longer finalized | finalized = false;
LogUnfinalized(currentTime());
| finalized = false;
LogUnfinalized(currentTime());
| 31,868 |
126 | // Load the total fees | uint256 localFeeUnderlying = uint256(feesUnderlying);
uint256 localFeeBond = uint256(feesBond);
dueProtocolFees = new uint256[](2);
| uint256 localFeeUnderlying = uint256(feesUnderlying);
uint256 localFeeBond = uint256(feesBond);
dueProtocolFees = new uint256[](2);
| 54,421 |
52 | // Withdraws quote token from existing NFT position poolAddress of the Ajana Pool. amountToWithdraw The maximum amount of quote token to be withdrawn by a lender. pricePrice of the bucket to withdraw from tokenId ID of the NFT to modify / | function withdrawQuoteNft(
IERC20Pool pool,
uint256 amountToWithdraw,
uint256 price,
uint256 tokenId
| function withdrawQuoteNft(
IERC20Pool pool,
uint256 amountToWithdraw,
uint256 price,
uint256 tokenId
| 33,335 |
1 | // 定义投票主题的结构 | struct Posposal {
bytes8 name; //投票主题的名字
uint voteCount; //主题的得到的票数
}
| struct Posposal {
bytes8 name; //投票主题的名字
uint voteCount; //主题的得到的票数
}
| 49,677 |
9 | // ERC2981 - Royalty Provide standard on-chain EIP-2981 royalty support for ERC721 or ERC1155 tokens, and additional functions for Rarible and Foundation. @custom:type eip-2535-facet@custom:category Finance@custom:provides-interfaces IEIP2981 IRoyalty IRaribleV1 IRaribleV2 IFoundation IEIP2981RoyaltyOverride / | contract Royalty is IRoyalty, RoyaltyInternal {
using RoyaltyStorage for RoyaltyStorage.Layout;
function defaultRoyalty() external view virtual returns (TokenRoyalty memory) {
return RoyaltyStorage.layout().defaultRoyalty;
}
/**
* @dev EIP-2981
*/
function royaltyInfo(uint256 tokenId, uint256 value) external view virtual returns (address, uint256) {
return _royaltyInfo(tokenId, value);
}
/**
* @dev IEIP2981RoyaltyOverride (Manifold)
*/
function getTokenRoyaltiesCount() external view virtual override returns (uint256) {
return _getTokenRoyaltiesCount();
}
function getTokenRoyaltyByIndex(uint256 index) external view virtual override returns (TokenRoyaltyConfig memory) {
return _getTokenRoyaltyByIndex(index);
}
/**
* @dev IFoundation
*/
function getFees(uint256 tokenId) external view virtual returns (address payable[] memory, uint256[] memory) {
address payable[] memory receivers = new address payable[](1);
uint256[] memory bps = new uint256[](1);
(address receiver, uint256 value) = _royaltyInfo(tokenId, 10000);
receivers[0] = payable(receiver);
bps[0] = value;
return (receivers, bps);
}
/**
* @dev IRaribleV1
*/
function getFeeRecipients(uint256 tokenId) external view virtual returns (address payable[] memory) {
address payable[] memory receivers = new address payable[](1);
(address receiver, ) = _royaltyInfo(tokenId, 10000);
receivers[0] = payable(receiver);
return receivers;
}
function getFeeBps(uint256 tokenId) external view virtual returns (uint256[] memory) {
uint256[] memory bps = new uint256[](1);
(, uint256 value) = _royaltyInfo(tokenId, 10000);
bps[0] = value;
return bps;
}
/**
* @dev IRaribleV2
*/
function getRaribleV2Royalties(uint256 tokenId) external view override returns (IRaribleV2.Part[] memory result) {
result = new IRaribleV2.Part[](1);
// Passing 10,000 as value will give us the bps (basis points, out of 10,000) of the royalty.
(address account, uint256 value) = _royaltyInfo(tokenId, 10000);
result[0].account = payable(account);
result[0].value = uint96(value);
}
}
| contract Royalty is IRoyalty, RoyaltyInternal {
using RoyaltyStorage for RoyaltyStorage.Layout;
function defaultRoyalty() external view virtual returns (TokenRoyalty memory) {
return RoyaltyStorage.layout().defaultRoyalty;
}
/**
* @dev EIP-2981
*/
function royaltyInfo(uint256 tokenId, uint256 value) external view virtual returns (address, uint256) {
return _royaltyInfo(tokenId, value);
}
/**
* @dev IEIP2981RoyaltyOverride (Manifold)
*/
function getTokenRoyaltiesCount() external view virtual override returns (uint256) {
return _getTokenRoyaltiesCount();
}
function getTokenRoyaltyByIndex(uint256 index) external view virtual override returns (TokenRoyaltyConfig memory) {
return _getTokenRoyaltyByIndex(index);
}
/**
* @dev IFoundation
*/
function getFees(uint256 tokenId) external view virtual returns (address payable[] memory, uint256[] memory) {
address payable[] memory receivers = new address payable[](1);
uint256[] memory bps = new uint256[](1);
(address receiver, uint256 value) = _royaltyInfo(tokenId, 10000);
receivers[0] = payable(receiver);
bps[0] = value;
return (receivers, bps);
}
/**
* @dev IRaribleV1
*/
function getFeeRecipients(uint256 tokenId) external view virtual returns (address payable[] memory) {
address payable[] memory receivers = new address payable[](1);
(address receiver, ) = _royaltyInfo(tokenId, 10000);
receivers[0] = payable(receiver);
return receivers;
}
function getFeeBps(uint256 tokenId) external view virtual returns (uint256[] memory) {
uint256[] memory bps = new uint256[](1);
(, uint256 value) = _royaltyInfo(tokenId, 10000);
bps[0] = value;
return bps;
}
/**
* @dev IRaribleV2
*/
function getRaribleV2Royalties(uint256 tokenId) external view override returns (IRaribleV2.Part[] memory result) {
result = new IRaribleV2.Part[](1);
// Passing 10,000 as value will give us the bps (basis points, out of 10,000) of the royalty.
(address account, uint256 value) = _royaltyInfo(tokenId, 10000);
result[0].account = payable(account);
result[0].value = uint96(value);
}
}
| 12,442 |
72 | // Check that auction doesn't need reset | require(!done, "Clipper/needs-reset");
| require(!done, "Clipper/needs-reset");
| 11,952 |
166 | // MIP39c2-SP3: Governance Core Unit - GOV-001 Hash: seth keccak -- "$(wget https:raw.githubusercontent.com/makerdao/mips/5c981b8b24c966d110f133c792d27e7728cc77ab/MIP39/MIP39c2-Subproposals/MIP39c2-SP3.md -q -O - 2>/dev/null)" | string constant public MIP39c2SP3 = "0x4476ffdb3a354f629e30766aaa0d6747490e2644f0f49d91f9dd2586c33c8c6e";
| string constant public MIP39c2SP3 = "0x4476ffdb3a354f629e30766aaa0d6747490e2644f0f49d91f9dd2586c33c8c6e";
| 54,990 |
25 | // Event emitted when exchange rate delta limit has been setoldLimit Previous limit newLimit New limit / | event ExchangeRateDeltaLimitSet(uint256 oldLimit, uint256 newLimit);
| event ExchangeRateDeltaLimitSet(uint256 oldLimit, uint256 newLimit);
| 1,679 |
3 | // Use a string as the account identifier, so people can have use any name they want |
mapping(string => bytes) proof_of_public_key;
mapping(string => uint) balanceOf;
|
mapping(string => bytes) proof_of_public_key;
mapping(string => uint) balanceOf;
| 46,467 |
323 | // Moves any USDC still in the Pool to Compound, and tracks the amount internally.This is done to earn interest on latent funds until we have other borrowers who can use it. Requirements: - The caller must be an admin. / | function sweepToCompound() public override onlyAdmin whenNotPaused {
IERC20 usdc = config.getUSDC();
uint256 usdcBalance = usdc.balanceOf(address(this));
ICUSDCContract cUSDC = config.getCUSDCContract();
// Approve compound to the exact amount
bool success = usdc.approve(address(cUSDC), usdcBalance);
require(success, "Failed to approve USDC for compound");
sweepToCompound(cUSDC, usdcBalance);
// Remove compound approval to be extra safe
success = config.getUSDC().approve(address(cUSDC), 0);
require(success, "Failed to approve USDC for compound");
}
| function sweepToCompound() public override onlyAdmin whenNotPaused {
IERC20 usdc = config.getUSDC();
uint256 usdcBalance = usdc.balanceOf(address(this));
ICUSDCContract cUSDC = config.getCUSDCContract();
// Approve compound to the exact amount
bool success = usdc.approve(address(cUSDC), usdcBalance);
require(success, "Failed to approve USDC for compound");
sweepToCompound(cUSDC, usdcBalance);
// Remove compound approval to be extra safe
success = config.getUSDC().approve(address(cUSDC), 0);
require(success, "Failed to approve USDC for compound");
}
| 14,488 |
561 | // Set the minimum fee for an order execution / | function setMinFee(uint128 fee) external onlyAdmin {
LibStorage.getConfigStorage().minFee = fee;
}
| function setMinFee(uint128 fee) external onlyAdmin {
LibStorage.getConfigStorage().minFee = fee;
}
| 51,885 |
10 | // Transfer the tokens from the sender to this contract | ERC20(l1Token).safeTransferFrom(msg.sender, address(this), amount);
| ERC20(l1Token).safeTransferFrom(msg.sender, address(this), amount);
| 43,644 |
5 | // Function to set the merging fee | function setMergingFee(uint256 _newMergingFee) external {
mergingFee = _newMergingFee;
}
| function setMergingFee(uint256 _newMergingFee) external {
mergingFee = _newMergingFee;
}
| 5,632 |
17 | // Base will always be index 0 | address base = Curve(_curve).reserves(0);
| address base = Curve(_curve).reserves(0);
| 10,465 |
22 | // Add an airline to the registration queue Can only be called from FlightSuretyApp contract | function registerAirline(address airlineAddress, address originAddress)
external
requireIsOperational
| function registerAirline(address airlineAddress, address originAddress)
external
requireIsOperational
| 5,937 |
119 | // List duration | uint32 duration;
| uint32 duration;
| 41,298 |
6 | // Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,non-reverting calls are assumed to be successful. / | function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
| function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
| 31,446 |
5 | // 총 공급량이 최대 발행량을 초과하지 않도록 확인 | require(totalSupply() + amount <= cap(), 'ERC20Capped: cap exceeded');
| require(totalSupply() + amount <= cap(), 'ERC20Capped: cap exceeded');
| 29,260 |
25 | // Saves the result of the game | games[++gameSerialId] = Game({ player: player, amount: amount, win: win, rewardIds: rewards });
| games[++gameSerialId] = Game({ player: player, amount: amount, win: win, rewardIds: rewards });
| 12,733 |
247 | // Active brains of Unitroller/ | address public comptrollerImplementation;
| address public comptrollerImplementation;
| 10,765 |
27 | // In case of accidental token transfer to this address, owner can transfer it elsewhere | function transferERC20Token(address _tokenAddress, address _to, uint256 _value)
public
| function transferERC20Token(address _tokenAddress, address _to, uint256 _value)
public
| 40,390 |
7 | // Adds a minter for potential refund tokenId The the minted token they would be reunder minter The address of the minter / | function addMinterForRefund(uint256 tokenId, address minter, address _sender) external {
onlyAdmin(_sender);
tokenMinters[tokenId] = minter;
}
| function addMinterForRefund(uint256 tokenId, address minter, address _sender) external {
onlyAdmin(_sender);
tokenMinters[tokenId] = minter;
}
| 17,875 |
35 | // mint new tokento owner collection collection groupId groupId socialType socialType amount mint amount tokenURI_ mint tokenURI_ / | function mintByWhiteAddress(
address to,
string memory collection,
uint256 groupId,
uint256 socialType,
uint256 amount,
string memory tokenURI_
| function mintByWhiteAddress(
address to,
string memory collection,
uint256 groupId,
uint256 socialType,
uint256 amount,
string memory tokenURI_
| 22,481 |
7 | // Mapping from owner to operator approvals | mapping(address => mapping(address => bool)) private _operatorApprovals;
| mapping(address => mapping(address => bool)) private _operatorApprovals;
| 7,419 |
73 | // File: contract-11d8e46302.sol | contract GermanShepherdDog is ERC20, Pausable, Ownable {
constructor() ERC20("German Shepherd Dog", "GSD") {
_mint(msg.sender, 1000000000000000000 * 10 ** decimals());
}
function pause() public onlyOwner {
_pause();
}
function unpause() public onlyOwner {
_unpause();
}
function _beforeTokenTransfer(address from, address to, uint256 amount)
internal
whenNotPaused
override
{
super._beforeTokenTransfer(from, to, amount);
}
} | contract GermanShepherdDog is ERC20, Pausable, Ownable {
constructor() ERC20("German Shepherd Dog", "GSD") {
_mint(msg.sender, 1000000000000000000 * 10 ** decimals());
}
function pause() public onlyOwner {
_pause();
}
function unpause() public onlyOwner {
_unpause();
}
function _beforeTokenTransfer(address from, address to, uint256 amount)
internal
whenNotPaused
override
{
super._beforeTokenTransfer(from, to, amount);
}
} | 81,532 |
2 | // Storage for token edition information | struct TokenEditionInfo {
string description;
string imageURI;
string animationURI;
}
| struct TokenEditionInfo {
string description;
string imageURI;
string animationURI;
}
| 21,671 |
5 | // The duration of voting on a proposal, in blocks | uint public votingPeriod;
| uint public votingPeriod;
| 19,067 |
10 | // the movie information | struct Movie {
string name;
string cover_hash;
Thumbs thumbs; // the information about thumb up and thumb down.
uint256 trx_reward;
uint256 token_reward;
address uploader; // who call the setMovie func.
StringArray keywords;
}
| struct Movie {
string name;
string cover_hash;
Thumbs thumbs; // the information about thumb up and thumb down.
uint256 trx_reward;
uint256 token_reward;
address uploader; // who call the setMovie func.
StringArray keywords;
}
| 48,948 |
159 | // Converts a uint to int and checks if positive/_x Number to be converted | function toPositiveInt(uint _x) internal pure returns (int y) {
y = int(_x);
require(y >= 0, "int-overflow");
}
| function toPositiveInt(uint _x) internal pure returns (int y) {
y = int(_x);
require(y >= 0, "int-overflow");
}
| 26,462 |
392 | // Calculate repay amount (_amount + (2 wei)) Approve transfer from | uint256 repayAmount = _getRepaymentAmountInternal(_saverData.flAmount);
ERC20(WETH_ADDR).approve(SOLO_MARGIN_ADDRESS, repayAmount);
Actions.ActionArgs[] memory operations = new Actions.ActionArgs[](3);
operations[0] = _getWithdrawAction(marketId, _saverData.flAmount, RAI_SAVER_FLASH_LOAN);
payable(RAI_SAVER_FLASH_LOAN).transfer(msg.value); // 0x fee
bytes memory exchangeData = packExchangeData(_exchangeData);
operations[1] = _getCallAction(abi.encode(exchangeData, _saverData), RAI_SAVER_FLASH_LOAN);
| uint256 repayAmount = _getRepaymentAmountInternal(_saverData.flAmount);
ERC20(WETH_ADDR).approve(SOLO_MARGIN_ADDRESS, repayAmount);
Actions.ActionArgs[] memory operations = new Actions.ActionArgs[](3);
operations[0] = _getWithdrawAction(marketId, _saverData.flAmount, RAI_SAVER_FLASH_LOAN);
payable(RAI_SAVER_FLASH_LOAN).transfer(msg.value); // 0x fee
bytes memory exchangeData = packExchangeData(_exchangeData);
operations[1] = _getCallAction(abi.encode(exchangeData, _saverData), RAI_SAVER_FLASH_LOAN);
| 49,360 |
1 | // Liq Add Cut fee at 1% initially | uint256 public LIQFEE = 100;
| uint256 public LIQFEE = 100;
| 10,375 |
17 | // pantherswap | function pantherCall(address _sender, uint256 _amount0, uint256 _amount1, bytes calldata _data) external {
execute(_sender, _amount0, _amount1, _data);
}
| function pantherCall(address _sender, uint256 _amount0, uint256 _amount1, bytes calldata _data) external {
execute(_sender, _amount0, _amount1, _data);
}
| 6,151 |
9 | // Security Check // Ensure this is an interest rate model contract. / | function isInterestRateModel() external pure returns (bool) {
return true;
}
| function isInterestRateModel() external pure returns (bool) {
return true;
}
| 3,381 |
6 | // Check if sender and receiver waller is whitelisted | function checkWhitelists (address from, address to) external view returns (bool);
| function checkWhitelists (address from, address to) external view returns (bool);
| 38,748 |
11 | // Decode a integer numeric value from a Witnet.Result as an `int128` value./_result An instance of Witnet.Result./ return The `int` decoded from the Witnet.Result. | function asInt128(Witnet.Result memory _result) external pure returns (int);
| function asInt128(Witnet.Result memory _result) external pure returns (int);
| 14,049 |
3,634 | // 1818 | entry "undomed" : ENG_ADJECTIVE
| entry "undomed" : ENG_ADJECTIVE
| 18,430 |
2 | // This is the inner, rebasing ERC. It's not what we interact with. | contract ATokenMock is ERC20Mock {
address internal immutable _underlyingAsset;
constructor(
string memory name,
string memory symbol,
address underlyingAsset
) ERC20Mock(name, symbol) {
_underlyingAsset = underlyingAsset;
}
// solhint-disable-next-line func-name-mixedcase
function UNDERLYING_ASSET_ADDRESS() external view returns (address) {
return _underlyingAsset;
}
}
| contract ATokenMock is ERC20Mock {
address internal immutable _underlyingAsset;
constructor(
string memory name,
string memory symbol,
address underlyingAsset
) ERC20Mock(name, symbol) {
_underlyingAsset = underlyingAsset;
}
// solhint-disable-next-line func-name-mixedcase
function UNDERLYING_ASSET_ADDRESS() external view returns (address) {
return _underlyingAsset;
}
}
| 40,055 |
12 | // method called by VRF with a random number rankId rank to set random for randomness random number / | function setNewPurity(uint256 rankId, uint256 randomness) external override {
require(
msg.sender == address(forgeRandom) || hasRole(DEFAULT_ADMIN_ROLE, msg.sender),
"Only random or admin allowed"
);
uint256 randomModulo = randomness % 100;
uint16 purityIncrease = 0;
if (randomModulo > 14) {
if (randomModulo < 30) {
purityIncrease = 100;
} else if (randomModulo < 45) {
purityIncrease = 200;
} else if (randomModulo < 60) {
purityIncrease = 300;
} else if (randomModulo < 75) {
purityIncrease = 400;
} else if (randomModulo < 90) {
purityIncrease = 500;
}
}
purityIncrease = purityIncrease * (purityMultiplier / 10);
uint16 purity = mineNft.getPurity(rankId);
uint16 newPurity = purity + purityIncrease;
uint16 finalPurity = (newPurity >= MAX_PURITY) ? MAX_PURITY : newPurity;
mineNft.setPurity(rankId, finalPurity);
}
| function setNewPurity(uint256 rankId, uint256 randomness) external override {
require(
msg.sender == address(forgeRandom) || hasRole(DEFAULT_ADMIN_ROLE, msg.sender),
"Only random or admin allowed"
);
uint256 randomModulo = randomness % 100;
uint16 purityIncrease = 0;
if (randomModulo > 14) {
if (randomModulo < 30) {
purityIncrease = 100;
} else if (randomModulo < 45) {
purityIncrease = 200;
} else if (randomModulo < 60) {
purityIncrease = 300;
} else if (randomModulo < 75) {
purityIncrease = 400;
} else if (randomModulo < 90) {
purityIncrease = 500;
}
}
purityIncrease = purityIncrease * (purityMultiplier / 10);
uint16 purity = mineNft.getPurity(rankId);
uint16 newPurity = purity + purityIncrease;
uint16 finalPurity = (newPurity >= MAX_PURITY) ? MAX_PURITY : newPurity;
mineNft.setPurity(rankId, finalPurity);
}
| 35,097 |
126 | // Start date of the TDE / | uint256 public TDEStartDate; // Epoch
| uint256 public TDEStartDate; // Epoch
| 7,469 |
3 | // Amount of ether a prospective recipient must pay to permanently become the recipient. See commit(). | uint public commitThreshold;
| uint public commitThreshold;
| 11,287 |
628 | // Open a margin position. Called by the margin trader who must provide both asigned loan offering as well as a DEX Order with which to sell the owedToken. addresses Addresses corresponding to:[0]= position owner [1]= owedToken [2]= heldToken [3]= loan payer [4]= loan owner [5]= loan taker [6]= loan position owner [7]= loan fee recipient [8]= loan lender fee token [9]= loan taker fee token [10]= exchange wrapper address values256 Values corresponding to:[0]= loan maximum amount [1]= loan minimum amount [2]= loan minimum heldToken [3]= loan lender fee [4]= loan taker fee [5]= loan expiration timestamp (in seconds) [6]= loan | function openPosition(
address[11] addresses,
uint256[10] values256,
uint32[4] values32,
bool depositInHeldToken,
bytes signature,
bytes order
)
external
| function openPosition(
address[11] addresses,
uint256[10] values256,
uint32[4] values32,
bool depositInHeldToken,
bytes signature,
bytes order
)
external
| 67,394 |
80 | // Transfer an item to a new user. itemId itemId of the item. recipient Address of the user to transfer to item to. / | function transfer(bytes32 itemId, address recipient) override external isOwner(itemId) isTransferable(itemId) isTransferEnabled(itemId, recipient) {
// Get item state.
ItemState storage state = itemState[itemId];
// Log the transfer.
emit Transfer(itemId, state.owner, recipient);
// Update ownership of the item.
state.owner = recipient;
// Disable this transfer in future and free up the slot.
itemTransferEnabled[itemId][recipient] = false;
}
| function transfer(bytes32 itemId, address recipient) override external isOwner(itemId) isTransferable(itemId) isTransferEnabled(itemId, recipient) {
// Get item state.
ItemState storage state = itemState[itemId];
// Log the transfer.
emit Transfer(itemId, state.owner, recipient);
// Update ownership of the item.
state.owner = recipient;
// Disable this transfer in future and free up the slot.
itemTransferEnabled[itemId][recipient] = false;
}
| 2,233 |
67 | // Transfer fee from signer to sender | IERC20(sourceToken).safeTransferFrom(
sourceWallet,
msg.sender,
discountAmount
);
| IERC20(sourceToken).safeTransferFrom(
sourceWallet,
msg.sender,
discountAmount
);
| 25,475 |
143 | // TRU price oracle | ITruPriceOracle public _oracle;
| ITruPriceOracle public _oracle;
| 57,036 |
10 | // rounds to zero if xy < RAY / 2 | function rdiv(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, RAY), y / 2) / y;
}
| function rdiv(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, RAY), y / 2) / y;
}
| 9,346 |
298 | // Batch mint. _accounts Array of all addresses to mint to. _amounts Array of all values to mint. / | function batchMint(address[] memory _accounts, uint256[] memory _amounts) public {
require(_accounts.length == _amounts.length, "SygnumToken: values and recipients are not equal.");
require(_accounts.length <= BATCH_LIMIT, "SygnumToken: batch count is greater than BATCH_LIMIT.");
for (uint256 i = 0; i < _accounts.length; i++) {
mint(_accounts[i], _amounts[i]);
}
}
| function batchMint(address[] memory _accounts, uint256[] memory _amounts) public {
require(_accounts.length == _amounts.length, "SygnumToken: values and recipients are not equal.");
require(_accounts.length <= BATCH_LIMIT, "SygnumToken: batch count is greater than BATCH_LIMIT.");
for (uint256 i = 0; i < _accounts.length; i++) {
mint(_accounts[i], _amounts[i]);
}
}
| 65,423 |
14 | // Can only challenge the only active claim, about the previous epoch | require(claims[_epoch].bridger != address(0), "No claim to challenge.");
require(block.timestamp < uint256(claims[_epoch].timestamp) + challengePeriod, "Challenge period elapsed.");
| require(claims[_epoch].bridger != address(0), "No claim to challenge.");
require(block.timestamp < uint256(claims[_epoch].timestamp) + challengePeriod, "Challenge period elapsed.");
| 27,058 |
103 | // Removes single address from whitelist. _beneficiary Address to be removed to the whitelist / | function removeFromWhitelist(address _beneficiary) external onlyOwner {
whitelist[_beneficiary] = false;
}
| function removeFromWhitelist(address _beneficiary) external onlyOwner {
whitelist[_beneficiary] = false;
}
| 61,158 |
601 | // calculates how much of a specific collateral can be liquidated, givena certain amount of principal currency. This function needs to be called afterall the checks to validate the liquidation have been performed, otherwise it might fail. _collateral the collateral to be liquidated _principal the principal currency to be liquidated _purchaseAmount the amount of principal being liquidated _userCollateralBalance the collatera balance for the specific _collateral asset of the user being liquidatedreturn the maximum amount that is possible to liquidated given all the liquidation constraints (user balance, close factor) andthe purchase amount / | {
collateralAmount = 0;
principalAmountNeeded = 0;
IPriceOracleGetter oracle =
IPriceOracleGetter(addressesProvider.getPriceOracle());
// Usage of a memory struct of vars to avoid "Stack too deep" errors due to local variables
AvailableCollateralToLiquidateLocalVars memory vars;
vars.collateralPrice = oracle.getAssetPrice(_collateral);
vars.principalCurrencyPrice = oracle.getAssetPrice(_principal);
vars.liquidationBonus = core.getReserveLiquidationBonus(_collateral);
vars.principalDecimals = core.getReserveDecimals(_principal);
vars.collateralDecimals = core.getReserveDecimals(_collateral);
//this is the maximum possible amount of the selected collateral that can be liquidated, given the
//max amount of principal currency that is available for liquidation.
vars.maxAmountCollateralToLiquidate = vars
.principalCurrencyPrice
.mul(_purchaseAmount)
.mul(10**vars.collateralDecimals)
.div(vars.collateralPrice.mul(10**vars.principalDecimals))
.mul(vars.liquidationBonus)
.div(100);
if (vars.maxAmountCollateralToLiquidate > _userCollateralBalance) {
collateralAmount = _userCollateralBalance;
principalAmountNeeded = vars
.collateralPrice
.mul(collateralAmount)
.mul(10**vars.principalDecimals)
.div(
vars.principalCurrencyPrice.mul(10**vars.collateralDecimals)
)
.mul(100)
.div(vars.liquidationBonus);
} else {
collateralAmount = vars.maxAmountCollateralToLiquidate;
principalAmountNeeded = _purchaseAmount;
}
return (collateralAmount, principalAmountNeeded);
}
| {
collateralAmount = 0;
principalAmountNeeded = 0;
IPriceOracleGetter oracle =
IPriceOracleGetter(addressesProvider.getPriceOracle());
// Usage of a memory struct of vars to avoid "Stack too deep" errors due to local variables
AvailableCollateralToLiquidateLocalVars memory vars;
vars.collateralPrice = oracle.getAssetPrice(_collateral);
vars.principalCurrencyPrice = oracle.getAssetPrice(_principal);
vars.liquidationBonus = core.getReserveLiquidationBonus(_collateral);
vars.principalDecimals = core.getReserveDecimals(_principal);
vars.collateralDecimals = core.getReserveDecimals(_collateral);
//this is the maximum possible amount of the selected collateral that can be liquidated, given the
//max amount of principal currency that is available for liquidation.
vars.maxAmountCollateralToLiquidate = vars
.principalCurrencyPrice
.mul(_purchaseAmount)
.mul(10**vars.collateralDecimals)
.div(vars.collateralPrice.mul(10**vars.principalDecimals))
.mul(vars.liquidationBonus)
.div(100);
if (vars.maxAmountCollateralToLiquidate > _userCollateralBalance) {
collateralAmount = _userCollateralBalance;
principalAmountNeeded = vars
.collateralPrice
.mul(collateralAmount)
.mul(10**vars.principalDecimals)
.div(
vars.principalCurrencyPrice.mul(10**vars.collateralDecimals)
)
.mul(100)
.div(vars.liquidationBonus);
} else {
collateralAmount = vars.maxAmountCollateralToLiquidate;
principalAmountNeeded = _purchaseAmount;
}
return (collateralAmount, principalAmountNeeded);
}
| 9,858 |
130 | // positionposition in a memory blocksizedata sizebasebase dataunbox() extracts the data out of a 256bit word with the given position and returns itbase is checked by validRange() to make sure it is not over size / | function unbox (uint256 base, uint16 position, uint16 size) internal pure returns (uint256 unboxed) {
require(validRange(256, base), "Value out of range UNBOX");
assembly {
// (((1 << size) - 1) & base >> position)
unboxed := and(sub(shl(size, 1), 1), shr(position, base))
}
}
| function unbox (uint256 base, uint16 position, uint16 size) internal pure returns (uint256 unboxed) {
require(validRange(256, base), "Value out of range UNBOX");
assembly {
// (((1 << size) - 1) & base >> position)
unboxed := and(sub(shl(size, 1), 1), shr(position, base))
}
}
| 59,700 |
603 | // Event fired when asset's pricing source (aggregator) is updated | event AssetSourceUpdated(address indexed asset, address indexed source);
| event AssetSourceUpdated(address indexed asset, address indexed source);
| 13,310 |
645 | // Get remaining work to full refund/ | function getRemainingWork(address _bidder) external view returns (uint256) {
| function getRemainingWork(address _bidder) external view returns (uint256) {
| 50,322 |
69 | // send tokens | IERC20 token = IERC20(lock.token);
token.safeTransfer(msg.sender, availableAmount);
| IERC20 token = IERC20(lock.token);
token.safeTransfer(msg.sender, availableAmount);
| 24,487 |
6 | // Emitted on proposition execution/hash the transaction's hash/value the value passed with `transaction`/successful is the transaction were successfully executed | event ExecutedTransaction(
bytes32 indexed hash,
uint256 value,
bool successful
);
| event ExecutedTransaction(
bytes32 indexed hash,
uint256 value,
bool successful
);
| 26,350 |
2 | // mint the 91 sub-NFTs when a 2652 is folded._folder address of person folding/ | function mint(address _folder) external onlyTwenty {
uint256[] memory mintIds;
uint256[] memory mintAmounts;
for(uint256 i=1;i<=91;i++){
mintIds[i]=i;
mintAmounts[i]=1;
}
_mintBatch(_folder, mintIds, mintAmounts,"");
}
| function mint(address _folder) external onlyTwenty {
uint256[] memory mintIds;
uint256[] memory mintAmounts;
for(uint256 i=1;i<=91;i++){
mintIds[i]=i;
mintAmounts[i]=1;
}
_mintBatch(_folder, mintIds, mintAmounts,"");
}
| 30,696 |
89 | // Enqueues a request (if a request isn't already present) for the given `identifier`, `time` pair. Time must be in the past and the identifier must be supported. identifier uniquely identifies the price requested. eg BTC/USD (encoded as bytes32) could be requested. time unix timestamp for the price request. / | function requestPrice(bytes32 identifier, uint256 time) external;
| function requestPrice(bytes32 identifier, uint256 time) external;
| 30,675 |
9 | // bind aging time for each stages | agingTimeByStage.push(1507366800);
agingTimeByStage.push(1508058000);
| agingTimeByStage.push(1507366800);
agingTimeByStage.push(1508058000);
| 47,536 |
94 | // make sure first two characters are not 0x | if (_temp[0] == 0x30)
{
require(_temp[1] != 0x78, "string cannot start with 0x");
require(_temp[1] != 0x58, "string cannot start with 0X");
}
| if (_temp[0] == 0x30)
{
require(_temp[1] != 0x78, "string cannot start with 0x");
require(_temp[1] != 0x58, "string cannot start with 0X");
}
| 3,984 |
41 | // erase contribution from the database and do manual refund for disapproved users | // @param _backer {address} address of user to be erased
function eraseContribution(address _backer) external onlyOwner() {
Backer storage backer = backers[_backer];
backer.refunded = true;
totalTokensSent = totalTokensSent.sub(backer.tokensToSend);
}
| // @param _backer {address} address of user to be erased
function eraseContribution(address _backer) external onlyOwner() {
Backer storage backer = backers[_backer];
backer.refunded = true;
totalTokensSent = totalTokensSent.sub(backer.tokensToSend);
}
| 24,280 |
7 | // liquidateFeeRate: 0.1% => 100000 (105) liquidateFeeRate: 10% => 10000000 (107) liquidateFeeRate: 100% => 100000000 (108) It's used when call liquidate method. | uint256 public liquidateFeeRate;
uint256 public liquidateMXPFeeRate;
| uint256 public liquidateFeeRate;
uint256 public liquidateMXPFeeRate;
| 32,958 |
523 | // Returns the address of a valid Uniswap V3 Pool/factory The contract address of the Uniswap V3 factory/poolKey The identifying key of the V3 pool/ return pool The V3 pool contract address | function verifyCallback(address factory, PoolAddress.PoolKey memory poolKey)
internal
view
returns (IUniswapV3Pool pool)
| function verifyCallback(address factory, PoolAddress.PoolKey memory poolKey)
internal
view
returns (IUniswapV3Pool pool)
| 24,128 |
28 | // Transfer tokens from a Moloch DAO by calling ragequit on all shares_molochDao Address of a Moloch DAO_convertWeth Flag to indicate that this DAO uses WETH/ | function forwardMoloch(address _molochDao, bool _convertWeth) public {
IMolochDao molochDao = IMolochDao(_molochDao);
(,uint shares,,) = molochDao.members(address(this));
molochDao.ragequit(shares);
address approvedToken = molochDao.approvedToken();
if (_convertWeth) {
IWEth weth = IWEth(approvedToken);
weth.withdraw(weth.balanceOf(address(this)));
forward(address(0));
} else {
forward(molochDao.approvedToken());
}
}
| function forwardMoloch(address _molochDao, bool _convertWeth) public {
IMolochDao molochDao = IMolochDao(_molochDao);
(,uint shares,,) = molochDao.members(address(this));
molochDao.ragequit(shares);
address approvedToken = molochDao.approvedToken();
if (_convertWeth) {
IWEth weth = IWEth(approvedToken);
weth.withdraw(weth.balanceOf(address(this)));
forward(address(0));
} else {
forward(molochDao.approvedToken());
}
}
| 52,024 |
156 | // Get arbitrator of an escrowreturn address Arbitrator address / | function _getArbitrator(uint _escrowId) internal view returns(address);
| function _getArbitrator(uint _escrowId) internal view returns(address);
| 26,129 |
3 | // Total vesting slots created by owner. | uint256 public totalVestingSlots;
| uint256 public totalVestingSlots;
| 8,213 |
131 | // This loop accumulates the payouts associated with a string of tied scores. It always executes at least once. | uint32 numProcessedThisTime = 0;
while (teamContract.getScore(c.placeToWinner[localVars[1]]) == teamContract.getScore(c.placeToWinner[localVars[0]])) {
| uint32 numProcessedThisTime = 0;
while (teamContract.getScore(c.placeToWinner[localVars[1]]) == teamContract.getScore(c.placeToWinner[localVars[0]])) {
| 48,519 |
139 | // keccak256("org.superfluid-finance.apps.SuperTokenLibrary.v1.cfa") | bytes32 private constant _CFA_SLOT = 0xb969d79d88acd02d04ed7ee7d43b949e7daf093d363abcfbbc43dfdfd1ce969a;
| bytes32 private constant _CFA_SLOT = 0xb969d79d88acd02d04ed7ee7d43b949e7daf093d363abcfbbc43dfdfd1ce969a;
| 28,114 |
557 | // Gets an asset rate using a stateful function, accrues interest so the/ exchange rate will be up to date for the current block. | function _getAssetRateStateful(uint256 currencyId)
private
returns (
int256,
AssetRateAdapter,
uint8
)
| function _getAssetRateStateful(uint256 currencyId)
private
returns (
int256,
AssetRateAdapter,
uint8
)
| 11,008 |
1 | // Transfer ownership here!!! | function handleAuctionCompleted( OpenFirstPriceAuction auction, address seller, address winner, uint256 key, uint256 winningBid ) internal virtual;
function handleAuctionAborted( OpenFirstPriceAuction auction, address seller, uint256 key ) internal virtual;
| function handleAuctionCompleted( OpenFirstPriceAuction auction, address seller, address winner, uint256 key, uint256 winningBid ) internal virtual;
function handleAuctionAborted( OpenFirstPriceAuction auction, address seller, uint256 key ) internal virtual;
| 27,853 |
69 | // NOTE: Vyper produces multiple signatures for a given function with "default" args | function deposit() external returns (uint256);
function deposit(uint256 amount) external returns (uint256);
function deposit(uint256 amount, address recipient) external returns (uint256);
| function deposit() external returns (uint256);
function deposit(uint256 amount) external returns (uint256);
function deposit(uint256 amount, address recipient) external returns (uint256);
| 22,264 |
30 | // Calculate how much is to be released now & update released counter | amountReleased = R1 - multisigAllocationClaimed;
multisigAllocationClaimed = R1;
| amountReleased = R1 - multisigAllocationClaimed;
multisigAllocationClaimed = R1;
| 11,707 |
5 | // convert wei representation (18 decimals) of token amount to 64x64 fixed point value wei representation of token amountreturn value64x64 64x64 fixed point representation of token amount / | function fromWei(uint256 value) internal pure returns (int128 value64x64) {
value64x64 = fromDecimals(value, 18);
}
| function fromWei(uint256 value) internal pure returns (int128 value64x64) {
value64x64 = fromDecimals(value, 18);
}
| 16,170 |
196 | // Flip Status Functions For Sale | function flipPauseStatus() public onlyOwner {
isSalePaused = !isSalePaused;
}
| function flipPauseStatus() public onlyOwner {
isSalePaused = !isSalePaused;
}
| 7,665 |
53 | // Submission Bits (Ballot Classifications) / do (bits & SETTINGS_MASK) to get just operational bits (as opposed to testing or official flag) | uint16 constant SETTINGS_MASK = 0xFFFF ^ USE_TESTING ^ IS_OFFICIAL ^ IS_BINDING;
| uint16 constant SETTINGS_MASK = 0xFFFF ^ USE_TESTING ^ IS_OFFICIAL ^ IS_BINDING;
| 47,111 |
148 | // Bounties: 2% of total goes to Decent bet for bounties | uint256 bountyTokens = safeDiv(safeMul(totalSupply, bountyPercentOfTotal), crowdfundPercentOfTotal);
balances[decentBetMultisig] = safeAdd(balances[decentBetMultisig], bountyTokens);
Transfer(0, decentBetMultisig, bountyTokens);
| uint256 bountyTokens = safeDiv(safeMul(totalSupply, bountyPercentOfTotal), crowdfundPercentOfTotal);
balances[decentBetMultisig] = safeAdd(balances[decentBetMultisig], bountyTokens);
Transfer(0, decentBetMultisig, bountyTokens);
| 8,374 |
182 | // The mask of the lower 160 bits for addresses. | uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;
| uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;
| 499 |
43 | // Creation of a new session | require(state == SessionState.GRACE || state == SessionState.CLOSED, "VS09");
uint256 sessionPeriod = uint256(sessionRule_.campaignPeriod)
.add(sessionRule_.votingPeriod)
.add(sessionRule_.revealPeriod)
.add(sessionRule_.gracePeriod);
uint256 previousStartAt =
(sessionsCount_ != 0) ? sessions[currentSessionId_].startAt : 0;
uint nextAvailableSession;
if (state == SessionState.GRACE) {
| require(state == SessionState.GRACE || state == SessionState.CLOSED, "VS09");
uint256 sessionPeriod = uint256(sessionRule_.campaignPeriod)
.add(sessionRule_.votingPeriod)
.add(sessionRule_.revealPeriod)
.add(sessionRule_.gracePeriod);
uint256 previousStartAt =
(sessionsCount_ != 0) ? sessions[currentSessionId_].startAt : 0;
uint nextAvailableSession;
if (state == SessionState.GRACE) {
| 48,404 |
1 | // emitted at each SmardexPair created token0 address of the token0 token1 address of the token1 pair address of the SmardexPair created totalPair number of SmardexPair created so far / | event PairCreated(address indexed token0, address indexed token1, address pair, uint256 totalPair);
| event PairCreated(address indexed token0, address indexed token1, address pair, uint256 totalPair);
| 26,925 |
61 | // Used to change `rewards`. Any distributed rewards will cease flowing to the old address and begin flowing to this address once the change is in effect.This will not change any Strategy reports in progress, only new reports made after this change goes into effect.This may only be called by the strategist. _rewards The address to use for collecting rewards. / | function setRewards(address _rewards) external onlyStrategist {
rewards = _rewards;
emit UpdatedRewards(_rewards);
}
| function setRewards(address _rewards) external onlyStrategist {
rewards = _rewards;
emit UpdatedRewards(_rewards);
}
| 31,926 |
79 | // Check if we hold a positive amount of _source | if (endAmount > 0) {
if (_source == ETH_TOKEN_ADDRESS) {
payable(_receiver).transfer(endAmount);
} else {
| if (endAmount > 0) {
if (_source == ETH_TOKEN_ADDRESS) {
payable(_receiver).transfer(endAmount);
} else {
| 24,594 |
55 | // after a {IERC721-safeTransferFrom}. This function MUST return the function selector,otherwise the caller will revert the transaction. The selector to bereturned can be obtained as `this.onERC721Received.selector`. Thisfunction MAY throw to revert and reject the transfer.Note: the ERC721 contract address is always the message sender. operator The address which called `safeTransferFrom` function from The address which previously owned the token tokenId The NFT identifier which is being transferred data Additional data with no specified formatreturn bytes4 `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` / | function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data)
public returns (bytes4);
| function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data)
public returns (bytes4);
| 16,322 |
0 | // Validates token addresses and assigns Asset Managers | for (uint256 i = 0; i < tokens.length; ++i) {
IERC20 token = tokens[i];
_require(token != IERC20(0), Errors.INVALID_TOKEN);
_poolAssetManagers[poolId][token] = assetManagers[i];
}
| for (uint256 i = 0; i < tokens.length; ++i) {
IERC20 token = tokens[i];
_require(token != IERC20(0), Errors.INVALID_TOKEN);
_poolAssetManagers[poolId][token] = assetManagers[i];
}
| 31,361 |
4 | // 保证签名正确 | require(referees[signer], "not referee!");
if(isVoteBuyer) voteBuyer += 1;
else voteSeller += 1;
| require(referees[signer], "not referee!");
if(isVoteBuyer) voteBuyer += 1;
else voteSeller += 1;
| 11,994 |
100 | // if sniper is new to this version of H1M | if (_sID == 0)
{
| if (_sID == 0)
{
| 10,159 |
8 | // Emitted when the allowance of a `spender` for an `owner` is set bya call to {approve}. `value` is the new allowance. / | event Approval(address indexed owner, address indexed spender, uint256 value);
| event Approval(address indexed owner, address indexed spender, uint256 value);
| 692 |
17 | // get the pricer for an asset _asset asset addressreturn pricer address / | function getPricer(address _asset) external view returns (address) {
return assetPricer[_asset];
}
| function getPricer(address _asset) external view returns (address) {
return assetPricer[_asset];
}
| 37,629 |
29 | // Get order hashes for a list of orders/_orders A list of orders/ return List of orders hashes | function getOrderHashBatch(Order[] memory _orders) external pure returns(bytes32[] memory) {
bytes32[] memory result = new bytes32[](_orders.length);
for (uint256 i=0; i < _orders.length; i++) {
result[i] = getOrderHash(_orders[i]);
}
return result;
}
| function getOrderHashBatch(Order[] memory _orders) external pure returns(bytes32[] memory) {
bytes32[] memory result = new bytes32[](_orders.length);
for (uint256 i=0; i < _orders.length; i++) {
result[i] = getOrderHash(_orders[i]);
}
return result;
}
| 50,509 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.