Umswaps are subsets of ERC-721 NFT collections pooled into ERC-20 tokens.
Umswaps are created by UmswapFactory.
UI being built at https://bokkypoobah.github.io/umswap/.
-
2022-07-16 UmswapFactory 0.8.5 testing deployed to 0x9d6856a4ccef088da9b6e8a7c476ae05bc7caa2e
-
2022-07-30 UmswapFactory 0.8.6 testing deployed to 0x39D61eDC9E951C93A0A714c008006c5093992db3
-
2022-07-31 UmswapFactory 0.8.7 testing deployed to 0xb9969521413D036eAb5Ff2095cDc31BF4600AF9e
-
2022-08-01 UmswapFactory 0.8.8 testing deployed to 0x06cD34744eb3bE01808790Df7D1AeB63355b27Ea
- Bug bounty offer on this contract
- Cancelled 2022-08-15 - new version
- Bug bounty offer on this contract
-
2022-08-15 UmswapFactory 0.8.9 testing deployed to 0x0AE45D0a938f4F07F236e5f43ffB05E79ceE8268
- Bug bounty now on offer on this contract
- Cancelled 2022-09-28 - new version
- Bug bounty now on offer on this contract
-
2022-09-28 UmswapFactory 0.9.0 testing deployed to 0x8f093895cD4C54eaB897C6377e1Bf85Fe5B4E948
- Bug bounty now on offer on this contract
Standard ERC-20 function.
function allowance(address tokenOwner, address spender) override external view returns (uint remaining)
Standard ERC-20 function.
function balanceOf(address tokenOwner) override external view returns (uint balance)
Standard ERC-20 function. Set to 18 decimals.
function decimals() override external view returns (uint8)
function getInfo() public view returns (address _creator, string memory __symbol, string memory __name, uint[] memory _tokenIds, uint _swappedIn, uint _swappedOut, uint __totalSupply)
function isValidTokenId(uint _tokenId) public view returns (bool)
Standard ERC-20 function.
function name() override external view returns (string memory)
Standard ERC-20 function.
function symbol() override external view returns (string memory)
Standard ERC-20 function.
function totalSupply() override external view returns (uint)
Standard ERC-20 function.
function approve(address spender, uint tokens) override external returns (bool success)
Receive any tips in ETH.
receive() external payable
function swap(uint[] calldata _inTokenIds, uint[] calldata _outTokenIds, address integrator) public payable reentrancyGuard
Standard ERC-20 function.
function transfer(address to, uint tokens) override external returns (bool success)
Standard ERC-20 function.
function transferFrom(address from, address to, uint tokens) override external returns (bool success)
Is name valid? Name cannot start or end with spaces, or contain repeating spaces. Name must be between 1 and 48 characters in length. Valid characters are 0-9, A-Z, a-z, space, +, -, : .
function isValidName(string memory str) public pure returns (bool)
function getUmswapsLength() public view returns (uint _length)
function getUmswaps(uint[] memory indices) public view returns (
Umswap[] memory _umswaps,
address[] memory _creators,
string[] memory _symbols,
string[] memory _names,
uint[][] memory _tokenIds,
uint[] memory _swappedIns,
uint[] memory _swappedOuts,
uint[] memory _totalSupplies
)
Owner of UmswapFactory
address public owner
Array of child Umswap addresses
Umswap[] public umswaps
function newUmswap(IERC721Partial _collection, string calldata _name, uint[] calldata _tokenIds, address integrator)
receive() external payable
function transferOwnership(address _newOwner) public onlyOwner
function withdraw(address token, uint tokens, uint tokenId) public onlyOwner
See test/00_test_0.js for the testing scripts and testIt.out for the results.
- Owned
- Can only initialise once
AlreadyInitialised()
- Transfer ownership
- Valid ownership transfer
- Invalid ownership transfer
NotOwner()
- Can only initialise once
- TipHandler
- Zero tips
- Non-zero tips
-
integrator
set toaddress(0)
-
integrator
set toaddress(this)
-
integrator
set to EOA/contract address/contract that rejects ETH payment
-
- CloneFactory
- Check
- UmswapFactory
-
newUmswap(...)
- Collection set to EOA
NotERC721()
- Collection set to non ERC-721 contract
NotERC721()
- Invalid name
InvalidName()
- TokenIds not sorted ascending
TokenIdsMustBeSortedWithNoDuplicates()
- Duplicate set
DuplicateSet()
- Collection set to EOA
- Receive ETH transfers
- Reject ERC-721
safeTransferFrom(msg.sender, UmswapFactory, tokenId)
transfers - Withdraw
- ETH
- ERC-20
- ERC-721
- Not owner
NotOwner()
-
- [ ]
-
- [ ]
npm install --save-dev hardhat OpenZeppelin v4.7.0 npm install --save-dev @openzeppelin/test-helpers npm install --save-dev @nomicfoundation/hardhat-toolbox