diff --git a/contracts/CashCow.sol b/contracts/CashCow.sol index 017ff92..7802d67 100644 --- a/contracts/CashCow.sol +++ b/contracts/CashCow.sol @@ -9,7 +9,8 @@ pragma solidity 0.8.13; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; - +import '../interfaces/IUniswapV3Pool.sol'; +import '../interfaces/IUniswapV3Factory.sol'; contract CashCow is ERC721('Cash Cow Quest', 'COWQ') { address immutable zero = 0x0000000000000000000000000000000000000000; diff --git a/contracts/ValueConduct.sol b/contracts/ValueConduct.sol new file mode 100644 index 0000000..095371a --- /dev/null +++ b/contracts/ValueConduct.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: AGPL-3.0-only +pragma solidity 0.8.11; + +import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; + + +contract ValueConduct is ERC20("Value Conduct", "VC") { + + constructor(address _mint1milTo) { + _mint(_mint1milTo, 1_000_000 * 10 ** 18); + } +} \ No newline at end of file diff --git a/interfaces/IERC20.sol b/interfaces/IERC20.sol new file mode 100644 index 0000000..b816bfe --- /dev/null +++ b/interfaces/IERC20.sol @@ -0,0 +1,82 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) + +pragma solidity ^0.8.0; + +/** + * @dev Interface of the ERC20 standard as defined in the EIP. + */ +interface IERC20 { + /** + * @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 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); +} diff --git a/tests/0_default_test.py b/tests/0_default_test.py new file mode 100644 index 0000000..525d32b --- /dev/null +++ b/tests/0_default_test.py @@ -0,0 +1,13 @@ +import pytest +from brownie import accounts, chain, ZERO_ADDRESS, interface +from tests.conftest import CashCow, DAI, ValueConduct, IV3Factory, isPolygon + + + +def test_default(isPolygon, CashCow, ValueConduct, DAI, IV3Factory): + assert isPolygon + assert CashCow.address != ZERO_ADDRESS + + + + diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..389a532 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1 @@ +#none habit pantera demonic mnemonic \ No newline at end of file diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..0a01947 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,36 @@ + +import pytest +from brownie import accounts, CashCow, chain, ZERO_ADDRESS, ValueConduct, interface + +DAI_ADDR = "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063" #polygon mainnet +V3Factory = "0x1F98431c8aD98523631AE4a59f267346ea31F984" + + +@pytest.fixture +def isPolygon(): + return chain._chainid == 137 + +@pytest.fixture +def CashCow(): + deployed1 = CashCow.deploy({'from': accounts[0]}) + return deployed1 + +@pytest.fixture +def ValueConduct(): + deployed2 = ValueConduct.deploy('0xe7b30a037f5598e4e73702ca66a59af5cc650dcd',{'from': accounts[0]}) + print("ValueConduct deplyed at: ", deployed2.address) + return deployed2 + +@pytest.fixture +def DAI(): + DAI = interface.IERC20(DAI_ADDR) + print("DAI wrapped. balance of accounts[0] - address: ", DAI.balanceOf(accounts[0]), DAI.address) + return DAI + +@pytest.fixture +def IV3Factory(): + factory = interface.IUniswapV3Factory(V3Factory) + print("DAI wrapped. balance of accounts[0] - address: ", DAI.balanceOf(accounts[0]), DAI.address) + return factory + +