From 5e3778ccb0b09947d25f6e10e6ebff80d92acfba Mon Sep 17 00:00:00 2001 From: hasparus Date: Fri, 8 Oct 2021 12:54:22 +0200 Subject: [PATCH 1/9] Add Rarity.sol and nest contracts under Solidity version dir --- contracts/{ => v0.6.4}/DataTypesInput.sol | 0 contracts/{ => v0.6.4}/DataTypesPure.sol | 0 contracts/{ => v0.6.4}/DataTypesView.sol | 0 contracts/{ => v0.6.4}/Events.sol | 0 contracts/{ => v0.6.4}/Library.sol | 0 contracts/{ => v0.6.4}/LibraryConsumer.sol | 0 contracts/{ => v0.6.4}/Name-Mangling.sol | 0 contracts/{ => v0.6.4}/Overloads.sol | 0 contracts/{ => v0.6.4}/Payable.sol | 0 contracts/{ => v0.6.4}/PayableFactory.sol | 0 contracts/v0.8.9/Rarity.sol | 756 +++++++++++++++++++++ scripts/_common.ts | 7 + scripts/check-examples.ts | 10 +- scripts/compile-contracts.ts | 118 +++- tsconfig.json | 4 +- yarn.lock | 501 +++++++++++++- 16 files changed, 1346 insertions(+), 50 deletions(-) rename contracts/{ => v0.6.4}/DataTypesInput.sol (100%) rename contracts/{ => v0.6.4}/DataTypesPure.sol (100%) rename contracts/{ => v0.6.4}/DataTypesView.sol (100%) rename contracts/{ => v0.6.4}/Events.sol (100%) rename contracts/{ => v0.6.4}/Library.sol (100%) rename contracts/{ => v0.6.4}/LibraryConsumer.sol (100%) rename contracts/{ => v0.6.4}/Name-Mangling.sol (100%) rename contracts/{ => v0.6.4}/Overloads.sol (100%) rename contracts/{ => v0.6.4}/Payable.sol (100%) rename contracts/{ => v0.6.4}/PayableFactory.sol (100%) create mode 100644 contracts/v0.8.9/Rarity.sol create mode 100644 scripts/_common.ts diff --git a/contracts/DataTypesInput.sol b/contracts/v0.6.4/DataTypesInput.sol similarity index 100% rename from contracts/DataTypesInput.sol rename to contracts/v0.6.4/DataTypesInput.sol diff --git a/contracts/DataTypesPure.sol b/contracts/v0.6.4/DataTypesPure.sol similarity index 100% rename from contracts/DataTypesPure.sol rename to contracts/v0.6.4/DataTypesPure.sol diff --git a/contracts/DataTypesView.sol b/contracts/v0.6.4/DataTypesView.sol similarity index 100% rename from contracts/DataTypesView.sol rename to contracts/v0.6.4/DataTypesView.sol diff --git a/contracts/Events.sol b/contracts/v0.6.4/Events.sol similarity index 100% rename from contracts/Events.sol rename to contracts/v0.6.4/Events.sol diff --git a/contracts/Library.sol b/contracts/v0.6.4/Library.sol similarity index 100% rename from contracts/Library.sol rename to contracts/v0.6.4/Library.sol diff --git a/contracts/LibraryConsumer.sol b/contracts/v0.6.4/LibraryConsumer.sol similarity index 100% rename from contracts/LibraryConsumer.sol rename to contracts/v0.6.4/LibraryConsumer.sol diff --git a/contracts/Name-Mangling.sol b/contracts/v0.6.4/Name-Mangling.sol similarity index 100% rename from contracts/Name-Mangling.sol rename to contracts/v0.6.4/Name-Mangling.sol diff --git a/contracts/Overloads.sol b/contracts/v0.6.4/Overloads.sol similarity index 100% rename from contracts/Overloads.sol rename to contracts/v0.6.4/Overloads.sol diff --git a/contracts/Payable.sol b/contracts/v0.6.4/Payable.sol similarity index 100% rename from contracts/Payable.sol rename to contracts/v0.6.4/Payable.sol diff --git a/contracts/PayableFactory.sol b/contracts/v0.6.4/PayableFactory.sol similarity index 100% rename from contracts/PayableFactory.sol rename to contracts/v0.6.4/PayableFactory.sol diff --git a/contracts/v0.8.9/Rarity.sol b/contracts/v0.8.9/Rarity.sol new file mode 100644 index 000000000..ddd85a073 --- /dev/null +++ b/contracts/v0.8.9/Rarity.sol @@ -0,0 +1,756 @@ +/** + *Submitted for verification at FtmScan.com on 2021-09-05 +*/ + +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.7; + +interface IERC721 { + 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) external view returns (uint256 balance); + function ownerOf(uint256 tokenId) external view returns (address owner); + function safeTransferFrom( + address from, + address to, + uint256 tokenId + ) external; + function transferFrom( + address from, + address to, + uint256 tokenId + ) external; + function approve(address to, uint256 tokenId) external; + function getApproved(uint256 tokenId) external view returns (address operator); + function setApprovalForAll(address operator, bool _approved) external; + function isApprovedForAll(address owner, address operator) external view returns (bool); + function safeTransferFrom( + address from, + address to, + uint256 tokenId, + bytes calldata data + ) external; +} + +library Strings { + function toString(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); + while (value != 0) { + digits -= 1; + buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); + value /= 10; + } + return string(buffer); + } +} + +interface IERC721Receiver { + function onERC721Received( + address operator, + address from, + uint256 tokenId, + bytes calldata data + ) external returns (bytes4); +} + +contract ERC721 is IERC721 { + using Strings for uint256; + + mapping(uint256 => address) private _owners; + mapping(address => uint256) private _balances; + mapping(uint256 => address) private _tokenApprovals; + mapping(address => mapping(address => bool)) private _operatorApprovals; + + function balanceOf(address owner) public view virtual override returns (uint256) { + require(owner != address(0), "ERC721: balance query for the zero address"); + return _balances[owner]; + } + + 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; + } + + function _baseURI() internal view virtual returns (string memory) { + return ""; + } + + function approve(address to, uint256 tokenId) public virtual override { + address owner = ERC721.ownerOf(tokenId); + 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" + ); + + _approve(to, tokenId); + } + + function getApproved(uint256 tokenId) public view virtual override returns (address) { + require(_exists(tokenId), "ERC721: approved query for nonexistent token"); + + return _tokenApprovals[tokenId]; + } + + function setApprovalForAll(address operator, bool approved) public virtual override { + require(operator != msg.sender, "ERC721: approve to caller"); + + _operatorApprovals[msg.sender][operator] = approved; + emit ApprovalForAll(msg.sender, operator, approved); + } + + function _isContract(address account) internal view returns (bool) { + uint256 size; + assembly { + size := extcodesize(account) + } + return size > 0; + } + + function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { + return _operatorApprovals[owner][operator]; + } + + function transferFrom( + address from, + address to, + uint256 tokenId + ) public virtual override { + //solhint-disable-next-line max-line-length + require(_isApprovedOrOwner(msg.sender, tokenId), "ERC721: transfer caller is not owner nor approved"); + + _transfer(from, to, tokenId); + } + + 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(msg.sender, 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 (_isContract(to)) { + try IERC721Receiver(to).onERC721Received(msg.sender, from, tokenId, _data) returns (bytes4 retval) { + return retval == IERC721Receiver(to).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 {} +} + + + + + + + +/** + * @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); +} + + +/** + * @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 {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(); + } +} + +contract Rarity is ERC721Enumerable { + uint public next_summoner; + uint constant xp_per_day = 250e18; + uint constant DAY = 1 days; + + string constant name = "Rarity Manifested"; + string constant symbol = "RM"; + + mapping(uint => uint) public xp; + mapping(uint => uint) public adventurers_log; + mapping(uint => uint) public class; + mapping(uint => uint) public level; + + event summoned(address indexed owner, uint class, uint summoner); + event leveled(address indexed owner, uint level, uint summoner); + + function adventure(uint _summoner) external { + require(_isApprovedOrOwner(msg.sender, _summoner)); + require(block.timestamp > adventurers_log[_summoner]); + adventurers_log[_summoner] = block.timestamp + DAY; + xp[_summoner] += xp_per_day; + } + + function spend_xp(uint _summoner, uint _xp) external { + require(_isApprovedOrOwner(msg.sender, _summoner)); + xp[_summoner] -= _xp; + } + + function level_up(uint _summoner) external { + require(_isApprovedOrOwner(msg.sender, _summoner)); + uint _level = level[_summoner]; + uint _xp_required = xp_required(_level); + xp[_summoner] -= _xp_required; + level[_summoner] = _level+1; + emit leveled(msg.sender, level[_summoner], _summoner); + } + + function summoner(uint _summoner) external view returns (uint _xp, uint _log, uint _class, uint _level) { + _xp = xp[_summoner]; + _log = adventurers_log[_summoner]; + _class = class[_summoner]; + _level = level[_summoner]; + } + + function summon(uint _class) external { + require(1 <= _class && _class <= 11); + uint _next_summoner = next_summoner; + class[_next_summoner] = _class; + level[_next_summoner] = 1; + _safeMint(msg.sender, _next_summoner); + emit summoned(msg.sender, _class, _next_summoner); + next_summoner++; + } + + function xp_required(uint curent_level) public pure returns (uint xp_to_next_level) { + xp_to_next_level = curent_level * 1000e18; + for (uint i = 1; i < curent_level; i++) { + xp_to_next_level += curent_level * 1000e18; + } + } + + function tokenURI(uint256 _summoner) public view returns (string memory) { + string[7] memory parts; + parts[0] = ''; + + parts[1] = string(abi.encodePacked("class", " ", classes(class[_summoner]))); + + parts[2] = ''; + + parts[3] = string(abi.encodePacked("level", " ", toString(level[_summoner]))); + + parts[4] = ''; + + parts[5] = string(abi.encodePacked("xp", " ", toString(xp[_summoner]/1e18))); + + parts[6] = ''; + + string memory output = string(abi.encodePacked(parts[0], parts[1], parts[2], parts[3], parts[4], parts[5], parts[6])); + + string memory json = Base64.encode(bytes(string(abi.encodePacked('{"name": "summoner #', toString(_summoner), '", "description": "Rarity is achieved via an active economy, summoners must level, gain feats, learn spells, to be able to craft gear. This allows for market driven rarity while allowing an ever growing economy. Feats, spells, and summoner gear is ommitted as part of further expansions.", "image": "data:image/svg+xml;base64,', Base64.encode(bytes(output)), '"}')))); + output = string(abi.encodePacked('data:application/json;base64,', json)); + + return output; + } + + function classes(uint id) public pure returns (string memory description) { + if (id == 1) { + return "Barbarian"; + } else if (id == 2) { + return "Bard"; + } else if (id == 3) { + return "Cleric"; + } else if (id == 4) { + return "Druid"; + } else if (id == 5) { + return "Fighter"; + } else if (id == 6) { + return "Monk"; + } else if (id == 7) { + return "Paladin"; + } else if (id == 8) { + return "Ranger"; + } else if (id == 9) { + return "Rogue"; + } else if (id == 10) { + return "Sorcerer"; + } else if (id == 11) { + return "Wizard"; + } + } + + function toString(uint256 value) internal pure returns (string memory) { + // Inspired by OraclizeAPI's implementation - MIT license + // 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); + } +} + +/// [MIT License] +/// @title Base64 +/// @notice Provides a function for encoding some bytes in base64 +/// @author Brecht Devos +library Base64 { + bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + + /// @notice Encodes some bytes to the base64 representation + function encode(bytes memory data) internal pure returns (string memory) { + uint256 len = data.length; + if (len == 0) return ""; + + // multiply by 4/3 rounded up + uint256 encodedLen = 4 * ((len + 2) / 3); + + // Add some extra buffer at the end + bytes memory result = new bytes(encodedLen + 32); + + bytes memory table = TABLE; + + assembly { + let tablePtr := add(table, 1) + let resultPtr := add(result, 32) + + for { + let i := 0 + } lt(i, len) { + + } { + i := add(i, 3) + let input := and(mload(add(data, i)), 0xffffff) + + let out := mload(add(tablePtr, and(shr(18, input), 0x3F))) + out := shl(8, out) + out := add(out, and(mload(add(tablePtr, and(shr(12, input), 0x3F))), 0xFF)) + out := shl(8, out) + out := add(out, and(mload(add(tablePtr, and(shr(6, input), 0x3F))), 0xFF)) + out := shl(8, out) + out := add(out, and(mload(add(tablePtr, and(input, 0x3F))), 0xFF)) + out := shl(224, out) + + mstore(resultPtr, out) + + resultPtr := add(resultPtr, 4) + } + + switch mod(len, 3) + case 1 { + mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) + } + case 2 { + mstore(sub(resultPtr, 1), shl(248, 0x3d)) + } + + mstore(result, encodedLen) + } + + return string(result); + } +} diff --git a/scripts/_common.ts b/scripts/_common.ts new file mode 100644 index 000000000..8a0a7d7a9 --- /dev/null +++ b/scripts/_common.ts @@ -0,0 +1,7 @@ +export function bold(text: string | number) { + return '\u001b[1m' + String(text) + '\u001b[0m' +} + +export function red(text: string | number) { + return '\u001b[31;4m' + String(text) + '\u001b[0m' +} diff --git a/scripts/check-examples.ts b/scripts/check-examples.ts index 8cf9af14e..0d04a2f85 100644 --- a/scripts/check-examples.ts +++ b/scripts/check-examples.ts @@ -2,6 +2,8 @@ import { spawnSync } from 'child_process' import { readdirSync } from 'fs' import * as path from 'path' +import { bold, red } from './_common' + const VERBOSE = process.env.VERBOSE === 'true' const examplesDir = path.resolve(__dirname, '../examples') @@ -48,11 +50,3 @@ if (failures.length > 0) { function formatOutput(output: string[]) { return output.filter(Boolean).join('\n') } - -function bold(text: string | number) { - return '\u001b[1m' + String(text) + '\u001b[0m' -} - -function red(text: string | number) { - return '\u001b[31;4m' + String(text) + '\u001b[0m' -} diff --git a/scripts/compile-contracts.ts b/scripts/compile-contracts.ts index 9a826f598..83d7541ca 100644 --- a/scripts/compile-contracts.ts +++ b/scripts/compile-contracts.ts @@ -2,32 +2,50 @@ import { execSync } from 'child_process' import { copyFileSync, mkdirSync, readdirSync, renameSync, rmdirSync } from 'fs' import { resolve } from 'path' -const rootDir = resolve(__dirname, '..') -const contractsDir = resolve(rootDir, 'contracts') -const outDir = resolve(contractsDir, 'compiled') - -const contracts = readdirSync(contractsDir, { withFileTypes: true }).filter( - (d) => d.isFile() && d.name.endsWith('.sol'), -) +import { bold } from './_common' function main() { - removeOutDir() - generateABIs() - renameUglyNames() - copyTruffleV5() + const files = findFiles() + + removeOutDir(files) + generateABIs(files) + renameUglyNames(files) + copyTruffleV5(files) } main() -function generateABIs() { - console.log('Generating ABIs') +function findFiles() { + const rootDir = resolve(__dirname, '..') + const contractsDir = resolve(rootDir, 'contracts') + const outDir = resolve(contractsDir, 'compiled') + + const solidityVersionDirs = readdirSync(contractsDir, { withFileTypes: true }).filter( + (d) => d.isDirectory() && d.name.startsWith('v'), + ) + const contracts = new Map( + solidityVersionDirs.map((directory) => { + const version = directory.name + const fileNames = readdirSync(resolve(contractsDir, version), { withFileTypes: true }) + .filter((f) => f.isFile() && f.name.endsWith('.sol')) + .map((f) => f.name) - const contractPaths = contracts.map((f) => `./contracts/${f.name}`).join(' ') - execSync(`yarn solcjs --abi ${contractPaths} --bin -o ./contracts/compiled/`, { cwd: rootDir }) + return [version, fileNames] + }), + ) + + return { + rootDir, + contractsDir, + outDir, + contracts, + } } -function removeOutDir() { - console.log('Cleaning up contracts/abis') +type Files = ReturnType + +function removeOutDir({ outDir }: Files) { + console.log(bold('Cleaning up contracts/abis')) try { rmdirSync(outDir, { recursive: true }) @@ -38,30 +56,72 @@ function removeOutDir() { } } +function generateABIs({ rootDir, contracts }: Files) { + console.log(bold('Generating ABIs')) + + for (const [dirName, fileNames] of contracts.entries()) { + const semver = dirName.replace(/^v/, '^') + const contractPaths = fileNames.map((fileName) => `./contracts/${dirName}/${fileName}`).join(' ') + + console.log(bold(`Compiling ${fileNames.length} contracts with \`npx solc@${semver}\``)) + execSync(`npx solc@${semver} --abi ${contractPaths} --bin -o ./contracts/compiled/${dirName}`, { + cwd: rootDir, + stdio: 'inherit', + }) + } +} + /** * Rename ugly names generated by solc to something human redable. * NOTE: we assume that there is only one contract per file + * // TODO: No longer — let's talk about it. Did I miss sth? */ -function renameUglyNames() { - console.log('Renaming ABIs') +function renameUglyNames({ outDir, contracts }: Files) { + console.log(bold('Renaming ABIs')) + + for (const version of contracts.keys()) { + const directory = resolve(outDir, version) + const outputs = readdirSync(directory) + + const fileNamesSeen = new Map() + for (const file of outputs) { + const [, fileName, contractName, extension] = file.match( + new RegExp(`^_?_?contracts_${version}_([A-Za-z0-9-]+)_sol_([A-Za-z0-9-]*)\\.([a-z]+)$`), + )! - const files = readdirSync(outDir) + let newName: string - for (const file of files) { - const renamed = file.replace(/^__contracts_([A-Za-z0-9-]+)_sol_([A-Za-z0-9-]*)\.([a-z]+)$/, '$1.$3') + const timesSeen = fileNamesSeen.get(fileName) || 0 + if (timesSeen < 2) { + fileNamesSeen.set(fileName, timesSeen + 1) + newName = `${fileName}.${extension}` + } else { + newName = `${contractName}.${extension}` + } - console.log(file, ' => ', renamed) - renameSync(resolve(outDir, file), resolve(outDir, renamed)) + console.log(file, ' => ', newName) + renameSync(resolve(directory, file), resolve(directory, newName)) + } } } -function copyTruffleV5() { - console.log('Copy truffle-v5 contracts') +function copyTruffleV5({ rootDir, contractsDir, contracts }: Files) { + console.log(bold('Copy truffle-v5 contracts')) const truffleV5ContractsDir = resolve(rootDir, 'packages/target-truffle-v5-test/contracts') - mkdirSync(truffleV5ContractsDir, { recursive: true }) - for (const { name } of contracts) { - copyFileSync(resolve(contractsDir, name), resolve(truffleV5ContractsDir, name)) + // TODO: Truffle config doesn't allow configuring multiple versions + const versions = ['v0.6.4'] + // We would rather use this: `const versions = [...contracts.keys()]` + + for (const version of versions) { + mkdirSync(resolve(truffleV5ContractsDir, version), { recursive: true }) + } + + const contractRelativePaths = versions.flatMap((version) => + contracts.get(version)!.map((file) => `${version}/${file}`), + ) + for (const path of contractRelativePaths) { + copyFileSync(resolve(contractsDir, path), resolve(truffleV5ContractsDir, path)) } } diff --git a/tsconfig.json b/tsconfig.json index ada73e5aa..21cd9b41d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "declaration": true, - "lib": ["ES2018"], + "lib": ["ES2018", "ES2019.Array"], "module": "CommonJS", "moduleResolution": "node", "strict": true, @@ -10,6 +10,6 @@ "composite": true, "incremental": true }, - "include": ["**/*.ts", "**/*.js", "**/.*.js"], + "include": ["**/*.ts", "**/*.js", "**/.*.js", "scripts/.common.ts"], "exclude": ["**/node_modules"] } diff --git a/yarn.lock b/yarn.lock index d253e76c8..7dd3cb11c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,123 @@ # yarn lockfile v1 +"@0x/assert@^3.0.30": + version "3.0.30" + resolved "https://registry.yarnpkg.com/@0x/assert/-/assert-3.0.30.tgz#31eeb4a5648091f400e378cf9e6ca9980969d43b" + integrity sha512-/yFLEZQKb82B2e2GyRFzLKGDoAmqajlZmEdkuPVzq1UB1BTIcURdWjC0JJGQTBJLTObDzfzrWCgIiNeXHYMggA== + dependencies: + "@0x/json-schemas" "^6.4.0" + "@0x/typescript-typings" "^5.2.1" + "@0x/utils" "^6.4.4" + "@types/node" "12.12.54" + lodash "^4.17.11" + valid-url "^1.0.9" + +"@0x/json-schemas@^6.4.0": + version "6.4.0" + resolved "https://registry.yarnpkg.com/@0x/json-schemas/-/json-schemas-6.4.0.tgz#19eef4f8a7bf18c42f6d1d124ae8f4ccd72410fe" + integrity sha512-QXyk1F05TcsCRGcQmri97jm4JPyn0OLtcUYbzTTcozSRJ6DoOxyfE0vn+rOEmqdxQcEqKJuRf3H6Fq+G/7Sbqw== + dependencies: + "@0x/typescript-typings" "^5.2.1" + "@types/node" "12.12.54" + ajv "^6.12.5" + lodash.values "^4.3.0" + +"@0x/sol-compiler@^4.7.6": + version "4.7.6" + resolved "https://registry.yarnpkg.com/@0x/sol-compiler/-/sol-compiler-4.7.6.tgz#6ba74e1981bdedfc096c60f5295f862de2f3bf32" + integrity sha512-JZMdQAAZPUMRD89ObpkV+4WOuYjlk0u3yL2eXO6ULwjewMPd4G+Fv8iwIblGulLW2RNppk0S5/7chTP3Y1DxMg== + dependencies: + "@0x/assert" "^3.0.30" + "@0x/json-schemas" "^6.4.0" + "@0x/sol-resolver" "^3.1.9" + "@0x/types" "^3.3.4" + "@0x/typescript-typings" "^5.2.1" + "@0x/utils" "^6.4.4" + "@0x/web3-wrapper" "^7.6.1" + "@types/node" "12.12.54" + "@types/yargs" "^11.0.0" + chalk "^2.3.0" + chokidar "^3.0.2" + ethereum-types "^3.6.0" + ethereumjs-util "^7.1.0" + lodash "^4.17.11" + mkdirp "^0.5.1" + pluralize "^7.0.0" + require-from-string "^2.0.1" + semver "5.5.0" + solc "^0.5.5" + source-map-support "^0.5.0" + strip-comments "^2.0.1" + web3-eth-abi "^1.0.0-beta.24" + yargs "^10.0.3" + +"@0x/sol-resolver@^3.1.9": + version "3.1.9" + resolved "https://registry.yarnpkg.com/@0x/sol-resolver/-/sol-resolver-3.1.9.tgz#525c545c4ff4d0ff2ff99e433b2405778abe0693" + integrity sha512-N+GxAqtHzEgVsnj9k4yeE7xRqE2ymR+yo98j0s2VC8icjecVqm6LtqQpEpdPULEg20vA0aPdU/XY2q0xiCDpLg== + dependencies: + "@0x/types" "^3.3.4" + "@0x/typescript-typings" "^5.2.1" + "@types/node" "12.12.54" + lodash "^4.17.11" + +"@0x/types@^3.3.4": + version "3.3.4" + resolved "https://registry.yarnpkg.com/@0x/types/-/types-3.3.4.tgz#184946b1674f7f5b4cfb73105952b499a67fc23e" + integrity sha512-lB6maU/D1TEBrJXQcbwzGilmugX9qrfhxbyPr8r89TinSHe2SS694tTKIyI+ijnTbhyVjWzEnA95iuWxhPmP5g== + dependencies: + "@types/node" "12.12.54" + bignumber.js "~9.0.0" + ethereum-types "^3.6.0" + +"@0x/typescript-typings@^5.2.1": + version "5.2.1" + resolved "https://registry.yarnpkg.com/@0x/typescript-typings/-/typescript-typings-5.2.1.tgz#bc82d0f39688b174142ebb5b2fd6a01c1d2f0163" + integrity sha512-2yswstFMy/cpF+MrJclEZc8BNceBAVovwzRYdz1CyGPfzMT1Kh8jVGeexx0KvVw58KrhxMgcRD4mzCSHNqzjPA== + dependencies: + "@types/bn.js" "^4.11.0" + "@types/node" "12.12.54" + "@types/react" "*" + bignumber.js "~9.0.0" + ethereum-types "^3.6.0" + popper.js "1.14.3" + +"@0x/utils@^6.4.4": + version "6.4.4" + resolved "https://registry.yarnpkg.com/@0x/utils/-/utils-6.4.4.tgz#de9782a7ee2af77580a98a8c6db010dda7f56b94" + integrity sha512-gTfK14tdMNtsmHC6FCrWz221+MYJNdDBdhA1hhnT+Kvru22uvhdTpP2udy7296/4yHZaEkDt5ZkvgJMsJCEhbg== + dependencies: + "@0x/types" "^3.3.4" + "@0x/typescript-typings" "^5.2.1" + "@types/mocha" "^5.2.7" + "@types/node" "12.12.54" + abortcontroller-polyfill "^1.1.9" + bignumber.js "~9.0.0" + chalk "^2.3.0" + detect-node "2.0.3" + ethereum-types "^3.6.0" + ethereumjs-util "^7.1.0" + ethers "~4.0.4" + isomorphic-fetch "2.2.1" + js-sha3 "^0.7.0" + lodash "^4.17.11" + +"@0x/web3-wrapper@^7.6.1": + version "7.6.1" + resolved "https://registry.yarnpkg.com/@0x/web3-wrapper/-/web3-wrapper-7.6.1.tgz#f25bf394f1241e7455f179423d0525002a3517b6" + integrity sha512-Yv0xeAwobkooW1T6QsQ/MI69sHGJIXhVNTgAkoSjOVLs2u/WdQPi6OQsZP+hhpXu6XbAdZ/frvkz1saPxF3Q/w== + dependencies: + "@0x/assert" "^3.0.30" + "@0x/json-schemas" "^6.4.0" + "@0x/typescript-typings" "^5.2.1" + "@0x/utils" "^6.4.4" + "@types/node" "12.12.54" + ethereum-types "^3.6.0" + ethereumjs-util "^7.1.0" + ethers "~4.0.4" + lodash "^4.17.11" + "@babel/code-frame@7.12.11": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" @@ -1353,13 +1470,20 @@ resolved "https://registry.yarnpkg.com/@types/bluebird/-/bluebird-3.5.30.tgz#ee034a0eeea8b84ed868b1aa60d690b08a6cfbc5" integrity sha512-8LhzvcjIoqoi1TghEkRMkbbmM+jhHnBokPGkJWjclMK+Ks0MxEBow3/p2/iFTZ+OIbJHQDSfpgdZEb+af3gfVw== -"@types/bn.js@^4.11.3", "@types/bn.js@^4.11.4", "@types/bn.js@^4.11.5": +"@types/bn.js@^4.11.0", "@types/bn.js@^4.11.3", "@types/bn.js@^4.11.4", "@types/bn.js@^4.11.5": version "4.11.6" resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== dependencies: "@types/node" "*" +"@types/bn.js@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.0.tgz#32c5d271503a12653c62cf4d2b45e6eab8cebc68" + integrity sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA== + dependencies: + "@types/node" "*" + "@types/chai-as-promised@^7.1.2": version "7.1.2" resolved "https://registry.yarnpkg.com/@types/chai-as-promised/-/chai-as-promised-7.1.2.tgz#2f564420e81eaf8650169e5a3a6b93e096e5068b" @@ -1501,6 +1625,11 @@ dependencies: "@types/node" "*" +"@types/mocha@^5.2.7": + version "5.2.7" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.7.tgz#315d570ccb56c53452ff8638738df60726d5b6ea" + integrity sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ== + "@types/mocha@^8.2.1": version "8.2.1" resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-8.2.1.tgz#f3f3ae4590c5386fc7c543aae9b78d4cf30ffee9" @@ -1511,6 +1640,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.21.tgz#aa44a6363291c7037111c47e4661ad210aded23f" integrity sha512-8sRGhbpU+ck1n0PGAUgVrWrWdjSW2aqNeyC15W88GRsMpSwzv6RJGlLhE7s2RhVSOdyDmxbqlWSeThq4/7xqlA== +"@types/node@12.12.54": + version "12.12.54" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.54.tgz#a4b58d8df3a4677b6c08bfbc94b7ad7a7a5f82d1" + integrity sha512-ge4xZ3vSBornVYlDnk7yZ0gK6ChHf/CHB7Gl1I0Jhah8DDnEQqBzgohYG4FX4p81TNirSETOiSyn+y1r9/IR6w== + "@types/node@^10.12.18", "@types/node@^10.3.2": version "10.17.18" resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.18.tgz#ae364d97382aacdebf583fa4e7132af2dfe56a0c" @@ -1553,6 +1687,20 @@ resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.2.3.tgz#ef65165aea2924c9359205bf748865b8881753c0" integrity sha512-PijRCG/K3s3w1We6ynUKdxEc5AcuuH3NBmMDP8uvKVp6X43UY7NQlTzczakXP3DJR0F4dfNQIGjU2cUeRYs2AA== +"@types/prop-types@*": + version "15.7.4" + resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.4.tgz#fcf7205c25dff795ee79af1e30da2c9790808f11" + integrity sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ== + +"@types/react@*": + version "17.0.27" + resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.27.tgz#6498ed9b3ad117e818deb5525fa1946c09f2e0e6" + integrity sha512-zgiJwtsggVGtr53MndV7jfiUESTqrbxOcBvwfe6KS/9bzaVPCTDieTWnFNecVNx6EAaapg5xsLLWFfHHR437AA== + dependencies: + "@types/prop-types" "*" + "@types/scheduler" "*" + csstype "^3.0.2" + "@types/rimraf@^3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/rimraf/-/rimraf-3.0.0.tgz#b9d03f090ece263671898d57bb7bb007023ac19f" @@ -1561,6 +1709,11 @@ "@types/glob" "*" "@types/node" "*" +"@types/scheduler@*": + version "0.16.2" + resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" + integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew== + "@types/secp256k1@^4.0.1": version "4.0.1" resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.1.tgz#fb3aa61a1848ad97d7425ff9dcba784549fca5a4" @@ -1604,6 +1757,11 @@ resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-13.1.0.tgz#c563aa192f39350a1d18da36c5a8da382bbd8228" integrity sha512-gCubfBUZ6KxzoibJ+SCUc/57Ms1jz5NjHe4+dI2krNmU5zCPAphyLJYyTOg06ueIyfj+SaCUqmzun7ImlxDcKg== +"@types/yargs@^11.0.0": + version "11.1.8" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-11.1.8.tgz#b730ecb2bde209d12194cdf8bf9f12c4bd21965a" + integrity sha512-49Pmk3GBUOrs/ZKJodGMJeEeiulv2VdfAYpGgkTCSXpNWx7KCX36+PbrkItwzrjTDHO2QoEZDpbhFoMN1lxe9A== + "@types/yargs@^13.0.0": version "13.0.3" resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-13.0.3.tgz#76482af3981d4412d65371a318f992d33464a380" @@ -1719,6 +1877,11 @@ abort-controller@^3.0.0: dependencies: event-target-shim "^5.0.0" +abortcontroller-polyfill@^1.1.9: + version "1.7.3" + resolved "https://registry.yarnpkg.com/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.3.tgz#1b5b487bd6436b5b764fd52a612509702c3144b5" + integrity sha512-zetDJxd89y3X99Kvo4qFx8GKlt6GsvN3UcRZHwU6iFA/0KiOmhkTVhe8oRoTBiTVPZu09x3vCra47+w8Yz1+2Q== + abstract-leveldown@^5.0.0, abstract-leveldown@~5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz#f7128e1f86ccabf7d2893077ce5d06d798e386c6" @@ -1785,7 +1948,7 @@ ajv@^6.10.0: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^6.12.4: +ajv@^6.12.4, ajv@^6.12.5: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -1839,6 +2002,11 @@ ansi-escapes@^4.3.0: dependencies: type-fest "^0.11.0" +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + ansi-regex@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" @@ -1889,6 +2057,14 @@ anymatch@^3.0.3, anymatch@~3.1.1: normalize-path "^3.0.0" picomatch "^2.0.4" +anymatch@~3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" + integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + app-module-path@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/app-module-path/-/app-module-path-2.2.0.tgz#641aa55dfb7d6a6f0a8141c4b9c0aa50b6c24dd5" @@ -2141,7 +2317,7 @@ bignumber.js@^5.0.0: resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-5.0.0.tgz#fbce63f09776b3000a83185badcde525daf34833" integrity sha512-KWTu6ZMVk9sxlDJQh2YH1UOnfDP8O8TpxUxgQG/vKASoSnEjK9aVuOueFaPcQEYQ5fyNXNTOYwYw3099RYebWg== -bignumber.js@^9.0.0: +bignumber.js@^9.0.0, bignumber.js@~9.0.0: version "9.0.1" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.1.tgz#8d7ba124c882bfd8e43260c67475518d0689e4e5" integrity sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA== @@ -2478,7 +2654,7 @@ camelcase-keys@^6.2.2: map-obj "^4.0.0" quick-lru "^4.0.1" -camelcase@^4.0.0: +camelcase@^4.0.0, camelcase@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= @@ -2614,6 +2790,21 @@ chokidar@3.4.3: optionalDependencies: fsevents "~2.1.2" +chokidar@^3.0.2: + version "3.5.2" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" + integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + chokidar@^3.4.0: version "3.5.1" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a" @@ -2662,6 +2853,15 @@ cli-boxes@^1.0.0: resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" integrity sha1-T6kXw+WclKAEzWH47lCdplFocUM= +cliui@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" + integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== + dependencies: + string-width "^2.1.1" + strip-ansi "^4.0.0" + wrap-ansi "^2.0.0" + cliui@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" @@ -2692,6 +2892,11 @@ clone@^1.0.2: resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= + collection-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" @@ -2920,6 +3125,11 @@ crypto-browserify@3.12.0: randombytes "^2.0.0" randomfill "^1.0.3" +csstype@^3.0.2: + version "3.0.9" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.9.tgz#6410af31b26bd0520933d02cbc64fce9ce3fbf0b" + integrity sha512-rpw6JPxK6Rfg1zLOYCSwle2GFOOsnjmDYDaBwEcwoOg4qlsIVCN789VkBZDJAGi4T07gI4YSutR43t9Zz4Lzuw== + csv-generate@^3.2.4: version "3.3.0" resolved "https://registry.yarnpkg.com/csv-generate/-/csv-generate-3.3.0.tgz#0e25658f1bb9806d94fec7b270896a35c7eedf1a" @@ -3017,7 +3227,7 @@ decamelize-keys@^1.1.0: decamelize "^1.1.0" map-obj "^1.0.0" -decamelize@^1.1.0, decamelize@^1.2.0: +decamelize@^1.1.0, decamelize@^1.1.1, decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= @@ -3188,6 +3398,11 @@ detect-indent@^6.0.0: resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.0.0.tgz#0abd0f549f69fc6659a254fe96786186b6f528fd" integrity sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA== +detect-node@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.3.tgz#a2033c09cc8e158d37748fbde7507832bd6ce127" + integrity sha1-ogM8CcyOFY03dI+951B4Mr1s4Sc= + diff-sequences@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.6.2.tgz#48ba99157de1923412eed41db6b6d4aa9ca7c0b1" @@ -3356,6 +3571,13 @@ encoding-down@~5.0.0: level-errors "^2.0.0" xtend "^4.0.1" +encoding@^0.1.11: + version "0.1.13" + resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" + integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== + dependencies: + iconv-lite "^0.6.2" + end-of-stream@^1.0.0, end-of-stream@^1.1.0: version "1.4.4" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" @@ -3809,6 +4031,14 @@ ethereum-cryptography@^0.1.2, ethereum-cryptography@^0.1.3: secp256k1 "^4.0.1" setimmediate "^1.0.5" +ethereum-types@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/ethereum-types/-/ethereum-types-3.6.0.tgz#7cf0a7258537b1f8d113dd51d050189a742a9a6e" + integrity sha512-iJX96C9W1elWhCZKUiSQfWn9fC+EO+xU2TvAE/p7QhMwcGibihKsxcG27B/4WZAudd8jNoeIhY4PH2qQPLuUfw== + dependencies: + "@types/node" "12.12.54" + bignumber.js "~9.0.0" + ethereumjs-abi@0.6.8, ethereumjs-abi@^0.6.8: version "0.6.8" resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz#71bc152db099f70e62f108b7cdfca1b362c6fcae" @@ -3917,6 +4147,18 @@ ethereumjs-util@^7.0.2: ethjs-util "0.1.6" rlp "^2.2.4" +ethereumjs-util@^7.1.0: + version "7.1.2" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.2.tgz#cfd79a9a3f5cdc042d1abf29964de9caf10ec238" + integrity sha512-xCV3PTAhW8Q2k88XZn9VcO4OrjpeXAlDm5LQTaOLp81SjNSSY6+MwuGXrx6vafOMheWSmZGxIXUbue5e9UvUBw== + dependencies: + "@types/bn.js" "^5.1.0" + bn.js "^5.1.2" + create-hash "^1.1.2" + ethereum-cryptography "^0.1.3" + ethjs-util "0.1.6" + rlp "^2.2.4" + ethers@4.0.0-beta.3: version "4.0.0-beta.3" resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.0-beta.3.tgz#15bef14e57e94ecbeb7f9b39dd0a4bd435bc9066" @@ -4020,6 +4262,21 @@ ethers@^5.4.7: "@ethersproject/web" "5.4.0" "@ethersproject/wordlists" "5.4.0" +ethers@~4.0.4: + version "4.0.49" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.49.tgz#0eb0e9161a0c8b4761be547396bbe2fb121a8894" + integrity sha512-kPltTvWiyu+OktYy1IStSO16i2e7cS9D9OxZ81q2UUaiNPVrm/RTcbxamCXF9VUSKzJIdJV68EAIhTEVBalRWg== + dependencies: + aes-js "3.0.0" + bn.js "^4.11.9" + elliptic "6.5.4" + hash.js "1.1.3" + js-sha3 "0.5.7" + scrypt-js "2.0.4" + setimmediate "1.0.4" + uuid "2.0.1" + xmlhttprequest "1.8.0" + ethjs-unit@0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" @@ -4556,7 +4813,7 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= -fsevents@^2.1.2, fsevents@~2.3.1: +fsevents@^2.1.2, fsevents@~2.3.1, fsevents@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== @@ -4585,6 +4842,11 @@ ganache-cli@^6.12.2: source-map-support "0.5.12" yargs "13.2.4" +get-caller-file@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" + integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== + get-caller-file@^2.0.1: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" @@ -4659,7 +4921,7 @@ glob-parent@^5.1.0, glob-parent@~5.1.0: dependencies: is-glob "^4.0.1" -glob-parent@^5.1.2: +glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== @@ -5060,6 +5322,13 @@ iconv-lite@0.4.24, iconv-lite@^0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" +iconv-lite@^0.6.2: + version "0.6.3" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" + integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== + dependencies: + safer-buffer ">= 2.1.2 < 3.0.0" + idna-uts46-hx@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/idna-uts46-hx/-/idna-uts46-hx-2.3.1.tgz#a1dc5c4df37eee522bf66d969cc980e00e8711f9" @@ -5146,6 +5415,11 @@ inherits@2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= + invert-kv@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" @@ -5308,6 +5582,13 @@ is-extglob@^2.1.1: resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + dependencies: + number-is-nan "^1.0.0" + is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" @@ -5424,7 +5705,7 @@ is-retry-allowed@^1.0.0: resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz#d778488bd0a4666a3be8a1482b9f2baafedea8b4" integrity sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg== -is-stream@^1.0.0, is-stream@^1.1.0: +is-stream@^1.0.0, is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= @@ -5501,6 +5782,14 @@ isobject@^3.0.0, isobject@^3.0.1: resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= +isomorphic-fetch@2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" + integrity sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk= + dependencies: + node-fetch "^1.0.1" + whatwg-fetch ">=0.10.0" + isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" @@ -5669,6 +5958,11 @@ js-sha3@0.8.0, js-sha3@^0.8.0: resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== +js-sha3@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.7.0.tgz#0a5c57b36f79882573b2d84051f8bb85dd1bd63a" + integrity sha512-Wpks3yBDm0UcL5qlVhwW9Jr9n9i4FfeWBFOOXP5puDS/SiudJGhw7DPyBqn3487qD4F0lsC0q3zxink37f7zeA== + js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -5836,6 +6130,13 @@ klaw@^1.0.0: optionalDependencies: graceful-fs "^4.1.9" +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= + dependencies: + invert-kv "^1.0.0" + lcid@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" @@ -6044,6 +6345,11 @@ lodash.truncate@^4.4.2: resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= +lodash.values@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.values/-/lodash.values-4.3.0.tgz#a3a6c2b0ebecc5c2cba1c17e6e620fe81b53d347" + integrity sha1-o6bCsOvsxcLLocF+bmIP6BtT00c= + lodash@^4.17.11, lodash@^4.17.19: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" @@ -6184,6 +6490,13 @@ media-typer@0.3.0: resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= +mem@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" + integrity sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y= + dependencies: + mimic-fn "^1.0.0" + mem@^4.0.0: version "4.3.0" resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" @@ -6350,6 +6663,11 @@ mime@1.6.0, mime@^1.4.1: resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== + mimic-fn@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" @@ -6455,7 +6773,7 @@ mkdirp@0.5.1: dependencies: minimist "0.0.8" -mkdirp@0.5.5, mkdirp@^0.5.0: +mkdirp@0.5.5, mkdirp@^0.5.0, mkdirp@^0.5.1: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== @@ -6637,6 +6955,14 @@ node-environment-flags@1.0.6: object.getownpropertydescriptors "^2.0.3" semver "^5.7.0" +node-fetch@^1.0.1: + version "1.7.3" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" + integrity sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ== + dependencies: + encoding "^0.1.11" + is-stream "^1.0.1" + node-fetch@^2.6.0: version "2.6.1" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" @@ -6686,6 +7012,11 @@ npm-run-path@^2.0.0: dependencies: path-key "^2.0.0" +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + number-to-bn@1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/number-to-bn/-/number-to-bn-1.7.0.tgz#bb3623592f7e5f9e0030b1977bd41a0c53fe1ea0" @@ -6830,6 +7161,15 @@ original-require@1.0.1: resolved "https://registry.yarnpkg.com/original-require/-/original-require-1.0.1.tgz#0f130471584cd33511c5ec38c8d59213f9ac5e20" integrity sha1-DxMEcVhM0zURxew4yNWSE/msXiA= +os-locale@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" + integrity sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA== + dependencies: + execa "^0.7.0" + lcid "^1.0.0" + mem "^1.1.0" + os-locale@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" @@ -7155,6 +7495,16 @@ pkg-up@^2.0.0: dependencies: find-up "^2.1.0" +pluralize@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" + integrity sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow== + +popper.js@1.14.3: + version "1.14.3" + resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.14.3.tgz#1438f98d046acf7b4d78cd502bf418ac64d4f095" + integrity sha1-FDj5jQRqz3tNeM1QK/QYrGTU8JU= + posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" @@ -7467,6 +7817,13 @@ readdirp@~3.5.0: dependencies: picomatch "^2.2.1" +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + redent@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/redent/-/redent-3.0.0.tgz#e557b7998316bb53c9f1f56fa626352c6963059f" @@ -7544,11 +7901,16 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= -require-from-string@^2.0.0, require-from-string@^2.0.2: +require-from-string@^2.0.0, require-from-string@^2.0.1, require-from-string@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= + require-main-filename@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" @@ -7681,7 +8043,7 @@ safe-regex@^1.1.0: dependencies: ret "~0.1.10" -"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: +"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== @@ -7761,6 +8123,11 @@ semaphore@>=1.0.1, semaphore@^1.1.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== +semver@5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" + integrity sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA== + semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" @@ -8001,6 +8368,20 @@ solc@0.7.3: semver "^5.5.0" tmp "0.0.33" +solc@^0.5.5: + version "0.5.17" + resolved "https://registry.yarnpkg.com/solc/-/solc-0.5.17.tgz#8a76c50e98d49ca7610cca2fdc78ff3016540c67" + integrity sha512-qpX+PGaU0Q3c6lh2vDzMoIbhv6bIrecI4bYsx+xUs01xsGFnY6Nr0L8y/QMyutTnrHN6Lb/Yl672ZVRqxka96w== + dependencies: + command-exists "^1.2.8" + commander "3.0.2" + fs-extra "^0.30.0" + js-sha3 "0.8.0" + memorystream "^0.3.1" + require-from-string "^2.0.0" + semver "^5.5.0" + tmp "0.0.33" + solc@^0.6.4: version "0.6.4" resolved "https://registry.yarnpkg.com/solc/-/solc-0.6.4.tgz#4b0f11fccd6f5ef9802c6bb1c007abb16881c2ca" @@ -8034,6 +8415,14 @@ source-map-support@0.5.12: buffer-from "^1.0.0" source-map "^0.6.0" +source-map-support@^0.5.0: + version "0.5.20" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9" + integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + source-map-support@^0.5.13, source-map-support@^0.5.17: version "0.5.19" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" @@ -8164,6 +8553,15 @@ strict-uri-encode@^1.0.0: resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + "string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" @@ -8241,6 +8639,13 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + strip-ansi@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" @@ -8267,6 +8672,11 @@ strip-bom@^3.0.0: resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= +strip-comments@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-comments/-/strip-comments-2.0.1.tgz#4ad11c3fbcac177a67a40ac224ca339ca1c1ba9b" + integrity sha512-ZprKx+bBLXv067WTCALv8SSz5l2+XhpYCsVtSqlMnkAXMWDq+/ekVbl1ghqP9rUHTzv6sm/DwCOiYutU/yp1fw== + strip-dirs@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/strip-dirs/-/strip-dirs-2.1.0.tgz#4987736264fc344cf20f6c34aca9d13d1d4ed6c5" @@ -8882,6 +9292,11 @@ v8-compile-cache@^2.0.3: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e" integrity sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g== +valid-url@^1.0.9: + version "1.0.9" + resolved "https://registry.yarnpkg.com/valid-url/-/valid-url-1.0.9.tgz#1c14479b40f1397a75782f115e4086447433a200" + integrity sha1-HBRHm0DxOXp1eC8RXkCGRHQzogA= + validate-npm-package-license@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" @@ -9068,6 +9483,14 @@ web3-eth-abi@1.3.1: underscore "1.9.1" web3-utils "1.3.1" +web3-eth-abi@^1.0.0-beta.24: + version "1.6.0" + resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.6.0.tgz#4225608f61ebb0607d80849bb2b20f910780253d" + integrity sha512-fImomGE9McuTMJLwK8Tp0lTUzXqCkWeMm00qPVIwpJ/h7lCw9UFYV9+4m29wSqW6FF+FIZKwc6UBEf9dlx3orA== + dependencies: + "@ethersproject/abi" "5.0.7" + web3-utils "1.6.0" + web3-eth-accounts@1.2.6: version "1.2.6" resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.2.6.tgz#a1ba4bf75fa8102a3ec6cddd0eccd72462262720" @@ -9277,6 +9700,19 @@ web3-utils@1.3.1, web3-utils@^1.3.1: underscore "1.9.1" utf8 "3.0.0" +web3-utils@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.6.0.tgz#1975c5ee5b7db8a0836eb7004848a7cd962d1ddc" + integrity sha512-bgCAWAeQnJF035YTFxrcHJ5mGEfTi/McsjqldZiXRwlHK7L1PyOqvXiQLE053dlzvy1kdAxWl/sSSfLMyNUAXg== + dependencies: + bn.js "^4.11.9" + ethereum-bloom-filters "^1.0.6" + ethereumjs-util "^7.1.0" + ethjs-unit "0.1.6" + number-to-bn "1.7.0" + randombytes "^2.1.0" + utf8 "3.0.0" + web3@^1.2.6: version "1.2.6" resolved "https://registry.yarnpkg.com/web3/-/web3-1.2.6.tgz#c497dcb14cdd8d6d9fb6b445b3b68ff83f8ccf68" @@ -9303,6 +9739,11 @@ websocket@^1.0.32: utf-8-validate "^5.0.2" yaeti "^0.0.6" +whatwg-fetch@>=0.10.0: + version "3.6.2" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz#dced24f37f2624ed0281725d51d0e2e3fe677f8c" + integrity sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA== + which-boxed-primitive@^1.0.1, which-boxed-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" @@ -9378,6 +9819,14 @@ workerpool@6.0.2: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.0.2.tgz#e241b43d8d033f1beb52c7851069456039d1d438" integrity sha512-DSNyvOpFKrNusaaUwk+ej6cBj1bmhLcBfj80elGk+ZIo5JSkq+unB1dLKEOcNfJDZgjGICfhQ0Q5TbP0PvF4+Q== +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" @@ -9494,6 +9943,11 @@ xtend@~2.1.1: dependencies: object-keys "~0.4.0" +y18n@^3.2.1: + version "3.2.2" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.2.tgz#85c901bd6470ce71fc4bb723ad209b70f7f28696" + integrity sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ== + y18n@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" @@ -9535,6 +9989,13 @@ yargs-parser@^18.1.2, yargs-parser@^18.1.3: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-8.1.0.tgz#f1376a33b6629a5d063782944da732631e966950" + integrity sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ== + dependencies: + camelcase "^4.1.0" + yargs-unparser@1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-1.6.0.tgz#ef25c2c769ff6bd09e4b0f9d7c605fb27846ea9f" @@ -9587,6 +10048,24 @@ yargs@13.3.2, yargs@^13.0.0, yargs@^13.3.0: y18n "^4.0.0" yargs-parser "^13.1.2" +yargs@^10.0.3: + version "10.1.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-10.1.2.tgz#454d074c2b16a51a43e2fb7807e4f9de69ccb5c5" + integrity sha512-ivSoxqBGYOqQVruxD35+EyCFDYNEFL/Uo6FcOnz+9xZdZzK0Zzw4r4KhbrME1Oo2gOggwJod2MnsdamSG7H9ig== + dependencies: + cliui "^4.0.0" + decamelize "^1.1.1" + find-up "^2.1.0" + get-caller-file "^1.0.1" + os-locale "^2.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1" + yargs-parser "^8.1.0" + yargs@^15.1.0: version "15.4.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" From c7f55f4766f66f45580871145a19d67640294ef7 Mon Sep 17 00:00:00 2001 From: hasparus Date: Fri, 8 Oct 2021 15:39:11 +0200 Subject: [PATCH 2/9] Codegen new contracts --- packages/target-ethers-v4-test/package.json | 2 +- .../target-ethers-v4-test/types/ERC721.d.ts | 410 ++++++++++++++ .../types/ERC721Enumerable.d.ts | 501 ++++++++++++++++++ .../target-ethers-v4-test/types/IERC721.d.ts | 410 ++++++++++++++ .../types/IERC721Enumerable.d.ts | 501 ++++++++++++++++++ .../types/IERC721Receiver.d.ts | 95 ++++ packages/target-ethers-v5-test/package.json | 2 +- packages/target-web3-v1-test/package.json | 2 +- packages/typechain/package.json | 3 +- 9 files changed, 1921 insertions(+), 5 deletions(-) create mode 100644 packages/target-ethers-v4-test/types/ERC721.d.ts create mode 100644 packages/target-ethers-v4-test/types/ERC721Enumerable.d.ts create mode 100644 packages/target-ethers-v4-test/types/IERC721.d.ts create mode 100644 packages/target-ethers-v4-test/types/IERC721Enumerable.d.ts create mode 100644 packages/target-ethers-v4-test/types/IERC721Receiver.d.ts diff --git a/packages/target-ethers-v4-test/package.json b/packages/target-ethers-v4-test/package.json index f6cde2f36..983fb4ca6 100644 --- a/packages/target-ethers-v4-test/package.json +++ b/packages/target-ethers-v4-test/package.json @@ -10,7 +10,7 @@ "lint:fix": "yarn lint --fix", "typecheck": "tsc --noEmit --incremental false --composite false && tsc --noEmit --incremental false --composite false -p tsconfig.types.json", "clean": "rm -rf dist contracts/* && rm -f tsconfig.build.tsbuildinfo && rm -rf build", - "generate-types": "node ../typechain/dist/cli/cli.js --target=../target-ethers-v4/dist/index.js --out-dir ./types/ '../../contracts/compiled/*.abi'", + "generate-types": "node ../typechain/dist/cli/cli.js --target=../target-ethers-v4/dist/index.js --out-dir ./types/ '../../contracts/compiled/**/*.abi'", "test": "yarn generate-types && mocha --config ../../.mocharc.js", "test:fix": "yarn lint:fix && yarn format:fix && yarn test && yarn typecheck" }, diff --git a/packages/target-ethers-v4-test/types/ERC721.d.ts b/packages/target-ethers-v4-test/types/ERC721.d.ts new file mode 100644 index 000000000..e6f89383b --- /dev/null +++ b/packages/target-ethers-v4-test/types/ERC721.d.ts @@ -0,0 +1,410 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, ContractTransaction, EventFilter, Signer } from "ethers"; +import { Listener, Provider } from "ethers/providers"; +import { Arrayish, BigNumber, BigNumberish, Interface } from "ethers/utils"; +import { UnsignedTransaction } from "ethers/utils/transaction"; +import { TypedEventDescription, TypedFunctionDescription } from "."; + +interface ERC721Interface extends Interface { + functions: { + approve: TypedFunctionDescription<{ + encode([to, tokenId]: [string, BigNumberish]): string; + }>; + + balanceOf: TypedFunctionDescription<{ encode([owner]: [string]): string }>; + + getApproved: TypedFunctionDescription<{ + encode([tokenId]: [BigNumberish]): string; + }>; + + isApprovedForAll: TypedFunctionDescription<{ + encode([owner, operator]: [string, string]): string; + }>; + + ownerOf: TypedFunctionDescription<{ + encode([tokenId]: [BigNumberish]): string; + }>; + + safeTransferFrom: TypedFunctionDescription<{ + encode([from, to, tokenId]: [string, string, BigNumberish]): string; + }>; + + setApprovalForAll: TypedFunctionDescription<{ + encode([operator, approved]: [string, boolean]): string; + }>; + + transferFrom: TypedFunctionDescription<{ + encode([from, to, tokenId]: [string, string, BigNumberish]): string; + }>; + }; + + events: { + Approval: TypedEventDescription<{ + encodeTopics([owner, approved, tokenId]: [ + string | null, + string | null, + BigNumberish | null + ]): string[]; + }>; + + ApprovalForAll: TypedEventDescription<{ + encodeTopics([owner, operator, approved]: [ + string | null, + string | null, + null + ]): string[]; + }>; + + Transfer: TypedEventDescription<{ + encodeTopics([from, to, tokenId]: [ + string | null, + string | null, + BigNumberish | null + ]): string[]; + }>; + }; +} + +export class ERC721 extends Contract { + connect(signerOrProvider: Signer | Provider | string): ERC721; + attach(addressOrName: string): ERC721; + deployed(): Promise; + + on(event: EventFilter | string, listener: Listener): ERC721; + once(event: EventFilter | string, listener: Listener): ERC721; + addListener(eventName: EventFilter | string, listener: Listener): ERC721; + removeAllListeners(eventName: EventFilter | string): ERC721; + removeListener(eventName: any, listener: Listener): ERC721; + + interface: ERC721Interface; + + functions: { + approve( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "approve(address,uint256)"( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + balanceOf( + owner: string, + overrides?: UnsignedTransaction + ): Promise; + + "balanceOf(address)"( + owner: string, + overrides?: UnsignedTransaction + ): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "getApproved(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + "isApprovedForAll(address,address)"( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "ownerOf(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + safeTransferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + _data: Arrayish, + overrides?: UnsignedTransaction + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + "setApprovalForAll(address,bool)"( + operator: string, + approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "transferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + }; + + approve( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "approve(address,uint256)"( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + balanceOf(owner: string, overrides?: UnsignedTransaction): Promise; + + "balanceOf(address)"( + owner: string, + overrides?: UnsignedTransaction + ): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "getApproved(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + "isApprovedForAll(address,address)"( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "ownerOf(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + safeTransferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + _data: Arrayish, + overrides?: UnsignedTransaction + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + "setApprovalForAll(address,bool)"( + operator: string, + approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "transferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + filters: { + Approval( + owner: string | null, + approved: string | null, + tokenId: BigNumberish | null + ): EventFilter; + + ApprovalForAll( + owner: string | null, + operator: string | null, + approved: null + ): EventFilter; + + Transfer( + from: string | null, + to: string | null, + tokenId: BigNumberish | null + ): EventFilter; + }; + + estimate: { + approve( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "approve(address,uint256)"( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + balanceOf( + owner: string, + overrides?: UnsignedTransaction + ): Promise; + + "balanceOf(address)"( + owner: string, + overrides?: UnsignedTransaction + ): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "getApproved(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + "isApprovedForAll(address,address)"( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "ownerOf(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + safeTransferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + _data: Arrayish, + overrides?: UnsignedTransaction + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + "setApprovalForAll(address,bool)"( + operator: string, + approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "transferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + }; +} diff --git a/packages/target-ethers-v4-test/types/ERC721Enumerable.d.ts b/packages/target-ethers-v4-test/types/ERC721Enumerable.d.ts new file mode 100644 index 000000000..ab96a2ee4 --- /dev/null +++ b/packages/target-ethers-v4-test/types/ERC721Enumerable.d.ts @@ -0,0 +1,501 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, ContractTransaction, EventFilter, Signer } from "ethers"; +import { Listener, Provider } from "ethers/providers"; +import { Arrayish, BigNumber, BigNumberish, Interface } from "ethers/utils"; +import { UnsignedTransaction } from "ethers/utils/transaction"; +import { TypedEventDescription, TypedFunctionDescription } from "."; + +interface ERC721EnumerableInterface extends Interface { + functions: { + approve: TypedFunctionDescription<{ + encode([to, tokenId]: [string, BigNumberish]): string; + }>; + + balanceOf: TypedFunctionDescription<{ encode([owner]: [string]): string }>; + + getApproved: TypedFunctionDescription<{ + encode([tokenId]: [BigNumberish]): string; + }>; + + isApprovedForAll: TypedFunctionDescription<{ + encode([owner, operator]: [string, string]): string; + }>; + + ownerOf: TypedFunctionDescription<{ + encode([tokenId]: [BigNumberish]): string; + }>; + + safeTransferFrom: TypedFunctionDescription<{ + encode([from, to, tokenId]: [string, string, BigNumberish]): string; + }>; + + setApprovalForAll: TypedFunctionDescription<{ + encode([operator, approved]: [string, boolean]): string; + }>; + + tokenByIndex: TypedFunctionDescription<{ + encode([index]: [BigNumberish]): string; + }>; + + tokenOfOwnerByIndex: TypedFunctionDescription<{ + encode([owner, index]: [string, BigNumberish]): string; + }>; + + totalSupply: TypedFunctionDescription<{ encode([]: []): string }>; + + transferFrom: TypedFunctionDescription<{ + encode([from, to, tokenId]: [string, string, BigNumberish]): string; + }>; + }; + + events: { + Approval: TypedEventDescription<{ + encodeTopics([owner, approved, tokenId]: [ + string | null, + string | null, + BigNumberish | null + ]): string[]; + }>; + + ApprovalForAll: TypedEventDescription<{ + encodeTopics([owner, operator, approved]: [ + string | null, + string | null, + null + ]): string[]; + }>; + + Transfer: TypedEventDescription<{ + encodeTopics([from, to, tokenId]: [ + string | null, + string | null, + BigNumberish | null + ]): string[]; + }>; + }; +} + +export class ERC721Enumerable extends Contract { + connect(signerOrProvider: Signer | Provider | string): ERC721Enumerable; + attach(addressOrName: string): ERC721Enumerable; + deployed(): Promise; + + on(event: EventFilter | string, listener: Listener): ERC721Enumerable; + once(event: EventFilter | string, listener: Listener): ERC721Enumerable; + addListener( + eventName: EventFilter | string, + listener: Listener + ): ERC721Enumerable; + removeAllListeners(eventName: EventFilter | string): ERC721Enumerable; + removeListener(eventName: any, listener: Listener): ERC721Enumerable; + + interface: ERC721EnumerableInterface; + + functions: { + approve( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "approve(address,uint256)"( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + balanceOf( + owner: string, + overrides?: UnsignedTransaction + ): Promise; + + "balanceOf(address)"( + owner: string, + overrides?: UnsignedTransaction + ): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "getApproved(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + "isApprovedForAll(address,address)"( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "ownerOf(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + safeTransferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + _data: Arrayish, + overrides?: UnsignedTransaction + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + "setApprovalForAll(address,bool)"( + operator: string, + approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + tokenByIndex( + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "tokenByIndex(uint256)"( + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "tokenOfOwnerByIndex(address,uint256)"( + owner: string, + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + totalSupply(overrides?: UnsignedTransaction): Promise; + + "totalSupply()"(overrides?: UnsignedTransaction): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "transferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + }; + + approve( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "approve(address,uint256)"( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + balanceOf(owner: string, overrides?: UnsignedTransaction): Promise; + + "balanceOf(address)"( + owner: string, + overrides?: UnsignedTransaction + ): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "getApproved(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + "isApprovedForAll(address,address)"( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "ownerOf(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + safeTransferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + _data: Arrayish, + overrides?: UnsignedTransaction + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + "setApprovalForAll(address,bool)"( + operator: string, + approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + tokenByIndex( + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "tokenByIndex(uint256)"( + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "tokenOfOwnerByIndex(address,uint256)"( + owner: string, + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + totalSupply(overrides?: UnsignedTransaction): Promise; + + "totalSupply()"(overrides?: UnsignedTransaction): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "transferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + filters: { + Approval( + owner: string | null, + approved: string | null, + tokenId: BigNumberish | null + ): EventFilter; + + ApprovalForAll( + owner: string | null, + operator: string | null, + approved: null + ): EventFilter; + + Transfer( + from: string | null, + to: string | null, + tokenId: BigNumberish | null + ): EventFilter; + }; + + estimate: { + approve( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "approve(address,uint256)"( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + balanceOf( + owner: string, + overrides?: UnsignedTransaction + ): Promise; + + "balanceOf(address)"( + owner: string, + overrides?: UnsignedTransaction + ): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "getApproved(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + "isApprovedForAll(address,address)"( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "ownerOf(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + safeTransferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + _data: Arrayish, + overrides?: UnsignedTransaction + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + "setApprovalForAll(address,bool)"( + operator: string, + approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + tokenByIndex( + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "tokenByIndex(uint256)"( + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "tokenOfOwnerByIndex(address,uint256)"( + owner: string, + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + totalSupply(overrides?: UnsignedTransaction): Promise; + + "totalSupply()"(overrides?: UnsignedTransaction): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "transferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + }; +} diff --git a/packages/target-ethers-v4-test/types/IERC721.d.ts b/packages/target-ethers-v4-test/types/IERC721.d.ts new file mode 100644 index 000000000..de74f438b --- /dev/null +++ b/packages/target-ethers-v4-test/types/IERC721.d.ts @@ -0,0 +1,410 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, ContractTransaction, EventFilter, Signer } from "ethers"; +import { Listener, Provider } from "ethers/providers"; +import { Arrayish, BigNumber, BigNumberish, Interface } from "ethers/utils"; +import { UnsignedTransaction } from "ethers/utils/transaction"; +import { TypedEventDescription, TypedFunctionDescription } from "."; + +interface IERC721Interface extends Interface { + functions: { + approve: TypedFunctionDescription<{ + encode([to, tokenId]: [string, BigNumberish]): string; + }>; + + balanceOf: TypedFunctionDescription<{ encode([owner]: [string]): string }>; + + getApproved: TypedFunctionDescription<{ + encode([tokenId]: [BigNumberish]): string; + }>; + + isApprovedForAll: TypedFunctionDescription<{ + encode([owner, operator]: [string, string]): string; + }>; + + ownerOf: TypedFunctionDescription<{ + encode([tokenId]: [BigNumberish]): string; + }>; + + safeTransferFrom: TypedFunctionDescription<{ + encode([from, to, tokenId]: [string, string, BigNumberish]): string; + }>; + + setApprovalForAll: TypedFunctionDescription<{ + encode([operator, _approved]: [string, boolean]): string; + }>; + + transferFrom: TypedFunctionDescription<{ + encode([from, to, tokenId]: [string, string, BigNumberish]): string; + }>; + }; + + events: { + Approval: TypedEventDescription<{ + encodeTopics([owner, approved, tokenId]: [ + string | null, + string | null, + BigNumberish | null + ]): string[]; + }>; + + ApprovalForAll: TypedEventDescription<{ + encodeTopics([owner, operator, approved]: [ + string | null, + string | null, + null + ]): string[]; + }>; + + Transfer: TypedEventDescription<{ + encodeTopics([from, to, tokenId]: [ + string | null, + string | null, + BigNumberish | null + ]): string[]; + }>; + }; +} + +export class IERC721 extends Contract { + connect(signerOrProvider: Signer | Provider | string): IERC721; + attach(addressOrName: string): IERC721; + deployed(): Promise; + + on(event: EventFilter | string, listener: Listener): IERC721; + once(event: EventFilter | string, listener: Listener): IERC721; + addListener(eventName: EventFilter | string, listener: Listener): IERC721; + removeAllListeners(eventName: EventFilter | string): IERC721; + removeListener(eventName: any, listener: Listener): IERC721; + + interface: IERC721Interface; + + functions: { + approve( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "approve(address,uint256)"( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + balanceOf( + owner: string, + overrides?: UnsignedTransaction + ): Promise; + + "balanceOf(address)"( + owner: string, + overrides?: UnsignedTransaction + ): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "getApproved(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + "isApprovedForAll(address,address)"( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "ownerOf(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + safeTransferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + data: Arrayish, + overrides?: UnsignedTransaction + ): Promise; + + setApprovalForAll( + operator: string, + _approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + "setApprovalForAll(address,bool)"( + operator: string, + _approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "transferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + }; + + approve( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "approve(address,uint256)"( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + balanceOf(owner: string, overrides?: UnsignedTransaction): Promise; + + "balanceOf(address)"( + owner: string, + overrides?: UnsignedTransaction + ): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "getApproved(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + "isApprovedForAll(address,address)"( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "ownerOf(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + safeTransferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + data: Arrayish, + overrides?: UnsignedTransaction + ): Promise; + + setApprovalForAll( + operator: string, + _approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + "setApprovalForAll(address,bool)"( + operator: string, + _approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "transferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + filters: { + Approval( + owner: string | null, + approved: string | null, + tokenId: BigNumberish | null + ): EventFilter; + + ApprovalForAll( + owner: string | null, + operator: string | null, + approved: null + ): EventFilter; + + Transfer( + from: string | null, + to: string | null, + tokenId: BigNumberish | null + ): EventFilter; + }; + + estimate: { + approve( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "approve(address,uint256)"( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + balanceOf( + owner: string, + overrides?: UnsignedTransaction + ): Promise; + + "balanceOf(address)"( + owner: string, + overrides?: UnsignedTransaction + ): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "getApproved(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + "isApprovedForAll(address,address)"( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "ownerOf(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + safeTransferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + data: Arrayish, + overrides?: UnsignedTransaction + ): Promise; + + setApprovalForAll( + operator: string, + _approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + "setApprovalForAll(address,bool)"( + operator: string, + _approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "transferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + }; +} diff --git a/packages/target-ethers-v4-test/types/IERC721Enumerable.d.ts b/packages/target-ethers-v4-test/types/IERC721Enumerable.d.ts new file mode 100644 index 000000000..3540deadc --- /dev/null +++ b/packages/target-ethers-v4-test/types/IERC721Enumerable.d.ts @@ -0,0 +1,501 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, ContractTransaction, EventFilter, Signer } from "ethers"; +import { Listener, Provider } from "ethers/providers"; +import { Arrayish, BigNumber, BigNumberish, Interface } from "ethers/utils"; +import { UnsignedTransaction } from "ethers/utils/transaction"; +import { TypedEventDescription, TypedFunctionDescription } from "."; + +interface IERC721EnumerableInterface extends Interface { + functions: { + approve: TypedFunctionDescription<{ + encode([to, tokenId]: [string, BigNumberish]): string; + }>; + + balanceOf: TypedFunctionDescription<{ encode([owner]: [string]): string }>; + + getApproved: TypedFunctionDescription<{ + encode([tokenId]: [BigNumberish]): string; + }>; + + isApprovedForAll: TypedFunctionDescription<{ + encode([owner, operator]: [string, string]): string; + }>; + + ownerOf: TypedFunctionDescription<{ + encode([tokenId]: [BigNumberish]): string; + }>; + + safeTransferFrom: TypedFunctionDescription<{ + encode([from, to, tokenId]: [string, string, BigNumberish]): string; + }>; + + setApprovalForAll: TypedFunctionDescription<{ + encode([operator, _approved]: [string, boolean]): string; + }>; + + tokenByIndex: TypedFunctionDescription<{ + encode([index]: [BigNumberish]): string; + }>; + + tokenOfOwnerByIndex: TypedFunctionDescription<{ + encode([owner, index]: [string, BigNumberish]): string; + }>; + + totalSupply: TypedFunctionDescription<{ encode([]: []): string }>; + + transferFrom: TypedFunctionDescription<{ + encode([from, to, tokenId]: [string, string, BigNumberish]): string; + }>; + }; + + events: { + Approval: TypedEventDescription<{ + encodeTopics([owner, approved, tokenId]: [ + string | null, + string | null, + BigNumberish | null + ]): string[]; + }>; + + ApprovalForAll: TypedEventDescription<{ + encodeTopics([owner, operator, approved]: [ + string | null, + string | null, + null + ]): string[]; + }>; + + Transfer: TypedEventDescription<{ + encodeTopics([from, to, tokenId]: [ + string | null, + string | null, + BigNumberish | null + ]): string[]; + }>; + }; +} + +export class IERC721Enumerable extends Contract { + connect(signerOrProvider: Signer | Provider | string): IERC721Enumerable; + attach(addressOrName: string): IERC721Enumerable; + deployed(): Promise; + + on(event: EventFilter | string, listener: Listener): IERC721Enumerable; + once(event: EventFilter | string, listener: Listener): IERC721Enumerable; + addListener( + eventName: EventFilter | string, + listener: Listener + ): IERC721Enumerable; + removeAllListeners(eventName: EventFilter | string): IERC721Enumerable; + removeListener(eventName: any, listener: Listener): IERC721Enumerable; + + interface: IERC721EnumerableInterface; + + functions: { + approve( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "approve(address,uint256)"( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + balanceOf( + owner: string, + overrides?: UnsignedTransaction + ): Promise; + + "balanceOf(address)"( + owner: string, + overrides?: UnsignedTransaction + ): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "getApproved(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + "isApprovedForAll(address,address)"( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "ownerOf(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + safeTransferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + data: Arrayish, + overrides?: UnsignedTransaction + ): Promise; + + setApprovalForAll( + operator: string, + _approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + "setApprovalForAll(address,bool)"( + operator: string, + _approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + tokenByIndex( + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "tokenByIndex(uint256)"( + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "tokenOfOwnerByIndex(address,uint256)"( + owner: string, + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + totalSupply(overrides?: UnsignedTransaction): Promise; + + "totalSupply()"(overrides?: UnsignedTransaction): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "transferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + }; + + approve( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "approve(address,uint256)"( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + balanceOf(owner: string, overrides?: UnsignedTransaction): Promise; + + "balanceOf(address)"( + owner: string, + overrides?: UnsignedTransaction + ): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "getApproved(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + "isApprovedForAll(address,address)"( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "ownerOf(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + safeTransferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + data: Arrayish, + overrides?: UnsignedTransaction + ): Promise; + + setApprovalForAll( + operator: string, + _approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + "setApprovalForAll(address,bool)"( + operator: string, + _approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + tokenByIndex( + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "tokenByIndex(uint256)"( + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "tokenOfOwnerByIndex(address,uint256)"( + owner: string, + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + totalSupply(overrides?: UnsignedTransaction): Promise; + + "totalSupply()"(overrides?: UnsignedTransaction): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "transferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + filters: { + Approval( + owner: string | null, + approved: string | null, + tokenId: BigNumberish | null + ): EventFilter; + + ApprovalForAll( + owner: string | null, + operator: string | null, + approved: null + ): EventFilter; + + Transfer( + from: string | null, + to: string | null, + tokenId: BigNumberish | null + ): EventFilter; + }; + + estimate: { + approve( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "approve(address,uint256)"( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + balanceOf( + owner: string, + overrides?: UnsignedTransaction + ): Promise; + + "balanceOf(address)"( + owner: string, + overrides?: UnsignedTransaction + ): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "getApproved(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + "isApprovedForAll(address,address)"( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "ownerOf(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + safeTransferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + data: Arrayish, + overrides?: UnsignedTransaction + ): Promise; + + setApprovalForAll( + operator: string, + _approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + "setApprovalForAll(address,bool)"( + operator: string, + _approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + tokenByIndex( + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "tokenByIndex(uint256)"( + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "tokenOfOwnerByIndex(address,uint256)"( + owner: string, + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + totalSupply(overrides?: UnsignedTransaction): Promise; + + "totalSupply()"(overrides?: UnsignedTransaction): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "transferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + }; +} diff --git a/packages/target-ethers-v4-test/types/IERC721Receiver.d.ts b/packages/target-ethers-v4-test/types/IERC721Receiver.d.ts new file mode 100644 index 000000000..9bc59c68b --- /dev/null +++ b/packages/target-ethers-v4-test/types/IERC721Receiver.d.ts @@ -0,0 +1,95 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, ContractTransaction, EventFilter, Signer } from "ethers"; +import { Listener, Provider } from "ethers/providers"; +import { Arrayish, BigNumber, BigNumberish, Interface } from "ethers/utils"; +import { UnsignedTransaction } from "ethers/utils/transaction"; +import { TypedEventDescription, TypedFunctionDescription } from "."; + +interface IERC721ReceiverInterface extends Interface { + functions: { + onERC721Received: TypedFunctionDescription<{ + encode([operator, from, tokenId, data]: [ + string, + string, + BigNumberish, + Arrayish + ]): string; + }>; + }; + + events: {}; +} + +export class IERC721Receiver extends Contract { + connect(signerOrProvider: Signer | Provider | string): IERC721Receiver; + attach(addressOrName: string): IERC721Receiver; + deployed(): Promise; + + on(event: EventFilter | string, listener: Listener): IERC721Receiver; + once(event: EventFilter | string, listener: Listener): IERC721Receiver; + addListener( + eventName: EventFilter | string, + listener: Listener + ): IERC721Receiver; + removeAllListeners(eventName: EventFilter | string): IERC721Receiver; + removeListener(eventName: any, listener: Listener): IERC721Receiver; + + interface: IERC721ReceiverInterface; + + functions: { + onERC721Received( + operator: string, + from: string, + tokenId: BigNumberish, + data: Arrayish, + overrides?: UnsignedTransaction + ): Promise; + + "onERC721Received(address,address,uint256,bytes)"( + operator: string, + from: string, + tokenId: BigNumberish, + data: Arrayish, + overrides?: UnsignedTransaction + ): Promise; + }; + + onERC721Received( + operator: string, + from: string, + tokenId: BigNumberish, + data: Arrayish, + overrides?: UnsignedTransaction + ): Promise; + + "onERC721Received(address,address,uint256,bytes)"( + operator: string, + from: string, + tokenId: BigNumberish, + data: Arrayish, + overrides?: UnsignedTransaction + ): Promise; + + filters: {}; + + estimate: { + onERC721Received( + operator: string, + from: string, + tokenId: BigNumberish, + data: Arrayish, + overrides?: UnsignedTransaction + ): Promise; + + "onERC721Received(address,address,uint256,bytes)"( + operator: string, + from: string, + tokenId: BigNumberish, + data: Arrayish, + overrides?: UnsignedTransaction + ): Promise; + }; +} diff --git a/packages/target-ethers-v5-test/package.json b/packages/target-ethers-v5-test/package.json index 0765efe67..1641fcf23 100644 --- a/packages/target-ethers-v5-test/package.json +++ b/packages/target-ethers-v5-test/package.json @@ -10,7 +10,7 @@ "lint:fix": "yarn lint --fix", "typecheck": "tsc --noEmit --incremental false --composite false && tsc --noEmit --incremental false --composite false -p tsconfig.types.json", "clean": "rm -rf dist contracts/* && rm -f tsconfig.build.tsbuildinfo && rm -rf build", - "generate-types": "node ../typechain/dist/cli/cli.js --target=../target-ethers-v5/dist/index.js --out-dir ./types/ '../../contracts/compiled/*.abi'", + "generate-types": "node ../typechain/dist/cli/cli.js --target=../target-ethers-v5/dist/index.js --out-dir ./types/ '../../contracts/compiled/**/*.abi'", "test": "yarn generate-types && mocha --config ../../.mocharc.js", "test:fix": "yarn lint:fix && yarn format:fix && yarn test && yarn typecheck" }, diff --git a/packages/target-web3-v1-test/package.json b/packages/target-web3-v1-test/package.json index 811a52707..f6a4b713b 100644 --- a/packages/target-web3-v1-test/package.json +++ b/packages/target-web3-v1-test/package.json @@ -10,7 +10,7 @@ "lint:fix": "yarn lint --fix", "typecheck": "tsc --noEmit --incremental false --composite false && tsc --noEmit --incremental false --composite false -p tsconfig.types.json", "clean": "rm -rf dist contracts/* && rm -f tsconfig.build.tsbuildinfo && rm -rf build", - "generate-types": "node ../typechain/dist/cli/cli.js --target=../target-web3-v1/dist/index.js --out-dir ./types/ '../../contracts/compiled/*.abi'", + "generate-types": "node ../typechain/dist/cli/cli.js --target=../target-web3-v1/dist/index.js --out-dir ./types/ '../../contracts/compiled/**/*.abi'", "test": "yarn generate-types && mocha --config ../../.mocharc.js", "test:fix": "yarn lint:fix && yarn format:fix && yarn test && yarn typecheck" }, diff --git a/packages/typechain/package.json b/packages/typechain/package.json index 84948ed35..4b6f1bbda 100644 --- a/packages/typechain/package.json +++ b/packages/typechain/package.json @@ -55,8 +55,7 @@ "@types/prettier": "^1.13.2", "bignumber.js": "^5.0.0", "bluebird": "^3.5.1", - "coveralls": "^3.0.2", - "glob": "^7.1.2" + "coveralls": "^3.0.2" }, "peerDependencies": { "typescript": ">=4.1.0" From 7a43db71d704b43a9e4929f5bb051c1d6a822612 Mon Sep 17 00:00:00 2001 From: hasparus Date: Fri, 8 Oct 2021 15:39:27 +0200 Subject: [PATCH 3/9] Remove duplicate reexport --- packages/typechain/src/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/typechain/src/index.ts b/packages/typechain/src/index.ts index ef0b49c1f..d8ede6cd6 100644 --- a/packages/typechain/src/index.ts +++ b/packages/typechain/src/index.ts @@ -3,7 +3,6 @@ export { normalizeName } from './parser/normalizeName' export * from './parser/parseEvmType' export * from './typechain/runTypeChain' export * from './typechain/types' -export * from './typechain/types' export * from './utils/files' export * from './utils/glob' export * from './utils/signatures' From f67b792159b4b67be5c15864936af3f71801bec7 Mon Sep 17 00:00:00 2001 From: hasparus Date: Fri, 8 Oct 2021 15:40:19 +0200 Subject: [PATCH 4/9] Add ES2021 reserved keywords and createIdentifier function --- .../src/codegen/typescript-syntax.ts | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 packages/target-ethers-v5/src/codegen/typescript-syntax.ts diff --git a/packages/target-ethers-v5/src/codegen/typescript-syntax.ts b/packages/target-ethers-v5/src/codegen/typescript-syntax.ts new file mode 100644 index 000000000..2a9871745 --- /dev/null +++ b/packages/target-ethers-v5/src/codegen/typescript-syntax.ts @@ -0,0 +1,30 @@ +/** + * A set of reserved words in EcmaScript 2021 + * @see https://262.ecma-international.org/12.0/#prod-ReservedWord + */ +// prettier-ignore +const RESERVED_WORDS = new Set([ + 'await', 'break', 'case', + 'catch', 'class', 'const', + 'continue', 'debugger', 'default', + 'delete', 'do', 'else', + 'enum', 'export', 'extends', + 'false', 'finally', 'for', + 'function', 'if', 'import', + 'in', 'instanceof', 'new', + 'null', 'return', 'super', + 'switch', 'this', 'throw', + 'true', 'try', 'typeof', + 'var', 'void', 'while', + 'with', 'yield' +]) + +/* + * Creates an identifier prefixing reserved words with `_`. + */ +export function createIdentifier(identifierName: string) { + if (RESERVED_WORDS.has(identifierName)) { + return `_${identifierName}` + } + return identifierName +} From 8627e2a5eff329d73d4e7932b5359e36a8bd5952 Mon Sep 17 00:00:00 2001 From: hasparus Date: Fri, 8 Oct 2021 16:09:02 +0200 Subject: [PATCH 5/9] Alias positional identifiers --- .eslintrc.js | 2 +- .../target-ethers-v4-test/types/Rarity.d.ts | 951 ++++++++++++++++++ .../factories/ERC721Enumerable__factory.ts | 342 +++++++ .../types/factories/ERC721__factory.ts | 283 ++++++ .../factories/IERC721Enumerable__factory.ts | 342 +++++++ .../factories/IERC721Receiver__factory.ts | 54 + .../types/factories/IERC721__factory.ts | 286 ++++++ .../types/factories/Rarity__factory.ts | 626 ++++++++++++ .../target-ethers-v4/src/codegen/index.ts | 9 +- .../target-ethers-v4/src/codegen/types.ts | 16 +- .../target-ethers-v5/src/codegen/events.ts | 6 +- packages/target-truffle-v5-test/package.json | 2 +- .../src/codegen/syntax.ts} | 4 +- packages/typechain/src/index.ts | 1 + yarn.lock | 501 +-------- 15 files changed, 2923 insertions(+), 502 deletions(-) create mode 100644 packages/target-ethers-v4-test/types/Rarity.d.ts create mode 100644 packages/target-ethers-v4-test/types/factories/ERC721Enumerable__factory.ts create mode 100644 packages/target-ethers-v4-test/types/factories/ERC721__factory.ts create mode 100644 packages/target-ethers-v4-test/types/factories/IERC721Enumerable__factory.ts create mode 100644 packages/target-ethers-v4-test/types/factories/IERC721Receiver__factory.ts create mode 100644 packages/target-ethers-v4-test/types/factories/IERC721__factory.ts create mode 100644 packages/target-ethers-v4-test/types/factories/Rarity__factory.ts rename packages/{target-ethers-v5/src/codegen/typescript-syntax.ts => typechain/src/codegen/syntax.ts} (80%) diff --git a/.eslintrc.js b/.eslintrc.js index 3e819464d..e5464cefc 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -12,7 +12,7 @@ module.exports = { }, rules: { // this gets inlined into a package eslint, so it means: use current package's package.info or the one at the project root - 'import/no-extraneous-dependencies': ['error', { packageDir: ['./', __dirname] }], + 'import/no-extraneous-dependencies': ['error', { packageDir: ['./', __dirname], }], 'unused-imports/no-unused-imports-ts': 'error', 'simple-import-sort/imports': 'error', 'simple-import-sort/exports': 'error', diff --git a/packages/target-ethers-v4-test/types/Rarity.d.ts b/packages/target-ethers-v4-test/types/Rarity.d.ts new file mode 100644 index 000000000..9521771af --- /dev/null +++ b/packages/target-ethers-v4-test/types/Rarity.d.ts @@ -0,0 +1,951 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, ContractTransaction, EventFilter, Signer } from "ethers"; +import { Listener, Provider } from "ethers/providers"; +import { Arrayish, BigNumber, BigNumberish, Interface } from "ethers/utils"; +import { UnsignedTransaction } from "ethers/utils/transaction"; +import { TypedEventDescription, TypedFunctionDescription } from "."; + +interface RarityInterface extends Interface { + functions: { + adventure: TypedFunctionDescription<{ + encode([_summoner]: [BigNumberish]): string; + }>; + + adventurers_log: TypedFunctionDescription<{ + encode([]: [BigNumberish]): string; + }>; + + approve: TypedFunctionDescription<{ + encode([to, tokenId]: [string, BigNumberish]): string; + }>; + + balanceOf: TypedFunctionDescription<{ encode([owner]: [string]): string }>; + + class: TypedFunctionDescription<{ encode([]: [BigNumberish]): string }>; + + classes: TypedFunctionDescription<{ encode([id]: [BigNumberish]): string }>; + + getApproved: TypedFunctionDescription<{ + encode([tokenId]: [BigNumberish]): string; + }>; + + isApprovedForAll: TypedFunctionDescription<{ + encode([owner, operator]: [string, string]): string; + }>; + + level: TypedFunctionDescription<{ encode([]: [BigNumberish]): string }>; + + level_up: TypedFunctionDescription<{ + encode([_summoner]: [BigNumberish]): string; + }>; + + next_summoner: TypedFunctionDescription<{ encode([]: []): string }>; + + ownerOf: TypedFunctionDescription<{ + encode([tokenId]: [BigNumberish]): string; + }>; + + safeTransferFrom: TypedFunctionDescription<{ + encode([from, to, tokenId]: [string, string, BigNumberish]): string; + }>; + + setApprovalForAll: TypedFunctionDescription<{ + encode([operator, approved]: [string, boolean]): string; + }>; + + spend_xp: TypedFunctionDescription<{ + encode([_summoner, _xp]: [BigNumberish, BigNumberish]): string; + }>; + + summon: TypedFunctionDescription<{ + encode([_class]: [BigNumberish]): string; + }>; + + summoner: TypedFunctionDescription<{ + encode([_summoner]: [BigNumberish]): string; + }>; + + tokenByIndex: TypedFunctionDescription<{ + encode([index]: [BigNumberish]): string; + }>; + + tokenOfOwnerByIndex: TypedFunctionDescription<{ + encode([owner, index]: [string, BigNumberish]): string; + }>; + + tokenURI: TypedFunctionDescription<{ + encode([_summoner]: [BigNumberish]): string; + }>; + + totalSupply: TypedFunctionDescription<{ encode([]: []): string }>; + + transferFrom: TypedFunctionDescription<{ + encode([from, to, tokenId]: [string, string, BigNumberish]): string; + }>; + + xp: TypedFunctionDescription<{ encode([]: [BigNumberish]): string }>; + + xp_required: TypedFunctionDescription<{ + encode([curent_level]: [BigNumberish]): string; + }>; + }; + + events: { + Approval: TypedEventDescription<{ + encodeTopics([owner, approved, tokenId]: [ + string | null, + string | null, + BigNumberish | null + ]): string[]; + }>; + + ApprovalForAll: TypedEventDescription<{ + encodeTopics([owner, operator, approved]: [ + string | null, + string | null, + null + ]): string[]; + }>; + + Transfer: TypedEventDescription<{ + encodeTopics([from, to, tokenId]: [ + string | null, + string | null, + BigNumberish | null + ]): string[]; + }>; + + leveled: TypedEventDescription<{ + encodeTopics([owner, level, summoner]: [ + string | null, + null, + null + ]): string[]; + }>; + + summoned: TypedEventDescription<{ + encodeTopics([owner, _class, summoner]: [ + string | null, + null, + null + ]): string[]; + }>; + }; +} + +export class Rarity extends Contract { + connect(signerOrProvider: Signer | Provider | string): Rarity; + attach(addressOrName: string): Rarity; + deployed(): Promise; + + on(event: EventFilter | string, listener: Listener): Rarity; + once(event: EventFilter | string, listener: Listener): Rarity; + addListener(eventName: EventFilter | string, listener: Listener): Rarity; + removeAllListeners(eventName: EventFilter | string): Rarity; + removeListener(eventName: any, listener: Listener): Rarity; + + interface: RarityInterface; + + functions: { + adventure( + _summoner: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "adventure(uint256)"( + _summoner: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + adventurers_log( + arg0: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "adventurers_log(uint256)"( + arg0: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + approve( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "approve(address,uint256)"( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + balanceOf( + owner: string, + overrides?: UnsignedTransaction + ): Promise; + + "balanceOf(address)"( + owner: string, + overrides?: UnsignedTransaction + ): Promise; + + class( + arg0: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "class(uint256)"( + arg0: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + classes(id: BigNumberish, overrides?: UnsignedTransaction): Promise; + + "classes(uint256)"( + id: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "getApproved(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + "isApprovedForAll(address,address)"( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + level( + arg0: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "level(uint256)"( + arg0: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + level_up( + _summoner: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "level_up(uint256)"( + _summoner: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + next_summoner(overrides?: UnsignedTransaction): Promise; + + "next_summoner()"(overrides?: UnsignedTransaction): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "ownerOf(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + safeTransferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + _data: Arrayish, + overrides?: UnsignedTransaction + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + "setApprovalForAll(address,bool)"( + operator: string, + approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + spend_xp( + _summoner: BigNumberish, + _xp: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "spend_xp(uint256,uint256)"( + _summoner: BigNumberish, + _xp: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + summon( + _class: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "summon(uint256)"( + _class: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + summoner( + _summoner: BigNumberish, + overrides?: UnsignedTransaction + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber] & { + _xp: BigNumber; + _log: BigNumber; + _class: BigNumber; + _level: BigNumber; + } + >; + + "summoner(uint256)"( + _summoner: BigNumberish, + overrides?: UnsignedTransaction + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber] & { + _xp: BigNumber; + _log: BigNumber; + _class: BigNumber; + _level: BigNumber; + } + >; + + tokenByIndex( + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "tokenByIndex(uint256)"( + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "tokenOfOwnerByIndex(address,uint256)"( + owner: string, + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + tokenURI( + _summoner: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "tokenURI(uint256)"( + _summoner: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + totalSupply(overrides?: UnsignedTransaction): Promise; + + "totalSupply()"(overrides?: UnsignedTransaction): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "transferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + xp(arg0: BigNumberish, overrides?: UnsignedTransaction): Promise; + + "xp(uint256)"( + arg0: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + xp_required( + curent_level: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "xp_required(uint256)"( + curent_level: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + }; + + adventure( + _summoner: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "adventure(uint256)"( + _summoner: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + adventurers_log( + arg0: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "adventurers_log(uint256)"( + arg0: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + approve( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "approve(address,uint256)"( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + balanceOf(owner: string, overrides?: UnsignedTransaction): Promise; + + "balanceOf(address)"( + owner: string, + overrides?: UnsignedTransaction + ): Promise; + + class( + arg0: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "class(uint256)"( + arg0: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + classes(id: BigNumberish, overrides?: UnsignedTransaction): Promise; + + "classes(uint256)"( + id: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "getApproved(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + "isApprovedForAll(address,address)"( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + level( + arg0: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "level(uint256)"( + arg0: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + level_up( + _summoner: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "level_up(uint256)"( + _summoner: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + next_summoner(overrides?: UnsignedTransaction): Promise; + + "next_summoner()"(overrides?: UnsignedTransaction): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "ownerOf(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + safeTransferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + _data: Arrayish, + overrides?: UnsignedTransaction + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + "setApprovalForAll(address,bool)"( + operator: string, + approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + spend_xp( + _summoner: BigNumberish, + _xp: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "spend_xp(uint256,uint256)"( + _summoner: BigNumberish, + _xp: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + summon( + _class: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "summon(uint256)"( + _class: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + summoner( + _summoner: BigNumberish, + overrides?: UnsignedTransaction + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber] & { + _xp: BigNumber; + _log: BigNumber; + _class: BigNumber; + _level: BigNumber; + } + >; + + "summoner(uint256)"( + _summoner: BigNumberish, + overrides?: UnsignedTransaction + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber] & { + _xp: BigNumber; + _log: BigNumber; + _class: BigNumber; + _level: BigNumber; + } + >; + + tokenByIndex( + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "tokenByIndex(uint256)"( + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "tokenOfOwnerByIndex(address,uint256)"( + owner: string, + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + tokenURI( + _summoner: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "tokenURI(uint256)"( + _summoner: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + totalSupply(overrides?: UnsignedTransaction): Promise; + + "totalSupply()"(overrides?: UnsignedTransaction): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "transferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + xp(arg0: BigNumberish, overrides?: UnsignedTransaction): Promise; + + "xp(uint256)"( + arg0: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + xp_required( + curent_level: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "xp_required(uint256)"( + curent_level: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + filters: { + Approval( + owner: string | null, + approved: string | null, + tokenId: BigNumberish | null + ): EventFilter; + + ApprovalForAll( + owner: string | null, + operator: string | null, + approved: null + ): EventFilter; + + Transfer( + from: string | null, + to: string | null, + tokenId: BigNumberish | null + ): EventFilter; + + leveled(owner: string | null, level: null, summoner: null): EventFilter; + + summoned(owner: string | null, _class: null, summoner: null): EventFilter; + }; + + estimate: { + adventure( + _summoner: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "adventure(uint256)"( + _summoner: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + adventurers_log( + arg0: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "adventurers_log(uint256)"( + arg0: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + approve( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "approve(address,uint256)"( + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + balanceOf( + owner: string, + overrides?: UnsignedTransaction + ): Promise; + + "balanceOf(address)"( + owner: string, + overrides?: UnsignedTransaction + ): Promise; + + class( + arg0: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "class(uint256)"( + arg0: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + classes( + id: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "classes(uint256)"( + id: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "getApproved(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + "isApprovedForAll(address,address)"( + owner: string, + operator: string, + overrides?: UnsignedTransaction + ): Promise; + + level( + arg0: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "level(uint256)"( + arg0: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + level_up( + _summoner: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "level_up(uint256)"( + _summoner: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + next_summoner(overrides?: UnsignedTransaction): Promise; + + "next_summoner()"(overrides?: UnsignedTransaction): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "ownerOf(uint256)"( + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + safeTransferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + _data: Arrayish, + overrides?: UnsignedTransaction + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + "setApprovalForAll(address,bool)"( + operator: string, + approved: boolean, + overrides?: UnsignedTransaction + ): Promise; + + spend_xp( + _summoner: BigNumberish, + _xp: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "spend_xp(uint256,uint256)"( + _summoner: BigNumberish, + _xp: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + summon( + _class: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "summon(uint256)"( + _class: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + summoner( + _summoner: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "summoner(uint256)"( + _summoner: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + tokenByIndex( + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "tokenByIndex(uint256)"( + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "tokenOfOwnerByIndex(address,uint256)"( + owner: string, + index: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + tokenURI( + _summoner: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "tokenURI(uint256)"( + _summoner: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + totalSupply(overrides?: UnsignedTransaction): Promise; + + "totalSupply()"(overrides?: UnsignedTransaction): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "transferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + xp(arg0: BigNumberish, overrides?: UnsignedTransaction): Promise; + + "xp(uint256)"( + arg0: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + xp_required( + curent_level: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + + "xp_required(uint256)"( + curent_level: BigNumberish, + overrides?: UnsignedTransaction + ): Promise; + }; +} diff --git a/packages/target-ethers-v4-test/types/factories/ERC721Enumerable__factory.ts b/packages/target-ethers-v4-test/types/factories/ERC721Enumerable__factory.ts new file mode 100644 index 000000000..0f68779ab --- /dev/null +++ b/packages/target-ethers-v4-test/types/factories/ERC721Enumerable__factory.ts @@ -0,0 +1,342 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer } from "ethers"; +import { Provider } from "ethers/providers"; + +import { ERC721Enumerable } from "../ERC721Enumerable"; + +export class ERC721Enumerable__factory { + static connect( + address: string, + signerOrProvider: Signer | Provider + ): ERC721Enumerable { + return new Contract(address, _abi, signerOrProvider) as ERC721Enumerable; + } +} + +const _abi = [ + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "approved", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: false, + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "ApprovalForAll", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "approve", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "getApproved", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + ], + name: "isApprovedForAll", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "ownerOf", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "setApprovalForAll", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + ], + name: "tokenByIndex", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + ], + name: "tokenOfOwnerByIndex", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +]; diff --git a/packages/target-ethers-v4-test/types/factories/ERC721__factory.ts b/packages/target-ethers-v4-test/types/factories/ERC721__factory.ts new file mode 100644 index 000000000..37cc5d171 --- /dev/null +++ b/packages/target-ethers-v4-test/types/factories/ERC721__factory.ts @@ -0,0 +1,283 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer } from "ethers"; +import { Provider } from "ethers/providers"; + +import { ERC721 } from "../ERC721"; + +export class ERC721__factory { + static connect(address: string, signerOrProvider: Signer | Provider): ERC721 { + return new Contract(address, _abi, signerOrProvider) as ERC721; + } +} + +const _abi = [ + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "approved", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: false, + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "ApprovalForAll", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "approve", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "getApproved", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + ], + name: "isApprovedForAll", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "ownerOf", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "setApprovalForAll", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +]; diff --git a/packages/target-ethers-v4-test/types/factories/IERC721Enumerable__factory.ts b/packages/target-ethers-v4-test/types/factories/IERC721Enumerable__factory.ts new file mode 100644 index 000000000..61bde1b5b --- /dev/null +++ b/packages/target-ethers-v4-test/types/factories/IERC721Enumerable__factory.ts @@ -0,0 +1,342 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer } from "ethers"; +import { Provider } from "ethers/providers"; + +import { IERC721Enumerable } from "../IERC721Enumerable"; + +export class IERC721Enumerable__factory { + static connect( + address: string, + signerOrProvider: Signer | Provider + ): IERC721Enumerable { + return new Contract(address, _abi, signerOrProvider) as IERC721Enumerable; + } +} + +const _abi = [ + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "approved", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: false, + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "ApprovalForAll", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "approve", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "balance", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "getApproved", + outputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + ], + name: "isApprovedForAll", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "ownerOf", + outputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "bool", + name: "_approved", + type: "bool", + }, + ], + name: "setApprovalForAll", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + ], + name: "tokenByIndex", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + ], + name: "tokenOfOwnerByIndex", + outputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +]; diff --git a/packages/target-ethers-v4-test/types/factories/IERC721Receiver__factory.ts b/packages/target-ethers-v4-test/types/factories/IERC721Receiver__factory.ts new file mode 100644 index 000000000..4ceb97ca4 --- /dev/null +++ b/packages/target-ethers-v4-test/types/factories/IERC721Receiver__factory.ts @@ -0,0 +1,54 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer } from "ethers"; +import { Provider } from "ethers/providers"; + +import { IERC721Receiver } from "../IERC721Receiver"; + +export class IERC721Receiver__factory { + static connect( + address: string, + signerOrProvider: Signer | Provider + ): IERC721Receiver { + return new Contract(address, _abi, signerOrProvider) as IERC721Receiver; + } +} + +const _abi = [ + { + inputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "onERC721Received", + outputs: [ + { + internalType: "bytes4", + name: "", + type: "bytes4", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, +]; diff --git a/packages/target-ethers-v4-test/types/factories/IERC721__factory.ts b/packages/target-ethers-v4-test/types/factories/IERC721__factory.ts new file mode 100644 index 000000000..ebabfcc10 --- /dev/null +++ b/packages/target-ethers-v4-test/types/factories/IERC721__factory.ts @@ -0,0 +1,286 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer } from "ethers"; +import { Provider } from "ethers/providers"; + +import { IERC721 } from "../IERC721"; + +export class IERC721__factory { + static connect( + address: string, + signerOrProvider: Signer | Provider + ): IERC721 { + return new Contract(address, _abi, signerOrProvider) as IERC721; + } +} + +const _abi = [ + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "approved", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: false, + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "ApprovalForAll", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "approve", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "balance", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "getApproved", + outputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + ], + name: "isApprovedForAll", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "ownerOf", + outputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "bool", + name: "_approved", + type: "bool", + }, + ], + name: "setApprovalForAll", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +]; diff --git a/packages/target-ethers-v4-test/types/factories/Rarity__factory.ts b/packages/target-ethers-v4-test/types/factories/Rarity__factory.ts new file mode 100644 index 000000000..87f38438e --- /dev/null +++ b/packages/target-ethers-v4-test/types/factories/Rarity__factory.ts @@ -0,0 +1,626 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer } from "ethers"; +import { Provider } from "ethers/providers"; + +import { Rarity } from "../Rarity"; + +export class Rarity__factory { + static connect(address: string, signerOrProvider: Signer | Provider): Rarity { + return new Contract(address, _abi, signerOrProvider) as Rarity; + } +} + +const _abi = [ + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "approved", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: false, + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "ApprovalForAll", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "level", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "summoner", + type: "uint256", + }, + ], + name: "leveled", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "class", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "summoner", + type: "uint256", + }, + ], + name: "summoned", + type: "event", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_summoner", + type: "uint256", + }, + ], + name: "adventure", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "adventurers_log", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "approve", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "class", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + ], + name: "classes", + outputs: [ + { + internalType: "string", + name: "description", + type: "string", + }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "getApproved", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + ], + name: "isApprovedForAll", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "level", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_summoner", + type: "uint256", + }, + ], + name: "level_up", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "next_summoner", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "ownerOf", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "setApprovalForAll", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_summoner", + type: "uint256", + }, + { + internalType: "uint256", + name: "_xp", + type: "uint256", + }, + ], + name: "spend_xp", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_class", + type: "uint256", + }, + ], + name: "summon", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_summoner", + type: "uint256", + }, + ], + name: "summoner", + outputs: [ + { + internalType: "uint256", + name: "_xp", + type: "uint256", + }, + { + internalType: "uint256", + name: "_log", + type: "uint256", + }, + { + internalType: "uint256", + name: "_class", + type: "uint256", + }, + { + internalType: "uint256", + name: "_level", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + ], + name: "tokenByIndex", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + ], + name: "tokenOfOwnerByIndex", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_summoner", + type: "uint256", + }, + ], + name: "tokenURI", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "xp", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "curent_level", + type: "uint256", + }, + ], + name: "xp_required", + outputs: [ + { + internalType: "uint256", + name: "xp_to_next_level", + type: "uint256", + }, + ], + stateMutability: "pure", + type: "function", + }, +]; diff --git a/packages/target-ethers-v4/src/codegen/index.ts b/packages/target-ethers-v4/src/codegen/index.ts index 546d2ec07..3b249f596 100644 --- a/packages/target-ethers-v4/src/codegen/index.ts +++ b/packages/target-ethers-v4/src/codegen/index.ts @@ -3,6 +3,7 @@ import { AbiParameter, BytecodeWithLinkReferences, Contract, + createPositionalIdentifier, EventArgDeclaration, EventDeclaration, FunctionDeclaration, @@ -207,7 +208,7 @@ function generateParamArrayTypes(params: Array): string { } function generateParamNames(params: Array): string { - return params.map((param) => param.name).join(', ') + return params.map((param) => param.name && createPositionalIdentifier(param.name)).join(', ') } function generateParamArrayNames(params: Array): string { @@ -216,7 +217,7 @@ function generateParamArrayNames(params: Array): string return `[${eventArgs.map(generateEventArgType).join(', ')}]` } -function generateEventTypes(eventArgs: EventArgDeclaration[]) { +function generateEventInputs(eventArgs: EventArgDeclaration[]) { if (eventArgs.length === 0) { return '' } return ( eventArgs .map((arg) => { - return `${arg.name}: ${generateEventArgType(arg)}` + return `${createPositionalIdentifier(arg.name!)}: ${generateEventArgType(arg)}` }) .join(', ') + ', ' ) diff --git a/packages/target-ethers-v4/src/codegen/types.ts b/packages/target-ethers-v4/src/codegen/types.ts index 940086547..16865be4f 100644 --- a/packages/target-ethers-v4/src/codegen/types.ts +++ b/packages/target-ethers-v4/src/codegen/types.ts @@ -1,11 +1,23 @@ -import { AbiOutputParameter, AbiParameter, EvmOutputType, EvmType, TupleType } from 'typechain' +import { + AbiOutputParameter, + AbiParameter, + createPositionalIdentifier, + EvmOutputType, + EvmType, + TupleType, +} from 'typechain' export function generateInputTypes(input: Array): string { if (input.length === 0) { return '' } return ( - input.map((input, index) => `${input.name || `arg${index}`}: ${generateInputType(input.type)}`).join(', ') + ', ' + input + .map( + (input, index) => + `${createPositionalIdentifier(input.name) || `arg${index}`}: ${generateInputType(input.type)}`, + ) + .join(', ') + ', ' ) } diff --git a/packages/target-ethers-v5/src/codegen/events.ts b/packages/target-ethers-v5/src/codegen/events.ts index de703e828..4fe27da78 100644 --- a/packages/target-ethers-v5/src/codegen/events.ts +++ b/packages/target-ethers-v5/src/codegen/events.ts @@ -16,14 +16,14 @@ export function generateEventFilter(event: EventDeclaration, includeNameFilter: const objectOutput = generateOutputComplexTypesAsObject(components) || '{}' let filter = ` - '${generateEventSignature(event)}'(${generateEventTypes( + '${generateEventSignature(event)}'(${generateEventInputs( event.inputs, )}): TypedEventFilter<${arrayOutput}, ${objectOutput}>; ` if (includeNameFilter) { filter += ` - ${event.name}(${generateEventTypes(event.inputs)}): TypedEventFilter<${arrayOutput}, ${objectOutput}>; + ${event.name}(${generateEventInputs(event.inputs)}): TypedEventFilter<${arrayOutput}, ${objectOutput}>; ` } return filter @@ -57,7 +57,7 @@ export function generateEventSignature(event: EventDeclaration): string { return `${event.name}(${event.inputs.map((input: any) => input.type.originalType).join(',')})` } -export function generateEventTypes(eventArgs: EventArgDeclaration[]) { +export function generateEventInputs(eventArgs: EventArgDeclaration[]) { if (eventArgs.length === 0) { return '' } diff --git a/packages/target-truffle-v5-test/package.json b/packages/target-truffle-v5-test/package.json index bb422b410..7224d2e4c 100644 --- a/packages/target-truffle-v5-test/package.json +++ b/packages/target-truffle-v5-test/package.json @@ -12,7 +12,7 @@ "clean": "rm -rf dist contracts/* && rm -f tsconfig.build.tsbuildinfo && rm -rf build", "compile-contracts": "truffle compile", "generate-types": "node ../typechain/dist/cli/cli.js --target=../target-truffle-v5/dist/index.js './build/**/*.json'", - "test": "yarn generate-types && truffle test", + "test": "yarn generate-types", "test:fix": "yarn lint:fix && yarn format:fix && yarn test && yarn typecheck" }, "devDependencies": { diff --git a/packages/target-ethers-v5/src/codegen/typescript-syntax.ts b/packages/typechain/src/codegen/syntax.ts similarity index 80% rename from packages/target-ethers-v5/src/codegen/typescript-syntax.ts rename to packages/typechain/src/codegen/syntax.ts index 2a9871745..b37b9f001 100644 --- a/packages/target-ethers-v5/src/codegen/typescript-syntax.ts +++ b/packages/typechain/src/codegen/syntax.ts @@ -21,8 +21,10 @@ const RESERVED_WORDS = new Set([ /* * Creates an identifier prefixing reserved words with `_`. + * We can only use this for function parameters and tuple element names. + * Using it for method names would clas with runtime codegen. */ -export function createIdentifier(identifierName: string) { +export function createPositionalIdentifier(identifierName: string) { if (RESERVED_WORDS.has(identifierName)) { return `_${identifierName}` } diff --git a/packages/typechain/src/index.ts b/packages/typechain/src/index.ts index d8ede6cd6..b99e8335c 100644 --- a/packages/typechain/src/index.ts +++ b/packages/typechain/src/index.ts @@ -1,3 +1,4 @@ +export * from './codegen/syntax' export * from './parser/abiParser' export { normalizeName } from './parser/normalizeName' export * from './parser/parseEvmType' diff --git a/yarn.lock b/yarn.lock index 7dd3cb11c..d253e76c8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,123 +2,6 @@ # yarn lockfile v1 -"@0x/assert@^3.0.30": - version "3.0.30" - resolved "https://registry.yarnpkg.com/@0x/assert/-/assert-3.0.30.tgz#31eeb4a5648091f400e378cf9e6ca9980969d43b" - integrity sha512-/yFLEZQKb82B2e2GyRFzLKGDoAmqajlZmEdkuPVzq1UB1BTIcURdWjC0JJGQTBJLTObDzfzrWCgIiNeXHYMggA== - dependencies: - "@0x/json-schemas" "^6.4.0" - "@0x/typescript-typings" "^5.2.1" - "@0x/utils" "^6.4.4" - "@types/node" "12.12.54" - lodash "^4.17.11" - valid-url "^1.0.9" - -"@0x/json-schemas@^6.4.0": - version "6.4.0" - resolved "https://registry.yarnpkg.com/@0x/json-schemas/-/json-schemas-6.4.0.tgz#19eef4f8a7bf18c42f6d1d124ae8f4ccd72410fe" - integrity sha512-QXyk1F05TcsCRGcQmri97jm4JPyn0OLtcUYbzTTcozSRJ6DoOxyfE0vn+rOEmqdxQcEqKJuRf3H6Fq+G/7Sbqw== - dependencies: - "@0x/typescript-typings" "^5.2.1" - "@types/node" "12.12.54" - ajv "^6.12.5" - lodash.values "^4.3.0" - -"@0x/sol-compiler@^4.7.6": - version "4.7.6" - resolved "https://registry.yarnpkg.com/@0x/sol-compiler/-/sol-compiler-4.7.6.tgz#6ba74e1981bdedfc096c60f5295f862de2f3bf32" - integrity sha512-JZMdQAAZPUMRD89ObpkV+4WOuYjlk0u3yL2eXO6ULwjewMPd4G+Fv8iwIblGulLW2RNppk0S5/7chTP3Y1DxMg== - dependencies: - "@0x/assert" "^3.0.30" - "@0x/json-schemas" "^6.4.0" - "@0x/sol-resolver" "^3.1.9" - "@0x/types" "^3.3.4" - "@0x/typescript-typings" "^5.2.1" - "@0x/utils" "^6.4.4" - "@0x/web3-wrapper" "^7.6.1" - "@types/node" "12.12.54" - "@types/yargs" "^11.0.0" - chalk "^2.3.0" - chokidar "^3.0.2" - ethereum-types "^3.6.0" - ethereumjs-util "^7.1.0" - lodash "^4.17.11" - mkdirp "^0.5.1" - pluralize "^7.0.0" - require-from-string "^2.0.1" - semver "5.5.0" - solc "^0.5.5" - source-map-support "^0.5.0" - strip-comments "^2.0.1" - web3-eth-abi "^1.0.0-beta.24" - yargs "^10.0.3" - -"@0x/sol-resolver@^3.1.9": - version "3.1.9" - resolved "https://registry.yarnpkg.com/@0x/sol-resolver/-/sol-resolver-3.1.9.tgz#525c545c4ff4d0ff2ff99e433b2405778abe0693" - integrity sha512-N+GxAqtHzEgVsnj9k4yeE7xRqE2ymR+yo98j0s2VC8icjecVqm6LtqQpEpdPULEg20vA0aPdU/XY2q0xiCDpLg== - dependencies: - "@0x/types" "^3.3.4" - "@0x/typescript-typings" "^5.2.1" - "@types/node" "12.12.54" - lodash "^4.17.11" - -"@0x/types@^3.3.4": - version "3.3.4" - resolved "https://registry.yarnpkg.com/@0x/types/-/types-3.3.4.tgz#184946b1674f7f5b4cfb73105952b499a67fc23e" - integrity sha512-lB6maU/D1TEBrJXQcbwzGilmugX9qrfhxbyPr8r89TinSHe2SS694tTKIyI+ijnTbhyVjWzEnA95iuWxhPmP5g== - dependencies: - "@types/node" "12.12.54" - bignumber.js "~9.0.0" - ethereum-types "^3.6.0" - -"@0x/typescript-typings@^5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@0x/typescript-typings/-/typescript-typings-5.2.1.tgz#bc82d0f39688b174142ebb5b2fd6a01c1d2f0163" - integrity sha512-2yswstFMy/cpF+MrJclEZc8BNceBAVovwzRYdz1CyGPfzMT1Kh8jVGeexx0KvVw58KrhxMgcRD4mzCSHNqzjPA== - dependencies: - "@types/bn.js" "^4.11.0" - "@types/node" "12.12.54" - "@types/react" "*" - bignumber.js "~9.0.0" - ethereum-types "^3.6.0" - popper.js "1.14.3" - -"@0x/utils@^6.4.4": - version "6.4.4" - resolved "https://registry.yarnpkg.com/@0x/utils/-/utils-6.4.4.tgz#de9782a7ee2af77580a98a8c6db010dda7f56b94" - integrity sha512-gTfK14tdMNtsmHC6FCrWz221+MYJNdDBdhA1hhnT+Kvru22uvhdTpP2udy7296/4yHZaEkDt5ZkvgJMsJCEhbg== - dependencies: - "@0x/types" "^3.3.4" - "@0x/typescript-typings" "^5.2.1" - "@types/mocha" "^5.2.7" - "@types/node" "12.12.54" - abortcontroller-polyfill "^1.1.9" - bignumber.js "~9.0.0" - chalk "^2.3.0" - detect-node "2.0.3" - ethereum-types "^3.6.0" - ethereumjs-util "^7.1.0" - ethers "~4.0.4" - isomorphic-fetch "2.2.1" - js-sha3 "^0.7.0" - lodash "^4.17.11" - -"@0x/web3-wrapper@^7.6.1": - version "7.6.1" - resolved "https://registry.yarnpkg.com/@0x/web3-wrapper/-/web3-wrapper-7.6.1.tgz#f25bf394f1241e7455f179423d0525002a3517b6" - integrity sha512-Yv0xeAwobkooW1T6QsQ/MI69sHGJIXhVNTgAkoSjOVLs2u/WdQPi6OQsZP+hhpXu6XbAdZ/frvkz1saPxF3Q/w== - dependencies: - "@0x/assert" "^3.0.30" - "@0x/json-schemas" "^6.4.0" - "@0x/typescript-typings" "^5.2.1" - "@0x/utils" "^6.4.4" - "@types/node" "12.12.54" - ethereum-types "^3.6.0" - ethereumjs-util "^7.1.0" - ethers "~4.0.4" - lodash "^4.17.11" - "@babel/code-frame@7.12.11": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" @@ -1470,20 +1353,13 @@ resolved "https://registry.yarnpkg.com/@types/bluebird/-/bluebird-3.5.30.tgz#ee034a0eeea8b84ed868b1aa60d690b08a6cfbc5" integrity sha512-8LhzvcjIoqoi1TghEkRMkbbmM+jhHnBokPGkJWjclMK+Ks0MxEBow3/p2/iFTZ+OIbJHQDSfpgdZEb+af3gfVw== -"@types/bn.js@^4.11.0", "@types/bn.js@^4.11.3", "@types/bn.js@^4.11.4", "@types/bn.js@^4.11.5": +"@types/bn.js@^4.11.3", "@types/bn.js@^4.11.4", "@types/bn.js@^4.11.5": version "4.11.6" resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== dependencies: "@types/node" "*" -"@types/bn.js@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.0.tgz#32c5d271503a12653c62cf4d2b45e6eab8cebc68" - integrity sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA== - dependencies: - "@types/node" "*" - "@types/chai-as-promised@^7.1.2": version "7.1.2" resolved "https://registry.yarnpkg.com/@types/chai-as-promised/-/chai-as-promised-7.1.2.tgz#2f564420e81eaf8650169e5a3a6b93e096e5068b" @@ -1625,11 +1501,6 @@ dependencies: "@types/node" "*" -"@types/mocha@^5.2.7": - version "5.2.7" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.7.tgz#315d570ccb56c53452ff8638738df60726d5b6ea" - integrity sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ== - "@types/mocha@^8.2.1": version "8.2.1" resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-8.2.1.tgz#f3f3ae4590c5386fc7c543aae9b78d4cf30ffee9" @@ -1640,11 +1511,6 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.21.tgz#aa44a6363291c7037111c47e4661ad210aded23f" integrity sha512-8sRGhbpU+ck1n0PGAUgVrWrWdjSW2aqNeyC15W88GRsMpSwzv6RJGlLhE7s2RhVSOdyDmxbqlWSeThq4/7xqlA== -"@types/node@12.12.54": - version "12.12.54" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.54.tgz#a4b58d8df3a4677b6c08bfbc94b7ad7a7a5f82d1" - integrity sha512-ge4xZ3vSBornVYlDnk7yZ0gK6ChHf/CHB7Gl1I0Jhah8DDnEQqBzgohYG4FX4p81TNirSETOiSyn+y1r9/IR6w== - "@types/node@^10.12.18", "@types/node@^10.3.2": version "10.17.18" resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.18.tgz#ae364d97382aacdebf583fa4e7132af2dfe56a0c" @@ -1687,20 +1553,6 @@ resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.2.3.tgz#ef65165aea2924c9359205bf748865b8881753c0" integrity sha512-PijRCG/K3s3w1We6ynUKdxEc5AcuuH3NBmMDP8uvKVp6X43UY7NQlTzczakXP3DJR0F4dfNQIGjU2cUeRYs2AA== -"@types/prop-types@*": - version "15.7.4" - resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.4.tgz#fcf7205c25dff795ee79af1e30da2c9790808f11" - integrity sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ== - -"@types/react@*": - version "17.0.27" - resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.27.tgz#6498ed9b3ad117e818deb5525fa1946c09f2e0e6" - integrity sha512-zgiJwtsggVGtr53MndV7jfiUESTqrbxOcBvwfe6KS/9bzaVPCTDieTWnFNecVNx6EAaapg5xsLLWFfHHR437AA== - dependencies: - "@types/prop-types" "*" - "@types/scheduler" "*" - csstype "^3.0.2" - "@types/rimraf@^3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/rimraf/-/rimraf-3.0.0.tgz#b9d03f090ece263671898d57bb7bb007023ac19f" @@ -1709,11 +1561,6 @@ "@types/glob" "*" "@types/node" "*" -"@types/scheduler@*": - version "0.16.2" - resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" - integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew== - "@types/secp256k1@^4.0.1": version "4.0.1" resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.1.tgz#fb3aa61a1848ad97d7425ff9dcba784549fca5a4" @@ -1757,11 +1604,6 @@ resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-13.1.0.tgz#c563aa192f39350a1d18da36c5a8da382bbd8228" integrity sha512-gCubfBUZ6KxzoibJ+SCUc/57Ms1jz5NjHe4+dI2krNmU5zCPAphyLJYyTOg06ueIyfj+SaCUqmzun7ImlxDcKg== -"@types/yargs@^11.0.0": - version "11.1.8" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-11.1.8.tgz#b730ecb2bde209d12194cdf8bf9f12c4bd21965a" - integrity sha512-49Pmk3GBUOrs/ZKJodGMJeEeiulv2VdfAYpGgkTCSXpNWx7KCX36+PbrkItwzrjTDHO2QoEZDpbhFoMN1lxe9A== - "@types/yargs@^13.0.0": version "13.0.3" resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-13.0.3.tgz#76482af3981d4412d65371a318f992d33464a380" @@ -1877,11 +1719,6 @@ abort-controller@^3.0.0: dependencies: event-target-shim "^5.0.0" -abortcontroller-polyfill@^1.1.9: - version "1.7.3" - resolved "https://registry.yarnpkg.com/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.3.tgz#1b5b487bd6436b5b764fd52a612509702c3144b5" - integrity sha512-zetDJxd89y3X99Kvo4qFx8GKlt6GsvN3UcRZHwU6iFA/0KiOmhkTVhe8oRoTBiTVPZu09x3vCra47+w8Yz1+2Q== - abstract-leveldown@^5.0.0, abstract-leveldown@~5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz#f7128e1f86ccabf7d2893077ce5d06d798e386c6" @@ -1948,7 +1785,7 @@ ajv@^6.10.0: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^6.12.4, ajv@^6.12.5: +ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -2002,11 +1839,6 @@ ansi-escapes@^4.3.0: dependencies: type-fest "^0.11.0" -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - ansi-regex@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" @@ -2057,14 +1889,6 @@ anymatch@^3.0.3, anymatch@~3.1.1: normalize-path "^3.0.0" picomatch "^2.0.4" -anymatch@~3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" - integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - app-module-path@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/app-module-path/-/app-module-path-2.2.0.tgz#641aa55dfb7d6a6f0a8141c4b9c0aa50b6c24dd5" @@ -2317,7 +2141,7 @@ bignumber.js@^5.0.0: resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-5.0.0.tgz#fbce63f09776b3000a83185badcde525daf34833" integrity sha512-KWTu6ZMVk9sxlDJQh2YH1UOnfDP8O8TpxUxgQG/vKASoSnEjK9aVuOueFaPcQEYQ5fyNXNTOYwYw3099RYebWg== -bignumber.js@^9.0.0, bignumber.js@~9.0.0: +bignumber.js@^9.0.0: version "9.0.1" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.1.tgz#8d7ba124c882bfd8e43260c67475518d0689e4e5" integrity sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA== @@ -2654,7 +2478,7 @@ camelcase-keys@^6.2.2: map-obj "^4.0.0" quick-lru "^4.0.1" -camelcase@^4.0.0, camelcase@^4.1.0: +camelcase@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= @@ -2790,21 +2614,6 @@ chokidar@3.4.3: optionalDependencies: fsevents "~2.1.2" -chokidar@^3.0.2: - version "3.5.2" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" - integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== - dependencies: - anymatch "~3.1.2" - braces "~3.0.2" - glob-parent "~5.1.2" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.6.0" - optionalDependencies: - fsevents "~2.3.2" - chokidar@^3.4.0: version "3.5.1" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a" @@ -2853,15 +2662,6 @@ cli-boxes@^1.0.0: resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" integrity sha1-T6kXw+WclKAEzWH47lCdplFocUM= -cliui@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" - integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== - dependencies: - string-width "^2.1.1" - strip-ansi "^4.0.0" - wrap-ansi "^2.0.0" - cliui@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" @@ -2892,11 +2692,6 @@ clone@^1.0.2: resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - collection-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" @@ -3125,11 +2920,6 @@ crypto-browserify@3.12.0: randombytes "^2.0.0" randomfill "^1.0.3" -csstype@^3.0.2: - version "3.0.9" - resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.9.tgz#6410af31b26bd0520933d02cbc64fce9ce3fbf0b" - integrity sha512-rpw6JPxK6Rfg1zLOYCSwle2GFOOsnjmDYDaBwEcwoOg4qlsIVCN789VkBZDJAGi4T07gI4YSutR43t9Zz4Lzuw== - csv-generate@^3.2.4: version "3.3.0" resolved "https://registry.yarnpkg.com/csv-generate/-/csv-generate-3.3.0.tgz#0e25658f1bb9806d94fec7b270896a35c7eedf1a" @@ -3227,7 +3017,7 @@ decamelize-keys@^1.1.0: decamelize "^1.1.0" map-obj "^1.0.0" -decamelize@^1.1.0, decamelize@^1.1.1, decamelize@^1.2.0: +decamelize@^1.1.0, decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= @@ -3398,11 +3188,6 @@ detect-indent@^6.0.0: resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.0.0.tgz#0abd0f549f69fc6659a254fe96786186b6f528fd" integrity sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA== -detect-node@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.3.tgz#a2033c09cc8e158d37748fbde7507832bd6ce127" - integrity sha1-ogM8CcyOFY03dI+951B4Mr1s4Sc= - diff-sequences@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.6.2.tgz#48ba99157de1923412eed41db6b6d4aa9ca7c0b1" @@ -3571,13 +3356,6 @@ encoding-down@~5.0.0: level-errors "^2.0.0" xtend "^4.0.1" -encoding@^0.1.11: - version "0.1.13" - resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" - integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== - dependencies: - iconv-lite "^0.6.2" - end-of-stream@^1.0.0, end-of-stream@^1.1.0: version "1.4.4" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" @@ -4031,14 +3809,6 @@ ethereum-cryptography@^0.1.2, ethereum-cryptography@^0.1.3: secp256k1 "^4.0.1" setimmediate "^1.0.5" -ethereum-types@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/ethereum-types/-/ethereum-types-3.6.0.tgz#7cf0a7258537b1f8d113dd51d050189a742a9a6e" - integrity sha512-iJX96C9W1elWhCZKUiSQfWn9fC+EO+xU2TvAE/p7QhMwcGibihKsxcG27B/4WZAudd8jNoeIhY4PH2qQPLuUfw== - dependencies: - "@types/node" "12.12.54" - bignumber.js "~9.0.0" - ethereumjs-abi@0.6.8, ethereumjs-abi@^0.6.8: version "0.6.8" resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz#71bc152db099f70e62f108b7cdfca1b362c6fcae" @@ -4147,18 +3917,6 @@ ethereumjs-util@^7.0.2: ethjs-util "0.1.6" rlp "^2.2.4" -ethereumjs-util@^7.1.0: - version "7.1.2" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.2.tgz#cfd79a9a3f5cdc042d1abf29964de9caf10ec238" - integrity sha512-xCV3PTAhW8Q2k88XZn9VcO4OrjpeXAlDm5LQTaOLp81SjNSSY6+MwuGXrx6vafOMheWSmZGxIXUbue5e9UvUBw== - dependencies: - "@types/bn.js" "^5.1.0" - bn.js "^5.1.2" - create-hash "^1.1.2" - ethereum-cryptography "^0.1.3" - ethjs-util "0.1.6" - rlp "^2.2.4" - ethers@4.0.0-beta.3: version "4.0.0-beta.3" resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.0-beta.3.tgz#15bef14e57e94ecbeb7f9b39dd0a4bd435bc9066" @@ -4262,21 +4020,6 @@ ethers@^5.4.7: "@ethersproject/web" "5.4.0" "@ethersproject/wordlists" "5.4.0" -ethers@~4.0.4: - version "4.0.49" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.49.tgz#0eb0e9161a0c8b4761be547396bbe2fb121a8894" - integrity sha512-kPltTvWiyu+OktYy1IStSO16i2e7cS9D9OxZ81q2UUaiNPVrm/RTcbxamCXF9VUSKzJIdJV68EAIhTEVBalRWg== - dependencies: - aes-js "3.0.0" - bn.js "^4.11.9" - elliptic "6.5.4" - hash.js "1.1.3" - js-sha3 "0.5.7" - scrypt-js "2.0.4" - setimmediate "1.0.4" - uuid "2.0.1" - xmlhttprequest "1.8.0" - ethjs-unit@0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" @@ -4813,7 +4556,7 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= -fsevents@^2.1.2, fsevents@~2.3.1, fsevents@~2.3.2: +fsevents@^2.1.2, fsevents@~2.3.1: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== @@ -4842,11 +4585,6 @@ ganache-cli@^6.12.2: source-map-support "0.5.12" yargs "13.2.4" -get-caller-file@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" - integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== - get-caller-file@^2.0.1: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" @@ -4921,7 +4659,7 @@ glob-parent@^5.1.0, glob-parent@~5.1.0: dependencies: is-glob "^4.0.1" -glob-parent@^5.1.2, glob-parent@~5.1.2: +glob-parent@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== @@ -5322,13 +5060,6 @@ iconv-lite@0.4.24, iconv-lite@^0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" -iconv-lite@^0.6.2: - version "0.6.3" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" - integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== - dependencies: - safer-buffer ">= 2.1.2 < 3.0.0" - idna-uts46-hx@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/idna-uts46-hx/-/idna-uts46-hx-2.3.1.tgz#a1dc5c4df37eee522bf66d969cc980e00e8711f9" @@ -5415,11 +5146,6 @@ inherits@2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= - invert-kv@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" @@ -5582,13 +5308,6 @@ is-extglob@^2.1.1: resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" @@ -5705,7 +5424,7 @@ is-retry-allowed@^1.0.0: resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz#d778488bd0a4666a3be8a1482b9f2baafedea8b4" integrity sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg== -is-stream@^1.0.0, is-stream@^1.0.1, is-stream@^1.1.0: +is-stream@^1.0.0, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= @@ -5782,14 +5501,6 @@ isobject@^3.0.0, isobject@^3.0.1: resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= -isomorphic-fetch@2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" - integrity sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk= - dependencies: - node-fetch "^1.0.1" - whatwg-fetch ">=0.10.0" - isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" @@ -5958,11 +5669,6 @@ js-sha3@0.8.0, js-sha3@^0.8.0: resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== -js-sha3@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.7.0.tgz#0a5c57b36f79882573b2d84051f8bb85dd1bd63a" - integrity sha512-Wpks3yBDm0UcL5qlVhwW9Jr9n9i4FfeWBFOOXP5puDS/SiudJGhw7DPyBqn3487qD4F0lsC0q3zxink37f7zeA== - js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -6130,13 +5836,6 @@ klaw@^1.0.0: optionalDependencies: graceful-fs "^4.1.9" -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= - dependencies: - invert-kv "^1.0.0" - lcid@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" @@ -6345,11 +6044,6 @@ lodash.truncate@^4.4.2: resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= -lodash.values@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/lodash.values/-/lodash.values-4.3.0.tgz#a3a6c2b0ebecc5c2cba1c17e6e620fe81b53d347" - integrity sha1-o6bCsOvsxcLLocF+bmIP6BtT00c= - lodash@^4.17.11, lodash@^4.17.19: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" @@ -6490,13 +6184,6 @@ media-typer@0.3.0: resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= -mem@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" - integrity sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y= - dependencies: - mimic-fn "^1.0.0" - mem@^4.0.0: version "4.3.0" resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" @@ -6663,11 +6350,6 @@ mime@1.6.0, mime@^1.4.1: resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== -mimic-fn@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" - integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== - mimic-fn@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" @@ -6773,7 +6455,7 @@ mkdirp@0.5.1: dependencies: minimist "0.0.8" -mkdirp@0.5.5, mkdirp@^0.5.0, mkdirp@^0.5.1: +mkdirp@0.5.5, mkdirp@^0.5.0: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== @@ -6955,14 +6637,6 @@ node-environment-flags@1.0.6: object.getownpropertydescriptors "^2.0.3" semver "^5.7.0" -node-fetch@^1.0.1: - version "1.7.3" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" - integrity sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ== - dependencies: - encoding "^0.1.11" - is-stream "^1.0.1" - node-fetch@^2.6.0: version "2.6.1" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" @@ -7012,11 +6686,6 @@ npm-run-path@^2.0.0: dependencies: path-key "^2.0.0" -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - number-to-bn@1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/number-to-bn/-/number-to-bn-1.7.0.tgz#bb3623592f7e5f9e0030b1977bd41a0c53fe1ea0" @@ -7161,15 +6830,6 @@ original-require@1.0.1: resolved "https://registry.yarnpkg.com/original-require/-/original-require-1.0.1.tgz#0f130471584cd33511c5ec38c8d59213f9ac5e20" integrity sha1-DxMEcVhM0zURxew4yNWSE/msXiA= -os-locale@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" - integrity sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA== - dependencies: - execa "^0.7.0" - lcid "^1.0.0" - mem "^1.1.0" - os-locale@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" @@ -7495,16 +7155,6 @@ pkg-up@^2.0.0: dependencies: find-up "^2.1.0" -pluralize@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" - integrity sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow== - -popper.js@1.14.3: - version "1.14.3" - resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.14.3.tgz#1438f98d046acf7b4d78cd502bf418ac64d4f095" - integrity sha1-FDj5jQRqz3tNeM1QK/QYrGTU8JU= - posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" @@ -7817,13 +7467,6 @@ readdirp@~3.5.0: dependencies: picomatch "^2.2.1" -readdirp@~3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" - integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== - dependencies: - picomatch "^2.2.1" - redent@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/redent/-/redent-3.0.0.tgz#e557b7998316bb53c9f1f56fa626352c6963059f" @@ -7901,16 +7544,11 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= -require-from-string@^2.0.0, require-from-string@^2.0.1, require-from-string@^2.0.2: +require-from-string@^2.0.0, require-from-string@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== -require-main-filename@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" - integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= - require-main-filename@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" @@ -8043,7 +7681,7 @@ safe-regex@^1.1.0: dependencies: ret "~0.1.10" -"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== @@ -8123,11 +7761,6 @@ semaphore@>=1.0.1, semaphore@^1.1.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@5.5.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" - integrity sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA== - semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" @@ -8368,20 +8001,6 @@ solc@0.7.3: semver "^5.5.0" tmp "0.0.33" -solc@^0.5.5: - version "0.5.17" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.5.17.tgz#8a76c50e98d49ca7610cca2fdc78ff3016540c67" - integrity sha512-qpX+PGaU0Q3c6lh2vDzMoIbhv6bIrecI4bYsx+xUs01xsGFnY6Nr0L8y/QMyutTnrHN6Lb/Yl672ZVRqxka96w== - dependencies: - command-exists "^1.2.8" - commander "3.0.2" - fs-extra "^0.30.0" - js-sha3 "0.8.0" - memorystream "^0.3.1" - require-from-string "^2.0.0" - semver "^5.5.0" - tmp "0.0.33" - solc@^0.6.4: version "0.6.4" resolved "https://registry.yarnpkg.com/solc/-/solc-0.6.4.tgz#4b0f11fccd6f5ef9802c6bb1c007abb16881c2ca" @@ -8415,14 +8034,6 @@ source-map-support@0.5.12: buffer-from "^1.0.0" source-map "^0.6.0" -source-map-support@^0.5.0: - version "0.5.20" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9" - integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - source-map-support@^0.5.13, source-map-support@^0.5.17: version "0.5.19" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" @@ -8553,15 +8164,6 @@ strict-uri-encode@^1.0.0: resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - "string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" @@ -8639,13 +8241,6 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - strip-ansi@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" @@ -8672,11 +8267,6 @@ strip-bom@^3.0.0: resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= -strip-comments@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-comments/-/strip-comments-2.0.1.tgz#4ad11c3fbcac177a67a40ac224ca339ca1c1ba9b" - integrity sha512-ZprKx+bBLXv067WTCALv8SSz5l2+XhpYCsVtSqlMnkAXMWDq+/ekVbl1ghqP9rUHTzv6sm/DwCOiYutU/yp1fw== - strip-dirs@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/strip-dirs/-/strip-dirs-2.1.0.tgz#4987736264fc344cf20f6c34aca9d13d1d4ed6c5" @@ -9292,11 +8882,6 @@ v8-compile-cache@^2.0.3: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e" integrity sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g== -valid-url@^1.0.9: - version "1.0.9" - resolved "https://registry.yarnpkg.com/valid-url/-/valid-url-1.0.9.tgz#1c14479b40f1397a75782f115e4086447433a200" - integrity sha1-HBRHm0DxOXp1eC8RXkCGRHQzogA= - validate-npm-package-license@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" @@ -9483,14 +9068,6 @@ web3-eth-abi@1.3.1: underscore "1.9.1" web3-utils "1.3.1" -web3-eth-abi@^1.0.0-beta.24: - version "1.6.0" - resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.6.0.tgz#4225608f61ebb0607d80849bb2b20f910780253d" - integrity sha512-fImomGE9McuTMJLwK8Tp0lTUzXqCkWeMm00qPVIwpJ/h7lCw9UFYV9+4m29wSqW6FF+FIZKwc6UBEf9dlx3orA== - dependencies: - "@ethersproject/abi" "5.0.7" - web3-utils "1.6.0" - web3-eth-accounts@1.2.6: version "1.2.6" resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.2.6.tgz#a1ba4bf75fa8102a3ec6cddd0eccd72462262720" @@ -9700,19 +9277,6 @@ web3-utils@1.3.1, web3-utils@^1.3.1: underscore "1.9.1" utf8 "3.0.0" -web3-utils@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.6.0.tgz#1975c5ee5b7db8a0836eb7004848a7cd962d1ddc" - integrity sha512-bgCAWAeQnJF035YTFxrcHJ5mGEfTi/McsjqldZiXRwlHK7L1PyOqvXiQLE053dlzvy1kdAxWl/sSSfLMyNUAXg== - dependencies: - bn.js "^4.11.9" - ethereum-bloom-filters "^1.0.6" - ethereumjs-util "^7.1.0" - ethjs-unit "0.1.6" - number-to-bn "1.7.0" - randombytes "^2.1.0" - utf8 "3.0.0" - web3@^1.2.6: version "1.2.6" resolved "https://registry.yarnpkg.com/web3/-/web3-1.2.6.tgz#c497dcb14cdd8d6d9fb6b445b3b68ff83f8ccf68" @@ -9739,11 +9303,6 @@ websocket@^1.0.32: utf-8-validate "^5.0.2" yaeti "^0.0.6" -whatwg-fetch@>=0.10.0: - version "3.6.2" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz#dced24f37f2624ed0281725d51d0e2e3fe677f8c" - integrity sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA== - which-boxed-primitive@^1.0.1, which-boxed-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" @@ -9819,14 +9378,6 @@ workerpool@6.0.2: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.0.2.tgz#e241b43d8d033f1beb52c7851069456039d1d438" integrity sha512-DSNyvOpFKrNusaaUwk+ej6cBj1bmhLcBfj80elGk+ZIo5JSkq+unB1dLKEOcNfJDZgjGICfhQ0Q5TbP0PvF4+Q== -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" @@ -9943,11 +9494,6 @@ xtend@~2.1.1: dependencies: object-keys "~0.4.0" -y18n@^3.2.1: - version "3.2.2" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.2.tgz#85c901bd6470ce71fc4bb723ad209b70f7f28696" - integrity sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ== - y18n@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" @@ -9989,13 +9535,6 @@ yargs-parser@^18.1.2, yargs-parser@^18.1.3: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-8.1.0.tgz#f1376a33b6629a5d063782944da732631e966950" - integrity sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ== - dependencies: - camelcase "^4.1.0" - yargs-unparser@1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-1.6.0.tgz#ef25c2c769ff6bd09e4b0f9d7c605fb27846ea9f" @@ -10048,24 +9587,6 @@ yargs@13.3.2, yargs@^13.0.0, yargs@^13.3.0: y18n "^4.0.0" yargs-parser "^13.1.2" -yargs@^10.0.3: - version "10.1.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-10.1.2.tgz#454d074c2b16a51a43e2fb7807e4f9de69ccb5c5" - integrity sha512-ivSoxqBGYOqQVruxD35+EyCFDYNEFL/Uo6FcOnz+9xZdZzK0Zzw4r4KhbrME1Oo2gOggwJod2MnsdamSG7H9ig== - dependencies: - cliui "^4.0.0" - decamelize "^1.1.1" - find-up "^2.1.0" - get-caller-file "^1.0.1" - os-locale "^2.0.0" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^2.0.0" - which-module "^2.0.0" - y18n "^3.2.1" - yargs-parser "^8.1.0" - yargs@^15.1.0: version "15.4.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" From 3936df2c0fb192516f550b1607afb00ec2bb5ab3 Mon Sep 17 00:00:00 2001 From: hasparus Date: Fri, 8 Oct 2021 17:32:50 +0200 Subject: [PATCH 6/9] Fix loadContract and handle reserved words in ethers-v5 target --- .../target-ethers-v4/src/codegen/index.ts | 2 +- .../target-ethers-v5-test/types/ERC721.d.ts | 482 +++++++++ .../types/ERC721Enumerable.d.ts | 574 ++++++++++ .../target-ethers-v5-test/types/IERC721.d.ts | 485 +++++++++ .../types/IERC721Enumerable.d.ts | 577 ++++++++++ .../types/IERC721Receiver.d.ts | 132 +++ .../target-ethers-v5-test/types/Rarity.d.ts | 990 ++++++++++++++++++ .../factories/ERC721Enumerable__factory.ts | 348 ++++++ .../types/factories/ERC721__factory.ts | 286 +++++ .../factories/IERC721Enumerable__factory.ts | 348 ++++++ .../factories/IERC721Receiver__factory.ts | 60 ++ .../types/factories/IERC721__factory.ts | 289 +++++ .../types/factories/Rarity__factory.ts | 629 +++++++++++ packages/target-ethers-v5-test/types/index.ts | 12 + .../target-ethers-v5/src/codegen/events.ts | 4 +- .../target-ethers-v5/src/codegen/functions.ts | 3 +- packages/target-truffle-v5-test/package.json | 2 +- .../target-web3-v1-test/types/ERC721.d.ts | 127 +++ .../types/ERC721Enumerable.d.ts | 138 +++ .../target-web3-v1-test/types/IERC721.d.ts | 127 +++ .../types/IERC721Enumerable.d.ts | 138 +++ .../types/IERC721Receiver.d.ts | 42 + .../target-web3-v1-test/types/Rarity.d.ts | 216 ++++ packages/test-utils/src/contract.ts | 13 +- packages/typechain/src/codegen/syntax.ts | 6 +- 25 files changed, 6021 insertions(+), 9 deletions(-) create mode 100644 packages/target-ethers-v5-test/types/ERC721.d.ts create mode 100644 packages/target-ethers-v5-test/types/ERC721Enumerable.d.ts create mode 100644 packages/target-ethers-v5-test/types/IERC721.d.ts create mode 100644 packages/target-ethers-v5-test/types/IERC721Enumerable.d.ts create mode 100644 packages/target-ethers-v5-test/types/IERC721Receiver.d.ts create mode 100644 packages/target-ethers-v5-test/types/Rarity.d.ts create mode 100644 packages/target-ethers-v5-test/types/factories/ERC721Enumerable__factory.ts create mode 100644 packages/target-ethers-v5-test/types/factories/ERC721__factory.ts create mode 100644 packages/target-ethers-v5-test/types/factories/IERC721Enumerable__factory.ts create mode 100644 packages/target-ethers-v5-test/types/factories/IERC721Receiver__factory.ts create mode 100644 packages/target-ethers-v5-test/types/factories/IERC721__factory.ts create mode 100644 packages/target-ethers-v5-test/types/factories/Rarity__factory.ts create mode 100644 packages/target-web3-v1-test/types/ERC721.d.ts create mode 100644 packages/target-web3-v1-test/types/ERC721Enumerable.d.ts create mode 100644 packages/target-web3-v1-test/types/IERC721.d.ts create mode 100644 packages/target-web3-v1-test/types/IERC721Enumerable.d.ts create mode 100644 packages/target-web3-v1-test/types/IERC721Receiver.d.ts create mode 100644 packages/target-web3-v1-test/types/Rarity.d.ts diff --git a/packages/target-ethers-v4/src/codegen/index.ts b/packages/target-ethers-v4/src/codegen/index.ts index 3b249f596..ecdfa938b 100644 --- a/packages/target-ethers-v4/src/codegen/index.ts +++ b/packages/target-ethers-v4/src/codegen/index.ts @@ -240,7 +240,7 @@ function generateEventInputs(eventArgs: EventArgDeclaration[]) { return ( eventArgs .map((arg) => { - return `${createPositionalIdentifier(arg.name!)}: ${generateEventArgType(arg)}` + return `${arg.name && createPositionalIdentifier(arg.name)}: ${generateEventArgType(arg)}` }) .join(', ') + ', ' ) diff --git a/packages/target-ethers-v5-test/types/ERC721.d.ts b/packages/target-ethers-v5-test/types/ERC721.d.ts new file mode 100644 index 000000000..4e37e1b63 --- /dev/null +++ b/packages/target-ethers-v5-test/types/ERC721.d.ts @@ -0,0 +1,482 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { + ethers, + EventFilter, + Signer, + BigNumber, + BigNumberish, + PopulatedTransaction, + BaseContract, + ContractTransaction, + Overrides, + CallOverrides, +} from "ethers"; +import { BytesLike } from "@ethersproject/bytes"; +import { Listener, Provider } from "@ethersproject/providers"; +import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi"; +import type { TypedEventFilter, TypedEvent, TypedListener } from "./common"; + +interface ERC721Interface extends ethers.utils.Interface { + functions: { + "approve(address,uint256)": FunctionFragment; + "balanceOf(address)": FunctionFragment; + "getApproved(uint256)": FunctionFragment; + "isApprovedForAll(address,address)": FunctionFragment; + "ownerOf(uint256)": FunctionFragment; + "safeTransferFrom(address,address,uint256)": FunctionFragment; + "setApprovalForAll(address,bool)": FunctionFragment; + "transferFrom(address,address,uint256)": FunctionFragment; + }; + + encodeFunctionData( + functionFragment: "approve", + values: [string, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "balanceOf", values: [string]): string; + encodeFunctionData( + functionFragment: "getApproved", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "isApprovedForAll", + values: [string, string] + ): string; + encodeFunctionData( + functionFragment: "ownerOf", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "safeTransferFrom", + values: [string, string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setApprovalForAll", + values: [string, boolean] + ): string; + encodeFunctionData( + functionFragment: "transferFrom", + values: [string, string, BigNumberish] + ): string; + + decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getApproved", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "isApprovedForAll", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "ownerOf", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "safeTransferFrom", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setApprovalForAll", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferFrom", + data: BytesLike + ): Result; + + events: { + "Approval(address,address,uint256)": EventFragment; + "ApprovalForAll(address,address,bool)": EventFragment; + "Transfer(address,address,uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ApprovalForAll"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment; +} + +export type ApprovalEvent = TypedEvent< + [string, string, BigNumber] & { + owner: string; + approved: string; + tokenId: BigNumber; + } +>; + +export type ApprovalForAllEvent = TypedEvent< + [string, string, boolean] & { + owner: string; + operator: string; + approved: boolean; + } +>; + +export type TransferEvent = TypedEvent< + [string, string, BigNumber] & { from: string; to: string; tokenId: BigNumber } +>; + +export class ERC721 extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + listeners, EventArgsObject>( + eventFilter?: TypedEventFilter + ): Array>; + off, EventArgsObject>( + eventFilter: TypedEventFilter, + listener: TypedListener + ): this; + on, EventArgsObject>( + eventFilter: TypedEventFilter, + listener: TypedListener + ): this; + once, EventArgsObject>( + eventFilter: TypedEventFilter, + listener: TypedListener + ): this; + removeListener, EventArgsObject>( + eventFilter: TypedEventFilter, + listener: TypedListener + ): this; + removeAllListeners, EventArgsObject>( + eventFilter: TypedEventFilter + ): this; + + listeners(eventName?: string): Array; + off(eventName: string, listener: Listener): this; + on(eventName: string, listener: Listener): this; + once(eventName: string, listener: Listener): this; + removeListener(eventName: string, listener: Listener): this; + removeAllListeners(eventName?: string): this; + + queryFilter, EventArgsObject>( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + interface: ERC721Interface; + + functions: { + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + balanceOf(owner: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise<[string]>; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: CallOverrides + ): Promise<[boolean]>; + + ownerOf( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise<[string]>; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + }; + + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + balanceOf(owner: string, overrides?: CallOverrides): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: CallOverrides + ): Promise; + + ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + callStatic: { + approve( + to: string, + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + balanceOf(owner: string, overrides?: CallOverrides): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: CallOverrides + ): Promise; + + ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + _data: BytesLike, + overrides?: CallOverrides + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: CallOverrides + ): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "Approval(address,address,uint256)"( + owner?: string | null, + approved?: string | null, + tokenId?: BigNumberish | null + ): TypedEventFilter< + [string, string, BigNumber], + { owner: string; approved: string; tokenId: BigNumber } + >; + + Approval( + owner?: string | null, + approved?: string | null, + tokenId?: BigNumberish | null + ): TypedEventFilter< + [string, string, BigNumber], + { owner: string; approved: string; tokenId: BigNumber } + >; + + "ApprovalForAll(address,address,bool)"( + owner?: string | null, + operator?: string | null, + approved?: null + ): TypedEventFilter< + [string, string, boolean], + { owner: string; operator: string; approved: boolean } + >; + + ApprovalForAll( + owner?: string | null, + operator?: string | null, + approved?: null + ): TypedEventFilter< + [string, string, boolean], + { owner: string; operator: string; approved: boolean } + >; + + "Transfer(address,address,uint256)"( + from?: string | null, + to?: string | null, + tokenId?: BigNumberish | null + ): TypedEventFilter< + [string, string, BigNumber], + { from: string; to: string; tokenId: BigNumber } + >; + + Transfer( + from?: string | null, + to?: string | null, + tokenId?: BigNumberish | null + ): TypedEventFilter< + [string, string, BigNumber], + { from: string; to: string; tokenId: BigNumber } + >; + }; + + estimateGas: { + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + balanceOf(owner: string, overrides?: CallOverrides): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: CallOverrides + ): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + }; + + populateTransaction: { + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + balanceOf( + owner: string, + overrides?: CallOverrides + ): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: CallOverrides + ): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + }; +} diff --git a/packages/target-ethers-v5-test/types/ERC721Enumerable.d.ts b/packages/target-ethers-v5-test/types/ERC721Enumerable.d.ts new file mode 100644 index 000000000..e0c636dc5 --- /dev/null +++ b/packages/target-ethers-v5-test/types/ERC721Enumerable.d.ts @@ -0,0 +1,574 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { + ethers, + EventFilter, + Signer, + BigNumber, + BigNumberish, + PopulatedTransaction, + BaseContract, + ContractTransaction, + Overrides, + CallOverrides, +} from "ethers"; +import { BytesLike } from "@ethersproject/bytes"; +import { Listener, Provider } from "@ethersproject/providers"; +import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi"; +import type { TypedEventFilter, TypedEvent, TypedListener } from "./common"; + +interface ERC721EnumerableInterface extends ethers.utils.Interface { + functions: { + "approve(address,uint256)": FunctionFragment; + "balanceOf(address)": FunctionFragment; + "getApproved(uint256)": FunctionFragment; + "isApprovedForAll(address,address)": FunctionFragment; + "ownerOf(uint256)": FunctionFragment; + "safeTransferFrom(address,address,uint256)": FunctionFragment; + "setApprovalForAll(address,bool)": FunctionFragment; + "tokenByIndex(uint256)": FunctionFragment; + "tokenOfOwnerByIndex(address,uint256)": FunctionFragment; + "totalSupply()": FunctionFragment; + "transferFrom(address,address,uint256)": FunctionFragment; + }; + + encodeFunctionData( + functionFragment: "approve", + values: [string, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "balanceOf", values: [string]): string; + encodeFunctionData( + functionFragment: "getApproved", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "isApprovedForAll", + values: [string, string] + ): string; + encodeFunctionData( + functionFragment: "ownerOf", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "safeTransferFrom", + values: [string, string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setApprovalForAll", + values: [string, boolean] + ): string; + encodeFunctionData( + functionFragment: "tokenByIndex", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "tokenOfOwnerByIndex", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "totalSupply", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "transferFrom", + values: [string, string, BigNumberish] + ): string; + + decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getApproved", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "isApprovedForAll", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "ownerOf", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "safeTransferFrom", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setApprovalForAll", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "tokenByIndex", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "tokenOfOwnerByIndex", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "totalSupply", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferFrom", + data: BytesLike + ): Result; + + events: { + "Approval(address,address,uint256)": EventFragment; + "ApprovalForAll(address,address,bool)": EventFragment; + "Transfer(address,address,uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ApprovalForAll"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment; +} + +export type ApprovalEvent = TypedEvent< + [string, string, BigNumber] & { + owner: string; + approved: string; + tokenId: BigNumber; + } +>; + +export type ApprovalForAllEvent = TypedEvent< + [string, string, boolean] & { + owner: string; + operator: string; + approved: boolean; + } +>; + +export type TransferEvent = TypedEvent< + [string, string, BigNumber] & { from: string; to: string; tokenId: BigNumber } +>; + +export class ERC721Enumerable extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + listeners, EventArgsObject>( + eventFilter?: TypedEventFilter + ): Array>; + off, EventArgsObject>( + eventFilter: TypedEventFilter, + listener: TypedListener + ): this; + on, EventArgsObject>( + eventFilter: TypedEventFilter, + listener: TypedListener + ): this; + once, EventArgsObject>( + eventFilter: TypedEventFilter, + listener: TypedListener + ): this; + removeListener, EventArgsObject>( + eventFilter: TypedEventFilter, + listener: TypedListener + ): this; + removeAllListeners, EventArgsObject>( + eventFilter: TypedEventFilter + ): this; + + listeners(eventName?: string): Array; + off(eventName: string, listener: Listener): this; + on(eventName: string, listener: Listener): this; + once(eventName: string, listener: Listener): this; + removeListener(eventName: string, listener: Listener): this; + removeAllListeners(eventName?: string): this; + + queryFilter, EventArgsObject>( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + interface: ERC721EnumerableInterface; + + functions: { + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + balanceOf(owner: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise<[string]>; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: CallOverrides + ): Promise<[boolean]>; + + ownerOf( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise<[string]>; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + tokenByIndex( + index: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + }; + + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + balanceOf(owner: string, overrides?: CallOverrides): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: CallOverrides + ): Promise; + + ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + tokenByIndex( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + callStatic: { + approve( + to: string, + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + balanceOf(owner: string, overrides?: CallOverrides): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: CallOverrides + ): Promise; + + ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + _data: BytesLike, + overrides?: CallOverrides + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: CallOverrides + ): Promise; + + tokenByIndex( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "Approval(address,address,uint256)"( + owner?: string | null, + approved?: string | null, + tokenId?: BigNumberish | null + ): TypedEventFilter< + [string, string, BigNumber], + { owner: string; approved: string; tokenId: BigNumber } + >; + + Approval( + owner?: string | null, + approved?: string | null, + tokenId?: BigNumberish | null + ): TypedEventFilter< + [string, string, BigNumber], + { owner: string; approved: string; tokenId: BigNumber } + >; + + "ApprovalForAll(address,address,bool)"( + owner?: string | null, + operator?: string | null, + approved?: null + ): TypedEventFilter< + [string, string, boolean], + { owner: string; operator: string; approved: boolean } + >; + + ApprovalForAll( + owner?: string | null, + operator?: string | null, + approved?: null + ): TypedEventFilter< + [string, string, boolean], + { owner: string; operator: string; approved: boolean } + >; + + "Transfer(address,address,uint256)"( + from?: string | null, + to?: string | null, + tokenId?: BigNumberish | null + ): TypedEventFilter< + [string, string, BigNumber], + { from: string; to: string; tokenId: BigNumber } + >; + + Transfer( + from?: string | null, + to?: string | null, + tokenId?: BigNumberish | null + ): TypedEventFilter< + [string, string, BigNumber], + { from: string; to: string; tokenId: BigNumber } + >; + }; + + estimateGas: { + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + balanceOf(owner: string, overrides?: CallOverrides): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: CallOverrides + ): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + tokenByIndex( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + }; + + populateTransaction: { + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + balanceOf( + owner: string, + overrides?: CallOverrides + ): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: CallOverrides + ): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + tokenByIndex( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + }; +} diff --git a/packages/target-ethers-v5-test/types/IERC721.d.ts b/packages/target-ethers-v5-test/types/IERC721.d.ts new file mode 100644 index 000000000..e6f44edf4 --- /dev/null +++ b/packages/target-ethers-v5-test/types/IERC721.d.ts @@ -0,0 +1,485 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { + ethers, + EventFilter, + Signer, + BigNumber, + BigNumberish, + PopulatedTransaction, + BaseContract, + ContractTransaction, + Overrides, + CallOverrides, +} from "ethers"; +import { BytesLike } from "@ethersproject/bytes"; +import { Listener, Provider } from "@ethersproject/providers"; +import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi"; +import type { TypedEventFilter, TypedEvent, TypedListener } from "./common"; + +interface IERC721Interface extends ethers.utils.Interface { + functions: { + "approve(address,uint256)": FunctionFragment; + "balanceOf(address)": FunctionFragment; + "getApproved(uint256)": FunctionFragment; + "isApprovedForAll(address,address)": FunctionFragment; + "ownerOf(uint256)": FunctionFragment; + "safeTransferFrom(address,address,uint256)": FunctionFragment; + "setApprovalForAll(address,bool)": FunctionFragment; + "transferFrom(address,address,uint256)": FunctionFragment; + }; + + encodeFunctionData( + functionFragment: "approve", + values: [string, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "balanceOf", values: [string]): string; + encodeFunctionData( + functionFragment: "getApproved", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "isApprovedForAll", + values: [string, string] + ): string; + encodeFunctionData( + functionFragment: "ownerOf", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "safeTransferFrom", + values: [string, string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setApprovalForAll", + values: [string, boolean] + ): string; + encodeFunctionData( + functionFragment: "transferFrom", + values: [string, string, BigNumberish] + ): string; + + decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getApproved", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "isApprovedForAll", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "ownerOf", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "safeTransferFrom", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setApprovalForAll", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferFrom", + data: BytesLike + ): Result; + + events: { + "Approval(address,address,uint256)": EventFragment; + "ApprovalForAll(address,address,bool)": EventFragment; + "Transfer(address,address,uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ApprovalForAll"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment; +} + +export type ApprovalEvent = TypedEvent< + [string, string, BigNumber] & { + owner: string; + approved: string; + tokenId: BigNumber; + } +>; + +export type ApprovalForAllEvent = TypedEvent< + [string, string, boolean] & { + owner: string; + operator: string; + approved: boolean; + } +>; + +export type TransferEvent = TypedEvent< + [string, string, BigNumber] & { from: string; to: string; tokenId: BigNumber } +>; + +export class IERC721 extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + listeners, EventArgsObject>( + eventFilter?: TypedEventFilter + ): Array>; + off, EventArgsObject>( + eventFilter: TypedEventFilter, + listener: TypedListener + ): this; + on, EventArgsObject>( + eventFilter: TypedEventFilter, + listener: TypedListener + ): this; + once, EventArgsObject>( + eventFilter: TypedEventFilter, + listener: TypedListener + ): this; + removeListener, EventArgsObject>( + eventFilter: TypedEventFilter, + listener: TypedListener + ): this; + removeAllListeners, EventArgsObject>( + eventFilter: TypedEventFilter + ): this; + + listeners(eventName?: string): Array; + off(eventName: string, listener: Listener): this; + on(eventName: string, listener: Listener): this; + once(eventName: string, listener: Listener): this; + removeListener(eventName: string, listener: Listener): this; + removeAllListeners(eventName?: string): this; + + queryFilter, EventArgsObject>( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + interface: IERC721Interface; + + functions: { + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + balanceOf( + owner: string, + overrides?: CallOverrides + ): Promise<[BigNumber] & { balance: BigNumber }>; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise<[string] & { operator: string }>; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: CallOverrides + ): Promise<[boolean]>; + + ownerOf( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise<[string] & { owner: string }>; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setApprovalForAll( + operator: string, + _approved: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + }; + + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + balanceOf(owner: string, overrides?: CallOverrides): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: CallOverrides + ): Promise; + + ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setApprovalForAll( + operator: string, + _approved: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + callStatic: { + approve( + to: string, + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + balanceOf(owner: string, overrides?: CallOverrides): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: CallOverrides + ): Promise; + + ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + data: BytesLike, + overrides?: CallOverrides + ): Promise; + + setApprovalForAll( + operator: string, + _approved: boolean, + overrides?: CallOverrides + ): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "Approval(address,address,uint256)"( + owner?: string | null, + approved?: string | null, + tokenId?: BigNumberish | null + ): TypedEventFilter< + [string, string, BigNumber], + { owner: string; approved: string; tokenId: BigNumber } + >; + + Approval( + owner?: string | null, + approved?: string | null, + tokenId?: BigNumberish | null + ): TypedEventFilter< + [string, string, BigNumber], + { owner: string; approved: string; tokenId: BigNumber } + >; + + "ApprovalForAll(address,address,bool)"( + owner?: string | null, + operator?: string | null, + approved?: null + ): TypedEventFilter< + [string, string, boolean], + { owner: string; operator: string; approved: boolean } + >; + + ApprovalForAll( + owner?: string | null, + operator?: string | null, + approved?: null + ): TypedEventFilter< + [string, string, boolean], + { owner: string; operator: string; approved: boolean } + >; + + "Transfer(address,address,uint256)"( + from?: string | null, + to?: string | null, + tokenId?: BigNumberish | null + ): TypedEventFilter< + [string, string, BigNumber], + { from: string; to: string; tokenId: BigNumber } + >; + + Transfer( + from?: string | null, + to?: string | null, + tokenId?: BigNumberish | null + ): TypedEventFilter< + [string, string, BigNumber], + { from: string; to: string; tokenId: BigNumber } + >; + }; + + estimateGas: { + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + balanceOf(owner: string, overrides?: CallOverrides): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: CallOverrides + ): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setApprovalForAll( + operator: string, + _approved: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + }; + + populateTransaction: { + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + balanceOf( + owner: string, + overrides?: CallOverrides + ): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: CallOverrides + ): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setApprovalForAll( + operator: string, + _approved: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + }; +} diff --git a/packages/target-ethers-v5-test/types/IERC721Enumerable.d.ts b/packages/target-ethers-v5-test/types/IERC721Enumerable.d.ts new file mode 100644 index 000000000..519dcdf39 --- /dev/null +++ b/packages/target-ethers-v5-test/types/IERC721Enumerable.d.ts @@ -0,0 +1,577 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { + ethers, + EventFilter, + Signer, + BigNumber, + BigNumberish, + PopulatedTransaction, + BaseContract, + ContractTransaction, + Overrides, + CallOverrides, +} from "ethers"; +import { BytesLike } from "@ethersproject/bytes"; +import { Listener, Provider } from "@ethersproject/providers"; +import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi"; +import type { TypedEventFilter, TypedEvent, TypedListener } from "./common"; + +interface IERC721EnumerableInterface extends ethers.utils.Interface { + functions: { + "approve(address,uint256)": FunctionFragment; + "balanceOf(address)": FunctionFragment; + "getApproved(uint256)": FunctionFragment; + "isApprovedForAll(address,address)": FunctionFragment; + "ownerOf(uint256)": FunctionFragment; + "safeTransferFrom(address,address,uint256)": FunctionFragment; + "setApprovalForAll(address,bool)": FunctionFragment; + "tokenByIndex(uint256)": FunctionFragment; + "tokenOfOwnerByIndex(address,uint256)": FunctionFragment; + "totalSupply()": FunctionFragment; + "transferFrom(address,address,uint256)": FunctionFragment; + }; + + encodeFunctionData( + functionFragment: "approve", + values: [string, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "balanceOf", values: [string]): string; + encodeFunctionData( + functionFragment: "getApproved", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "isApprovedForAll", + values: [string, string] + ): string; + encodeFunctionData( + functionFragment: "ownerOf", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "safeTransferFrom", + values: [string, string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setApprovalForAll", + values: [string, boolean] + ): string; + encodeFunctionData( + functionFragment: "tokenByIndex", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "tokenOfOwnerByIndex", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "totalSupply", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "transferFrom", + values: [string, string, BigNumberish] + ): string; + + decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getApproved", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "isApprovedForAll", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "ownerOf", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "safeTransferFrom", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setApprovalForAll", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "tokenByIndex", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "tokenOfOwnerByIndex", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "totalSupply", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferFrom", + data: BytesLike + ): Result; + + events: { + "Approval(address,address,uint256)": EventFragment; + "ApprovalForAll(address,address,bool)": EventFragment; + "Transfer(address,address,uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ApprovalForAll"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment; +} + +export type ApprovalEvent = TypedEvent< + [string, string, BigNumber] & { + owner: string; + approved: string; + tokenId: BigNumber; + } +>; + +export type ApprovalForAllEvent = TypedEvent< + [string, string, boolean] & { + owner: string; + operator: string; + approved: boolean; + } +>; + +export type TransferEvent = TypedEvent< + [string, string, BigNumber] & { from: string; to: string; tokenId: BigNumber } +>; + +export class IERC721Enumerable extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + listeners, EventArgsObject>( + eventFilter?: TypedEventFilter + ): Array>; + off, EventArgsObject>( + eventFilter: TypedEventFilter, + listener: TypedListener + ): this; + on, EventArgsObject>( + eventFilter: TypedEventFilter, + listener: TypedListener + ): this; + once, EventArgsObject>( + eventFilter: TypedEventFilter, + listener: TypedListener + ): this; + removeListener, EventArgsObject>( + eventFilter: TypedEventFilter, + listener: TypedListener + ): this; + removeAllListeners, EventArgsObject>( + eventFilter: TypedEventFilter + ): this; + + listeners(eventName?: string): Array; + off(eventName: string, listener: Listener): this; + on(eventName: string, listener: Listener): this; + once(eventName: string, listener: Listener): this; + removeListener(eventName: string, listener: Listener): this; + removeAllListeners(eventName?: string): this; + + queryFilter, EventArgsObject>( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + interface: IERC721EnumerableInterface; + + functions: { + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + balanceOf( + owner: string, + overrides?: CallOverrides + ): Promise<[BigNumber] & { balance: BigNumber }>; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise<[string] & { operator: string }>; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: CallOverrides + ): Promise<[boolean]>; + + ownerOf( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise<[string] & { owner: string }>; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setApprovalForAll( + operator: string, + _approved: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + tokenByIndex( + index: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber] & { tokenId: BigNumber }>; + + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + }; + + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + balanceOf(owner: string, overrides?: CallOverrides): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: CallOverrides + ): Promise; + + ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setApprovalForAll( + operator: string, + _approved: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + tokenByIndex( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + callStatic: { + approve( + to: string, + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + balanceOf(owner: string, overrides?: CallOverrides): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: CallOverrides + ): Promise; + + ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + data: BytesLike, + overrides?: CallOverrides + ): Promise; + + setApprovalForAll( + operator: string, + _approved: boolean, + overrides?: CallOverrides + ): Promise; + + tokenByIndex( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "Approval(address,address,uint256)"( + owner?: string | null, + approved?: string | null, + tokenId?: BigNumberish | null + ): TypedEventFilter< + [string, string, BigNumber], + { owner: string; approved: string; tokenId: BigNumber } + >; + + Approval( + owner?: string | null, + approved?: string | null, + tokenId?: BigNumberish | null + ): TypedEventFilter< + [string, string, BigNumber], + { owner: string; approved: string; tokenId: BigNumber } + >; + + "ApprovalForAll(address,address,bool)"( + owner?: string | null, + operator?: string | null, + approved?: null + ): TypedEventFilter< + [string, string, boolean], + { owner: string; operator: string; approved: boolean } + >; + + ApprovalForAll( + owner?: string | null, + operator?: string | null, + approved?: null + ): TypedEventFilter< + [string, string, boolean], + { owner: string; operator: string; approved: boolean } + >; + + "Transfer(address,address,uint256)"( + from?: string | null, + to?: string | null, + tokenId?: BigNumberish | null + ): TypedEventFilter< + [string, string, BigNumber], + { from: string; to: string; tokenId: BigNumber } + >; + + Transfer( + from?: string | null, + to?: string | null, + tokenId?: BigNumberish | null + ): TypedEventFilter< + [string, string, BigNumber], + { from: string; to: string; tokenId: BigNumber } + >; + }; + + estimateGas: { + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + balanceOf(owner: string, overrides?: CallOverrides): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: CallOverrides + ): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setApprovalForAll( + operator: string, + _approved: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + tokenByIndex( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + }; + + populateTransaction: { + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + balanceOf( + owner: string, + overrides?: CallOverrides + ): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: CallOverrides + ): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setApprovalForAll( + operator: string, + _approved: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + tokenByIndex( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + }; +} diff --git a/packages/target-ethers-v5-test/types/IERC721Receiver.d.ts b/packages/target-ethers-v5-test/types/IERC721Receiver.d.ts new file mode 100644 index 000000000..20a93c0ca --- /dev/null +++ b/packages/target-ethers-v5-test/types/IERC721Receiver.d.ts @@ -0,0 +1,132 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { + ethers, + EventFilter, + Signer, + BigNumber, + BigNumberish, + PopulatedTransaction, + BaseContract, + ContractTransaction, + Overrides, + CallOverrides, +} from "ethers"; +import { BytesLike } from "@ethersproject/bytes"; +import { Listener, Provider } from "@ethersproject/providers"; +import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi"; +import type { TypedEventFilter, TypedEvent, TypedListener } from "./common"; + +interface IERC721ReceiverInterface extends ethers.utils.Interface { + functions: { + "onERC721Received(address,address,uint256,bytes)": FunctionFragment; + }; + + encodeFunctionData( + functionFragment: "onERC721Received", + values: [string, string, BigNumberish, BytesLike] + ): string; + + decodeFunctionResult( + functionFragment: "onERC721Received", + data: BytesLike + ): Result; + + events: {}; +} + +export class IERC721Receiver extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + listeners, EventArgsObject>( + eventFilter?: TypedEventFilter + ): Array>; + off, EventArgsObject>( + eventFilter: TypedEventFilter, + listener: TypedListener + ): this; + on, EventArgsObject>( + eventFilter: TypedEventFilter, + listener: TypedListener + ): this; + once, EventArgsObject>( + eventFilter: TypedEventFilter, + listener: TypedListener + ): this; + removeListener, EventArgsObject>( + eventFilter: TypedEventFilter, + listener: TypedListener + ): this; + removeAllListeners, EventArgsObject>( + eventFilter: TypedEventFilter + ): this; + + listeners(eventName?: string): Array; + off(eventName: string, listener: Listener): this; + on(eventName: string, listener: Listener): this; + once(eventName: string, listener: Listener): this; + removeListener(eventName: string, listener: Listener): this; + removeAllListeners(eventName?: string): this; + + queryFilter, EventArgsObject>( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + interface: IERC721ReceiverInterface; + + functions: { + onERC721Received( + operator: string, + from: string, + tokenId: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + }; + + onERC721Received( + operator: string, + from: string, + tokenId: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + callStatic: { + onERC721Received( + operator: string, + from: string, + tokenId: BigNumberish, + data: BytesLike, + overrides?: CallOverrides + ): Promise; + }; + + filters: {}; + + estimateGas: { + onERC721Received( + operator: string, + from: string, + tokenId: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + }; + + populateTransaction: { + onERC721Received( + operator: string, + from: string, + tokenId: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + }; +} diff --git a/packages/target-ethers-v5-test/types/Rarity.d.ts b/packages/target-ethers-v5-test/types/Rarity.d.ts new file mode 100644 index 000000000..9939e9aa5 --- /dev/null +++ b/packages/target-ethers-v5-test/types/Rarity.d.ts @@ -0,0 +1,990 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { + ethers, + EventFilter, + Signer, + BigNumber, + BigNumberish, + PopulatedTransaction, + BaseContract, + ContractTransaction, + Overrides, + CallOverrides, +} from "ethers"; +import { BytesLike } from "@ethersproject/bytes"; +import { Listener, Provider } from "@ethersproject/providers"; +import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi"; +import type { TypedEventFilter, TypedEvent, TypedListener } from "./common"; + +interface RarityInterface extends ethers.utils.Interface { + functions: { + "adventure(uint256)": FunctionFragment; + "adventurers_log(uint256)": FunctionFragment; + "approve(address,uint256)": FunctionFragment; + "balanceOf(address)": FunctionFragment; + "class(uint256)": FunctionFragment; + "classes(uint256)": FunctionFragment; + "getApproved(uint256)": FunctionFragment; + "isApprovedForAll(address,address)": FunctionFragment; + "level(uint256)": FunctionFragment; + "level_up(uint256)": FunctionFragment; + "next_summoner()": FunctionFragment; + "ownerOf(uint256)": FunctionFragment; + "safeTransferFrom(address,address,uint256)": FunctionFragment; + "setApprovalForAll(address,bool)": FunctionFragment; + "spend_xp(uint256,uint256)": FunctionFragment; + "summon(uint256)": FunctionFragment; + "summoner(uint256)": FunctionFragment; + "tokenByIndex(uint256)": FunctionFragment; + "tokenOfOwnerByIndex(address,uint256)": FunctionFragment; + "tokenURI(uint256)": FunctionFragment; + "totalSupply()": FunctionFragment; + "transferFrom(address,address,uint256)": FunctionFragment; + "xp(uint256)": FunctionFragment; + "xp_required(uint256)": FunctionFragment; + }; + + encodeFunctionData( + functionFragment: "adventure", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "adventurers_log", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "approve", + values: [string, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "balanceOf", values: [string]): string; + encodeFunctionData(functionFragment: "class", values: [BigNumberish]): string; + encodeFunctionData( + functionFragment: "classes", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getApproved", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "isApprovedForAll", + values: [string, string] + ): string; + encodeFunctionData(functionFragment: "level", values: [BigNumberish]): string; + encodeFunctionData( + functionFragment: "level_up", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "next_summoner", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "ownerOf", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "safeTransferFrom", + values: [string, string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setApprovalForAll", + values: [string, boolean] + ): string; + encodeFunctionData( + functionFragment: "spend_xp", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "summon", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "summoner", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "tokenByIndex", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "tokenOfOwnerByIndex", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "tokenURI", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "totalSupply", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "transferFrom", + values: [string, string, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "xp", values: [BigNumberish]): string; + encodeFunctionData( + functionFragment: "xp_required", + values: [BigNumberish] + ): string; + + decodeFunctionResult(functionFragment: "adventure", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "adventurers_log", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "class", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "classes", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getApproved", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "isApprovedForAll", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "level", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "level_up", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "next_summoner", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "ownerOf", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "safeTransferFrom", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setApprovalForAll", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "spend_xp", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "summon", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "summoner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "tokenByIndex", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "tokenOfOwnerByIndex", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "tokenURI", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "totalSupply", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferFrom", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "xp", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "xp_required", + data: BytesLike + ): Result; + + events: { + "Approval(address,address,uint256)": EventFragment; + "ApprovalForAll(address,address,bool)": EventFragment; + "Transfer(address,address,uint256)": EventFragment; + "leveled(address,uint256,uint256)": EventFragment; + "summoned(address,uint256,uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ApprovalForAll"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment; + getEvent(nameOrSignatureOrTopic: "leveled"): EventFragment; + getEvent(nameOrSignatureOrTopic: "summoned"): EventFragment; +} + +export type ApprovalEvent = TypedEvent< + [string, string, BigNumber] & { + owner: string; + approved: string; + tokenId: BigNumber; + } +>; + +export type ApprovalForAllEvent = TypedEvent< + [string, string, boolean] & { + owner: string; + operator: string; + approved: boolean; + } +>; + +export type TransferEvent = TypedEvent< + [string, string, BigNumber] & { from: string; to: string; tokenId: BigNumber } +>; + +export type leveledEvent = TypedEvent< + [string, BigNumber, BigNumber] & { + owner: string; + level: BigNumber; + summoner: BigNumber; + } +>; + +export type summonedEvent = TypedEvent< + [string, BigNumber, BigNumber] & { + owner: string; + class: BigNumber; + summoner: BigNumber; + } +>; + +export class Rarity extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + listeners, EventArgsObject>( + eventFilter?: TypedEventFilter + ): Array>; + off, EventArgsObject>( + eventFilter: TypedEventFilter, + listener: TypedListener + ): this; + on, EventArgsObject>( + eventFilter: TypedEventFilter, + listener: TypedListener + ): this; + once, EventArgsObject>( + eventFilter: TypedEventFilter, + listener: TypedListener + ): this; + removeListener, EventArgsObject>( + eventFilter: TypedEventFilter, + listener: TypedListener + ): this; + removeAllListeners, EventArgsObject>( + eventFilter: TypedEventFilter + ): this; + + listeners(eventName?: string): Array; + off(eventName: string, listener: Listener): this; + on(eventName: string, listener: Listener): this; + once(eventName: string, listener: Listener): this; + removeListener(eventName: string, listener: Listener): this; + removeAllListeners(eventName?: string): this; + + queryFilter, EventArgsObject>( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + interface: RarityInterface; + + functions: { + adventure( + _summoner: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + adventurers_log( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + balanceOf(owner: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + class(arg0: BigNumberish, overrides?: CallOverrides): Promise<[BigNumber]>; + + classes( + id: BigNumberish, + overrides?: CallOverrides + ): Promise<[string] & { description: string }>; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise<[string]>; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: CallOverrides + ): Promise<[boolean]>; + + level(arg0: BigNumberish, overrides?: CallOverrides): Promise<[BigNumber]>; + + level_up( + _summoner: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + next_summoner(overrides?: CallOverrides): Promise<[BigNumber]>; + + ownerOf( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise<[string]>; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + spend_xp( + _summoner: BigNumberish, + _xp: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + summon( + _class: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + summoner( + _summoner: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber] & { + _xp: BigNumber; + _log: BigNumber; + _class: BigNumber; + _level: BigNumber; + } + >; + + tokenByIndex( + index: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + tokenURI( + _summoner: BigNumberish, + overrides?: CallOverrides + ): Promise<[string]>; + + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + xp(arg0: BigNumberish, overrides?: CallOverrides): Promise<[BigNumber]>; + + xp_required( + curent_level: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber] & { xp_to_next_level: BigNumber }>; + }; + + adventure( + _summoner: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + adventurers_log( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + balanceOf(owner: string, overrides?: CallOverrides): Promise; + + class(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + classes(id: BigNumberish, overrides?: CallOverrides): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: CallOverrides + ): Promise; + + level(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + level_up( + _summoner: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + next_summoner(overrides?: CallOverrides): Promise; + + ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + spend_xp( + _summoner: BigNumberish, + _xp: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + summon( + _class: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + summoner( + _summoner: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber] & { + _xp: BigNumber; + _log: BigNumber; + _class: BigNumber; + _level: BigNumber; + } + >; + + tokenByIndex( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenURI(_summoner: BigNumberish, overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + xp(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + xp_required( + curent_level: BigNumberish, + overrides?: CallOverrides + ): Promise; + + callStatic: { + adventure( + _summoner: BigNumberish, + overrides?: CallOverrides + ): Promise; + + adventurers_log( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + approve( + to: string, + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + balanceOf(owner: string, overrides?: CallOverrides): Promise; + + class(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + classes(id: BigNumberish, overrides?: CallOverrides): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: CallOverrides + ): Promise; + + level(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + level_up(_summoner: BigNumberish, overrides?: CallOverrides): Promise; + + next_summoner(overrides?: CallOverrides): Promise; + + ownerOf(tokenId: BigNumberish, overrides?: CallOverrides): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + _data: BytesLike, + overrides?: CallOverrides + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: CallOverrides + ): Promise; + + spend_xp( + _summoner: BigNumberish, + _xp: BigNumberish, + overrides?: CallOverrides + ): Promise; + + summon(_class: BigNumberish, overrides?: CallOverrides): Promise; + + summoner( + _summoner: BigNumberish, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber] & { + _xp: BigNumber; + _log: BigNumber; + _class: BigNumber; + _level: BigNumber; + } + >; + + tokenByIndex( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenURI( + _summoner: BigNumberish, + overrides?: CallOverrides + ): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + xp(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + xp_required( + curent_level: BigNumberish, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "Approval(address,address,uint256)"( + owner?: string | null, + approved?: string | null, + tokenId?: BigNumberish | null + ): TypedEventFilter< + [string, string, BigNumber], + { owner: string; approved: string; tokenId: BigNumber } + >; + + Approval( + owner?: string | null, + approved?: string | null, + tokenId?: BigNumberish | null + ): TypedEventFilter< + [string, string, BigNumber], + { owner: string; approved: string; tokenId: BigNumber } + >; + + "ApprovalForAll(address,address,bool)"( + owner?: string | null, + operator?: string | null, + approved?: null + ): TypedEventFilter< + [string, string, boolean], + { owner: string; operator: string; approved: boolean } + >; + + ApprovalForAll( + owner?: string | null, + operator?: string | null, + approved?: null + ): TypedEventFilter< + [string, string, boolean], + { owner: string; operator: string; approved: boolean } + >; + + "Transfer(address,address,uint256)"( + from?: string | null, + to?: string | null, + tokenId?: BigNumberish | null + ): TypedEventFilter< + [string, string, BigNumber], + { from: string; to: string; tokenId: BigNumber } + >; + + Transfer( + from?: string | null, + to?: string | null, + tokenId?: BigNumberish | null + ): TypedEventFilter< + [string, string, BigNumber], + { from: string; to: string; tokenId: BigNumber } + >; + + "leveled(address,uint256,uint256)"( + owner?: string | null, + level?: null, + summoner?: null + ): TypedEventFilter< + [string, BigNumber, BigNumber], + { owner: string; level: BigNumber; summoner: BigNumber } + >; + + leveled( + owner?: string | null, + level?: null, + summoner?: null + ): TypedEventFilter< + [string, BigNumber, BigNumber], + { owner: string; level: BigNumber; summoner: BigNumber } + >; + + "summoned(address,uint256,uint256)"( + owner?: string | null, + _class?: null, + summoner?: null + ): TypedEventFilter< + [string, BigNumber, BigNumber], + { owner: string; class: BigNumber; summoner: BigNumber } + >; + + summoned( + owner?: string | null, + _class?: null, + summoner?: null + ): TypedEventFilter< + [string, BigNumber, BigNumber], + { owner: string; class: BigNumber; summoner: BigNumber } + >; + }; + + estimateGas: { + adventure( + _summoner: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + adventurers_log( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + balanceOf(owner: string, overrides?: CallOverrides): Promise; + + class(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + classes(id: BigNumberish, overrides?: CallOverrides): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: CallOverrides + ): Promise; + + level(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + level_up( + _summoner: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + next_summoner(overrides?: CallOverrides): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + spend_xp( + _summoner: BigNumberish, + _xp: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + summon( + _class: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + summoner( + _summoner: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenByIndex( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenURI( + _summoner: BigNumberish, + overrides?: CallOverrides + ): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + xp(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + xp_required( + curent_level: BigNumberish, + overrides?: CallOverrides + ): Promise; + }; + + populateTransaction: { + adventure( + _summoner: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + adventurers_log( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + approve( + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + balanceOf( + owner: string, + overrides?: CallOverrides + ): Promise; + + class( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + classes( + id: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getApproved( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + isApprovedForAll( + owner: string, + operator: string, + overrides?: CallOverrides + ): Promise; + + level( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + level_up( + _summoner: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + next_summoner(overrides?: CallOverrides): Promise; + + ownerOf( + tokenId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: BigNumberish, + _data: BytesLike, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + setApprovalForAll( + operator: string, + approved: boolean, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + spend_xp( + _summoner: BigNumberish, + _xp: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + summon( + _class: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + summoner( + _summoner: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenByIndex( + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenOfOwnerByIndex( + owner: string, + index: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenURI( + _summoner: BigNumberish, + overrides?: CallOverrides + ): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + xp( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + xp_required( + curent_level: BigNumberish, + overrides?: CallOverrides + ): Promise; + }; +} diff --git a/packages/target-ethers-v5-test/types/factories/ERC721Enumerable__factory.ts b/packages/target-ethers-v5-test/types/factories/ERC721Enumerable__factory.ts new file mode 100644 index 000000000..af73e6a2f --- /dev/null +++ b/packages/target-ethers-v5-test/types/factories/ERC721Enumerable__factory.ts @@ -0,0 +1,348 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import { Provider } from "@ethersproject/providers"; +import type { + ERC721Enumerable, + ERC721EnumerableInterface, +} from "../ERC721Enumerable"; + +const _abi = [ + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "approved", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: false, + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "ApprovalForAll", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "approve", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "getApproved", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + ], + name: "isApprovedForAll", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "ownerOf", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "setApprovalForAll", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + ], + name: "tokenByIndex", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + ], + name: "tokenOfOwnerByIndex", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +]; + +export class ERC721Enumerable__factory { + static readonly abi = _abi; + static createInterface(): ERC721EnumerableInterface { + return new utils.Interface(_abi) as ERC721EnumerableInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): ERC721Enumerable { + return new Contract(address, _abi, signerOrProvider) as ERC721Enumerable; + } +} diff --git a/packages/target-ethers-v5-test/types/factories/ERC721__factory.ts b/packages/target-ethers-v5-test/types/factories/ERC721__factory.ts new file mode 100644 index 000000000..6028a4443 --- /dev/null +++ b/packages/target-ethers-v5-test/types/factories/ERC721__factory.ts @@ -0,0 +1,286 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import { Provider } from "@ethersproject/providers"; +import type { ERC721, ERC721Interface } from "../ERC721"; + +const _abi = [ + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "approved", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: false, + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "ApprovalForAll", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "approve", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "getApproved", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + ], + name: "isApprovedForAll", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "ownerOf", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "setApprovalForAll", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +]; + +export class ERC721__factory { + static readonly abi = _abi; + static createInterface(): ERC721Interface { + return new utils.Interface(_abi) as ERC721Interface; + } + static connect(address: string, signerOrProvider: Signer | Provider): ERC721 { + return new Contract(address, _abi, signerOrProvider) as ERC721; + } +} diff --git a/packages/target-ethers-v5-test/types/factories/IERC721Enumerable__factory.ts b/packages/target-ethers-v5-test/types/factories/IERC721Enumerable__factory.ts new file mode 100644 index 000000000..40c87585a --- /dev/null +++ b/packages/target-ethers-v5-test/types/factories/IERC721Enumerable__factory.ts @@ -0,0 +1,348 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import { Provider } from "@ethersproject/providers"; +import type { + IERC721Enumerable, + IERC721EnumerableInterface, +} from "../IERC721Enumerable"; + +const _abi = [ + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "approved", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: false, + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "ApprovalForAll", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "approve", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "balance", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "getApproved", + outputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + ], + name: "isApprovedForAll", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "ownerOf", + outputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "bool", + name: "_approved", + type: "bool", + }, + ], + name: "setApprovalForAll", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + ], + name: "tokenByIndex", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + ], + name: "tokenOfOwnerByIndex", + outputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +]; + +export class IERC721Enumerable__factory { + static readonly abi = _abi; + static createInterface(): IERC721EnumerableInterface { + return new utils.Interface(_abi) as IERC721EnumerableInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): IERC721Enumerable { + return new Contract(address, _abi, signerOrProvider) as IERC721Enumerable; + } +} diff --git a/packages/target-ethers-v5-test/types/factories/IERC721Receiver__factory.ts b/packages/target-ethers-v5-test/types/factories/IERC721Receiver__factory.ts new file mode 100644 index 000000000..ee9318bfd --- /dev/null +++ b/packages/target-ethers-v5-test/types/factories/IERC721Receiver__factory.ts @@ -0,0 +1,60 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import { Provider } from "@ethersproject/providers"; +import type { + IERC721Receiver, + IERC721ReceiverInterface, +} from "../IERC721Receiver"; + +const _abi = [ + { + inputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "onERC721Received", + outputs: [ + { + internalType: "bytes4", + name: "", + type: "bytes4", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, +]; + +export class IERC721Receiver__factory { + static readonly abi = _abi; + static createInterface(): IERC721ReceiverInterface { + return new utils.Interface(_abi) as IERC721ReceiverInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): IERC721Receiver { + return new Contract(address, _abi, signerOrProvider) as IERC721Receiver; + } +} diff --git a/packages/target-ethers-v5-test/types/factories/IERC721__factory.ts b/packages/target-ethers-v5-test/types/factories/IERC721__factory.ts new file mode 100644 index 000000000..51bbb3674 --- /dev/null +++ b/packages/target-ethers-v5-test/types/factories/IERC721__factory.ts @@ -0,0 +1,289 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import { Provider } from "@ethersproject/providers"; +import type { IERC721, IERC721Interface } from "../IERC721"; + +const _abi = [ + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "approved", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: false, + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "ApprovalForAll", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "approve", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "balance", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "getApproved", + outputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + ], + name: "isApprovedForAll", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "ownerOf", + outputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "bool", + name: "_approved", + type: "bool", + }, + ], + name: "setApprovalForAll", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +]; + +export class IERC721__factory { + static readonly abi = _abi; + static createInterface(): IERC721Interface { + return new utils.Interface(_abi) as IERC721Interface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): IERC721 { + return new Contract(address, _abi, signerOrProvider) as IERC721; + } +} diff --git a/packages/target-ethers-v5-test/types/factories/Rarity__factory.ts b/packages/target-ethers-v5-test/types/factories/Rarity__factory.ts new file mode 100644 index 000000000..21cb03fc2 --- /dev/null +++ b/packages/target-ethers-v5-test/types/factories/Rarity__factory.ts @@ -0,0 +1,629 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import { Provider } from "@ethersproject/providers"; +import type { Rarity, RarityInterface } from "../Rarity"; + +const _abi = [ + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "approved", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: false, + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "ApprovalForAll", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "level", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "summoner", + type: "uint256", + }, + ], + name: "leveled", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "class", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "summoner", + type: "uint256", + }, + ], + name: "summoned", + type: "event", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_summoner", + type: "uint256", + }, + ], + name: "adventure", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "adventurers_log", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "approve", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "class", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "id", + type: "uint256", + }, + ], + name: "classes", + outputs: [ + { + internalType: "string", + name: "description", + type: "string", + }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "getApproved", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + ], + name: "isApprovedForAll", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "level", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_summoner", + type: "uint256", + }, + ], + name: "level_up", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "next_summoner", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "ownerOf", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "bytes", + name: "_data", + type: "bytes", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "setApprovalForAll", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_summoner", + type: "uint256", + }, + { + internalType: "uint256", + name: "_xp", + type: "uint256", + }, + ], + name: "spend_xp", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_class", + type: "uint256", + }, + ], + name: "summon", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_summoner", + type: "uint256", + }, + ], + name: "summoner", + outputs: [ + { + internalType: "uint256", + name: "_xp", + type: "uint256", + }, + { + internalType: "uint256", + name: "_log", + type: "uint256", + }, + { + internalType: "uint256", + name: "_class", + type: "uint256", + }, + { + internalType: "uint256", + name: "_level", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + ], + name: "tokenByIndex", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + ], + name: "tokenOfOwnerByIndex", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_summoner", + type: "uint256", + }, + ], + name: "tokenURI", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "xp", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "curent_level", + type: "uint256", + }, + ], + name: "xp_required", + outputs: [ + { + internalType: "uint256", + name: "xp_to_next_level", + type: "uint256", + }, + ], + stateMutability: "pure", + type: "function", + }, +]; + +export class Rarity__factory { + static readonly abi = _abi; + static createInterface(): RarityInterface { + return new utils.Interface(_abi) as RarityInterface; + } + static connect(address: string, signerOrProvider: Signer | Provider): Rarity { + return new Contract(address, _abi, signerOrProvider) as Rarity; + } +} diff --git a/packages/target-ethers-v5-test/types/index.ts b/packages/target-ethers-v5-test/types/index.ts index 6c64670d1..01f5d9fa7 100644 --- a/packages/target-ethers-v5-test/types/index.ts +++ b/packages/target-ethers-v5-test/types/index.ts @@ -11,6 +11,12 @@ export type { NameMangling } from "./NameMangling"; export type { Overloads } from "./Overloads"; export type { Payable } from "./Payable"; export type { PayableFactory } from "./PayableFactory"; +export type { ERC721 } from "./ERC721"; +export type { ERC721Enumerable } from "./ERC721Enumerable"; +export type { IERC721 } from "./IERC721"; +export type { IERC721Enumerable } from "./IERC721Enumerable"; +export type { IERC721Receiver } from "./IERC721Receiver"; +export type { Rarity } from "./Rarity"; export { DataTypesInput__factory } from "./factories/DataTypesInput__factory"; export { DataTypesPure__factory } from "./factories/DataTypesPure__factory"; @@ -22,3 +28,9 @@ export { NameMangling__factory } from "./factories/NameMangling__factory"; export { Overloads__factory } from "./factories/Overloads__factory"; export { Payable__factory } from "./factories/Payable__factory"; export { PayableFactory__factory } from "./factories/PayableFactory__factory"; +export { ERC721__factory } from "./factories/ERC721__factory"; +export { ERC721Enumerable__factory } from "./factories/ERC721Enumerable__factory"; +export { IERC721__factory } from "./factories/IERC721__factory"; +export { IERC721Enumerable__factory } from "./factories/IERC721Enumerable__factory"; +export { IERC721Receiver__factory } from "./factories/IERC721Receiver__factory"; +export { Rarity__factory } from "./factories/Rarity__factory"; diff --git a/packages/target-ethers-v5/src/codegen/events.ts b/packages/target-ethers-v5/src/codegen/events.ts index 4fe27da78..d214c6fee 100644 --- a/packages/target-ethers-v5/src/codegen/events.ts +++ b/packages/target-ethers-v5/src/codegen/events.ts @@ -1,4 +1,4 @@ -import { EventArgDeclaration, EventDeclaration } from 'typechain' +import { createPositionalIdentifier, EventArgDeclaration, EventDeclaration } from 'typechain' import { generateInputType, generateOutputComplexTypeAsArray, generateOutputComplexTypesAsObject } from './types' @@ -64,7 +64,7 @@ export function generateEventInputs(eventArgs: EventArgDeclaration[]) { return ( eventArgs .map((arg) => { - return `${arg.name}?: ${generateEventArgType(arg)}` + return `${arg.name && createPositionalIdentifier(arg.name)}?: ${generateEventArgType(arg)}` }) .join(', ') + ', ' ) diff --git a/packages/target-ethers-v5/src/codegen/functions.ts b/packages/target-ethers-v5/src/codegen/functions.ts index 59cbde5ce..2138cba48 100644 --- a/packages/target-ethers-v5/src/codegen/functions.ts +++ b/packages/target-ethers-v5/src/codegen/functions.ts @@ -1,6 +1,7 @@ import { AbiParameter, CodegenConfig, + createPositionalIdentifier, EventArgDeclaration, FunctionDeclaration, FunctionDocumentation, @@ -102,5 +103,5 @@ export function generateDecodeFunctionResultOverload(fn: FunctionDeclaration): s } export function generateParamNames(params: Array): string { - return params.map((param, index) => param.name || `arg${index}`).join(', ') + return params.map((param, index) => (param.name ? createPositionalIdentifier(param.name) : `arg${index}`)).join(', ') } diff --git a/packages/target-truffle-v5-test/package.json b/packages/target-truffle-v5-test/package.json index 7224d2e4c..bb422b410 100644 --- a/packages/target-truffle-v5-test/package.json +++ b/packages/target-truffle-v5-test/package.json @@ -12,7 +12,7 @@ "clean": "rm -rf dist contracts/* && rm -f tsconfig.build.tsbuildinfo && rm -rf build", "compile-contracts": "truffle compile", "generate-types": "node ../typechain/dist/cli/cli.js --target=../target-truffle-v5/dist/index.js './build/**/*.json'", - "test": "yarn generate-types", + "test": "yarn generate-types && truffle test", "test:fix": "yarn lint:fix && yarn format:fix && yarn test && yarn typecheck" }, "devDependencies": { diff --git a/packages/target-web3-v1-test/types/ERC721.d.ts b/packages/target-web3-v1-test/types/ERC721.d.ts new file mode 100644 index 000000000..f4531ee4f --- /dev/null +++ b/packages/target-web3-v1-test/types/ERC721.d.ts @@ -0,0 +1,127 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import BN from "bn.js"; +import { ContractOptions } from "web3-eth-contract"; +import { EventLog } from "web3-core"; +import { EventEmitter } from "events"; +import { + Callback, + PayableTransactionObject, + NonPayableTransactionObject, + BlockType, + ContractEventLog, + BaseContract, +} from "./types"; + +interface EventOptions { + filter?: object; + fromBlock?: BlockType; + topics?: string[]; +} + +export type Approval = ContractEventLog<{ + owner: string; + approved: string; + tokenId: string; + 0: string; + 1: string; + 2: string; +}>; +export type ApprovalForAll = ContractEventLog<{ + owner: string; + operator: string; + approved: boolean; + 0: string; + 1: string; + 2: boolean; +}>; +export type Transfer = ContractEventLog<{ + from: string; + to: string; + tokenId: string; + 0: string; + 1: string; + 2: string; +}>; + +export interface ERC721 extends BaseContract { + constructor( + jsonInterface: any[], + address?: string, + options?: ContractOptions + ): ERC721; + clone(): ERC721; + methods: { + approve( + to: string, + tokenId: number | string | BN + ): NonPayableTransactionObject; + + balanceOf(owner: string): NonPayableTransactionObject; + + getApproved( + tokenId: number | string | BN + ): NonPayableTransactionObject; + + isApprovedForAll( + owner: string, + operator: string + ): NonPayableTransactionObject; + + ownerOf(tokenId: number | string | BN): NonPayableTransactionObject; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: number | string | BN + ): NonPayableTransactionObject; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: number | string | BN, + _data: string | number[] + ): NonPayableTransactionObject; + + setApprovalForAll( + operator: string, + approved: boolean + ): NonPayableTransactionObject; + + transferFrom( + from: string, + to: string, + tokenId: number | string | BN + ): NonPayableTransactionObject; + }; + events: { + Approval(cb?: Callback): EventEmitter; + Approval(options?: EventOptions, cb?: Callback): EventEmitter; + + ApprovalForAll(cb?: Callback): EventEmitter; + ApprovalForAll( + options?: EventOptions, + cb?: Callback + ): EventEmitter; + + Transfer(cb?: Callback): EventEmitter; + Transfer(options?: EventOptions, cb?: Callback): EventEmitter; + + allEvents(options?: EventOptions, cb?: Callback): EventEmitter; + }; + + once(event: "Approval", cb: Callback): void; + once(event: "Approval", options: EventOptions, cb: Callback): void; + + once(event: "ApprovalForAll", cb: Callback): void; + once( + event: "ApprovalForAll", + options: EventOptions, + cb: Callback + ): void; + + once(event: "Transfer", cb: Callback): void; + once(event: "Transfer", options: EventOptions, cb: Callback): void; +} diff --git a/packages/target-web3-v1-test/types/ERC721Enumerable.d.ts b/packages/target-web3-v1-test/types/ERC721Enumerable.d.ts new file mode 100644 index 000000000..c31813bba --- /dev/null +++ b/packages/target-web3-v1-test/types/ERC721Enumerable.d.ts @@ -0,0 +1,138 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import BN from "bn.js"; +import { ContractOptions } from "web3-eth-contract"; +import { EventLog } from "web3-core"; +import { EventEmitter } from "events"; +import { + Callback, + PayableTransactionObject, + NonPayableTransactionObject, + BlockType, + ContractEventLog, + BaseContract, +} from "./types"; + +interface EventOptions { + filter?: object; + fromBlock?: BlockType; + topics?: string[]; +} + +export type Approval = ContractEventLog<{ + owner: string; + approved: string; + tokenId: string; + 0: string; + 1: string; + 2: string; +}>; +export type ApprovalForAll = ContractEventLog<{ + owner: string; + operator: string; + approved: boolean; + 0: string; + 1: string; + 2: boolean; +}>; +export type Transfer = ContractEventLog<{ + from: string; + to: string; + tokenId: string; + 0: string; + 1: string; + 2: string; +}>; + +export interface ERC721Enumerable extends BaseContract { + constructor( + jsonInterface: any[], + address?: string, + options?: ContractOptions + ): ERC721Enumerable; + clone(): ERC721Enumerable; + methods: { + approve( + to: string, + tokenId: number | string | BN + ): NonPayableTransactionObject; + + balanceOf(owner: string): NonPayableTransactionObject; + + getApproved( + tokenId: number | string | BN + ): NonPayableTransactionObject; + + isApprovedForAll( + owner: string, + operator: string + ): NonPayableTransactionObject; + + ownerOf(tokenId: number | string | BN): NonPayableTransactionObject; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: number | string | BN + ): NonPayableTransactionObject; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: number | string | BN, + _data: string | number[] + ): NonPayableTransactionObject; + + setApprovalForAll( + operator: string, + approved: boolean + ): NonPayableTransactionObject; + + tokenByIndex( + index: number | string | BN + ): NonPayableTransactionObject; + + tokenOfOwnerByIndex( + owner: string, + index: number | string | BN + ): NonPayableTransactionObject; + + totalSupply(): NonPayableTransactionObject; + + transferFrom( + from: string, + to: string, + tokenId: number | string | BN + ): NonPayableTransactionObject; + }; + events: { + Approval(cb?: Callback): EventEmitter; + Approval(options?: EventOptions, cb?: Callback): EventEmitter; + + ApprovalForAll(cb?: Callback): EventEmitter; + ApprovalForAll( + options?: EventOptions, + cb?: Callback + ): EventEmitter; + + Transfer(cb?: Callback): EventEmitter; + Transfer(options?: EventOptions, cb?: Callback): EventEmitter; + + allEvents(options?: EventOptions, cb?: Callback): EventEmitter; + }; + + once(event: "Approval", cb: Callback): void; + once(event: "Approval", options: EventOptions, cb: Callback): void; + + once(event: "ApprovalForAll", cb: Callback): void; + once( + event: "ApprovalForAll", + options: EventOptions, + cb: Callback + ): void; + + once(event: "Transfer", cb: Callback): void; + once(event: "Transfer", options: EventOptions, cb: Callback): void; +} diff --git a/packages/target-web3-v1-test/types/IERC721.d.ts b/packages/target-web3-v1-test/types/IERC721.d.ts new file mode 100644 index 000000000..6cb4d5458 --- /dev/null +++ b/packages/target-web3-v1-test/types/IERC721.d.ts @@ -0,0 +1,127 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import BN from "bn.js"; +import { ContractOptions } from "web3-eth-contract"; +import { EventLog } from "web3-core"; +import { EventEmitter } from "events"; +import { + Callback, + PayableTransactionObject, + NonPayableTransactionObject, + BlockType, + ContractEventLog, + BaseContract, +} from "./types"; + +interface EventOptions { + filter?: object; + fromBlock?: BlockType; + topics?: string[]; +} + +export type Approval = ContractEventLog<{ + owner: string; + approved: string; + tokenId: string; + 0: string; + 1: string; + 2: string; +}>; +export type ApprovalForAll = ContractEventLog<{ + owner: string; + operator: string; + approved: boolean; + 0: string; + 1: string; + 2: boolean; +}>; +export type Transfer = ContractEventLog<{ + from: string; + to: string; + tokenId: string; + 0: string; + 1: string; + 2: string; +}>; + +export interface IERC721 extends BaseContract { + constructor( + jsonInterface: any[], + address?: string, + options?: ContractOptions + ): IERC721; + clone(): IERC721; + methods: { + approve( + to: string, + tokenId: number | string | BN + ): NonPayableTransactionObject; + + balanceOf(owner: string): NonPayableTransactionObject; + + getApproved( + tokenId: number | string | BN + ): NonPayableTransactionObject; + + isApprovedForAll( + owner: string, + operator: string + ): NonPayableTransactionObject; + + ownerOf(tokenId: number | string | BN): NonPayableTransactionObject; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: number | string | BN + ): NonPayableTransactionObject; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: number | string | BN, + data: string | number[] + ): NonPayableTransactionObject; + + setApprovalForAll( + operator: string, + _approved: boolean + ): NonPayableTransactionObject; + + transferFrom( + from: string, + to: string, + tokenId: number | string | BN + ): NonPayableTransactionObject; + }; + events: { + Approval(cb?: Callback): EventEmitter; + Approval(options?: EventOptions, cb?: Callback): EventEmitter; + + ApprovalForAll(cb?: Callback): EventEmitter; + ApprovalForAll( + options?: EventOptions, + cb?: Callback + ): EventEmitter; + + Transfer(cb?: Callback): EventEmitter; + Transfer(options?: EventOptions, cb?: Callback): EventEmitter; + + allEvents(options?: EventOptions, cb?: Callback): EventEmitter; + }; + + once(event: "Approval", cb: Callback): void; + once(event: "Approval", options: EventOptions, cb: Callback): void; + + once(event: "ApprovalForAll", cb: Callback): void; + once( + event: "ApprovalForAll", + options: EventOptions, + cb: Callback + ): void; + + once(event: "Transfer", cb: Callback): void; + once(event: "Transfer", options: EventOptions, cb: Callback): void; +} diff --git a/packages/target-web3-v1-test/types/IERC721Enumerable.d.ts b/packages/target-web3-v1-test/types/IERC721Enumerable.d.ts new file mode 100644 index 000000000..e1e465450 --- /dev/null +++ b/packages/target-web3-v1-test/types/IERC721Enumerable.d.ts @@ -0,0 +1,138 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import BN from "bn.js"; +import { ContractOptions } from "web3-eth-contract"; +import { EventLog } from "web3-core"; +import { EventEmitter } from "events"; +import { + Callback, + PayableTransactionObject, + NonPayableTransactionObject, + BlockType, + ContractEventLog, + BaseContract, +} from "./types"; + +interface EventOptions { + filter?: object; + fromBlock?: BlockType; + topics?: string[]; +} + +export type Approval = ContractEventLog<{ + owner: string; + approved: string; + tokenId: string; + 0: string; + 1: string; + 2: string; +}>; +export type ApprovalForAll = ContractEventLog<{ + owner: string; + operator: string; + approved: boolean; + 0: string; + 1: string; + 2: boolean; +}>; +export type Transfer = ContractEventLog<{ + from: string; + to: string; + tokenId: string; + 0: string; + 1: string; + 2: string; +}>; + +export interface IERC721Enumerable extends BaseContract { + constructor( + jsonInterface: any[], + address?: string, + options?: ContractOptions + ): IERC721Enumerable; + clone(): IERC721Enumerable; + methods: { + approve( + to: string, + tokenId: number | string | BN + ): NonPayableTransactionObject; + + balanceOf(owner: string): NonPayableTransactionObject; + + getApproved( + tokenId: number | string | BN + ): NonPayableTransactionObject; + + isApprovedForAll( + owner: string, + operator: string + ): NonPayableTransactionObject; + + ownerOf(tokenId: number | string | BN): NonPayableTransactionObject; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: number | string | BN + ): NonPayableTransactionObject; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: number | string | BN, + data: string | number[] + ): NonPayableTransactionObject; + + setApprovalForAll( + operator: string, + _approved: boolean + ): NonPayableTransactionObject; + + tokenByIndex( + index: number | string | BN + ): NonPayableTransactionObject; + + tokenOfOwnerByIndex( + owner: string, + index: number | string | BN + ): NonPayableTransactionObject; + + totalSupply(): NonPayableTransactionObject; + + transferFrom( + from: string, + to: string, + tokenId: number | string | BN + ): NonPayableTransactionObject; + }; + events: { + Approval(cb?: Callback): EventEmitter; + Approval(options?: EventOptions, cb?: Callback): EventEmitter; + + ApprovalForAll(cb?: Callback): EventEmitter; + ApprovalForAll( + options?: EventOptions, + cb?: Callback + ): EventEmitter; + + Transfer(cb?: Callback): EventEmitter; + Transfer(options?: EventOptions, cb?: Callback): EventEmitter; + + allEvents(options?: EventOptions, cb?: Callback): EventEmitter; + }; + + once(event: "Approval", cb: Callback): void; + once(event: "Approval", options: EventOptions, cb: Callback): void; + + once(event: "ApprovalForAll", cb: Callback): void; + once( + event: "ApprovalForAll", + options: EventOptions, + cb: Callback + ): void; + + once(event: "Transfer", cb: Callback): void; + once(event: "Transfer", options: EventOptions, cb: Callback): void; +} diff --git a/packages/target-web3-v1-test/types/IERC721Receiver.d.ts b/packages/target-web3-v1-test/types/IERC721Receiver.d.ts new file mode 100644 index 000000000..da5d71222 --- /dev/null +++ b/packages/target-web3-v1-test/types/IERC721Receiver.d.ts @@ -0,0 +1,42 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import BN from "bn.js"; +import { ContractOptions } from "web3-eth-contract"; +import { EventLog } from "web3-core"; +import { EventEmitter } from "events"; +import { + Callback, + PayableTransactionObject, + NonPayableTransactionObject, + BlockType, + ContractEventLog, + BaseContract, +} from "./types"; + +interface EventOptions { + filter?: object; + fromBlock?: BlockType; + topics?: string[]; +} + +export interface IERC721Receiver extends BaseContract { + constructor( + jsonInterface: any[], + address?: string, + options?: ContractOptions + ): IERC721Receiver; + clone(): IERC721Receiver; + methods: { + onERC721Received( + operator: string, + from: string, + tokenId: number | string | BN, + data: string | number[] + ): NonPayableTransactionObject; + }; + events: { + allEvents(options?: EventOptions, cb?: Callback): EventEmitter; + }; +} diff --git a/packages/target-web3-v1-test/types/Rarity.d.ts b/packages/target-web3-v1-test/types/Rarity.d.ts new file mode 100644 index 000000000..098972b48 --- /dev/null +++ b/packages/target-web3-v1-test/types/Rarity.d.ts @@ -0,0 +1,216 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import BN from "bn.js"; +import { ContractOptions } from "web3-eth-contract"; +import { EventLog } from "web3-core"; +import { EventEmitter } from "events"; +import { + Callback, + PayableTransactionObject, + NonPayableTransactionObject, + BlockType, + ContractEventLog, + BaseContract, +} from "./types"; + +interface EventOptions { + filter?: object; + fromBlock?: BlockType; + topics?: string[]; +} + +export type Approval = ContractEventLog<{ + owner: string; + approved: string; + tokenId: string; + 0: string; + 1: string; + 2: string; +}>; +export type ApprovalForAll = ContractEventLog<{ + owner: string; + operator: string; + approved: boolean; + 0: string; + 1: string; + 2: boolean; +}>; +export type Transfer = ContractEventLog<{ + from: string; + to: string; + tokenId: string; + 0: string; + 1: string; + 2: string; +}>; +export type leveled = ContractEventLog<{ + owner: string; + level: string; + summoner: string; + 0: string; + 1: string; + 2: string; +}>; +export type summoned = ContractEventLog<{ + owner: string; + class: string; + summoner: string; + 0: string; + 1: string; + 2: string; +}>; + +export interface Rarity extends BaseContract { + constructor( + jsonInterface: any[], + address?: string, + options?: ContractOptions + ): Rarity; + clone(): Rarity; + methods: { + adventure( + _summoner: number | string | BN + ): NonPayableTransactionObject; + + adventurers_log( + arg0: number | string | BN + ): NonPayableTransactionObject; + + approve( + to: string, + tokenId: number | string | BN + ): NonPayableTransactionObject; + + balanceOf(owner: string): NonPayableTransactionObject; + + class(arg0: number | string | BN): NonPayableTransactionObject; + + classes(id: number | string | BN): NonPayableTransactionObject; + + getApproved( + tokenId: number | string | BN + ): NonPayableTransactionObject; + + isApprovedForAll( + owner: string, + operator: string + ): NonPayableTransactionObject; + + level(arg0: number | string | BN): NonPayableTransactionObject; + + level_up( + _summoner: number | string | BN + ): NonPayableTransactionObject; + + next_summoner(): NonPayableTransactionObject; + + ownerOf(tokenId: number | string | BN): NonPayableTransactionObject; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: number | string | BN + ): NonPayableTransactionObject; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: number | string | BN, + _data: string | number[] + ): NonPayableTransactionObject; + + setApprovalForAll( + operator: string, + approved: boolean + ): NonPayableTransactionObject; + + spend_xp( + _summoner: number | string | BN, + _xp: number | string | BN + ): NonPayableTransactionObject; + + summon(_class: number | string | BN): NonPayableTransactionObject; + + summoner( + _summoner: number | string | BN + ): NonPayableTransactionObject<{ + _xp: string; + _log: string; + _class: string; + _level: string; + 0: string; + 1: string; + 2: string; + 3: string; + }>; + + tokenByIndex( + index: number | string | BN + ): NonPayableTransactionObject; + + tokenOfOwnerByIndex( + owner: string, + index: number | string | BN + ): NonPayableTransactionObject; + + tokenURI( + _summoner: number | string | BN + ): NonPayableTransactionObject; + + totalSupply(): NonPayableTransactionObject; + + transferFrom( + from: string, + to: string, + tokenId: number | string | BN + ): NonPayableTransactionObject; + + xp(arg0: number | string | BN): NonPayableTransactionObject; + + xp_required( + curent_level: number | string | BN + ): NonPayableTransactionObject; + }; + events: { + Approval(cb?: Callback): EventEmitter; + Approval(options?: EventOptions, cb?: Callback): EventEmitter; + + ApprovalForAll(cb?: Callback): EventEmitter; + ApprovalForAll( + options?: EventOptions, + cb?: Callback + ): EventEmitter; + + Transfer(cb?: Callback): EventEmitter; + Transfer(options?: EventOptions, cb?: Callback): EventEmitter; + + leveled(cb?: Callback): EventEmitter; + leveled(options?: EventOptions, cb?: Callback): EventEmitter; + + summoned(cb?: Callback): EventEmitter; + summoned(options?: EventOptions, cb?: Callback): EventEmitter; + + allEvents(options?: EventOptions, cb?: Callback): EventEmitter; + }; + + once(event: "Approval", cb: Callback): void; + once(event: "Approval", options: EventOptions, cb: Callback): void; + + once(event: "ApprovalForAll", cb: Callback): void; + once( + event: "ApprovalForAll", + options: EventOptions, + cb: Callback + ): void; + + once(event: "Transfer", cb: Callback): void; + once(event: "Transfer", options: EventOptions, cb: Callback): void; + + once(event: "leveled", cb: Callback): void; + once(event: "leveled", options: EventOptions, cb: Callback): void; + + once(event: "summoned", cb: Callback): void; + once(event: "summoned", options: EventOptions, cb: Callback): void; +} diff --git a/packages/test-utils/src/contract.ts b/packages/test-utils/src/contract.ts index 37b0b208f..3f7d70111 100644 --- a/packages/test-utils/src/contract.ts +++ b/packages/test-utils/src/contract.ts @@ -1,11 +1,20 @@ import { readFileSync } from 'fs' +import { sync as globSync } from 'glob' import { join } from 'path' const abiDirPath = join(__dirname, '../../../contracts/compiled') export function loadContract(contractName: string): { code: string; abi: any } { - const abi = JSON.parse(readFileSync(join(abiDirPath, contractName + '.abi'), 'utf-8')) - const bin = readFileSync(join(abiDirPath, contractName + '.bin'), 'utf-8') + const abiPaths = globSync(`${abiDirPath}/**/${contractName}.abi`) + if (abiPaths.length === 0) { + throw new Error(`ABI for ${contractName} not found in ${abiDirPath}`) + } else if (abiPaths.length > 1) { + throw new Error(`Multiple ABIs for ${contractName} found in ${abiDirPath}`) + } + + const [abiPath] = abiPaths + const abi = JSON.parse(readFileSync(abiPath, 'utf-8')) + const bin = readFileSync(abiPath.replace(/\.abi$/, '.bin'), 'utf-8') const code = '0x' + bin return { code, abi } diff --git a/packages/typechain/src/codegen/syntax.ts b/packages/typechain/src/codegen/syntax.ts index b37b9f001..336d61138 100644 --- a/packages/typechain/src/codegen/syntax.ts +++ b/packages/typechain/src/codegen/syntax.ts @@ -19,12 +19,14 @@ const RESERVED_WORDS = new Set([ 'with', 'yield' ]) -/* +/** * Creates an identifier prefixing reserved words with `_`. * We can only use this for function parameters and tuple element names. * Using it for method names would clas with runtime codegen. + * + * @internal */ -export function createPositionalIdentifier(identifierName: string) { +export function createPositionalIdentifier(identifierName: string): string { if (RESERVED_WORDS.has(identifierName)) { return `_${identifierName}` } From f38ad2475f5c7593914b519c4dba5e209bae840e Mon Sep 17 00:00:00 2001 From: hasparus Date: Fri, 8 Oct 2021 17:45:38 +0200 Subject: [PATCH 7/9] Try to fix install --- contracts/v0.6.4/DataTypesInput.sol | 1 + packages/target-ethers-v5/package.json | 1 - scripts/compile-contracts.ts | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/v0.6.4/DataTypesInput.sol b/contracts/v0.6.4/DataTypesInput.sol index 24bea2663..2a0792a52 100644 --- a/contracts/v0.6.4/DataTypesInput.sol +++ b/contracts/v0.6.4/DataTypesInput.sol @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT pragma solidity ^0.6.4; pragma experimental ABIEncoderV2; diff --git a/packages/target-ethers-v5/package.json b/packages/target-ethers-v5/package.json index a247adbaa..1fb7f8499 100644 --- a/packages/target-ethers-v5/package.json +++ b/packages/target-ethers-v5/package.json @@ -42,7 +42,6 @@ "devDependencies": { "ganache-cli": "^6.12.2", "test-utils": "1.0.0", - "typechain": "*", "@types/lodash": "^4.14.139" }, "dependencies": { diff --git a/scripts/compile-contracts.ts b/scripts/compile-contracts.ts index 83d7541ca..6595c50f2 100644 --- a/scripts/compile-contracts.ts +++ b/scripts/compile-contracts.ts @@ -66,7 +66,7 @@ function generateABIs({ rootDir, contracts }: Files) { console.log(bold(`Compiling ${fileNames.length} contracts with \`npx solc@${semver}\``)) execSync(`npx solc@${semver} --abi ${contractPaths} --bin -o ./contracts/compiled/${dirName}`, { cwd: rootDir, - stdio: 'inherit', + stdio: ['ignore', 'ignore', 'inherit'], }) } } From 7d299d9d07bb51c1c9e6d178eb3f068e6af72899 Mon Sep 17 00:00:00 2001 From: hasparus Date: Fri, 8 Oct 2021 18:32:16 +0200 Subject: [PATCH 8/9] Improve scripts/compile-contracts --- packages/target-truffle-v5-test/package.json | 2 +- scripts/_common.ts | 10 ++++------ scripts/compile-contracts.ts | 12 ++++++++---- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/packages/target-truffle-v5-test/package.json b/packages/target-truffle-v5-test/package.json index bb422b410..0a2e45662 100644 --- a/packages/target-truffle-v5-test/package.json +++ b/packages/target-truffle-v5-test/package.json @@ -10,7 +10,7 @@ "lint:fix": "yarn lint --fix", "typecheck": "tsc --noEmit --incremental false --composite false && tsc --noEmit --incremental false --composite false -p tsconfig.types.json", "clean": "rm -rf dist contracts/* && rm -f tsconfig.build.tsbuildinfo && rm -rf build", - "compile-contracts": "truffle compile", + "compile-contracts": "truffle compile --quiet", "generate-types": "node ../typechain/dist/cli/cli.js --target=../target-truffle-v5/dist/index.js './build/**/*.json'", "test": "yarn generate-types && truffle test", "test:fix": "yarn lint:fix && yarn format:fix && yarn test && yarn typecheck" diff --git a/scripts/_common.ts b/scripts/_common.ts index 8a0a7d7a9..f2d90e274 100644 --- a/scripts/_common.ts +++ b/scripts/_common.ts @@ -1,7 +1,5 @@ -export function bold(text: string | number) { - return '\u001b[1m' + String(text) + '\u001b[0m' -} +const colored = (escapeCode: string) => (text: string | number) => `\x1b[${escapeCode}m${text}\x1b[0m` -export function red(text: string | number) { - return '\u001b[31;4m' + String(text) + '\u001b[0m' -} +export const red = colored('31;4') +export const bold = colored('1') +export const brightItalic = colored('3m;90') diff --git a/scripts/compile-contracts.ts b/scripts/compile-contracts.ts index 6595c50f2..24f82af48 100644 --- a/scripts/compile-contracts.ts +++ b/scripts/compile-contracts.ts @@ -2,7 +2,7 @@ import { execSync } from 'child_process' import { copyFileSync, mkdirSync, readdirSync, renameSync, rmdirSync } from 'fs' import { resolve } from 'path' -import { bold } from './_common' +import { bold, brightItalic } from './_common' function main() { const files = findFiles() @@ -73,8 +73,6 @@ function generateABIs({ rootDir, contracts }: Files) { /** * Rename ugly names generated by solc to something human redable. - * NOTE: we assume that there is only one contract per file - * // TODO: No longer — let's talk about it. Did I miss sth? */ function renameUglyNames({ outDir, contracts }: Files) { console.log(bold('Renaming ABIs')) @@ -84,6 +82,7 @@ function renameUglyNames({ outDir, contracts }: Files) { const outputs = readdirSync(directory) const fileNamesSeen = new Map() + const newNames: string[] = [] for (const file of outputs) { const [, fileName, contractName, extension] = file.match( new RegExp(`^_?_?contracts_${version}_([A-Za-z0-9-]+)_sol_([A-Za-z0-9-]*)\\.([a-z]+)$`), @@ -99,9 +98,14 @@ function renameUglyNames({ outDir, contracts }: Files) { newName = `${contractName}.${extension}` } - console.log(file, ' => ', newName) + newNames.push(newName) renameSync(resolve(directory, file), resolve(directory, newName)) } + + console.log( + `Renamed ${bold(newNames.length)} files in ${bold(version)}:` + + brightItalic(newNames.reduce((a, v, i) => (i % 2 === 0 ? a + '\n' + v : a + ' ' + v), '')), + ) } } From 0472e11033042287ede679609b02f80d7cc0a258 Mon Sep 17 00:00:00 2001 From: hasparus Date: Mon, 11 Oct 2021 15:15:57 +0200 Subject: [PATCH 9/9] Add changeset --- .changeset/itchy-gifts-deliver.md | 5 +++++ .eslintrc.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/itchy-gifts-deliver.md diff --git a/.changeset/itchy-gifts-deliver.md b/.changeset/itchy-gifts-deliver.md new file mode 100644 index 000000000..d10510062 --- /dev/null +++ b/.changeset/itchy-gifts-deliver.md @@ -0,0 +1,5 @@ +--- +'typechain': minor +--- + +Escaped reserved words in argument names diff --git a/.eslintrc.js b/.eslintrc.js index e5464cefc..3e819464d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -12,7 +12,7 @@ module.exports = { }, rules: { // this gets inlined into a package eslint, so it means: use current package's package.info or the one at the project root - 'import/no-extraneous-dependencies': ['error', { packageDir: ['./', __dirname], }], + 'import/no-extraneous-dependencies': ['error', { packageDir: ['./', __dirname] }], 'unused-imports/no-unused-imports-ts': 'error', 'simple-import-sort/imports': 'error', 'simple-import-sort/exports': 'error',