├── src
├── networks
│ ├── arbitrum.json
│ ├── goerli.json
│ ├── kovan.json
│ ├── mainnet.json
│ ├── matic.json
│ ├── mumbai.json
│ ├── rinkeby.json
│ ├── ropsten.json
│ ├── arbitrum-testnet.json
│ └── ganache.json
├── .gitignore
├── .npmignore
├── README.md
├── gen
│ ├── adapter
│ │ ├── commons.js
│ │ ├── index.js
│ │ └── factories
│ │ │ ├── ILootExpansion__factory.js
│ │ │ ├── MockExpansionNoFee__factory.js
│ │ │ ├── MockExpansionNonCompliant__factory.js
│ │ │ ├── Migrations__factory.js
│ │ │ └── MockExpansion__factory.js
│ └── typechain
│ │ ├── commons.ts
│ │ ├── index.ts
│ │ ├── factories
│ │ ├── ILootExpansion__factory.ts
│ │ ├── MockExpansionNoFee__factory.ts
│ │ ├── MockExpansionNonCompliant__factory.ts
│ │ ├── Migrations__factory.ts
│ │ ├── MockExpansion__factory.ts
│ │ └── LootRegistry__factory.ts
│ │ ├── MockExpansionNonCompliant.d.ts
│ │ ├── MockExpansionNoFee.d.ts
│ │ ├── ILootExpansion.d.ts
│ │ ├── Migrations.d.ts
│ │ └── MockExpansion.d.ts
├── artifacts
│ ├── @openzeppelin
│ │ └── contracts
│ │ │ ├── utils
│ │ │ ├── Context.sol
│ │ │ │ └── Context.json
│ │ │ ├── Address.sol
│ │ │ │ └── Address.json
│ │ │ ├── Strings.sol
│ │ │ │ └── Strings.json
│ │ │ ├── EnumerableMap.sol
│ │ │ │ └── EnumerableMap.json
│ │ │ └── EnumerableSet.sol
│ │ │ │ └── EnumerableSet.json
│ │ │ ├── math
│ │ │ └── SafeMath.sol
│ │ │ │ └── SafeMath.json
│ │ │ ├── introspection
│ │ │ ├── ERC165.sol
│ │ │ │ └── ERC165.json
│ │ │ └── IERC165.sol
│ │ │ │ └── IERC165.json
│ │ │ └── token
│ │ │ └── ERC721
│ │ │ ├── IERC721Receiver.sol
│ │ │ └── IERC721Receiver.json
│ │ │ ├── IERC721.sol
│ │ │ └── IERC721.json
│ │ │ ├── IERC721Metadata.sol
│ │ │ └── IERC721Metadata.json
│ │ │ └── IERC721Enumerable.sol
│ │ │ └── IERC721Enumerable.json
│ └── contracts
│ │ ├── interfaces
│ │ └── ILootExpansion.sol
│ │ │ └── ILootExpansion.json
│ │ ├── mocks
│ │ ├── MockExpansionNoFee.sol
│ │ │ └── MockExpansionNoFee.json
│ │ ├── MockExpansionNonCompliant.sol
│ │ │ └── MockExpansionNonCompliant.json
│ │ └── MockExpansion.sol
│ │ │ └── MockExpansion.json
│ │ └── migrations
│ │ └── Migrations.sol
│ │ └── Migrations.json
├── contracts
│ ├── mocks
│ │ ├── MockExpansionNonCompliant.sol
│ │ ├── MockExpansionNoFee.sol
│ │ └── MockExpansion.sol
│ ├── migrations
│ │ └── Migrations.sol
│ ├── interfaces
│ │ └── ILootExpansion.sol
│ └── LootRegistry.sol
└── package.json
├── .eslintignore
├── .gitattributes
├── .solcover.js
├── config
└── PROD.env.sample
├── README.md
├── .prettierrc
├── .gitignore
├── tests
├── utils
│ ├── helpers.ts
│ └── index.ts
└── LootRegistry.spec.ts
├── typings
├── truffle.d.ts
├── chai-bn.ts
└── chai-bignumber.d.ts
├── .solhint.json
├── tsconfig.json
├── .eslintrc.js
├── hardhat.config.ts
├── utils
├── config-loader.ts
└── deploy-contracts.ts
└── package.json
/src/networks/arbitrum.json:
--------------------------------------------------------------------------------
1 | [
2 | ]
--------------------------------------------------------------------------------
/src/networks/goerli.json:
--------------------------------------------------------------------------------
1 | [
2 | ]
--------------------------------------------------------------------------------
/src/networks/kovan.json:
--------------------------------------------------------------------------------
1 | [
2 | ]
--------------------------------------------------------------------------------
/src/networks/mainnet.json:
--------------------------------------------------------------------------------
1 | [
2 | ]
--------------------------------------------------------------------------------
/src/networks/matic.json:
--------------------------------------------------------------------------------
1 | [
2 | ]
--------------------------------------------------------------------------------
/src/networks/mumbai.json:
--------------------------------------------------------------------------------
1 | [
2 | ]
--------------------------------------------------------------------------------
/src/networks/rinkeby.json:
--------------------------------------------------------------------------------
1 | [
2 | ]
--------------------------------------------------------------------------------
/src/networks/ropsten.json:
--------------------------------------------------------------------------------
1 | [
2 | ]
--------------------------------------------------------------------------------
/src/networks/arbitrum-testnet.json:
--------------------------------------------------------------------------------
1 | [
2 | ]
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | .eslintrc.js
2 | node_modules
3 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.sol linguist-language=Solidity
2 |
--------------------------------------------------------------------------------
/src/.gitignore:
--------------------------------------------------------------------------------
1 | cache
2 | artifacts/build-info
3 | artifacts/**/*.dbg.json
4 |
--------------------------------------------------------------------------------
/src/.npmignore:
--------------------------------------------------------------------------------
1 | cache
2 | artifacts/build-info
3 | artifacts/**/*.dbg.json
4 |
--------------------------------------------------------------------------------
/.solcover.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | skipFiles: ['mocks', 'migrations']
3 | }
4 |
--------------------------------------------------------------------------------
/config/PROD.env.sample:
--------------------------------------------------------------------------------
1 | ETH_MNEMONIC=""
2 | INFURA_API_KEY=""
3 | ETHERSCAN=""
4 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Loot Expansion Contracts
2 | ===============================
3 |
4 |
5 | ## LICENSE
6 |
--------------------------------------------------------------------------------
/src/README.md:
--------------------------------------------------------------------------------
1 | lootproject/expansions-contracts
2 | ============================
3 |
4 | ## LICENSE
5 |
6 |
--------------------------------------------------------------------------------
/src/networks/ganache.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "contractName": "ExampleContract",
4 | "address": "0xc52Ae9dbAA394785177E20e25432aE67f76E4e15"
5 | }
6 | ]
--------------------------------------------------------------------------------
/src/gen/adapter/commons.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | /* Autogenerated file. Do not edit manually. */
3 | /* tslint:disable */
4 | /* eslint-disable */
5 | exports.__esModule = true;
6 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "tabWidth": 2,
3 | "useTabs": false,
4 | "semi": false,
5 | "singleQuote": true,
6 | "trailingComma": "none",
7 | "arrowParens": "avoid",
8 | "printWidth": 130
9 | }
10 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .vscode
2 | node_modules/
3 |
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | lerna-debug.log*
8 |
9 | *.js.map
10 | build
11 | coverage
12 | coverage.json
13 |
14 | config/*.env
15 |
--------------------------------------------------------------------------------
/tests/utils/helpers.ts:
--------------------------------------------------------------------------------
1 | // Check if tx was Reverted with specified message
2 | export function RevertError(errorMessage?: string) {
3 | let prefix = 'VM Exception while processing transaction: revert'
4 | return errorMessage ? `${prefix + ' ' + errorMessage}` : prefix
5 | }
--------------------------------------------------------------------------------
/src/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.json:
--------------------------------------------------------------------------------
1 | {
2 | "_format": "hh-sol-artifact-1",
3 | "contractName": "Context",
4 | "sourceName": "@openzeppelin/contracts/utils/Context.sol",
5 | "abi": [],
6 | "bytecode": "0x",
7 | "deployedBytecode": "0x",
8 | "linkReferences": {},
9 | "deployedLinkReferences": {}
10 | }
11 |
--------------------------------------------------------------------------------
/typings/truffle.d.ts:
--------------------------------------------------------------------------------
1 | declare module 'truffle' {
2 | import * as truffle from 'truffle-contract'
3 |
4 | interface ArtifactsGlobal {
5 | require(name: string): truffle.TruffleContract
6 | }
7 |
8 | global {
9 | function contract(name: string, callback: (accounts: Array) => void): void
10 | const artifacts: ArtifactsGlobal
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/typings/chai-bn.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | ///
3 |
4 | declare module 'chai-bn' {
5 | function chaiBN(bignumber: any): (chai: any, utils: any) => void
6 |
7 | namespace chaiBN {}
8 |
9 | export = chaiBN
10 | }
11 |
12 | declare namespace Chai {
13 | interface Equal {
14 | BN: any
15 | }
16 | interface NumberComparer {
17 | BN: any
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/contracts/mocks/MockExpansionNonCompliant.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.7.6;
2 | import "@openzeppelin/contracts/utils/Strings.sol";
3 |
4 | contract MockExpansionNonCompliant {
5 | using Strings for uint256;
6 |
7 | // To signal being a loot Expansion contract
8 | function tokenUri(uint256 lootId) external pure returns (string memory) {
9 | return string(abi.encodePacked("https://baseURI.net/", lootId.toString()));
10 | }
11 | }
--------------------------------------------------------------------------------
/src/contracts/mocks/MockExpansionNoFee.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.7.6;
2 | import "@openzeppelin/contracts/utils/Strings.sol";
3 |
4 | contract MockExpansionNoFee {
5 | using Strings for uint256;
6 |
7 | // To signal being a loot Expansion contract
8 | function lootExpansionTokenUri(uint256 lootId) external view returns (string memory tokenUri) {
9 | return string(abi.encodePacked("https://baseURI.net/", lootId.toString()));
10 | }
11 | }
--------------------------------------------------------------------------------
/typings/chai-bignumber.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | declare module 'chai-bignumber' {
4 | function chaiBignumber(bignumber: any): (chai: any, utils: any) => void
5 |
6 | namespace chaiBignumber {}
7 |
8 | export = chaiBignumber
9 | }
10 |
11 | declare namespace Chai {
12 | // For BDD API
13 | interface Assertion extends LanguageChains, NumericComparison, TypeComparison {
14 | bignumber: Assertion
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "expansions-contracts",
3 | "version": "0.0.1",
4 | "description": "Loot Expansion Registry Contracts",
5 | "repository": "https://github.com/lootproject/expansions-contracts",
6 | "license": "Apache-2.0",
7 | "main": "gen/adapter/index.js",
8 | "types": "gen/typechain/index.ts",
9 | "scripts": {},
10 | "optionalDependencies": {
11 | "ethers": "^5.0.32"
12 | },
13 | "dependencies": {},
14 | "devDependencies": {
15 | "@openzeppelin/contracts": "3.4.2-solc-0.7"
16 | },
17 | "keywords": [
18 | "Ethereum"
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/src/gen/typechain/commons.ts:
--------------------------------------------------------------------------------
1 | /* Autogenerated file. Do not edit manually. */
2 | /* tslint:disable */
3 | /* eslint-disable */
4 |
5 | import { EventFilter, Event } from "ethers";
6 | import { Result } from "@ethersproject/abi";
7 |
8 | export interface TypedEventFilter<_EventArgsArray, _EventArgsObject>
9 | extends EventFilter {}
10 |
11 | export interface TypedEvent extends Event {
12 | args: EventArgs;
13 | }
14 |
15 | export type TypedListener<
16 | EventArgsArray extends Array,
17 | EventArgsObject
18 | > = (
19 | ...listenerArg: [
20 | ...EventArgsArray,
21 | TypedEvent
22 | ]
23 | ) => void;
24 |
--------------------------------------------------------------------------------
/src/contracts/migrations/Migrations.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: Apache-2.0
2 | pragma solidity 0.7.6;
3 |
4 |
5 | contract Migrations {
6 | address public owner;
7 | uint public last_completed_migration;
8 |
9 | constructor() public {
10 | owner = msg.sender;
11 | }
12 |
13 | modifier restricted() {
14 | if (msg.sender == owner)
15 | _;
16 | }
17 |
18 | function setCompleted(uint completed) public restricted {
19 | last_completed_migration = completed;
20 | }
21 |
22 | function upgrade(address new_address) public restricted {
23 | Migrations upgraded = Migrations(new_address);
24 | upgraded.setCompleted(last_completed_migration);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/tests/utils/index.ts:
--------------------------------------------------------------------------------
1 | import * as chai from 'chai'
2 | import chaiAsPromised from 'chai-as-promised'
3 | import chaiString from 'chai-string'
4 | import * as ethers from 'ethers'
5 |
6 | import BN = require('bn.js') // used by web3
7 |
8 | export * from './helpers'
9 |
10 | const BigNumber = ethers.BigNumber
11 | export { BigNumber }
12 |
13 | export const { assert, expect } = chai
14 | .use(chaiString)
15 | .use(chaiAsPromised)
16 | .use(require('chai-bignumber')(BigNumber)) // Used by ethers.js & waffle
17 | .use(require('bn-chai')(BN)) // Used by Web3 & truffle
18 |
19 | export function b(raw: ethers.BigNumberish): ethers.BigNumber {
20 | return ethers.BigNumber.from(raw)
21 | }
22 |
--------------------------------------------------------------------------------
/src/contracts/interfaces/ILootExpansion.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.7.6;
2 |
3 | interface ILootExpansion {
4 | // To signal being a loot Expansion contract
5 | function lootExpansionTokenUri(uint256 lootId) external view returns (string memory tokenUri);
6 |
7 | // Returns the fee the expansion is charging per claim
8 | function claimFeeAmount() external view returns (uint256 feeAmount);
9 |
10 | // Returns the address to which the fee should be sent to
11 | function claimFeeRecipient() external view returns (address feeRecipient);
12 |
13 | // Return the maximum supply for this expansion. If none, return 2**256-1
14 | function maxSupply() external view returns (uint256 expansionMaxSupply);
15 | }
--------------------------------------------------------------------------------
/src/artifacts/@openzeppelin/contracts/utils/Address.sol/Address.json:
--------------------------------------------------------------------------------
1 | {
2 | "_format": "hh-sol-artifact-1",
3 | "contractName": "Address",
4 | "sourceName": "@openzeppelin/contracts/utils/Address.sol",
5 | "abi": [],
6 | "bytecode": "0x60566023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220ff80c1cd1665c16a698ccc713855c8e04b4b0411a7535e379d997a706e7f14cb64736f6c63430007060033",
7 | "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220ff80c1cd1665c16a698ccc713855c8e04b4b0411a7535e379d997a706e7f14cb64736f6c63430007060033",
8 | "linkReferences": {},
9 | "deployedLinkReferences": {}
10 | }
11 |
--------------------------------------------------------------------------------
/src/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.json:
--------------------------------------------------------------------------------
1 | {
2 | "_format": "hh-sol-artifact-1",
3 | "contractName": "Strings",
4 | "sourceName": "@openzeppelin/contracts/utils/Strings.sol",
5 | "abi": [],
6 | "bytecode": "0x60566023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122043f7461f1728a33ff96fbc70e2b6011b84b32d3609fe07647100a6861eeaa7cc64736f6c63430007060033",
7 | "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122043f7461f1728a33ff96fbc70e2b6011b84b32d3609fe07647100a6861eeaa7cc64736f6c63430007060033",
8 | "linkReferences": {},
9 | "deployedLinkReferences": {}
10 | }
11 |
--------------------------------------------------------------------------------
/src/artifacts/@openzeppelin/contracts/math/SafeMath.sol/SafeMath.json:
--------------------------------------------------------------------------------
1 | {
2 | "_format": "hh-sol-artifact-1",
3 | "contractName": "SafeMath",
4 | "sourceName": "@openzeppelin/contracts/math/SafeMath.sol",
5 | "abi": [],
6 | "bytecode": "0x60566023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122007ba3be99120b8d191a452bb38aef0b3c152b140866a6e63142d088e926df69064736f6c63430007060033",
7 | "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122007ba3be99120b8d191a452bb38aef0b3c152b140866a6e63142d088e926df69064736f6c63430007060033",
8 | "linkReferences": {},
9 | "deployedLinkReferences": {}
10 | }
11 |
--------------------------------------------------------------------------------
/src/artifacts/@openzeppelin/contracts/utils/EnumerableMap.sol/EnumerableMap.json:
--------------------------------------------------------------------------------
1 | {
2 | "_format": "hh-sol-artifact-1",
3 | "contractName": "EnumerableMap",
4 | "sourceName": "@openzeppelin/contracts/utils/EnumerableMap.sol",
5 | "abi": [],
6 | "bytecode": "0x60566023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220a228c6e32b5403d39ad07c8ddf94d22b7ac5e1616afcf9e3d91e9028efa2031f64736f6c63430007060033",
7 | "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220a228c6e32b5403d39ad07c8ddf94d22b7ac5e1616afcf9e3d91e9028efa2031f64736f6c63430007060033",
8 | "linkReferences": {},
9 | "deployedLinkReferences": {}
10 | }
11 |
--------------------------------------------------------------------------------
/src/artifacts/@openzeppelin/contracts/utils/EnumerableSet.sol/EnumerableSet.json:
--------------------------------------------------------------------------------
1 | {
2 | "_format": "hh-sol-artifact-1",
3 | "contractName": "EnumerableSet",
4 | "sourceName": "@openzeppelin/contracts/utils/EnumerableSet.sol",
5 | "abi": [],
6 | "bytecode": "0x60566023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220846bcaf516f3fa7c51139078247293205fc85b8d02aecfa1fa619eb9ae0d3aa764736f6c63430007060033",
7 | "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220846bcaf516f3fa7c51139078247293205fc85b8d02aecfa1fa619eb9ae0d3aa764736f6c63430007060033",
8 | "linkReferences": {},
9 | "deployedLinkReferences": {}
10 | }
11 |
--------------------------------------------------------------------------------
/src/artifacts/@openzeppelin/contracts/introspection/ERC165.sol/ERC165.json:
--------------------------------------------------------------------------------
1 | {
2 | "_format": "hh-sol-artifact-1",
3 | "contractName": "ERC165",
4 | "sourceName": "@openzeppelin/contracts/introspection/ERC165.sol",
5 | "abi": [
6 | {
7 | "inputs": [
8 | {
9 | "internalType": "bytes4",
10 | "name": "interfaceId",
11 | "type": "bytes4"
12 | }
13 | ],
14 | "name": "supportsInterface",
15 | "outputs": [
16 | {
17 | "internalType": "bool",
18 | "name": "",
19 | "type": "bool"
20 | }
21 | ],
22 | "stateMutability": "view",
23 | "type": "function"
24 | }
25 | ],
26 | "bytecode": "0x",
27 | "deployedBytecode": "0x",
28 | "linkReferences": {},
29 | "deployedLinkReferences": {}
30 | }
31 |
--------------------------------------------------------------------------------
/src/artifacts/@openzeppelin/contracts/introspection/IERC165.sol/IERC165.json:
--------------------------------------------------------------------------------
1 | {
2 | "_format": "hh-sol-artifact-1",
3 | "contractName": "IERC165",
4 | "sourceName": "@openzeppelin/contracts/introspection/IERC165.sol",
5 | "abi": [
6 | {
7 | "inputs": [
8 | {
9 | "internalType": "bytes4",
10 | "name": "interfaceId",
11 | "type": "bytes4"
12 | }
13 | ],
14 | "name": "supportsInterface",
15 | "outputs": [
16 | {
17 | "internalType": "bool",
18 | "name": "",
19 | "type": "bool"
20 | }
21 | ],
22 | "stateMutability": "view",
23 | "type": "function"
24 | }
25 | ],
26 | "bytecode": "0x",
27 | "deployedBytecode": "0x",
28 | "linkReferences": {},
29 | "deployedLinkReferences": {}
30 | }
31 |
--------------------------------------------------------------------------------
/.solhint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "solhint:recommended",
3 | "rules": {
4 | "quotes": "off",
5 | "const-name-snakecase": "off",
6 | "contract-name-camelcase": "off",
7 | "event-name-camelcase": "off",
8 | "func-name-mixedcase": "off",
9 | "func-param-name-mixedcase": "off",
10 | "modifier-name-mixedcase": "off",
11 | "private-vars-leading-underscore": "off",
12 | "use-forbidden-name": "off",
13 | "var-name-mixedcase": "off",
14 | "func-order": "off",
15 | "imports-on-top": "off",
16 | "ordering": "off",
17 | "no-unused-vars": "off",
18 | "no-inline-assembly": "off",
19 | "visibility-modifier-order": "off",
20 | "compiler-version": ["error", "0.7.6"],
21 | "func-visibility": ["warn", {"ignoreConstructors":true}],
22 | "reason-string": ["warn", {"maxLength": 96}]
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/gen/typechain/index.ts:
--------------------------------------------------------------------------------
1 | /* Autogenerated file. Do not edit manually. */
2 | /* tslint:disable */
3 | /* eslint-disable */
4 | export type { ILootExpansion } from "./ILootExpansion";
5 | export type { LootRegistry } from "./LootRegistry";
6 | export type { Migrations } from "./Migrations";
7 | export type { MockExpansion } from "./MockExpansion";
8 | export type { MockExpansionNoFee } from "./MockExpansionNoFee";
9 | export type { MockExpansionNonCompliant } from "./MockExpansionNonCompliant";
10 |
11 | export { ILootExpansion__factory } from "./factories/ILootExpansion__factory";
12 | export { LootRegistry__factory } from "./factories/LootRegistry__factory";
13 | export { Migrations__factory } from "./factories/Migrations__factory";
14 | export { MockExpansion__factory } from "./factories/MockExpansion__factory";
15 | export { MockExpansionNoFee__factory } from "./factories/MockExpansionNoFee__factory";
16 | export { MockExpansionNonCompliant__factory } from "./factories/MockExpansionNonCompliant__factory";
17 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2017",
4 | "module": "commonjs",
5 | "moduleResolution": "node",
6 | "sourceMap": true,
7 | "allowSyntheticDefaultImports": true,
8 | "resolveJsonModule": true,
9 | "downlevelIteration": true,
10 | "importHelpers": true,
11 | "removeComments": false,
12 |
13 | "strictNullChecks": true,
14 | "noImplicitUseStrict": true,
15 | "noImplicitAny": false,
16 | "noImplicitReturns": true,
17 | "noImplicitThis": true,
18 | "noUnusedParameters": false,
19 | "noErrorTruncation": true,
20 | "esModuleInterop": true,
21 |
22 | "experimentalDecorators": true,
23 | "forceConsistentCasingInFileNames": true,
24 | "allowJs": false,
25 | "checkJs": false,
26 |
27 | "baseUrl": ".",
28 | "outDir": "build",
29 | "lib": ["es2017", "dom"],
30 |
31 | "typeRoots": [
32 | "./node_modules/@types"
33 | ]
34 | },
35 |
36 | "include": [
37 | "typings", "tests", "utils"
38 | ],
39 |
40 | "files": ["./hardhat.config.ts"],
41 |
42 | "exclude": [
43 | "node_modules",
44 | "dist"
45 | ]
46 | }
47 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | const { off } = require("process")
2 |
3 | module.exports = {
4 | parser: '@typescript-eslint/parser',
5 | parserOptions: {
6 | ecmaVersion: 2018,
7 | sourceType: 'module'
8 | },
9 |
10 | extends: [
11 | 'plugin:@typescript-eslint/recommended',
12 | 'plugin:import/errors',
13 | 'plugin:import/warnings',
14 | 'plugin:import/typescript',
15 | 'prettier'
16 | ],
17 |
18 | rules: {
19 | '@typescript-eslint/no-unused-vars': 'off',
20 | '@typescript-eslint/no-explicit-any': 'off',
21 | '@typescript-eslint/no-non-null-assertion': 'off',
22 | '@typescript-eslint/explicit-module-boundary-types': 'off',
23 | '@typescript-eslint/ban-types': 'off',
24 | '@typescript-eslint/ban-ts-comment': 'off',
25 | '@typescript-eslint/no-empty-function': 'off',
26 | '@typescript-eslint/no-inferrable-types': 'off',
27 | '@typescript-eslint/no-var-requires': 'off',
28 |
29 | 'prefer-spread': 'off',
30 | 'prefer-const': 'off',
31 |
32 | 'import/no-unresolved': 'off',
33 | // 'import/no-default-export': 2,
34 | 'import/no-named-as-default-member': 'off',
35 |
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/artifacts/@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol/IERC721Receiver.json:
--------------------------------------------------------------------------------
1 | {
2 | "_format": "hh-sol-artifact-1",
3 | "contractName": "IERC721Receiver",
4 | "sourceName": "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol",
5 | "abi": [
6 | {
7 | "inputs": [
8 | {
9 | "internalType": "address",
10 | "name": "operator",
11 | "type": "address"
12 | },
13 | {
14 | "internalType": "address",
15 | "name": "from",
16 | "type": "address"
17 | },
18 | {
19 | "internalType": "uint256",
20 | "name": "tokenId",
21 | "type": "uint256"
22 | },
23 | {
24 | "internalType": "bytes",
25 | "name": "data",
26 | "type": "bytes"
27 | }
28 | ],
29 | "name": "onERC721Received",
30 | "outputs": [
31 | {
32 | "internalType": "bytes4",
33 | "name": "",
34 | "type": "bytes4"
35 | }
36 | ],
37 | "stateMutability": "nonpayable",
38 | "type": "function"
39 | }
40 | ],
41 | "bytecode": "0x",
42 | "deployedBytecode": "0x",
43 | "linkReferences": {},
44 | "deployedLinkReferences": {}
45 | }
46 |
--------------------------------------------------------------------------------
/src/contracts/mocks/MockExpansion.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.7.6;
2 | import "@openzeppelin/contracts/utils/Strings.sol";
3 | import "../interfaces/ILootExpansion.sol";
4 |
5 | contract MockExpansion is ILootExpansion {
6 | using Strings for uint256;
7 | uint256 feeAmount;
8 | address feeRecipient;
9 |
10 | // Set the fee for claiming
11 | function setFee(uint256 _feeAmount) external {
12 | feeAmount = _feeAmount;
13 | }
14 |
15 | // Set the fee recipient for claiming
16 | function setRecipient(address _feeRecipient) external {
17 | feeRecipient = _feeRecipient;
18 | }
19 |
20 | // To signal being a loot Expansion contract
21 | function lootExpansionTokenUri(uint256 lootId) external override pure returns (string memory) {
22 | return string(abi.encodePacked("https://baseURI.net/", lootId.toString()));
23 | }
24 |
25 | // Returns the fee the expansion is charging per claim
26 | function claimFeeAmount() external override view returns (uint256) {
27 | return feeAmount;
28 | }
29 |
30 | // Returns the address to which the fee should be sent to
31 | function claimFeeRecipient() external override view returns (address) {
32 | return feeRecipient;
33 | }
34 |
35 | // Return the maximum supply for this expansion. If none, return 2**256-1
36 | function maxSupply() external view returns (uint256) {
37 | return 8000;
38 | }
39 | }
--------------------------------------------------------------------------------
/src/artifacts/contracts/interfaces/ILootExpansion.sol/ILootExpansion.json:
--------------------------------------------------------------------------------
1 | {
2 | "_format": "hh-sol-artifact-1",
3 | "contractName": "ILootExpansion",
4 | "sourceName": "contracts/interfaces/ILootExpansion.sol",
5 | "abi": [
6 | {
7 | "inputs": [],
8 | "name": "claimFeeAmount",
9 | "outputs": [
10 | {
11 | "internalType": "uint256",
12 | "name": "feeAmount",
13 | "type": "uint256"
14 | }
15 | ],
16 | "stateMutability": "view",
17 | "type": "function"
18 | },
19 | {
20 | "inputs": [],
21 | "name": "claimFeeRecipient",
22 | "outputs": [
23 | {
24 | "internalType": "address",
25 | "name": "feeRecipient",
26 | "type": "address"
27 | }
28 | ],
29 | "stateMutability": "view",
30 | "type": "function"
31 | },
32 | {
33 | "inputs": [
34 | {
35 | "internalType": "uint256",
36 | "name": "lootId",
37 | "type": "uint256"
38 | }
39 | ],
40 | "name": "lootExpansionTokenUri",
41 | "outputs": [
42 | {
43 | "internalType": "string",
44 | "name": "tokenUri",
45 | "type": "string"
46 | }
47 | ],
48 | "stateMutability": "view",
49 | "type": "function"
50 | }
51 | ],
52 | "bytecode": "0x",
53 | "deployedBytecode": "0x",
54 | "linkReferences": {},
55 | "deployedLinkReferences": {}
56 | }
57 |
--------------------------------------------------------------------------------
/src/gen/typechain/factories/ILootExpansion__factory.ts:
--------------------------------------------------------------------------------
1 | /* Autogenerated file. Do not edit manually. */
2 | /* tslint:disable */
3 | /* eslint-disable */
4 |
5 | import { Contract, Signer } from "ethers";
6 | import { Provider } from "@ethersproject/providers";
7 |
8 | import type { ILootExpansion } from "../ILootExpansion";
9 |
10 | export class ILootExpansion__factory {
11 | static connect(
12 | address: string,
13 | signerOrProvider: Signer | Provider
14 | ): ILootExpansion {
15 | return new Contract(address, _abi, signerOrProvider) as ILootExpansion;
16 | }
17 | }
18 |
19 | const _abi = [
20 | {
21 | inputs: [],
22 | name: "claimFeeAmount",
23 | outputs: [
24 | {
25 | internalType: "uint256",
26 | name: "feeAmount",
27 | type: "uint256",
28 | },
29 | ],
30 | stateMutability: "view",
31 | type: "function",
32 | },
33 | {
34 | inputs: [],
35 | name: "claimFeeRecipient",
36 | outputs: [
37 | {
38 | internalType: "address",
39 | name: "feeRecipient",
40 | type: "address",
41 | },
42 | ],
43 | stateMutability: "view",
44 | type: "function",
45 | },
46 | {
47 | inputs: [
48 | {
49 | internalType: "uint256",
50 | name: "lootId",
51 | type: "uint256",
52 | },
53 | ],
54 | name: "lootExpansionTokenUri",
55 | outputs: [
56 | {
57 | internalType: "string",
58 | name: "tokenUri",
59 | type: "string",
60 | },
61 | ],
62 | stateMutability: "view",
63 | type: "function",
64 | },
65 | ];
66 |
--------------------------------------------------------------------------------
/hardhat.config.ts:
--------------------------------------------------------------------------------
1 | import { HardhatUserConfig } from 'hardhat/config'
2 | import { networkConfig } from './utils/config-loader'
3 |
4 | import '@nomiclabs/hardhat-truffle5'
5 | import '@nomiclabs/hardhat-ethers'
6 | import '@nomiclabs/hardhat-web3'
7 | import '@nomiclabs/hardhat-etherscan'
8 | import "@tenderly/hardhat-tenderly"
9 |
10 | import 'hardhat-gas-reporter'
11 | import 'solidity-coverage'
12 |
13 | const ganacheNetwork = {
14 | url: 'http://127.0.0.1:8545',
15 | blockGasLimit: 6000000000
16 | }
17 |
18 | const config: HardhatUserConfig = {
19 | solidity: {
20 | version: '0.7.6',
21 | settings: {
22 | optimizer: {
23 | enabled: true,
24 | runs: 999999,
25 | details: {
26 | yul: true
27 | }
28 | }
29 | }
30 | },
31 | paths: {
32 | root: 'src',
33 | tests: '../tests'
34 | },
35 | networks: {
36 | mainnet: networkConfig('mainnet'),
37 | rinkeby: networkConfig('rinkeby'),
38 | ganache: ganacheNetwork,
39 | coverage: {
40 | url: 'http://localhost:8555'
41 | }
42 | },
43 | etherscan: {
44 | // Your API key for Etherscan
45 | // Obtain one at https://etherscan.io/
46 | apiKey: networkConfig('mainnet').etherscan
47 | },
48 | mocha: {
49 | timeout: process.env.COVERAGE ? 15 * 60 * 1000 : 30 * 1000
50 | },
51 | gasReporter: {
52 | enabled: !!process.env.REPORT_GAS === true,
53 | currency: 'USD',
54 | gasPrice: 21,
55 | showTimeSpent: true
56 | },
57 | tenderly: {
58 | project: "project/name",
59 | username: "username",
60 | }
61 | }
62 |
63 | export default config
64 |
--------------------------------------------------------------------------------
/src/gen/adapter/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3 | if (k2 === undefined) k2 = k;
4 | Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5 | }) : (function(o, m, k, k2) {
6 | if (k2 === undefined) k2 = k;
7 | o[k2] = m[k];
8 | }));
9 | exports.__esModule = true;
10 | exports.MockExpansionNonCompliant__factory = exports.MockExpansionNoFee__factory = exports.MockExpansion__factory = exports.Migrations__factory = exports.LootRegistry__factory = exports.ILootExpansion__factory = void 0;
11 | var ILootExpansion__factory_1 = require("./factories/ILootExpansion__factory");
12 | __createBinding(exports, ILootExpansion__factory_1, "ILootExpansion__factory");
13 | var LootRegistry__factory_1 = require("./factories/LootRegistry__factory");
14 | __createBinding(exports, LootRegistry__factory_1, "LootRegistry__factory");
15 | var Migrations__factory_1 = require("./factories/Migrations__factory");
16 | __createBinding(exports, Migrations__factory_1, "Migrations__factory");
17 | var MockExpansion__factory_1 = require("./factories/MockExpansion__factory");
18 | __createBinding(exports, MockExpansion__factory_1, "MockExpansion__factory");
19 | var MockExpansionNoFee__factory_1 = require("./factories/MockExpansionNoFee__factory");
20 | __createBinding(exports, MockExpansionNoFee__factory_1, "MockExpansionNoFee__factory");
21 | var MockExpansionNonCompliant__factory_1 = require("./factories/MockExpansionNonCompliant__factory");
22 | __createBinding(exports, MockExpansionNonCompliant__factory_1, "MockExpansionNonCompliant__factory");
23 |
--------------------------------------------------------------------------------
/src/gen/adapter/factories/ILootExpansion__factory.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | /* Autogenerated file. Do not edit manually. */
3 | /* tslint:disable */
4 | /* eslint-disable */
5 | exports.__esModule = true;
6 | exports.ILootExpansion__factory = void 0;
7 | var ethers_1 = require("ethers");
8 | var ILootExpansion__factory = /** @class */ (function () {
9 | function ILootExpansion__factory() {
10 | }
11 | ILootExpansion__factory.connect = function (address, signerOrProvider) {
12 | return new ethers_1.Contract(address, _abi, signerOrProvider);
13 | };
14 | return ILootExpansion__factory;
15 | }());
16 | exports.ILootExpansion__factory = ILootExpansion__factory;
17 | var _abi = [
18 | {
19 | inputs: [],
20 | name: "claimFeeAmount",
21 | outputs: [
22 | {
23 | internalType: "uint256",
24 | name: "feeAmount",
25 | type: "uint256"
26 | },
27 | ],
28 | stateMutability: "view",
29 | type: "function"
30 | },
31 | {
32 | inputs: [],
33 | name: "claimFeeRecipient",
34 | outputs: [
35 | {
36 | internalType: "address",
37 | name: "feeRecipient",
38 | type: "address"
39 | },
40 | ],
41 | stateMutability: "view",
42 | type: "function"
43 | },
44 | {
45 | inputs: [
46 | {
47 | internalType: "uint256",
48 | name: "lootId",
49 | type: "uint256"
50 | },
51 | ],
52 | name: "lootExpansionTokenUri",
53 | outputs: [
54 | {
55 | internalType: "string",
56 | name: "tokenUri",
57 | type: "string"
58 | },
59 | ],
60 | stateMutability: "view",
61 | type: "function"
62 | },
63 | ];
64 |
--------------------------------------------------------------------------------
/utils/config-loader.ts:
--------------------------------------------------------------------------------
1 | import * as dotenv from 'dotenv'
2 | import * as path from 'path'
3 | import { HttpNetworkConfig } from 'hardhat/types'
4 | import { ethers } from 'ethers'
5 |
6 | type EthereumNetworksTypes = 'rinkeby' | 'ropsten' | 'kovan' | 'goerli' | 'mainnet' | 'mumbai' | 'matic' | 'arbitrum' | 'arbitrum-testnet'
7 |
8 | export const getEnvConfig = (env: string) => {
9 | const envFile = path.resolve(__dirname, `../config/${env}.env`)
10 | const envLoad = dotenv.config({ path: envFile })
11 |
12 | if (envLoad.error) {
13 | console.warn('No config found, using default')
14 | return { ETH_MNEMONIC: ethers.Wallet.createRandom().mnemonic.phrase }
15 | }
16 |
17 | return envLoad.parsed || {}
18 | }
19 |
20 | export const networkGasMultiplier = (network: EthereumNetworksTypes): number => {
21 | switch (network) {
22 | case 'arbitrum-testnet':
23 | case 'arbitrum':
24 | return 5
25 |
26 | default:
27 | return 1
28 | }
29 | }
30 |
31 | export const networkRpcUrl = (network: EthereumNetworksTypes): string => {
32 | const config = getEnvConfig('PROD')
33 | return `https://${network}.infura.io/v3/${config['INFURA_API_KEY']}`
34 | }
35 |
36 | export const networkChainId = (network: EthereumNetworksTypes): number => {
37 | const config = getEnvConfig('PROD')
38 |
39 | switch (network) {
40 | case 'mumbai':
41 | return 80001
42 |
43 | case 'ropsten':
44 | return 3
45 |
46 | case 'matic':
47 | return 137
48 |
49 | case 'arbitrum-testnet':
50 | return 421611
51 |
52 | case 'arbitrum':
53 | return 42161
54 |
55 | case 'rinkeby':
56 | return 4
57 |
58 | case 'goerli':
59 | return 5
60 |
61 | case 'mainnet':
62 | return 1
63 |
64 | case 'kovan':
65 | return 42
66 | }
67 | }
68 |
69 | export const networkConfig = (network: EthereumNetworksTypes): HttpNetworkConfig & { etherscan?: string } => {
70 | const config = getEnvConfig('PROD')
71 | return {
72 | url: networkRpcUrl(network),
73 | chainId: networkChainId(network),
74 | accounts: {
75 | mnemonic: config['ETH_MNEMONIC'],
76 | initialIndex: 0,
77 | count: 10,
78 | path: `m/44'/60'/0'/0`
79 | },
80 | gas: 'auto',
81 | gasPrice: 'auto',
82 | gasMultiplier: networkGasMultiplier(network),
83 | timeout: 20000,
84 | httpHeaders: {},
85 | etherscan: config['ETHERSCAN']
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/utils/deploy-contracts.ts:
--------------------------------------------------------------------------------
1 | import { network, run, config, tenderly } from 'hardhat'
2 | import * as _ from 'lodash'
3 | import ora from 'ora'
4 |
5 | import {
6 | Example__factory,
7 | } from '../src/gen/typechain'
8 |
9 | import { UniversalDeployer } from '@0xsequence/deployer'
10 | import { ContractFactory, BigNumber, providers } from 'ethers'
11 | import fs from 'fs'
12 |
13 | const prompt = ora()
14 |
15 | /**
16 | * @notice Deploy contract via universal deployer
17 | */
18 |
19 | const provider = new providers.Web3Provider(network.provider.send)
20 | const signer = provider.getSigner()
21 | const universalDeployer = new UniversalDeployer(network.name, signer.provider)
22 | const txParams = {
23 | gasLimit: 6000000,
24 | gasPrice: BigNumber.from(10)
25 | .pow(9)
26 | .mul(16)
27 | }
28 |
29 | const attempVerify = async (name: string, _: new () => T, address: string, ...args: Parameters) => {
30 | try {
31 | await run("verify:verify", {
32 | address: address,
33 | constructorArguments: args,
34 | })
35 | } catch {}
36 |
37 | try {
38 | await tenderly.verify({
39 | name: name,
40 | address: address,
41 | })
42 | } catch {}
43 | }
44 |
45 | const buildNetworkJson = (...contracts: { name: string, address: string }[]) => {
46 | return contracts.map((c) => ({
47 | contractName: c.name,
48 | address: c.address
49 | }))
50 | }
51 |
52 | const main = async () => {
53 | prompt.info(`Network Name: ${network.name}`)
54 | prompt.info(`Local Deployer Address: ${await signer.getAddress()}`)
55 | prompt.info(`Local Deployer Balance: ${await signer.getBalance()}`)
56 |
57 | // Deploying contracts
58 | const exampleContract = await universalDeployer.deploy('Example', Example__factory, txParams)
59 |
60 | // Logger
61 | prompt.start(`writing deployment information to ${network.name}.json`)
62 | fs.writeFileSync(`./src/networks/${network.name}.json`, JSON.stringify(buildNetworkJson(
63 | { name: "ExampleContract", address: exampleContract.address },
64 | ), null, 2))
65 | prompt.succeed()
66 |
67 | // Verifying contracts via Tenderly
68 | prompt.start(`verifying contracts`)
69 | await attempVerify("Factory", Example__factory, exampleContract.address)
70 |
71 | prompt.succeed()
72 | }
73 |
74 | // We recommend this pattern to be able to use async/await everywhere
75 | // and properly handle errors.
76 | main()
77 | .then(() => {
78 | process.exit(0)
79 | })
80 | .catch(error => {
81 | console.error(error)
82 | process.exit(1)
83 | })
84 |
--------------------------------------------------------------------------------
/src/contracts/LootRegistry.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.7.6;
2 | import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
3 | import "./interfaces/ILootExpansion.sol";
4 |
5 | contract LootRegistry is ERC721 {
6 |
7 | // Track all expansions in an array
8 | address[] public expansions;
9 |
10 | // Mapping between expansion ID and its address
11 | mapping (uint256 => address) public expansionIDtoAddress;
12 |
13 | // Mapping between expansion address and its ID
14 | mapping (address => uint256) public expansionAddressToID;
15 |
16 | // Register the claiming fee amount for each expansion
17 | mapping (address => uint256) public claimingFee;
18 |
19 | // Register the claiming fee recipient for each expansion
20 | mapping (address => address) public feeRecipient;
21 |
22 | // Events
23 | event ExpansionRegistered(address indexed expansionAddress, uint256 indexed expansionID, uint256 indexed feeAmount, address feeRecipient);
24 |
25 | constructor() ERC721("LootRegistry", "LootExpansion") {}
26 |
27 | /**
28 | * @notice Will add a new loot expansion contract in the registry
29 | * @param _expansionAddress Address of the expansion contract to add to registry
30 | */
31 | function registerLootExpansion(address _expansionAddress) external {
32 | require(
33 | expansionAddressToID[_expansionAddress] == 0,
34 | "LootRegistry#registerLootExpansion: Expansion already registered"
35 | );
36 |
37 | // Check if contract implements lootExpansionTokenUri and if it returns anything
38 | try ILootExpansion(_expansionAddress).lootExpansionTokenUri(1) returns (string memory _uri) {
39 | require(bytes(_uri).length > 0, "LootRegistry#registerLootExpansion: Expansion doesn't support lootExpansionTokenUri");
40 | } catch {
41 | revert("LootRegistry#registerLootExpansion: Expansion doesn't support lootExpansionTokenUri");
42 | }
43 |
44 | // Register expansion information
45 | expansions.push(_expansionAddress);
46 | uint256 expansionID = expansions.length;
47 | expansionIDtoAddress[expansionID] = _expansionAddress;
48 | expansionAddressToID[_expansionAddress] = expansionID;
49 |
50 | // Try see if expansion implements a fee
51 | try ILootExpansion(_expansionAddress).claimFeeAmount() returns (uint256 _fee) {
52 | claimingFee[_expansionAddress] = _fee;
53 | feeRecipient[_expansionAddress] = ILootExpansion(_expansionAddress).claimFeeRecipient();
54 | } catch {
55 | // Do nothing
56 | }
57 |
58 | // Emit event of expansion registration
59 | emit ExpansionRegistered(_expansionAddress, expansionID, claimingFee[_expansionAddress] , feeRecipient[_expansionAddress]);
60 | }
61 |
62 | /**
63 | * @notice Return array of all expansions registered
64 | */
65 | function getExpansions() external view returns (address[] memory) {
66 | return expansions;
67 | }
68 |
69 | }
--------------------------------------------------------------------------------
/src/gen/typechain/factories/MockExpansionNoFee__factory.ts:
--------------------------------------------------------------------------------
1 | /* Autogenerated file. Do not edit manually. */
2 | /* tslint:disable */
3 | /* eslint-disable */
4 |
5 | import { Signer, Contract, ContractFactory, Overrides } from "ethers";
6 | import { Provider, TransactionRequest } from "@ethersproject/providers";
7 |
8 | import type { MockExpansionNoFee } from "../MockExpansionNoFee";
9 |
10 | export class MockExpansionNoFee__factory extends ContractFactory {
11 | constructor(signer?: Signer) {
12 | super(_abi, _bytecode, signer);
13 | }
14 |
15 | deploy(
16 | overrides?: Overrides & { from?: string | Promise }
17 | ): Promise {
18 | return super.deploy(overrides || {}) as Promise;
19 | }
20 | getDeployTransaction(
21 | overrides?: Overrides & { from?: string | Promise }
22 | ): TransactionRequest {
23 | return super.getDeployTransaction(overrides || {});
24 | }
25 | attach(address: string): MockExpansionNoFee {
26 | return super.attach(address) as MockExpansionNoFee;
27 | }
28 | connect(signer: Signer): MockExpansionNoFee__factory {
29 | return super.connect(signer) as MockExpansionNoFee__factory;
30 | }
31 | static connect(
32 | address: string,
33 | signerOrProvider: Signer | Provider
34 | ): MockExpansionNoFee {
35 | return new Contract(address, _abi, signerOrProvider) as MockExpansionNoFee;
36 | }
37 | }
38 |
39 | const _abi = [
40 | {
41 | inputs: [
42 | {
43 | internalType: "uint256",
44 | name: "lootId",
45 | type: "uint256",
46 | },
47 | ],
48 | name: "lootExpansionTokenUri",
49 | outputs: [
50 | {
51 | internalType: "string",
52 | name: "tokenUri",
53 | type: "string",
54 | },
55 | ],
56 | stateMutability: "view",
57 | type: "function",
58 | },
59 | ];
60 |
61 | const _bytecode =
62 | "0x608060405234801561001057600080fd5b506102e4806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80633f5c50c414610030575b600080fd5b61004d6004803603602081101561004657600080fd5b50356100c2565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561008757818101518382015260200161006f565b50505050905090810190601f1680156100b45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60606100cd82610181565b60405160200180807f68747470733a2f2f626173655552492e6e65742f00000000000000000000000081525060140182805190602001908083835b6020831061014557805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610108565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405290505b919050565b6060816101c2575060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015261017c565b8160005b81156101da57600101600a820491506101c6565b60008167ffffffffffffffff811180156101f357600080fd5b506040519080825280601f01601f19166020018201604052801561021e576020820181803683370190505b5085935090507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82015b83156102a557600a840660300160f81b8282806001900393508151811061026b57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a84049350610248565b5094935050505056fea26469706673582212203d9b8b351ebe40fc2d9d02651e14ee5df6866c6bdf6e3ddc92b39fadff4a6d6e64736f6c63430007060033";
63 |
--------------------------------------------------------------------------------
/src/gen/typechain/factories/MockExpansionNonCompliant__factory.ts:
--------------------------------------------------------------------------------
1 | /* Autogenerated file. Do not edit manually. */
2 | /* tslint:disable */
3 | /* eslint-disable */
4 |
5 | import { Signer, Contract, ContractFactory, Overrides } from "ethers";
6 | import { Provider, TransactionRequest } from "@ethersproject/providers";
7 |
8 | import type { MockExpansionNonCompliant } from "../MockExpansionNonCompliant";
9 |
10 | export class MockExpansionNonCompliant__factory extends ContractFactory {
11 | constructor(signer?: Signer) {
12 | super(_abi, _bytecode, signer);
13 | }
14 |
15 | deploy(
16 | overrides?: Overrides & { from?: string | Promise }
17 | ): Promise {
18 | return super.deploy(overrides || {}) as Promise;
19 | }
20 | getDeployTransaction(
21 | overrides?: Overrides & { from?: string | Promise }
22 | ): TransactionRequest {
23 | return super.getDeployTransaction(overrides || {});
24 | }
25 | attach(address: string): MockExpansionNonCompliant {
26 | return super.attach(address) as MockExpansionNonCompliant;
27 | }
28 | connect(signer: Signer): MockExpansionNonCompliant__factory {
29 | return super.connect(signer) as MockExpansionNonCompliant__factory;
30 | }
31 | static connect(
32 | address: string,
33 | signerOrProvider: Signer | Provider
34 | ): MockExpansionNonCompliant {
35 | return new Contract(
36 | address,
37 | _abi,
38 | signerOrProvider
39 | ) as MockExpansionNonCompliant;
40 | }
41 | }
42 |
43 | const _abi = [
44 | {
45 | inputs: [
46 | {
47 | internalType: "uint256",
48 | name: "lootId",
49 | type: "uint256",
50 | },
51 | ],
52 | name: "tokenUri",
53 | outputs: [
54 | {
55 | internalType: "string",
56 | name: "",
57 | type: "string",
58 | },
59 | ],
60 | stateMutability: "pure",
61 | type: "function",
62 | },
63 | ];
64 |
65 | const _bytecode =
66 | "0x608060405234801561001057600080fd5b506102e4806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80631675f45514610030575b600080fd5b61004d6004803603602081101561004657600080fd5b50356100c2565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561008757818101518382015260200161006f565b50505050905090810190601f1680156100b45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60606100cd82610181565b60405160200180807f68747470733a2f2f626173655552492e6e65742f00000000000000000000000081525060140182805190602001908083835b6020831061014557805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610108565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405290505b919050565b6060816101c2575060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015261017c565b8160005b81156101da57600101600a820491506101c6565b60008167ffffffffffffffff811180156101f357600080fd5b506040519080825280601f01601f19166020018201604052801561021e576020820181803683370190505b5085935090507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82015b83156102a557600a840660300160f81b8282806001900393508151811061026b57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a84049350610248565b5094935050505056fea2646970667358221220204ccfe7998f8dae8211cb68e469b027d94945a2783fafaa320e870bd933668364736f6c63430007060033";
67 |
--------------------------------------------------------------------------------
/src/artifacts/contracts/mocks/MockExpansionNoFee.sol/MockExpansionNoFee.json:
--------------------------------------------------------------------------------
1 | {
2 | "_format": "hh-sol-artifact-1",
3 | "contractName": "MockExpansionNoFee",
4 | "sourceName": "contracts/mocks/MockExpansionNoFee.sol",
5 | "abi": [
6 | {
7 | "inputs": [
8 | {
9 | "internalType": "uint256",
10 | "name": "lootId",
11 | "type": "uint256"
12 | }
13 | ],
14 | "name": "lootExpansionTokenUri",
15 | "outputs": [
16 | {
17 | "internalType": "string",
18 | "name": "tokenUri",
19 | "type": "string"
20 | }
21 | ],
22 | "stateMutability": "view",
23 | "type": "function"
24 | }
25 | ],
26 | "bytecode": "0x608060405234801561001057600080fd5b506102e4806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80633f5c50c414610030575b600080fd5b61004d6004803603602081101561004657600080fd5b50356100c2565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561008757818101518382015260200161006f565b50505050905090810190601f1680156100b45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60606100cd82610181565b60405160200180807f68747470733a2f2f626173655552492e6e65742f00000000000000000000000081525060140182805190602001908083835b6020831061014557805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610108565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405290505b919050565b6060816101c2575060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015261017c565b8160005b81156101da57600101600a820491506101c6565b60008167ffffffffffffffff811180156101f357600080fd5b506040519080825280601f01601f19166020018201604052801561021e576020820181803683370190505b5085935090507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82015b83156102a557600a840660300160f81b8282806001900393508151811061026b57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a84049350610248565b5094935050505056fea26469706673582212203d9b8b351ebe40fc2d9d02651e14ee5df6866c6bdf6e3ddc92b39fadff4a6d6e64736f6c63430007060033",
27 | "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c80633f5c50c414610030575b600080fd5b61004d6004803603602081101561004657600080fd5b50356100c2565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561008757818101518382015260200161006f565b50505050905090810190601f1680156100b45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60606100cd82610181565b60405160200180807f68747470733a2f2f626173655552492e6e65742f00000000000000000000000081525060140182805190602001908083835b6020831061014557805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610108565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405290505b919050565b6060816101c2575060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015261017c565b8160005b81156101da57600101600a820491506101c6565b60008167ffffffffffffffff811180156101f357600080fd5b506040519080825280601f01601f19166020018201604052801561021e576020820181803683370190505b5085935090507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82015b83156102a557600a840660300160f81b8282806001900393508151811061026b57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a84049350610248565b5094935050505056fea26469706673582212203d9b8b351ebe40fc2d9d02651e14ee5df6866c6bdf6e3ddc92b39fadff4a6d6e64736f6c63430007060033",
28 | "linkReferences": {},
29 | "deployedLinkReferences": {}
30 | }
31 |
--------------------------------------------------------------------------------
/src/artifacts/contracts/mocks/MockExpansionNonCompliant.sol/MockExpansionNonCompliant.json:
--------------------------------------------------------------------------------
1 | {
2 | "_format": "hh-sol-artifact-1",
3 | "contractName": "MockExpansionNonCompliant",
4 | "sourceName": "contracts/mocks/MockExpansionNonCompliant.sol",
5 | "abi": [
6 | {
7 | "inputs": [
8 | {
9 | "internalType": "uint256",
10 | "name": "lootId",
11 | "type": "uint256"
12 | }
13 | ],
14 | "name": "tokenUri",
15 | "outputs": [
16 | {
17 | "internalType": "string",
18 | "name": "",
19 | "type": "string"
20 | }
21 | ],
22 | "stateMutability": "pure",
23 | "type": "function"
24 | }
25 | ],
26 | "bytecode": "0x608060405234801561001057600080fd5b506102e4806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80631675f45514610030575b600080fd5b61004d6004803603602081101561004657600080fd5b50356100c2565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561008757818101518382015260200161006f565b50505050905090810190601f1680156100b45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60606100cd82610181565b60405160200180807f68747470733a2f2f626173655552492e6e65742f00000000000000000000000081525060140182805190602001908083835b6020831061014557805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610108565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405290505b919050565b6060816101c2575060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015261017c565b8160005b81156101da57600101600a820491506101c6565b60008167ffffffffffffffff811180156101f357600080fd5b506040519080825280601f01601f19166020018201604052801561021e576020820181803683370190505b5085935090507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82015b83156102a557600a840660300160f81b8282806001900393508151811061026b57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a84049350610248565b5094935050505056fea2646970667358221220204ccfe7998f8dae8211cb68e469b027d94945a2783fafaa320e870bd933668364736f6c63430007060033",
27 | "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c80631675f45514610030575b600080fd5b61004d6004803603602081101561004657600080fd5b50356100c2565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561008757818101518382015260200161006f565b50505050905090810190601f1680156100b45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60606100cd82610181565b60405160200180807f68747470733a2f2f626173655552492e6e65742f00000000000000000000000081525060140182805190602001908083835b6020831061014557805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610108565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405290505b919050565b6060816101c2575060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015261017c565b8160005b81156101da57600101600a820491506101c6565b60008167ffffffffffffffff811180156101f357600080fd5b506040519080825280601f01601f19166020018201604052801561021e576020820181803683370190505b5085935090507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82015b83156102a557600a840660300160f81b8282806001900393508151811061026b57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a84049350610248565b5094935050505056fea2646970667358221220204ccfe7998f8dae8211cb68e469b027d94945a2783fafaa320e870bd933668364736f6c63430007060033",
28 | "linkReferences": {},
29 | "deployedLinkReferences": {}
30 | }
31 |
--------------------------------------------------------------------------------
/src/gen/typechain/factories/Migrations__factory.ts:
--------------------------------------------------------------------------------
1 | /* Autogenerated file. Do not edit manually. */
2 | /* tslint:disable */
3 | /* eslint-disable */
4 |
5 | import { Signer, Contract, ContractFactory, Overrides } from "ethers";
6 | import { Provider, TransactionRequest } from "@ethersproject/providers";
7 |
8 | import type { Migrations } from "../Migrations";
9 |
10 | export class Migrations__factory extends ContractFactory {
11 | constructor(signer?: Signer) {
12 | super(_abi, _bytecode, signer);
13 | }
14 |
15 | deploy(
16 | overrides?: Overrides & { from?: string | Promise }
17 | ): Promise {
18 | return super.deploy(overrides || {}) as Promise;
19 | }
20 | getDeployTransaction(
21 | overrides?: Overrides & { from?: string | Promise }
22 | ): TransactionRequest {
23 | return super.getDeployTransaction(overrides || {});
24 | }
25 | attach(address: string): Migrations {
26 | return super.attach(address) as Migrations;
27 | }
28 | connect(signer: Signer): Migrations__factory {
29 | return super.connect(signer) as Migrations__factory;
30 | }
31 | static connect(
32 | address: string,
33 | signerOrProvider: Signer | Provider
34 | ): Migrations {
35 | return new Contract(address, _abi, signerOrProvider) as Migrations;
36 | }
37 | }
38 |
39 | const _abi = [
40 | {
41 | inputs: [],
42 | stateMutability: "nonpayable",
43 | type: "constructor",
44 | },
45 | {
46 | inputs: [],
47 | name: "last_completed_migration",
48 | outputs: [
49 | {
50 | internalType: "uint256",
51 | name: "",
52 | type: "uint256",
53 | },
54 | ],
55 | stateMutability: "view",
56 | type: "function",
57 | },
58 | {
59 | inputs: [],
60 | name: "owner",
61 | outputs: [
62 | {
63 | internalType: "address",
64 | name: "",
65 | type: "address",
66 | },
67 | ],
68 | stateMutability: "view",
69 | type: "function",
70 | },
71 | {
72 | inputs: [
73 | {
74 | internalType: "uint256",
75 | name: "completed",
76 | type: "uint256",
77 | },
78 | ],
79 | name: "setCompleted",
80 | outputs: [],
81 | stateMutability: "nonpayable",
82 | type: "function",
83 | },
84 | {
85 | inputs: [
86 | {
87 | internalType: "address",
88 | name: "new_address",
89 | type: "address",
90 | },
91 | ],
92 | name: "upgrade",
93 | outputs: [],
94 | stateMutability: "nonpayable",
95 | type: "function",
96 | },
97 | ];
98 |
99 | const _bytecode =
100 | "0x608060405234801561001057600080fd5b50600080546001600160a01b03191633179055610202806100326000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630900f01014610051578063445df0ac146100865780638da5cb5b146100a0578063fdacd576146100d1575b600080fd5b6100846004803603602081101561006757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166100ee565b005b61008e610185565b60408051918252519081900360200190f35b6100a861018b565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b610084600480360360208110156100e757600080fd5b50356101a7565b60005473ffffffffffffffffffffffffffffffffffffffff163314156101825760008190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561016857600080fd5b505af115801561017c573d6000803e3d6000fd5b50505050505b50565b60015481565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff163314156101825760015556fea2646970667358221220c356fd16dd98acec36d2966175de7f7a7fa5a8bb405384b0de6773cfb8ada45864736f6c63430007060033";
101 |
--------------------------------------------------------------------------------
/src/artifacts/contracts/migrations/Migrations.sol/Migrations.json:
--------------------------------------------------------------------------------
1 | {
2 | "_format": "hh-sol-artifact-1",
3 | "contractName": "Migrations",
4 | "sourceName": "contracts/migrations/Migrations.sol",
5 | "abi": [
6 | {
7 | "inputs": [],
8 | "stateMutability": "nonpayable",
9 | "type": "constructor"
10 | },
11 | {
12 | "inputs": [],
13 | "name": "last_completed_migration",
14 | "outputs": [
15 | {
16 | "internalType": "uint256",
17 | "name": "",
18 | "type": "uint256"
19 | }
20 | ],
21 | "stateMutability": "view",
22 | "type": "function"
23 | },
24 | {
25 | "inputs": [],
26 | "name": "owner",
27 | "outputs": [
28 | {
29 | "internalType": "address",
30 | "name": "",
31 | "type": "address"
32 | }
33 | ],
34 | "stateMutability": "view",
35 | "type": "function"
36 | },
37 | {
38 | "inputs": [
39 | {
40 | "internalType": "uint256",
41 | "name": "completed",
42 | "type": "uint256"
43 | }
44 | ],
45 | "name": "setCompleted",
46 | "outputs": [],
47 | "stateMutability": "nonpayable",
48 | "type": "function"
49 | },
50 | {
51 | "inputs": [
52 | {
53 | "internalType": "address",
54 | "name": "new_address",
55 | "type": "address"
56 | }
57 | ],
58 | "name": "upgrade",
59 | "outputs": [],
60 | "stateMutability": "nonpayable",
61 | "type": "function"
62 | }
63 | ],
64 | "bytecode": "0x608060405234801561001057600080fd5b50600080546001600160a01b03191633179055610202806100326000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630900f01014610051578063445df0ac146100865780638da5cb5b146100a0578063fdacd576146100d1575b600080fd5b6100846004803603602081101561006757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166100ee565b005b61008e610185565b60408051918252519081900360200190f35b6100a861018b565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b610084600480360360208110156100e757600080fd5b50356101a7565b60005473ffffffffffffffffffffffffffffffffffffffff163314156101825760008190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561016857600080fd5b505af115801561017c573d6000803e3d6000fd5b50505050505b50565b60015481565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff163314156101825760015556fea2646970667358221220c356fd16dd98acec36d2966175de7f7a7fa5a8bb405384b0de6773cfb8ada45864736f6c63430007060033",
65 | "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80630900f01014610051578063445df0ac146100865780638da5cb5b146100a0578063fdacd576146100d1575b600080fd5b6100846004803603602081101561006757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166100ee565b005b61008e610185565b60408051918252519081900360200190f35b6100a861018b565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b610084600480360360208110156100e757600080fd5b50356101a7565b60005473ffffffffffffffffffffffffffffffffffffffff163314156101825760008190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561016857600080fd5b505af115801561017c573d6000803e3d6000fd5b50505050505b50565b60015481565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff163314156101825760015556fea2646970667358221220c356fd16dd98acec36d2966175de7f7a7fa5a8bb405384b0de6773cfb8ada45864736f6c63430007060033",
66 | "linkReferences": {},
67 | "deployedLinkReferences": {}
68 | }
69 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "root",
3 | "private": true,
4 | "workspaces": ["src"],
5 | "license": "Apache-2.0",
6 | "scripts": {
7 | "build": "yarn clean && yarn compile && yarn adapter",
8 | "clean": "rimraf src/artifacts && rimraf src/gen && rimraf cache",
9 | "compile": "hardhat --max-memory 4096 compile",
10 | "adapter": "yarn adapter:gen && yarn adapter:build",
11 | "adapter:gen": "rimraf src/gen/typechain && typechain --target ethers-v5 --outDir src/gen/typechain './src/artifacts/contracts/**/*[^dbg].json'",
12 | "adapter:build": "rimraf src/gen/adapter && tsc ./src/gen/typechain/index.ts --outDir ./src/gen/adapter",
13 | "test": "yarn build && hardhat test",
14 | "quicktest": "hardhat test",
15 | "precoverage": "yarn build",
16 | "coverage": "COVERAGE=true NET_ID=1 hardhat coverage --network coverage",
17 | "benchmark": "BENCHMARK=true yarn test",
18 | "lint": "yarn lint:ts && yarn lint:sol",
19 | "lint:fix": "yarn lint:ts:fix && yarn lint:sol:fix",
20 | "lint:sol": "solhint './src/contracts/**/*.sol'",
21 | "lint:sol:fix": "solhint './src/contracts/**/*.sol' --fix",
22 | "lint:ts": "eslint -c .eslintrc.js './**/*.ts'",
23 | "lint:ts:fix": "eslint -c .eslintrc.js --fix './**/*.ts'",
24 | "format": "prettier --write ./**/*.ts",
25 | "start:ganache": "ganache-cli --chainId ${npm_package_config_ganacheChainID} --networkId ${npm_package_config_ganacheChainID} --port ${npm_package_config_ganachePort} --gasLimit ${npm_package_config_ganacheGasLimit} --gasPrice ${npm_package_config_ganacheGasPrice} --defaultBalanceEther ${npm_package_config_etherBalance} --deterministic --mnemonic \"${npm_package_config_mnemonic}\" ${npm_package_config_extra}",
26 | "start:ganache:verbose": "yarn run start:ganache --verbose",
27 | "stop:ganache": "ps aux | grep ganache-cli | grep -v grep | awk '{print $2}' | xargs kill -9",
28 | "deploy:ganache": "hardhat run --network ganache utils/deploy-contracts.ts",
29 | "deploy": "hardhat run utils/deploy-contracts.ts --network",
30 | "verify": "hardhat verify --network",
31 | "release": "yarn publish src"
32 | },
33 | "husky": {
34 | "hooks": {
35 | "pre-commit": "yarn lint",
36 | "pre-push": "yarn lint && yarn test"
37 | }
38 | },
39 | "devDependencies": {
40 | "@0xsequence/deployer": "^0.21.5",
41 | "@nomiclabs/hardhat-ethers": "^2.0.2",
42 | "@nomiclabs/hardhat-etherscan": "^2.1.4",
43 | "@nomiclabs/hardhat-truffle5": "^2.0.0",
44 | "@nomiclabs/hardhat-web3": "^2.0.0",
45 | "@tenderly/hardhat-tenderly": "^1.0.11",
46 | "@typechain/ethers-v5": "^6.0.3",
47 | "@types/chai-as-promised": "^7.1.0",
48 | "@types/chai-string": "^1.4.1",
49 | "@types/mocha": "^8.2.1",
50 | "@typescript-eslint/eslint-plugin": "^4.18.0",
51 | "@typescript-eslint/parser": "^4.18.0",
52 | "bn-chai": "^1.0.1",
53 | "chai": "^4.3.4",
54 | "chai-as-promised": "^7.1.1",
55 | "chai-bignumber": "^3.0.0",
56 | "chai-string": "^1.5.0",
57 | "child_process": "^1.0.2",
58 | "dotenv": "^8.2.0",
59 | "eslint": "^7.22.0",
60 | "eslint-config-prettier": "^8.1.0",
61 | "eslint-plugin-import": "^2.22.0",
62 | "eslint-plugin-prettier": "^3.3.1",
63 | "ethers": "^5.0.32",
64 | "ganache-cli": "6.12.2",
65 | "hardhat": "2.1.1",
66 | "hardhat-gas-reporter": "1.0.4",
67 | "husky": "^4.2.3",
68 | "rimraf": "^3.0.2",
69 | "scrypt": "github:barrysteyn/node-scrypt#fb60a8d3c158fe115a624b5ffa7480f3a24b03fb",
70 | "solhint": "^3.3.4",
71 | "solidity-coverage": "^0.7.16",
72 | "ts-node": "^9.1.1",
73 | "typechain": "^4.0.3",
74 | "typescript": "^4.2.3"
75 | },
76 | "config": {
77 | "mnemonic": "test test test test test test test test test test test junk",
78 | "ganacheChainID": 127001,
79 | "ganachePort": 8545,
80 | "ganacheGasLimit": "0xfffffffffff",
81 | "ganacheGasPrice": "2",
82 | "etherBalance": "100000",
83 | "extra": ""
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/src/gen/adapter/factories/MockExpansionNoFee__factory.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | /* Autogenerated file. Do not edit manually. */
3 | /* tslint:disable */
4 | /* eslint-disable */
5 | var __extends = (this && this.__extends) || (function () {
6 | var extendStatics = function (d, b) {
7 | extendStatics = Object.setPrototypeOf ||
8 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
9 | function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
10 | return extendStatics(d, b);
11 | };
12 | return function (d, b) {
13 | if (typeof b !== "function" && b !== null)
14 | throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
15 | extendStatics(d, b);
16 | function __() { this.constructor = d; }
17 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
18 | };
19 | })();
20 | exports.__esModule = true;
21 | exports.MockExpansionNoFee__factory = void 0;
22 | var ethers_1 = require("ethers");
23 | var MockExpansionNoFee__factory = /** @class */ (function (_super) {
24 | __extends(MockExpansionNoFee__factory, _super);
25 | function MockExpansionNoFee__factory(signer) {
26 | return _super.call(this, _abi, _bytecode, signer) || this;
27 | }
28 | MockExpansionNoFee__factory.prototype.deploy = function (overrides) {
29 | return _super.prototype.deploy.call(this, overrides || {});
30 | };
31 | MockExpansionNoFee__factory.prototype.getDeployTransaction = function (overrides) {
32 | return _super.prototype.getDeployTransaction.call(this, overrides || {});
33 | };
34 | MockExpansionNoFee__factory.prototype.attach = function (address) {
35 | return _super.prototype.attach.call(this, address);
36 | };
37 | MockExpansionNoFee__factory.prototype.connect = function (signer) {
38 | return _super.prototype.connect.call(this, signer);
39 | };
40 | MockExpansionNoFee__factory.connect = function (address, signerOrProvider) {
41 | return new ethers_1.Contract(address, _abi, signerOrProvider);
42 | };
43 | return MockExpansionNoFee__factory;
44 | }(ethers_1.ContractFactory));
45 | exports.MockExpansionNoFee__factory = MockExpansionNoFee__factory;
46 | var _abi = [
47 | {
48 | inputs: [
49 | {
50 | internalType: "uint256",
51 | name: "lootId",
52 | type: "uint256"
53 | },
54 | ],
55 | name: "lootExpansionTokenUri",
56 | outputs: [
57 | {
58 | internalType: "string",
59 | name: "tokenUri",
60 | type: "string"
61 | },
62 | ],
63 | stateMutability: "view",
64 | type: "function"
65 | },
66 | ];
67 | var _bytecode = "0x608060405234801561001057600080fd5b506102e4806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80633f5c50c414610030575b600080fd5b61004d6004803603602081101561004657600080fd5b50356100c2565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561008757818101518382015260200161006f565b50505050905090810190601f1680156100b45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60606100cd82610181565b60405160200180807f68747470733a2f2f626173655552492e6e65742f00000000000000000000000081525060140182805190602001908083835b6020831061014557805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610108565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405290505b919050565b6060816101c2575060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015261017c565b8160005b81156101da57600101600a820491506101c6565b60008167ffffffffffffffff811180156101f357600080fd5b506040519080825280601f01601f19166020018201604052801561021e576020820181803683370190505b5085935090507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82015b83156102a557600a840660300160f81b8282806001900393508151811061026b57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a84049350610248565b5094935050505056fea26469706673582212203d9b8b351ebe40fc2d9d02651e14ee5df6866c6bdf6e3ddc92b39fadff4a6d6e64736f6c63430007060033";
68 |
--------------------------------------------------------------------------------
/src/gen/adapter/factories/MockExpansionNonCompliant__factory.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | /* Autogenerated file. Do not edit manually. */
3 | /* tslint:disable */
4 | /* eslint-disable */
5 | var __extends = (this && this.__extends) || (function () {
6 | var extendStatics = function (d, b) {
7 | extendStatics = Object.setPrototypeOf ||
8 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
9 | function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
10 | return extendStatics(d, b);
11 | };
12 | return function (d, b) {
13 | if (typeof b !== "function" && b !== null)
14 | throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
15 | extendStatics(d, b);
16 | function __() { this.constructor = d; }
17 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
18 | };
19 | })();
20 | exports.__esModule = true;
21 | exports.MockExpansionNonCompliant__factory = void 0;
22 | var ethers_1 = require("ethers");
23 | var MockExpansionNonCompliant__factory = /** @class */ (function (_super) {
24 | __extends(MockExpansionNonCompliant__factory, _super);
25 | function MockExpansionNonCompliant__factory(signer) {
26 | return _super.call(this, _abi, _bytecode, signer) || this;
27 | }
28 | MockExpansionNonCompliant__factory.prototype.deploy = function (overrides) {
29 | return _super.prototype.deploy.call(this, overrides || {});
30 | };
31 | MockExpansionNonCompliant__factory.prototype.getDeployTransaction = function (overrides) {
32 | return _super.prototype.getDeployTransaction.call(this, overrides || {});
33 | };
34 | MockExpansionNonCompliant__factory.prototype.attach = function (address) {
35 | return _super.prototype.attach.call(this, address);
36 | };
37 | MockExpansionNonCompliant__factory.prototype.connect = function (signer) {
38 | return _super.prototype.connect.call(this, signer);
39 | };
40 | MockExpansionNonCompliant__factory.connect = function (address, signerOrProvider) {
41 | return new ethers_1.Contract(address, _abi, signerOrProvider);
42 | };
43 | return MockExpansionNonCompliant__factory;
44 | }(ethers_1.ContractFactory));
45 | exports.MockExpansionNonCompliant__factory = MockExpansionNonCompliant__factory;
46 | var _abi = [
47 | {
48 | inputs: [
49 | {
50 | internalType: "uint256",
51 | name: "lootId",
52 | type: "uint256"
53 | },
54 | ],
55 | name: "tokenUri",
56 | outputs: [
57 | {
58 | internalType: "string",
59 | name: "",
60 | type: "string"
61 | },
62 | ],
63 | stateMutability: "pure",
64 | type: "function"
65 | },
66 | ];
67 | var _bytecode = "0x608060405234801561001057600080fd5b506102e4806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80631675f45514610030575b600080fd5b61004d6004803603602081101561004657600080fd5b50356100c2565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561008757818101518382015260200161006f565b50505050905090810190601f1680156100b45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60606100cd82610181565b60405160200180807f68747470733a2f2f626173655552492e6e65742f00000000000000000000000081525060140182805190602001908083835b6020831061014557805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610108565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405290505b919050565b6060816101c2575060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015261017c565b8160005b81156101da57600101600a820491506101c6565b60008167ffffffffffffffff811180156101f357600080fd5b506040519080825280601f01601f19166020018201604052801561021e576020820181803683370190505b5085935090507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82015b83156102a557600a840660300160f81b8282806001900393508151811061026b57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a84049350610248565b5094935050505056fea2646970667358221220204ccfe7998f8dae8211cb68e469b027d94945a2783fafaa320e870bd933668364736f6c63430007060033";
68 |
--------------------------------------------------------------------------------
/src/gen/typechain/MockExpansionNonCompliant.d.ts:
--------------------------------------------------------------------------------
1 | /* Autogenerated file. Do not edit manually. */
2 | /* tslint:disable */
3 | /* eslint-disable */
4 |
5 | import {
6 | ethers,
7 | EventFilter,
8 | Signer,
9 | BigNumber,
10 | BigNumberish,
11 | PopulatedTransaction,
12 | Contract,
13 | ContractTransaction,
14 | CallOverrides,
15 | } from "ethers";
16 | import { BytesLike } from "@ethersproject/bytes";
17 | import { Listener, Provider } from "@ethersproject/providers";
18 | import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
19 | import { TypedEventFilter, TypedEvent, TypedListener } from "./commons";
20 |
21 | interface MockExpansionNonCompliantInterface extends ethers.utils.Interface {
22 | functions: {
23 | "tokenUri(uint256)": FunctionFragment;
24 | };
25 |
26 | encodeFunctionData(
27 | functionFragment: "tokenUri",
28 | values: [BigNumberish]
29 | ): string;
30 |
31 | decodeFunctionResult(functionFragment: "tokenUri", data: BytesLike): Result;
32 |
33 | events: {};
34 | }
35 |
36 | export class MockExpansionNonCompliant extends Contract {
37 | connect(signerOrProvider: Signer | Provider | string): this;
38 | attach(addressOrName: string): this;
39 | deployed(): Promise;
40 |
41 | listeners, EventArgsObject>(
42 | eventFilter?: TypedEventFilter
43 | ): Array>;
44 | off, EventArgsObject>(
45 | eventFilter: TypedEventFilter,
46 | listener: TypedListener
47 | ): this;
48 | on, EventArgsObject>(
49 | eventFilter: TypedEventFilter,
50 | listener: TypedListener
51 | ): this;
52 | once, EventArgsObject>(
53 | eventFilter: TypedEventFilter,
54 | listener: TypedListener
55 | ): this;
56 | removeListener, EventArgsObject>(
57 | eventFilter: TypedEventFilter,
58 | listener: TypedListener
59 | ): this;
60 | removeAllListeners, EventArgsObject>(
61 | eventFilter: TypedEventFilter
62 | ): this;
63 |
64 | listeners(eventName?: string): Array;
65 | off(eventName: string, listener: Listener): this;
66 | on(eventName: string, listener: Listener): this;
67 | once(eventName: string, listener: Listener): this;
68 | removeListener(eventName: string, listener: Listener): this;
69 | removeAllListeners(eventName?: string): this;
70 |
71 | queryFilter, EventArgsObject>(
72 | event: TypedEventFilter,
73 | fromBlockOrBlockhash?: string | number | undefined,
74 | toBlock?: string | number | undefined
75 | ): Promise>>;
76 |
77 | interface: MockExpansionNonCompliantInterface;
78 |
79 | functions: {
80 | tokenUri(
81 | lootId: BigNumberish,
82 | overrides?: CallOverrides
83 | ): Promise<[string]>;
84 |
85 | "tokenUri(uint256)"(
86 | lootId: BigNumberish,
87 | overrides?: CallOverrides
88 | ): Promise<[string]>;
89 | };
90 |
91 | tokenUri(lootId: BigNumberish, overrides?: CallOverrides): Promise;
92 |
93 | "tokenUri(uint256)"(
94 | lootId: BigNumberish,
95 | overrides?: CallOverrides
96 | ): Promise;
97 |
98 | callStatic: {
99 | tokenUri(lootId: BigNumberish, overrides?: CallOverrides): Promise;
100 |
101 | "tokenUri(uint256)"(
102 | lootId: BigNumberish,
103 | overrides?: CallOverrides
104 | ): Promise;
105 | };
106 |
107 | filters: {};
108 |
109 | estimateGas: {
110 | tokenUri(
111 | lootId: BigNumberish,
112 | overrides?: CallOverrides
113 | ): Promise;
114 |
115 | "tokenUri(uint256)"(
116 | lootId: BigNumberish,
117 | overrides?: CallOverrides
118 | ): Promise;
119 | };
120 |
121 | populateTransaction: {
122 | tokenUri(
123 | lootId: BigNumberish,
124 | overrides?: CallOverrides
125 | ): Promise;
126 |
127 | "tokenUri(uint256)"(
128 | lootId: BigNumberish,
129 | overrides?: CallOverrides
130 | ): Promise;
131 | };
132 | }
133 |
--------------------------------------------------------------------------------
/src/gen/adapter/factories/Migrations__factory.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | /* Autogenerated file. Do not edit manually. */
3 | /* tslint:disable */
4 | /* eslint-disable */
5 | var __extends = (this && this.__extends) || (function () {
6 | var extendStatics = function (d, b) {
7 | extendStatics = Object.setPrototypeOf ||
8 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
9 | function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
10 | return extendStatics(d, b);
11 | };
12 | return function (d, b) {
13 | if (typeof b !== "function" && b !== null)
14 | throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
15 | extendStatics(d, b);
16 | function __() { this.constructor = d; }
17 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
18 | };
19 | })();
20 | exports.__esModule = true;
21 | exports.Migrations__factory = void 0;
22 | var ethers_1 = require("ethers");
23 | var Migrations__factory = /** @class */ (function (_super) {
24 | __extends(Migrations__factory, _super);
25 | function Migrations__factory(signer) {
26 | return _super.call(this, _abi, _bytecode, signer) || this;
27 | }
28 | Migrations__factory.prototype.deploy = function (overrides) {
29 | return _super.prototype.deploy.call(this, overrides || {});
30 | };
31 | Migrations__factory.prototype.getDeployTransaction = function (overrides) {
32 | return _super.prototype.getDeployTransaction.call(this, overrides || {});
33 | };
34 | Migrations__factory.prototype.attach = function (address) {
35 | return _super.prototype.attach.call(this, address);
36 | };
37 | Migrations__factory.prototype.connect = function (signer) {
38 | return _super.prototype.connect.call(this, signer);
39 | };
40 | Migrations__factory.connect = function (address, signerOrProvider) {
41 | return new ethers_1.Contract(address, _abi, signerOrProvider);
42 | };
43 | return Migrations__factory;
44 | }(ethers_1.ContractFactory));
45 | exports.Migrations__factory = Migrations__factory;
46 | var _abi = [
47 | {
48 | inputs: [],
49 | stateMutability: "nonpayable",
50 | type: "constructor"
51 | },
52 | {
53 | inputs: [],
54 | name: "last_completed_migration",
55 | outputs: [
56 | {
57 | internalType: "uint256",
58 | name: "",
59 | type: "uint256"
60 | },
61 | ],
62 | stateMutability: "view",
63 | type: "function"
64 | },
65 | {
66 | inputs: [],
67 | name: "owner",
68 | outputs: [
69 | {
70 | internalType: "address",
71 | name: "",
72 | type: "address"
73 | },
74 | ],
75 | stateMutability: "view",
76 | type: "function"
77 | },
78 | {
79 | inputs: [
80 | {
81 | internalType: "uint256",
82 | name: "completed",
83 | type: "uint256"
84 | },
85 | ],
86 | name: "setCompleted",
87 | outputs: [],
88 | stateMutability: "nonpayable",
89 | type: "function"
90 | },
91 | {
92 | inputs: [
93 | {
94 | internalType: "address",
95 | name: "new_address",
96 | type: "address"
97 | },
98 | ],
99 | name: "upgrade",
100 | outputs: [],
101 | stateMutability: "nonpayable",
102 | type: "function"
103 | },
104 | ];
105 | var _bytecode = "0x608060405234801561001057600080fd5b50600080546001600160a01b03191633179055610202806100326000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630900f01014610051578063445df0ac146100865780638da5cb5b146100a0578063fdacd576146100d1575b600080fd5b6100846004803603602081101561006757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166100ee565b005b61008e610185565b60408051918252519081900360200190f35b6100a861018b565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b610084600480360360208110156100e757600080fd5b50356101a7565b60005473ffffffffffffffffffffffffffffffffffffffff163314156101825760008190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561016857600080fd5b505af115801561017c573d6000803e3d6000fd5b50505050505b50565b60015481565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff163314156101825760015556fea2646970667358221220c356fd16dd98acec36d2966175de7f7a7fa5a8bb405384b0de6773cfb8ada45864736f6c63430007060033";
106 |
--------------------------------------------------------------------------------
/src/gen/typechain/MockExpansionNoFee.d.ts:
--------------------------------------------------------------------------------
1 | /* Autogenerated file. Do not edit manually. */
2 | /* tslint:disable */
3 | /* eslint-disable */
4 |
5 | import {
6 | ethers,
7 | EventFilter,
8 | Signer,
9 | BigNumber,
10 | BigNumberish,
11 | PopulatedTransaction,
12 | Contract,
13 | ContractTransaction,
14 | CallOverrides,
15 | } from "ethers";
16 | import { BytesLike } from "@ethersproject/bytes";
17 | import { Listener, Provider } from "@ethersproject/providers";
18 | import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
19 | import { TypedEventFilter, TypedEvent, TypedListener } from "./commons";
20 |
21 | interface MockExpansionNoFeeInterface extends ethers.utils.Interface {
22 | functions: {
23 | "lootExpansionTokenUri(uint256)": FunctionFragment;
24 | };
25 |
26 | encodeFunctionData(
27 | functionFragment: "lootExpansionTokenUri",
28 | values: [BigNumberish]
29 | ): string;
30 |
31 | decodeFunctionResult(
32 | functionFragment: "lootExpansionTokenUri",
33 | data: BytesLike
34 | ): Result;
35 |
36 | events: {};
37 | }
38 |
39 | export class MockExpansionNoFee extends Contract {
40 | connect(signerOrProvider: Signer | Provider | string): this;
41 | attach(addressOrName: string): this;
42 | deployed(): Promise;
43 |
44 | listeners, EventArgsObject>(
45 | eventFilter?: TypedEventFilter
46 | ): Array>;
47 | off, EventArgsObject>(
48 | eventFilter: TypedEventFilter,
49 | listener: TypedListener
50 | ): this;
51 | on, EventArgsObject>(
52 | eventFilter: TypedEventFilter,
53 | listener: TypedListener
54 | ): this;
55 | once, EventArgsObject>(
56 | eventFilter: TypedEventFilter,
57 | listener: TypedListener
58 | ): this;
59 | removeListener, EventArgsObject>(
60 | eventFilter: TypedEventFilter,
61 | listener: TypedListener
62 | ): this;
63 | removeAllListeners, EventArgsObject>(
64 | eventFilter: TypedEventFilter
65 | ): this;
66 |
67 | listeners(eventName?: string): Array;
68 | off(eventName: string, listener: Listener): this;
69 | on(eventName: string, listener: Listener): this;
70 | once(eventName: string, listener: Listener): this;
71 | removeListener(eventName: string, listener: Listener): this;
72 | removeAllListeners(eventName?: string): this;
73 |
74 | queryFilter, EventArgsObject>(
75 | event: TypedEventFilter,
76 | fromBlockOrBlockhash?: string | number | undefined,
77 | toBlock?: string | number | undefined
78 | ): Promise>>;
79 |
80 | interface: MockExpansionNoFeeInterface;
81 |
82 | functions: {
83 | lootExpansionTokenUri(
84 | lootId: BigNumberish,
85 | overrides?: CallOverrides
86 | ): Promise<[string] & { tokenUri: string }>;
87 |
88 | "lootExpansionTokenUri(uint256)"(
89 | lootId: BigNumberish,
90 | overrides?: CallOverrides
91 | ): Promise<[string] & { tokenUri: string }>;
92 | };
93 |
94 | lootExpansionTokenUri(
95 | lootId: BigNumberish,
96 | overrides?: CallOverrides
97 | ): Promise;
98 |
99 | "lootExpansionTokenUri(uint256)"(
100 | lootId: BigNumberish,
101 | overrides?: CallOverrides
102 | ): Promise;
103 |
104 | callStatic: {
105 | lootExpansionTokenUri(
106 | lootId: BigNumberish,
107 | overrides?: CallOverrides
108 | ): Promise;
109 |
110 | "lootExpansionTokenUri(uint256)"(
111 | lootId: BigNumberish,
112 | overrides?: CallOverrides
113 | ): Promise;
114 | };
115 |
116 | filters: {};
117 |
118 | estimateGas: {
119 | lootExpansionTokenUri(
120 | lootId: BigNumberish,
121 | overrides?: CallOverrides
122 | ): Promise;
123 |
124 | "lootExpansionTokenUri(uint256)"(
125 | lootId: BigNumberish,
126 | overrides?: CallOverrides
127 | ): Promise;
128 | };
129 |
130 | populateTransaction: {
131 | lootExpansionTokenUri(
132 | lootId: BigNumberish,
133 | overrides?: CallOverrides
134 | ): Promise;
135 |
136 | "lootExpansionTokenUri(uint256)"(
137 | lootId: BigNumberish,
138 | overrides?: CallOverrides
139 | ): Promise;
140 | };
141 | }
142 |
--------------------------------------------------------------------------------
/src/gen/typechain/factories/MockExpansion__factory.ts:
--------------------------------------------------------------------------------
1 | /* Autogenerated file. Do not edit manually. */
2 | /* tslint:disable */
3 | /* eslint-disable */
4 |
5 | import { Signer, Contract, ContractFactory, Overrides } from "ethers";
6 | import { Provider, TransactionRequest } from "@ethersproject/providers";
7 |
8 | import type { MockExpansion } from "../MockExpansion";
9 |
10 | export class MockExpansion__factory extends ContractFactory {
11 | constructor(signer?: Signer) {
12 | super(_abi, _bytecode, signer);
13 | }
14 |
15 | deploy(
16 | overrides?: Overrides & { from?: string | Promise }
17 | ): Promise {
18 | return super.deploy(overrides || {}) as Promise;
19 | }
20 | getDeployTransaction(
21 | overrides?: Overrides & { from?: string | Promise }
22 | ): TransactionRequest {
23 | return super.getDeployTransaction(overrides || {});
24 | }
25 | attach(address: string): MockExpansion {
26 | return super.attach(address) as MockExpansion;
27 | }
28 | connect(signer: Signer): MockExpansion__factory {
29 | return super.connect(signer) as MockExpansion__factory;
30 | }
31 | static connect(
32 | address: string,
33 | signerOrProvider: Signer | Provider
34 | ): MockExpansion {
35 | return new Contract(address, _abi, signerOrProvider) as MockExpansion;
36 | }
37 | }
38 |
39 | const _abi = [
40 | {
41 | inputs: [],
42 | name: "claimFeeAmount",
43 | outputs: [
44 | {
45 | internalType: "uint256",
46 | name: "",
47 | type: "uint256",
48 | },
49 | ],
50 | stateMutability: "view",
51 | type: "function",
52 | },
53 | {
54 | inputs: [],
55 | name: "claimFeeRecipient",
56 | outputs: [
57 | {
58 | internalType: "address",
59 | name: "",
60 | type: "address",
61 | },
62 | ],
63 | stateMutability: "view",
64 | type: "function",
65 | },
66 | {
67 | inputs: [
68 | {
69 | internalType: "uint256",
70 | name: "lootId",
71 | type: "uint256",
72 | },
73 | ],
74 | name: "lootExpansionTokenUri",
75 | outputs: [
76 | {
77 | internalType: "string",
78 | name: "",
79 | type: "string",
80 | },
81 | ],
82 | stateMutability: "pure",
83 | type: "function",
84 | },
85 | {
86 | inputs: [],
87 | name: "maxSupply",
88 | outputs: [
89 | {
90 | internalType: "uint256",
91 | name: "",
92 | type: "uint256",
93 | },
94 | ],
95 | stateMutability: "view",
96 | type: "function",
97 | },
98 | {
99 | inputs: [
100 | {
101 | internalType: "uint256",
102 | name: "_feeAmount",
103 | type: "uint256",
104 | },
105 | ],
106 | name: "setFee",
107 | outputs: [],
108 | stateMutability: "nonpayable",
109 | type: "function",
110 | },
111 | {
112 | inputs: [
113 | {
114 | internalType: "address",
115 | name: "_feeRecipient",
116 | type: "address",
117 | },
118 | ],
119 | name: "setRecipient",
120 | outputs: [],
121 | stateMutability: "nonpayable",
122 | type: "function",
123 | },
124 | ];
125 |
126 | const _bytecode =
127 | "0x608060405234801561001057600080fd5b50610444806100206000396000f3fe608060405234801561001057600080fd5b50600436106100725760003560e01c80637c5e62d0116100505780637c5e62d01461015b57806388888d951461018c578063d5abeb01146101a657610072565b80633bbed4a0146100775780633f5c50c4146100ac57806369fe0e2d1461013e575b600080fd5b6100aa6004803603602081101561008d57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166101ae565b005b6100c9600480360360208110156100c257600080fd5b50356101f5565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101035781810151838201526020016100eb565b50505050905090810190601f1680156101305780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100aa6004803603602081101561015457600080fd5b50356102b4565b6101636102b9565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6101946102d5565b60408051918252519081900360200190f35b6101946102db565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6060610200826102e1565b60405160200180807f68747470733a2f2f626173655552492e6e65742f00000000000000000000000081525060140182805190602001908083835b6020831061027857805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161023b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405290505b919050565b600055565b60015473ffffffffffffffffffffffffffffffffffffffff1690565b60005490565b611f4090565b606081610322575060408051808201909152600181527f300000000000000000000000000000000000000000000000000000000000000060208201526102af565b8160005b811561033a57600101600a82049150610326565b60008167ffffffffffffffff8111801561035357600080fd5b506040519080825280601f01601f19166020018201604052801561037e576020820181803683370190505b5085935090507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82015b831561040557600a840660300160f81b828280600190039350815181106103cb57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a840493506103a8565b5094935050505056fea26469706673582212209338081681570406afb144924667d95feecc8d6e8548d7f8dc4526e7ad9dd3db64736f6c63430007060033";
128 |
--------------------------------------------------------------------------------
/tests/LootRegistry.spec.ts:
--------------------------------------------------------------------------------
1 | import * as ethers from 'ethers'
2 | import { expect, RevertError} from './utils'
3 |
4 | import {
5 | LootRegistry,
6 | MockExpansion,
7 | MockExpansionNoFee,
8 | MockExpansionNonCompliant
9 | } from 'src/gen/typechain'
10 | import { BigNumber } from 'ethers'
11 |
12 | ethers.utils.Logger.setLogLevel(ethers.utils.Logger.levels.ERROR)
13 |
14 | // Importing contract artifacts
15 | const LootRegistryArtifact = artifacts.require('LootRegistry')
16 | const MockExpansionArtifact = artifacts.require('MockExpansion')
17 | const MockExpansionNoFeeArtifact = artifacts.require('MockExpansionNoFee')
18 | const MockExpansionInvalidArtifact = artifacts.require('MockExpansionNonCompliant')
19 |
20 | const fee = ethers.utils.parseUnits('0.01', 'ether')
21 | const fee_recipient = ethers.Wallet.createRandom().address
22 |
23 | contract('LootRegistry', () => {
24 | let registry: LootRegistry
25 | let expansion: MockExpansion
26 | let expansionNoFee: MockExpansionNoFee
27 | let registryInvalid: MockExpansionNonCompliant
28 |
29 | beforeEach(async () => {
30 | // Deploy contracts
31 | registry = await LootRegistryArtifact.new()
32 | expansion = await MockExpansionArtifact.new()
33 | expansionNoFee = await MockExpansionNoFeeArtifact.new()
34 | registryInvalid = await MockExpansionInvalidArtifact.new()
35 | })
36 |
37 | describe('registerLootExpansion()', () => {
38 | it(`should pass if expansion is valid`, async () => {
39 | const tx = registry.registerLootExpansion(expansion.address)
40 | await expect(tx).to.be.fulfilled
41 | })
42 |
43 | it(`should pass if expansion is doesn't implement fee interface`, async () => {
44 | const tx = registry.registerLootExpansion(expansionNoFee.address)
45 | await expect(tx).to.be.fulfilled
46 | })
47 |
48 | it(`should revert if expansion is already registered`, async () => {
49 | await registry.registerLootExpansion(expansion.address)
50 | const tx = registry.registerLootExpansion(expansion.address)
51 | await expect(tx).to.be.rejectedWith(RevertError("LootRegistry#registerLootExpansion: Expansion already registered"))
52 | })
53 |
54 | it(`should revert if expansion doesn't support lootExpansionTokenUri()`, async () => {
55 | const tx = registry.registerLootExpansion(registryInvalid.address)
56 | await expect(tx).to.be.rejectedWith(RevertError("LootRegistry#registerLootExpansion: Expansion doesn't support lootExpansionTokenUri"))
57 | })
58 |
59 | context('when valid expansion is registered()', () => {
60 | beforeEach(async () => {
61 | // Set fee on expansion
62 | await expansion.setFee(fee)
63 | await expansion.setRecipient(fee_recipient)
64 |
65 | // Register expansion
66 | await registry.registerLootExpansion(expansion.address)
67 | })
68 |
69 | it(`should add expansion to expansion array`, async () => {
70 | const expansions = await registry.getExpansions()
71 | await expect(expansions.length).to.be.eql(1)
72 |
73 | const expansions_address = await registry.expansions(0)
74 | await expect(expansions_address).to.be.eql(expansion.address)
75 | })
76 |
77 |
78 | it(`should set expansion id to 1`, async () => {
79 | const expansionID = await registry.expansionAddressToID(expansion.address)
80 | await expect(expansionID).to.be.eq.BN(1)
81 | })
82 |
83 | it(`should map id 1 to expansion address`, async () => {
84 | const expansionAddress = await registry.expansionIDtoAddress(1)
85 | await expect(expansionAddress).to.be.eql(expansion.address)
86 | })
87 |
88 | it(`should set claiming fee to expected value`, async () => {
89 | const _fee = await registry.claimingFee(expansion.address)
90 | await expect(_fee).to.be.eq.BN(fee.toString())
91 | })
92 |
93 | it(`should set fee recipient to expected value`, async () => {
94 | const _recipient = await registry.feeRecipient(expansion.address)
95 | await expect(_recipient).to.be.eql(fee_recipient)
96 | })
97 | })
98 |
99 | context('when expansion without fee interface is registered()', () => {
100 | beforeEach(async () => {
101 | // Register expansion
102 | await registry.registerLootExpansion(expansionNoFee.address)
103 | })
104 |
105 | it(`should add expansion to expansion array`, async () => {
106 | const _expansions = await registry.getExpansions()
107 | await expect(_expansions.length).to.be.eql(1)
108 | })
109 |
110 | it(`should set expansion id to 1`, async () => {
111 | const expansionID = await registry.expansionAddressToID(expansionNoFee.address)
112 | await expect(expansionID).to.be.eq.BN(1)
113 | })
114 |
115 | it(`should map id 1 to expansion address`, async () => {
116 | const expansionAddress = await registry.expansionIDtoAddress(1)
117 | await expect(expansionAddress).to.be.eql(expansionNoFee.address)
118 | })
119 |
120 | it(`should set claiming fee to 0`, async () => {
121 | const _fee = await registry.claimingFee(expansionNoFee.address)
122 | await expect(_fee).to.be.eq.BN(0)
123 | })
124 |
125 | it(`should set fee recipient to 0x0`, async () => {
126 | const _recpiient = await registry.feeRecipient(expansionNoFee.address)
127 | await expect(_recpiient).to.be.eql(ethers.constants.AddressZero)
128 | })
129 | })
130 |
131 | })
132 | })
133 |
--------------------------------------------------------------------------------
/src/artifacts/contracts/mocks/MockExpansion.sol/MockExpansion.json:
--------------------------------------------------------------------------------
1 | {
2 | "_format": "hh-sol-artifact-1",
3 | "contractName": "MockExpansion",
4 | "sourceName": "contracts/mocks/MockExpansion.sol",
5 | "abi": [
6 | {
7 | "inputs": [],
8 | "name": "claimFeeAmount",
9 | "outputs": [
10 | {
11 | "internalType": "uint256",
12 | "name": "",
13 | "type": "uint256"
14 | }
15 | ],
16 | "stateMutability": "view",
17 | "type": "function"
18 | },
19 | {
20 | "inputs": [],
21 | "name": "claimFeeRecipient",
22 | "outputs": [
23 | {
24 | "internalType": "address",
25 | "name": "",
26 | "type": "address"
27 | }
28 | ],
29 | "stateMutability": "view",
30 | "type": "function"
31 | },
32 | {
33 | "inputs": [
34 | {
35 | "internalType": "uint256",
36 | "name": "lootId",
37 | "type": "uint256"
38 | }
39 | ],
40 | "name": "lootExpansionTokenUri",
41 | "outputs": [
42 | {
43 | "internalType": "string",
44 | "name": "",
45 | "type": "string"
46 | }
47 | ],
48 | "stateMutability": "pure",
49 | "type": "function"
50 | },
51 | {
52 | "inputs": [],
53 | "name": "maxSupply",
54 | "outputs": [
55 | {
56 | "internalType": "uint256",
57 | "name": "",
58 | "type": "uint256"
59 | }
60 | ],
61 | "stateMutability": "view",
62 | "type": "function"
63 | },
64 | {
65 | "inputs": [
66 | {
67 | "internalType": "uint256",
68 | "name": "_feeAmount",
69 | "type": "uint256"
70 | }
71 | ],
72 | "name": "setFee",
73 | "outputs": [],
74 | "stateMutability": "nonpayable",
75 | "type": "function"
76 | },
77 | {
78 | "inputs": [
79 | {
80 | "internalType": "address",
81 | "name": "_feeRecipient",
82 | "type": "address"
83 | }
84 | ],
85 | "name": "setRecipient",
86 | "outputs": [],
87 | "stateMutability": "nonpayable",
88 | "type": "function"
89 | }
90 | ],
91 | "bytecode": "0x608060405234801561001057600080fd5b50610444806100206000396000f3fe608060405234801561001057600080fd5b50600436106100725760003560e01c80637c5e62d0116100505780637c5e62d01461015b57806388888d951461018c578063d5abeb01146101a657610072565b80633bbed4a0146100775780633f5c50c4146100ac57806369fe0e2d1461013e575b600080fd5b6100aa6004803603602081101561008d57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166101ae565b005b6100c9600480360360208110156100c257600080fd5b50356101f5565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101035781810151838201526020016100eb565b50505050905090810190601f1680156101305780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100aa6004803603602081101561015457600080fd5b50356102b4565b6101636102b9565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6101946102d5565b60408051918252519081900360200190f35b6101946102db565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6060610200826102e1565b60405160200180807f68747470733a2f2f626173655552492e6e65742f00000000000000000000000081525060140182805190602001908083835b6020831061027857805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161023b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405290505b919050565b600055565b60015473ffffffffffffffffffffffffffffffffffffffff1690565b60005490565b611f4090565b606081610322575060408051808201909152600181527f300000000000000000000000000000000000000000000000000000000000000060208201526102af565b8160005b811561033a57600101600a82049150610326565b60008167ffffffffffffffff8111801561035357600080fd5b506040519080825280601f01601f19166020018201604052801561037e576020820181803683370190505b5085935090507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82015b831561040557600a840660300160f81b828280600190039350815181106103cb57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a840493506103a8565b5094935050505056fea26469706673582212209338081681570406afb144924667d95feecc8d6e8548d7f8dc4526e7ad9dd3db64736f6c63430007060033",
92 | "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100725760003560e01c80637c5e62d0116100505780637c5e62d01461015b57806388888d951461018c578063d5abeb01146101a657610072565b80633bbed4a0146100775780633f5c50c4146100ac57806369fe0e2d1461013e575b600080fd5b6100aa6004803603602081101561008d57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166101ae565b005b6100c9600480360360208110156100c257600080fd5b50356101f5565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101035781810151838201526020016100eb565b50505050905090810190601f1680156101305780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100aa6004803603602081101561015457600080fd5b50356102b4565b6101636102b9565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6101946102d5565b60408051918252519081900360200190f35b6101946102db565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6060610200826102e1565b60405160200180807f68747470733a2f2f626173655552492e6e65742f00000000000000000000000081525060140182805190602001908083835b6020831061027857805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161023b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405290505b919050565b600055565b60015473ffffffffffffffffffffffffffffffffffffffff1690565b60005490565b611f4090565b606081610322575060408051808201909152600181527f300000000000000000000000000000000000000000000000000000000000000060208201526102af565b8160005b811561033a57600101600a82049150610326565b60008167ffffffffffffffff8111801561035357600080fd5b506040519080825280601f01601f19166020018201604052801561037e576020820181803683370190505b5085935090507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82015b831561040557600a840660300160f81b828280600190039350815181106103cb57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a840493506103a8565b5094935050505056fea26469706673582212209338081681570406afb144924667d95feecc8d6e8548d7f8dc4526e7ad9dd3db64736f6c63430007060033",
93 | "linkReferences": {},
94 | "deployedLinkReferences": {}
95 | }
96 |
--------------------------------------------------------------------------------
/src/gen/adapter/factories/MockExpansion__factory.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | /* Autogenerated file. Do not edit manually. */
3 | /* tslint:disable */
4 | /* eslint-disable */
5 | var __extends = (this && this.__extends) || (function () {
6 | var extendStatics = function (d, b) {
7 | extendStatics = Object.setPrototypeOf ||
8 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
9 | function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
10 | return extendStatics(d, b);
11 | };
12 | return function (d, b) {
13 | if (typeof b !== "function" && b !== null)
14 | throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
15 | extendStatics(d, b);
16 | function __() { this.constructor = d; }
17 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
18 | };
19 | })();
20 | exports.__esModule = true;
21 | exports.MockExpansion__factory = void 0;
22 | var ethers_1 = require("ethers");
23 | var MockExpansion__factory = /** @class */ (function (_super) {
24 | __extends(MockExpansion__factory, _super);
25 | function MockExpansion__factory(signer) {
26 | return _super.call(this, _abi, _bytecode, signer) || this;
27 | }
28 | MockExpansion__factory.prototype.deploy = function (overrides) {
29 | return _super.prototype.deploy.call(this, overrides || {});
30 | };
31 | MockExpansion__factory.prototype.getDeployTransaction = function (overrides) {
32 | return _super.prototype.getDeployTransaction.call(this, overrides || {});
33 | };
34 | MockExpansion__factory.prototype.attach = function (address) {
35 | return _super.prototype.attach.call(this, address);
36 | };
37 | MockExpansion__factory.prototype.connect = function (signer) {
38 | return _super.prototype.connect.call(this, signer);
39 | };
40 | MockExpansion__factory.connect = function (address, signerOrProvider) {
41 | return new ethers_1.Contract(address, _abi, signerOrProvider);
42 | };
43 | return MockExpansion__factory;
44 | }(ethers_1.ContractFactory));
45 | exports.MockExpansion__factory = MockExpansion__factory;
46 | var _abi = [
47 | {
48 | inputs: [],
49 | name: "claimFeeAmount",
50 | outputs: [
51 | {
52 | internalType: "uint256",
53 | name: "",
54 | type: "uint256"
55 | },
56 | ],
57 | stateMutability: "view",
58 | type: "function"
59 | },
60 | {
61 | inputs: [],
62 | name: "claimFeeRecipient",
63 | outputs: [
64 | {
65 | internalType: "address",
66 | name: "",
67 | type: "address"
68 | },
69 | ],
70 | stateMutability: "view",
71 | type: "function"
72 | },
73 | {
74 | inputs: [
75 | {
76 | internalType: "uint256",
77 | name: "lootId",
78 | type: "uint256"
79 | },
80 | ],
81 | name: "lootExpansionTokenUri",
82 | outputs: [
83 | {
84 | internalType: "string",
85 | name: "",
86 | type: "string"
87 | },
88 | ],
89 | stateMutability: "pure",
90 | type: "function"
91 | },
92 | {
93 | inputs: [],
94 | name: "maxSupply",
95 | outputs: [
96 | {
97 | internalType: "uint256",
98 | name: "",
99 | type: "uint256"
100 | },
101 | ],
102 | stateMutability: "view",
103 | type: "function"
104 | },
105 | {
106 | inputs: [
107 | {
108 | internalType: "uint256",
109 | name: "_feeAmount",
110 | type: "uint256"
111 | },
112 | ],
113 | name: "setFee",
114 | outputs: [],
115 | stateMutability: "nonpayable",
116 | type: "function"
117 | },
118 | {
119 | inputs: [
120 | {
121 | internalType: "address",
122 | name: "_feeRecipient",
123 | type: "address"
124 | },
125 | ],
126 | name: "setRecipient",
127 | outputs: [],
128 | stateMutability: "nonpayable",
129 | type: "function"
130 | },
131 | ];
132 | var _bytecode = "0x608060405234801561001057600080fd5b50610444806100206000396000f3fe608060405234801561001057600080fd5b50600436106100725760003560e01c80637c5e62d0116100505780637c5e62d01461015b57806388888d951461018c578063d5abeb01146101a657610072565b80633bbed4a0146100775780633f5c50c4146100ac57806369fe0e2d1461013e575b600080fd5b6100aa6004803603602081101561008d57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166101ae565b005b6100c9600480360360208110156100c257600080fd5b50356101f5565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101035781810151838201526020016100eb565b50505050905090810190601f1680156101305780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100aa6004803603602081101561015457600080fd5b50356102b4565b6101636102b9565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6101946102d5565b60408051918252519081900360200190f35b6101946102db565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6060610200826102e1565b60405160200180807f68747470733a2f2f626173655552492e6e65742f00000000000000000000000081525060140182805190602001908083835b6020831061027857805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161023b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405290505b919050565b600055565b60015473ffffffffffffffffffffffffffffffffffffffff1690565b60005490565b611f4090565b606081610322575060408051808201909152600181527f300000000000000000000000000000000000000000000000000000000000000060208201526102af565b8160005b811561033a57600101600a82049150610326565b60008167ffffffffffffffff8111801561035357600080fd5b506040519080825280601f01601f19166020018201604052801561037e576020820181803683370190505b5085935090507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82015b831561040557600a840660300160f81b828280600190039350815181106103cb57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a840493506103a8565b5094935050505056fea26469706673582212209338081681570406afb144924667d95feecc8d6e8548d7f8dc4526e7ad9dd3db64736f6c63430007060033";
133 |
--------------------------------------------------------------------------------
/src/gen/typechain/ILootExpansion.d.ts:
--------------------------------------------------------------------------------
1 | /* Autogenerated file. Do not edit manually. */
2 | /* tslint:disable */
3 | /* eslint-disable */
4 |
5 | import {
6 | ethers,
7 | EventFilter,
8 | Signer,
9 | BigNumber,
10 | BigNumberish,
11 | PopulatedTransaction,
12 | Contract,
13 | ContractTransaction,
14 | CallOverrides,
15 | } from "ethers";
16 | import { BytesLike } from "@ethersproject/bytes";
17 | import { Listener, Provider } from "@ethersproject/providers";
18 | import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
19 | import { TypedEventFilter, TypedEvent, TypedListener } from "./commons";
20 |
21 | interface ILootExpansionInterface extends ethers.utils.Interface {
22 | functions: {
23 | "claimFeeAmount()": FunctionFragment;
24 | "claimFeeRecipient()": FunctionFragment;
25 | "lootExpansionTokenUri(uint256)": FunctionFragment;
26 | };
27 |
28 | encodeFunctionData(
29 | functionFragment: "claimFeeAmount",
30 | values?: undefined
31 | ): string;
32 | encodeFunctionData(
33 | functionFragment: "claimFeeRecipient",
34 | values?: undefined
35 | ): string;
36 | encodeFunctionData(
37 | functionFragment: "lootExpansionTokenUri",
38 | values: [BigNumberish]
39 | ): string;
40 |
41 | decodeFunctionResult(
42 | functionFragment: "claimFeeAmount",
43 | data: BytesLike
44 | ): Result;
45 | decodeFunctionResult(
46 | functionFragment: "claimFeeRecipient",
47 | data: BytesLike
48 | ): Result;
49 | decodeFunctionResult(
50 | functionFragment: "lootExpansionTokenUri",
51 | data: BytesLike
52 | ): Result;
53 |
54 | events: {};
55 | }
56 |
57 | export class ILootExpansion extends Contract {
58 | connect(signerOrProvider: Signer | Provider | string): this;
59 | attach(addressOrName: string): this;
60 | deployed(): Promise;
61 |
62 | listeners, EventArgsObject>(
63 | eventFilter?: TypedEventFilter
64 | ): Array>;
65 | off, EventArgsObject>(
66 | eventFilter: TypedEventFilter,
67 | listener: TypedListener
68 | ): this;
69 | on, EventArgsObject>(
70 | eventFilter: TypedEventFilter,
71 | listener: TypedListener
72 | ): this;
73 | once, EventArgsObject>(
74 | eventFilter: TypedEventFilter,
75 | listener: TypedListener
76 | ): this;
77 | removeListener, EventArgsObject>(
78 | eventFilter: TypedEventFilter,
79 | listener: TypedListener
80 | ): this;
81 | removeAllListeners, EventArgsObject>(
82 | eventFilter: TypedEventFilter
83 | ): this;
84 |
85 | listeners(eventName?: string): Array;
86 | off(eventName: string, listener: Listener): this;
87 | on(eventName: string, listener: Listener): this;
88 | once(eventName: string, listener: Listener): this;
89 | removeListener(eventName: string, listener: Listener): this;
90 | removeAllListeners(eventName?: string): this;
91 |
92 | queryFilter, EventArgsObject>(
93 | event: TypedEventFilter,
94 | fromBlockOrBlockhash?: string | number | undefined,
95 | toBlock?: string | number | undefined
96 | ): Promise>>;
97 |
98 | interface: ILootExpansionInterface;
99 |
100 | functions: {
101 | claimFeeAmount(
102 | overrides?: CallOverrides
103 | ): Promise<[BigNumber] & { feeAmount: BigNumber }>;
104 |
105 | "claimFeeAmount()"(
106 | overrides?: CallOverrides
107 | ): Promise<[BigNumber] & { feeAmount: BigNumber }>;
108 |
109 | claimFeeRecipient(
110 | overrides?: CallOverrides
111 | ): Promise<[string] & { feeRecipient: string }>;
112 |
113 | "claimFeeRecipient()"(
114 | overrides?: CallOverrides
115 | ): Promise<[string] & { feeRecipient: string }>;
116 |
117 | lootExpansionTokenUri(
118 | lootId: BigNumberish,
119 | overrides?: CallOverrides
120 | ): Promise<[string] & { tokenUri: string }>;
121 |
122 | "lootExpansionTokenUri(uint256)"(
123 | lootId: BigNumberish,
124 | overrides?: CallOverrides
125 | ): Promise<[string] & { tokenUri: string }>;
126 | };
127 |
128 | claimFeeAmount(overrides?: CallOverrides): Promise;
129 |
130 | "claimFeeAmount()"(overrides?: CallOverrides): Promise;
131 |
132 | claimFeeRecipient(overrides?: CallOverrides): Promise;
133 |
134 | "claimFeeRecipient()"(overrides?: CallOverrides): Promise;
135 |
136 | lootExpansionTokenUri(
137 | lootId: BigNumberish,
138 | overrides?: CallOverrides
139 | ): Promise;
140 |
141 | "lootExpansionTokenUri(uint256)"(
142 | lootId: BigNumberish,
143 | overrides?: CallOverrides
144 | ): Promise;
145 |
146 | callStatic: {
147 | claimFeeAmount(overrides?: CallOverrides): Promise;
148 |
149 | "claimFeeAmount()"(overrides?: CallOverrides): Promise;
150 |
151 | claimFeeRecipient(overrides?: CallOverrides): Promise;
152 |
153 | "claimFeeRecipient()"(overrides?: CallOverrides): Promise;
154 |
155 | lootExpansionTokenUri(
156 | lootId: BigNumberish,
157 | overrides?: CallOverrides
158 | ): Promise;
159 |
160 | "lootExpansionTokenUri(uint256)"(
161 | lootId: BigNumberish,
162 | overrides?: CallOverrides
163 | ): Promise;
164 | };
165 |
166 | filters: {};
167 |
168 | estimateGas: {
169 | claimFeeAmount(overrides?: CallOverrides): Promise;
170 |
171 | "claimFeeAmount()"(overrides?: CallOverrides): Promise;
172 |
173 | claimFeeRecipient(overrides?: CallOverrides): Promise;
174 |
175 | "claimFeeRecipient()"(overrides?: CallOverrides): Promise;
176 |
177 | lootExpansionTokenUri(
178 | lootId: BigNumberish,
179 | overrides?: CallOverrides
180 | ): Promise;
181 |
182 | "lootExpansionTokenUri(uint256)"(
183 | lootId: BigNumberish,
184 | overrides?: CallOverrides
185 | ): Promise;
186 | };
187 |
188 | populateTransaction: {
189 | claimFeeAmount(overrides?: CallOverrides): Promise;
190 |
191 | "claimFeeAmount()"(
192 | overrides?: CallOverrides
193 | ): Promise;
194 |
195 | claimFeeRecipient(overrides?: CallOverrides): Promise;
196 |
197 | "claimFeeRecipient()"(
198 | overrides?: CallOverrides
199 | ): Promise;
200 |
201 | lootExpansionTokenUri(
202 | lootId: BigNumberish,
203 | overrides?: CallOverrides
204 | ): Promise;
205 |
206 | "lootExpansionTokenUri(uint256)"(
207 | lootId: BigNumberish,
208 | overrides?: CallOverrides
209 | ): Promise;
210 | };
211 | }
212 |
--------------------------------------------------------------------------------
/src/artifacts/@openzeppelin/contracts/token/ERC721/IERC721.sol/IERC721.json:
--------------------------------------------------------------------------------
1 | {
2 | "_format": "hh-sol-artifact-1",
3 | "contractName": "IERC721",
4 | "sourceName": "@openzeppelin/contracts/token/ERC721/IERC721.sol",
5 | "abi": [
6 | {
7 | "anonymous": false,
8 | "inputs": [
9 | {
10 | "indexed": true,
11 | "internalType": "address",
12 | "name": "owner",
13 | "type": "address"
14 | },
15 | {
16 | "indexed": true,
17 | "internalType": "address",
18 | "name": "approved",
19 | "type": "address"
20 | },
21 | {
22 | "indexed": true,
23 | "internalType": "uint256",
24 | "name": "tokenId",
25 | "type": "uint256"
26 | }
27 | ],
28 | "name": "Approval",
29 | "type": "event"
30 | },
31 | {
32 | "anonymous": false,
33 | "inputs": [
34 | {
35 | "indexed": true,
36 | "internalType": "address",
37 | "name": "owner",
38 | "type": "address"
39 | },
40 | {
41 | "indexed": true,
42 | "internalType": "address",
43 | "name": "operator",
44 | "type": "address"
45 | },
46 | {
47 | "indexed": false,
48 | "internalType": "bool",
49 | "name": "approved",
50 | "type": "bool"
51 | }
52 | ],
53 | "name": "ApprovalForAll",
54 | "type": "event"
55 | },
56 | {
57 | "anonymous": false,
58 | "inputs": [
59 | {
60 | "indexed": true,
61 | "internalType": "address",
62 | "name": "from",
63 | "type": "address"
64 | },
65 | {
66 | "indexed": true,
67 | "internalType": "address",
68 | "name": "to",
69 | "type": "address"
70 | },
71 | {
72 | "indexed": true,
73 | "internalType": "uint256",
74 | "name": "tokenId",
75 | "type": "uint256"
76 | }
77 | ],
78 | "name": "Transfer",
79 | "type": "event"
80 | },
81 | {
82 | "inputs": [
83 | {
84 | "internalType": "address",
85 | "name": "to",
86 | "type": "address"
87 | },
88 | {
89 | "internalType": "uint256",
90 | "name": "tokenId",
91 | "type": "uint256"
92 | }
93 | ],
94 | "name": "approve",
95 | "outputs": [],
96 | "stateMutability": "nonpayable",
97 | "type": "function"
98 | },
99 | {
100 | "inputs": [
101 | {
102 | "internalType": "address",
103 | "name": "owner",
104 | "type": "address"
105 | }
106 | ],
107 | "name": "balanceOf",
108 | "outputs": [
109 | {
110 | "internalType": "uint256",
111 | "name": "balance",
112 | "type": "uint256"
113 | }
114 | ],
115 | "stateMutability": "view",
116 | "type": "function"
117 | },
118 | {
119 | "inputs": [
120 | {
121 | "internalType": "uint256",
122 | "name": "tokenId",
123 | "type": "uint256"
124 | }
125 | ],
126 | "name": "getApproved",
127 | "outputs": [
128 | {
129 | "internalType": "address",
130 | "name": "operator",
131 | "type": "address"
132 | }
133 | ],
134 | "stateMutability": "view",
135 | "type": "function"
136 | },
137 | {
138 | "inputs": [
139 | {
140 | "internalType": "address",
141 | "name": "owner",
142 | "type": "address"
143 | },
144 | {
145 | "internalType": "address",
146 | "name": "operator",
147 | "type": "address"
148 | }
149 | ],
150 | "name": "isApprovedForAll",
151 | "outputs": [
152 | {
153 | "internalType": "bool",
154 | "name": "",
155 | "type": "bool"
156 | }
157 | ],
158 | "stateMutability": "view",
159 | "type": "function"
160 | },
161 | {
162 | "inputs": [
163 | {
164 | "internalType": "uint256",
165 | "name": "tokenId",
166 | "type": "uint256"
167 | }
168 | ],
169 | "name": "ownerOf",
170 | "outputs": [
171 | {
172 | "internalType": "address",
173 | "name": "owner",
174 | "type": "address"
175 | }
176 | ],
177 | "stateMutability": "view",
178 | "type": "function"
179 | },
180 | {
181 | "inputs": [
182 | {
183 | "internalType": "address",
184 | "name": "from",
185 | "type": "address"
186 | },
187 | {
188 | "internalType": "address",
189 | "name": "to",
190 | "type": "address"
191 | },
192 | {
193 | "internalType": "uint256",
194 | "name": "tokenId",
195 | "type": "uint256"
196 | }
197 | ],
198 | "name": "safeTransferFrom",
199 | "outputs": [],
200 | "stateMutability": "nonpayable",
201 | "type": "function"
202 | },
203 | {
204 | "inputs": [
205 | {
206 | "internalType": "address",
207 | "name": "from",
208 | "type": "address"
209 | },
210 | {
211 | "internalType": "address",
212 | "name": "to",
213 | "type": "address"
214 | },
215 | {
216 | "internalType": "uint256",
217 | "name": "tokenId",
218 | "type": "uint256"
219 | },
220 | {
221 | "internalType": "bytes",
222 | "name": "data",
223 | "type": "bytes"
224 | }
225 | ],
226 | "name": "safeTransferFrom",
227 | "outputs": [],
228 | "stateMutability": "nonpayable",
229 | "type": "function"
230 | },
231 | {
232 | "inputs": [
233 | {
234 | "internalType": "address",
235 | "name": "operator",
236 | "type": "address"
237 | },
238 | {
239 | "internalType": "bool",
240 | "name": "_approved",
241 | "type": "bool"
242 | }
243 | ],
244 | "name": "setApprovalForAll",
245 | "outputs": [],
246 | "stateMutability": "nonpayable",
247 | "type": "function"
248 | },
249 | {
250 | "inputs": [
251 | {
252 | "internalType": "bytes4",
253 | "name": "interfaceId",
254 | "type": "bytes4"
255 | }
256 | ],
257 | "name": "supportsInterface",
258 | "outputs": [
259 | {
260 | "internalType": "bool",
261 | "name": "",
262 | "type": "bool"
263 | }
264 | ],
265 | "stateMutability": "view",
266 | "type": "function"
267 | },
268 | {
269 | "inputs": [
270 | {
271 | "internalType": "address",
272 | "name": "from",
273 | "type": "address"
274 | },
275 | {
276 | "internalType": "address",
277 | "name": "to",
278 | "type": "address"
279 | },
280 | {
281 | "internalType": "uint256",
282 | "name": "tokenId",
283 | "type": "uint256"
284 | }
285 | ],
286 | "name": "transferFrom",
287 | "outputs": [],
288 | "stateMutability": "nonpayable",
289 | "type": "function"
290 | }
291 | ],
292 | "bytecode": "0x",
293 | "deployedBytecode": "0x",
294 | "linkReferences": {},
295 | "deployedLinkReferences": {}
296 | }
297 |
--------------------------------------------------------------------------------
/src/artifacts/@openzeppelin/contracts/token/ERC721/IERC721Metadata.sol/IERC721Metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "_format": "hh-sol-artifact-1",
3 | "contractName": "IERC721Metadata",
4 | "sourceName": "@openzeppelin/contracts/token/ERC721/IERC721Metadata.sol",
5 | "abi": [
6 | {
7 | "anonymous": false,
8 | "inputs": [
9 | {
10 | "indexed": true,
11 | "internalType": "address",
12 | "name": "owner",
13 | "type": "address"
14 | },
15 | {
16 | "indexed": true,
17 | "internalType": "address",
18 | "name": "approved",
19 | "type": "address"
20 | },
21 | {
22 | "indexed": true,
23 | "internalType": "uint256",
24 | "name": "tokenId",
25 | "type": "uint256"
26 | }
27 | ],
28 | "name": "Approval",
29 | "type": "event"
30 | },
31 | {
32 | "anonymous": false,
33 | "inputs": [
34 | {
35 | "indexed": true,
36 | "internalType": "address",
37 | "name": "owner",
38 | "type": "address"
39 | },
40 | {
41 | "indexed": true,
42 | "internalType": "address",
43 | "name": "operator",
44 | "type": "address"
45 | },
46 | {
47 | "indexed": false,
48 | "internalType": "bool",
49 | "name": "approved",
50 | "type": "bool"
51 | }
52 | ],
53 | "name": "ApprovalForAll",
54 | "type": "event"
55 | },
56 | {
57 | "anonymous": false,
58 | "inputs": [
59 | {
60 | "indexed": true,
61 | "internalType": "address",
62 | "name": "from",
63 | "type": "address"
64 | },
65 | {
66 | "indexed": true,
67 | "internalType": "address",
68 | "name": "to",
69 | "type": "address"
70 | },
71 | {
72 | "indexed": true,
73 | "internalType": "uint256",
74 | "name": "tokenId",
75 | "type": "uint256"
76 | }
77 | ],
78 | "name": "Transfer",
79 | "type": "event"
80 | },
81 | {
82 | "inputs": [
83 | {
84 | "internalType": "address",
85 | "name": "to",
86 | "type": "address"
87 | },
88 | {
89 | "internalType": "uint256",
90 | "name": "tokenId",
91 | "type": "uint256"
92 | }
93 | ],
94 | "name": "approve",
95 | "outputs": [],
96 | "stateMutability": "nonpayable",
97 | "type": "function"
98 | },
99 | {
100 | "inputs": [
101 | {
102 | "internalType": "address",
103 | "name": "owner",
104 | "type": "address"
105 | }
106 | ],
107 | "name": "balanceOf",
108 | "outputs": [
109 | {
110 | "internalType": "uint256",
111 | "name": "balance",
112 | "type": "uint256"
113 | }
114 | ],
115 | "stateMutability": "view",
116 | "type": "function"
117 | },
118 | {
119 | "inputs": [
120 | {
121 | "internalType": "uint256",
122 | "name": "tokenId",
123 | "type": "uint256"
124 | }
125 | ],
126 | "name": "getApproved",
127 | "outputs": [
128 | {
129 | "internalType": "address",
130 | "name": "operator",
131 | "type": "address"
132 | }
133 | ],
134 | "stateMutability": "view",
135 | "type": "function"
136 | },
137 | {
138 | "inputs": [
139 | {
140 | "internalType": "address",
141 | "name": "owner",
142 | "type": "address"
143 | },
144 | {
145 | "internalType": "address",
146 | "name": "operator",
147 | "type": "address"
148 | }
149 | ],
150 | "name": "isApprovedForAll",
151 | "outputs": [
152 | {
153 | "internalType": "bool",
154 | "name": "",
155 | "type": "bool"
156 | }
157 | ],
158 | "stateMutability": "view",
159 | "type": "function"
160 | },
161 | {
162 | "inputs": [],
163 | "name": "name",
164 | "outputs": [
165 | {
166 | "internalType": "string",
167 | "name": "",
168 | "type": "string"
169 | }
170 | ],
171 | "stateMutability": "view",
172 | "type": "function"
173 | },
174 | {
175 | "inputs": [
176 | {
177 | "internalType": "uint256",
178 | "name": "tokenId",
179 | "type": "uint256"
180 | }
181 | ],
182 | "name": "ownerOf",
183 | "outputs": [
184 | {
185 | "internalType": "address",
186 | "name": "owner",
187 | "type": "address"
188 | }
189 | ],
190 | "stateMutability": "view",
191 | "type": "function"
192 | },
193 | {
194 | "inputs": [
195 | {
196 | "internalType": "address",
197 | "name": "from",
198 | "type": "address"
199 | },
200 | {
201 | "internalType": "address",
202 | "name": "to",
203 | "type": "address"
204 | },
205 | {
206 | "internalType": "uint256",
207 | "name": "tokenId",
208 | "type": "uint256"
209 | }
210 | ],
211 | "name": "safeTransferFrom",
212 | "outputs": [],
213 | "stateMutability": "nonpayable",
214 | "type": "function"
215 | },
216 | {
217 | "inputs": [
218 | {
219 | "internalType": "address",
220 | "name": "from",
221 | "type": "address"
222 | },
223 | {
224 | "internalType": "address",
225 | "name": "to",
226 | "type": "address"
227 | },
228 | {
229 | "internalType": "uint256",
230 | "name": "tokenId",
231 | "type": "uint256"
232 | },
233 | {
234 | "internalType": "bytes",
235 | "name": "data",
236 | "type": "bytes"
237 | }
238 | ],
239 | "name": "safeTransferFrom",
240 | "outputs": [],
241 | "stateMutability": "nonpayable",
242 | "type": "function"
243 | },
244 | {
245 | "inputs": [
246 | {
247 | "internalType": "address",
248 | "name": "operator",
249 | "type": "address"
250 | },
251 | {
252 | "internalType": "bool",
253 | "name": "_approved",
254 | "type": "bool"
255 | }
256 | ],
257 | "name": "setApprovalForAll",
258 | "outputs": [],
259 | "stateMutability": "nonpayable",
260 | "type": "function"
261 | },
262 | {
263 | "inputs": [
264 | {
265 | "internalType": "bytes4",
266 | "name": "interfaceId",
267 | "type": "bytes4"
268 | }
269 | ],
270 | "name": "supportsInterface",
271 | "outputs": [
272 | {
273 | "internalType": "bool",
274 | "name": "",
275 | "type": "bool"
276 | }
277 | ],
278 | "stateMutability": "view",
279 | "type": "function"
280 | },
281 | {
282 | "inputs": [],
283 | "name": "symbol",
284 | "outputs": [
285 | {
286 | "internalType": "string",
287 | "name": "",
288 | "type": "string"
289 | }
290 | ],
291 | "stateMutability": "view",
292 | "type": "function"
293 | },
294 | {
295 | "inputs": [
296 | {
297 | "internalType": "uint256",
298 | "name": "tokenId",
299 | "type": "uint256"
300 | }
301 | ],
302 | "name": "tokenURI",
303 | "outputs": [
304 | {
305 | "internalType": "string",
306 | "name": "",
307 | "type": "string"
308 | }
309 | ],
310 | "stateMutability": "view",
311 | "type": "function"
312 | },
313 | {
314 | "inputs": [
315 | {
316 | "internalType": "address",
317 | "name": "from",
318 | "type": "address"
319 | },
320 | {
321 | "internalType": "address",
322 | "name": "to",
323 | "type": "address"
324 | },
325 | {
326 | "internalType": "uint256",
327 | "name": "tokenId",
328 | "type": "uint256"
329 | }
330 | ],
331 | "name": "transferFrom",
332 | "outputs": [],
333 | "stateMutability": "nonpayable",
334 | "type": "function"
335 | }
336 | ],
337 | "bytecode": "0x",
338 | "deployedBytecode": "0x",
339 | "linkReferences": {},
340 | "deployedLinkReferences": {}
341 | }
342 |
--------------------------------------------------------------------------------
/src/gen/typechain/Migrations.d.ts:
--------------------------------------------------------------------------------
1 | /* Autogenerated file. Do not edit manually. */
2 | /* tslint:disable */
3 | /* eslint-disable */
4 |
5 | import {
6 | ethers,
7 | EventFilter,
8 | Signer,
9 | BigNumber,
10 | BigNumberish,
11 | PopulatedTransaction,
12 | Contract,
13 | ContractTransaction,
14 | Overrides,
15 | CallOverrides,
16 | } from "ethers";
17 | import { BytesLike } from "@ethersproject/bytes";
18 | import { Listener, Provider } from "@ethersproject/providers";
19 | import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
20 | import { TypedEventFilter, TypedEvent, TypedListener } from "./commons";
21 |
22 | interface MigrationsInterface extends ethers.utils.Interface {
23 | functions: {
24 | "last_completed_migration()": FunctionFragment;
25 | "owner()": FunctionFragment;
26 | "setCompleted(uint256)": FunctionFragment;
27 | "upgrade(address)": FunctionFragment;
28 | };
29 |
30 | encodeFunctionData(
31 | functionFragment: "last_completed_migration",
32 | values?: undefined
33 | ): string;
34 | encodeFunctionData(functionFragment: "owner", values?: undefined): string;
35 | encodeFunctionData(
36 | functionFragment: "setCompleted",
37 | values: [BigNumberish]
38 | ): string;
39 | encodeFunctionData(functionFragment: "upgrade", values: [string]): string;
40 |
41 | decodeFunctionResult(
42 | functionFragment: "last_completed_migration",
43 | data: BytesLike
44 | ): Result;
45 | decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
46 | decodeFunctionResult(
47 | functionFragment: "setCompleted",
48 | data: BytesLike
49 | ): Result;
50 | decodeFunctionResult(functionFragment: "upgrade", data: BytesLike): Result;
51 |
52 | events: {};
53 | }
54 |
55 | export class Migrations extends Contract {
56 | connect(signerOrProvider: Signer | Provider | string): this;
57 | attach(addressOrName: string): this;
58 | deployed(): Promise;
59 |
60 | listeners, EventArgsObject>(
61 | eventFilter?: TypedEventFilter
62 | ): Array>;
63 | off, EventArgsObject>(
64 | eventFilter: TypedEventFilter,
65 | listener: TypedListener
66 | ): this;
67 | on, EventArgsObject>(
68 | eventFilter: TypedEventFilter,
69 | listener: TypedListener
70 | ): this;
71 | once, EventArgsObject>(
72 | eventFilter: TypedEventFilter,
73 | listener: TypedListener
74 | ): this;
75 | removeListener, EventArgsObject>(
76 | eventFilter: TypedEventFilter,
77 | listener: TypedListener
78 | ): this;
79 | removeAllListeners, EventArgsObject>(
80 | eventFilter: TypedEventFilter
81 | ): this;
82 |
83 | listeners(eventName?: string): Array;
84 | off(eventName: string, listener: Listener): this;
85 | on(eventName: string, listener: Listener): this;
86 | once(eventName: string, listener: Listener): this;
87 | removeListener(eventName: string, listener: Listener): this;
88 | removeAllListeners(eventName?: string): this;
89 |
90 | queryFilter, EventArgsObject>(
91 | event: TypedEventFilter,
92 | fromBlockOrBlockhash?: string | number | undefined,
93 | toBlock?: string | number | undefined
94 | ): Promise>>;
95 |
96 | interface: MigrationsInterface;
97 |
98 | functions: {
99 | last_completed_migration(overrides?: CallOverrides): Promise<[BigNumber]>;
100 |
101 | "last_completed_migration()"(
102 | overrides?: CallOverrides
103 | ): Promise<[BigNumber]>;
104 |
105 | owner(overrides?: CallOverrides): Promise<[string]>;
106 |
107 | "owner()"(overrides?: CallOverrides): Promise<[string]>;
108 |
109 | setCompleted(
110 | completed: BigNumberish,
111 | overrides?: Overrides & { from?: string | Promise }
112 | ): Promise;
113 |
114 | "setCompleted(uint256)"(
115 | completed: BigNumberish,
116 | overrides?: Overrides & { from?: string | Promise }
117 | ): Promise;
118 |
119 | upgrade(
120 | new_address: string,
121 | overrides?: Overrides & { from?: string | Promise }
122 | ): Promise;
123 |
124 | "upgrade(address)"(
125 | new_address: string,
126 | overrides?: Overrides & { from?: string | Promise }
127 | ): Promise;
128 | };
129 |
130 | last_completed_migration(overrides?: CallOverrides): Promise;
131 |
132 | "last_completed_migration()"(overrides?: CallOverrides): Promise;
133 |
134 | owner(overrides?: CallOverrides): Promise;
135 |
136 | "owner()"(overrides?: CallOverrides): Promise;
137 |
138 | setCompleted(
139 | completed: BigNumberish,
140 | overrides?: Overrides & { from?: string | Promise }
141 | ): Promise;
142 |
143 | "setCompleted(uint256)"(
144 | completed: BigNumberish,
145 | overrides?: Overrides & { from?: string | Promise }
146 | ): Promise;
147 |
148 | upgrade(
149 | new_address: string,
150 | overrides?: Overrides & { from?: string | Promise }
151 | ): Promise;
152 |
153 | "upgrade(address)"(
154 | new_address: string,
155 | overrides?: Overrides & { from?: string | Promise }
156 | ): Promise;
157 |
158 | callStatic: {
159 | last_completed_migration(overrides?: CallOverrides): Promise;
160 |
161 | "last_completed_migration()"(overrides?: CallOverrides): Promise;
162 |
163 | owner(overrides?: CallOverrides): Promise;
164 |
165 | "owner()"(overrides?: CallOverrides): Promise;
166 |
167 | setCompleted(
168 | completed: BigNumberish,
169 | overrides?: CallOverrides
170 | ): Promise;
171 |
172 | "setCompleted(uint256)"(
173 | completed: BigNumberish,
174 | overrides?: CallOverrides
175 | ): Promise;
176 |
177 | upgrade(new_address: string, overrides?: CallOverrides): Promise;
178 |
179 | "upgrade(address)"(
180 | new_address: string,
181 | overrides?: CallOverrides
182 | ): Promise;
183 | };
184 |
185 | filters: {};
186 |
187 | estimateGas: {
188 | last_completed_migration(overrides?: CallOverrides): Promise;
189 |
190 | "last_completed_migration()"(overrides?: CallOverrides): Promise;
191 |
192 | owner(overrides?: CallOverrides): Promise;
193 |
194 | "owner()"(overrides?: CallOverrides): Promise;
195 |
196 | setCompleted(
197 | completed: BigNumberish,
198 | overrides?: Overrides & { from?: string | Promise }
199 | ): Promise;
200 |
201 | "setCompleted(uint256)"(
202 | completed: BigNumberish,
203 | overrides?: Overrides & { from?: string | Promise }
204 | ): Promise;
205 |
206 | upgrade(
207 | new_address: string,
208 | overrides?: Overrides & { from?: string | Promise }
209 | ): Promise;
210 |
211 | "upgrade(address)"(
212 | new_address: string,
213 | overrides?: Overrides & { from?: string | Promise }
214 | ): Promise;
215 | };
216 |
217 | populateTransaction: {
218 | last_completed_migration(
219 | overrides?: CallOverrides
220 | ): Promise;
221 |
222 | "last_completed_migration()"(
223 | overrides?: CallOverrides
224 | ): Promise;
225 |
226 | owner(overrides?: CallOverrides): Promise;
227 |
228 | "owner()"(overrides?: CallOverrides): Promise;
229 |
230 | setCompleted(
231 | completed: BigNumberish,
232 | overrides?: Overrides & { from?: string | Promise }
233 | ): Promise;
234 |
235 | "setCompleted(uint256)"(
236 | completed: BigNumberish,
237 | overrides?: Overrides & { from?: string | Promise }
238 | ): Promise;
239 |
240 | upgrade(
241 | new_address: string,
242 | overrides?: Overrides & { from?: string | Promise }
243 | ): Promise;
244 |
245 | "upgrade(address)"(
246 | new_address: string,
247 | overrides?: Overrides & { from?: string | Promise }
248 | ): Promise;
249 | };
250 | }
251 |
--------------------------------------------------------------------------------
/src/artifacts/@openzeppelin/contracts/token/ERC721/IERC721Enumerable.sol/IERC721Enumerable.json:
--------------------------------------------------------------------------------
1 | {
2 | "_format": "hh-sol-artifact-1",
3 | "contractName": "IERC721Enumerable",
4 | "sourceName": "@openzeppelin/contracts/token/ERC721/IERC721Enumerable.sol",
5 | "abi": [
6 | {
7 | "anonymous": false,
8 | "inputs": [
9 | {
10 | "indexed": true,
11 | "internalType": "address",
12 | "name": "owner",
13 | "type": "address"
14 | },
15 | {
16 | "indexed": true,
17 | "internalType": "address",
18 | "name": "approved",
19 | "type": "address"
20 | },
21 | {
22 | "indexed": true,
23 | "internalType": "uint256",
24 | "name": "tokenId",
25 | "type": "uint256"
26 | }
27 | ],
28 | "name": "Approval",
29 | "type": "event"
30 | },
31 | {
32 | "anonymous": false,
33 | "inputs": [
34 | {
35 | "indexed": true,
36 | "internalType": "address",
37 | "name": "owner",
38 | "type": "address"
39 | },
40 | {
41 | "indexed": true,
42 | "internalType": "address",
43 | "name": "operator",
44 | "type": "address"
45 | },
46 | {
47 | "indexed": false,
48 | "internalType": "bool",
49 | "name": "approved",
50 | "type": "bool"
51 | }
52 | ],
53 | "name": "ApprovalForAll",
54 | "type": "event"
55 | },
56 | {
57 | "anonymous": false,
58 | "inputs": [
59 | {
60 | "indexed": true,
61 | "internalType": "address",
62 | "name": "from",
63 | "type": "address"
64 | },
65 | {
66 | "indexed": true,
67 | "internalType": "address",
68 | "name": "to",
69 | "type": "address"
70 | },
71 | {
72 | "indexed": true,
73 | "internalType": "uint256",
74 | "name": "tokenId",
75 | "type": "uint256"
76 | }
77 | ],
78 | "name": "Transfer",
79 | "type": "event"
80 | },
81 | {
82 | "inputs": [
83 | {
84 | "internalType": "address",
85 | "name": "to",
86 | "type": "address"
87 | },
88 | {
89 | "internalType": "uint256",
90 | "name": "tokenId",
91 | "type": "uint256"
92 | }
93 | ],
94 | "name": "approve",
95 | "outputs": [],
96 | "stateMutability": "nonpayable",
97 | "type": "function"
98 | },
99 | {
100 | "inputs": [
101 | {
102 | "internalType": "address",
103 | "name": "owner",
104 | "type": "address"
105 | }
106 | ],
107 | "name": "balanceOf",
108 | "outputs": [
109 | {
110 | "internalType": "uint256",
111 | "name": "balance",
112 | "type": "uint256"
113 | }
114 | ],
115 | "stateMutability": "view",
116 | "type": "function"
117 | },
118 | {
119 | "inputs": [
120 | {
121 | "internalType": "uint256",
122 | "name": "tokenId",
123 | "type": "uint256"
124 | }
125 | ],
126 | "name": "getApproved",
127 | "outputs": [
128 | {
129 | "internalType": "address",
130 | "name": "operator",
131 | "type": "address"
132 | }
133 | ],
134 | "stateMutability": "view",
135 | "type": "function"
136 | },
137 | {
138 | "inputs": [
139 | {
140 | "internalType": "address",
141 | "name": "owner",
142 | "type": "address"
143 | },
144 | {
145 | "internalType": "address",
146 | "name": "operator",
147 | "type": "address"
148 | }
149 | ],
150 | "name": "isApprovedForAll",
151 | "outputs": [
152 | {
153 | "internalType": "bool",
154 | "name": "",
155 | "type": "bool"
156 | }
157 | ],
158 | "stateMutability": "view",
159 | "type": "function"
160 | },
161 | {
162 | "inputs": [
163 | {
164 | "internalType": "uint256",
165 | "name": "tokenId",
166 | "type": "uint256"
167 | }
168 | ],
169 | "name": "ownerOf",
170 | "outputs": [
171 | {
172 | "internalType": "address",
173 | "name": "owner",
174 | "type": "address"
175 | }
176 | ],
177 | "stateMutability": "view",
178 | "type": "function"
179 | },
180 | {
181 | "inputs": [
182 | {
183 | "internalType": "address",
184 | "name": "from",
185 | "type": "address"
186 | },
187 | {
188 | "internalType": "address",
189 | "name": "to",
190 | "type": "address"
191 | },
192 | {
193 | "internalType": "uint256",
194 | "name": "tokenId",
195 | "type": "uint256"
196 | }
197 | ],
198 | "name": "safeTransferFrom",
199 | "outputs": [],
200 | "stateMutability": "nonpayable",
201 | "type": "function"
202 | },
203 | {
204 | "inputs": [
205 | {
206 | "internalType": "address",
207 | "name": "from",
208 | "type": "address"
209 | },
210 | {
211 | "internalType": "address",
212 | "name": "to",
213 | "type": "address"
214 | },
215 | {
216 | "internalType": "uint256",
217 | "name": "tokenId",
218 | "type": "uint256"
219 | },
220 | {
221 | "internalType": "bytes",
222 | "name": "data",
223 | "type": "bytes"
224 | }
225 | ],
226 | "name": "safeTransferFrom",
227 | "outputs": [],
228 | "stateMutability": "nonpayable",
229 | "type": "function"
230 | },
231 | {
232 | "inputs": [
233 | {
234 | "internalType": "address",
235 | "name": "operator",
236 | "type": "address"
237 | },
238 | {
239 | "internalType": "bool",
240 | "name": "_approved",
241 | "type": "bool"
242 | }
243 | ],
244 | "name": "setApprovalForAll",
245 | "outputs": [],
246 | "stateMutability": "nonpayable",
247 | "type": "function"
248 | },
249 | {
250 | "inputs": [
251 | {
252 | "internalType": "bytes4",
253 | "name": "interfaceId",
254 | "type": "bytes4"
255 | }
256 | ],
257 | "name": "supportsInterface",
258 | "outputs": [
259 | {
260 | "internalType": "bool",
261 | "name": "",
262 | "type": "bool"
263 | }
264 | ],
265 | "stateMutability": "view",
266 | "type": "function"
267 | },
268 | {
269 | "inputs": [
270 | {
271 | "internalType": "uint256",
272 | "name": "index",
273 | "type": "uint256"
274 | }
275 | ],
276 | "name": "tokenByIndex",
277 | "outputs": [
278 | {
279 | "internalType": "uint256",
280 | "name": "",
281 | "type": "uint256"
282 | }
283 | ],
284 | "stateMutability": "view",
285 | "type": "function"
286 | },
287 | {
288 | "inputs": [
289 | {
290 | "internalType": "address",
291 | "name": "owner",
292 | "type": "address"
293 | },
294 | {
295 | "internalType": "uint256",
296 | "name": "index",
297 | "type": "uint256"
298 | }
299 | ],
300 | "name": "tokenOfOwnerByIndex",
301 | "outputs": [
302 | {
303 | "internalType": "uint256",
304 | "name": "tokenId",
305 | "type": "uint256"
306 | }
307 | ],
308 | "stateMutability": "view",
309 | "type": "function"
310 | },
311 | {
312 | "inputs": [],
313 | "name": "totalSupply",
314 | "outputs": [
315 | {
316 | "internalType": "uint256",
317 | "name": "",
318 | "type": "uint256"
319 | }
320 | ],
321 | "stateMutability": "view",
322 | "type": "function"
323 | },
324 | {
325 | "inputs": [
326 | {
327 | "internalType": "address",
328 | "name": "from",
329 | "type": "address"
330 | },
331 | {
332 | "internalType": "address",
333 | "name": "to",
334 | "type": "address"
335 | },
336 | {
337 | "internalType": "uint256",
338 | "name": "tokenId",
339 | "type": "uint256"
340 | }
341 | ],
342 | "name": "transferFrom",
343 | "outputs": [],
344 | "stateMutability": "nonpayable",
345 | "type": "function"
346 | }
347 | ],
348 | "bytecode": "0x",
349 | "deployedBytecode": "0x",
350 | "linkReferences": {},
351 | "deployedLinkReferences": {}
352 | }
353 |
--------------------------------------------------------------------------------
/src/gen/typechain/MockExpansion.d.ts:
--------------------------------------------------------------------------------
1 | /* Autogenerated file. Do not edit manually. */
2 | /* tslint:disable */
3 | /* eslint-disable */
4 |
5 | import {
6 | ethers,
7 | EventFilter,
8 | Signer,
9 | BigNumber,
10 | BigNumberish,
11 | PopulatedTransaction,
12 | Contract,
13 | ContractTransaction,
14 | Overrides,
15 | CallOverrides,
16 | } from "ethers";
17 | import { BytesLike } from "@ethersproject/bytes";
18 | import { Listener, Provider } from "@ethersproject/providers";
19 | import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
20 | import { TypedEventFilter, TypedEvent, TypedListener } from "./commons";
21 |
22 | interface MockExpansionInterface extends ethers.utils.Interface {
23 | functions: {
24 | "claimFeeAmount()": FunctionFragment;
25 | "claimFeeRecipient()": FunctionFragment;
26 | "lootExpansionTokenUri(uint256)": FunctionFragment;
27 | "maxSupply()": FunctionFragment;
28 | "setFee(uint256)": FunctionFragment;
29 | "setRecipient(address)": FunctionFragment;
30 | };
31 |
32 | encodeFunctionData(
33 | functionFragment: "claimFeeAmount",
34 | values?: undefined
35 | ): string;
36 | encodeFunctionData(
37 | functionFragment: "claimFeeRecipient",
38 | values?: undefined
39 | ): string;
40 | encodeFunctionData(
41 | functionFragment: "lootExpansionTokenUri",
42 | values: [BigNumberish]
43 | ): string;
44 | encodeFunctionData(functionFragment: "maxSupply", values?: undefined): string;
45 | encodeFunctionData(
46 | functionFragment: "setFee",
47 | values: [BigNumberish]
48 | ): string;
49 | encodeFunctionData(
50 | functionFragment: "setRecipient",
51 | values: [string]
52 | ): string;
53 |
54 | decodeFunctionResult(
55 | functionFragment: "claimFeeAmount",
56 | data: BytesLike
57 | ): Result;
58 | decodeFunctionResult(
59 | functionFragment: "claimFeeRecipient",
60 | data: BytesLike
61 | ): Result;
62 | decodeFunctionResult(
63 | functionFragment: "lootExpansionTokenUri",
64 | data: BytesLike
65 | ): Result;
66 | decodeFunctionResult(functionFragment: "maxSupply", data: BytesLike): Result;
67 | decodeFunctionResult(functionFragment: "setFee", data: BytesLike): Result;
68 | decodeFunctionResult(
69 | functionFragment: "setRecipient",
70 | data: BytesLike
71 | ): Result;
72 |
73 | events: {};
74 | }
75 |
76 | export class MockExpansion extends Contract {
77 | connect(signerOrProvider: Signer | Provider | string): this;
78 | attach(addressOrName: string): this;
79 | deployed(): Promise;
80 |
81 | listeners, EventArgsObject>(
82 | eventFilter?: TypedEventFilter
83 | ): Array>;
84 | off, EventArgsObject>(
85 | eventFilter: TypedEventFilter,
86 | listener: TypedListener
87 | ): this;
88 | on, EventArgsObject>(
89 | eventFilter: TypedEventFilter,
90 | listener: TypedListener
91 | ): this;
92 | once, EventArgsObject>(
93 | eventFilter: TypedEventFilter,
94 | listener: TypedListener
95 | ): this;
96 | removeListener, EventArgsObject>(
97 | eventFilter: TypedEventFilter,
98 | listener: TypedListener
99 | ): this;
100 | removeAllListeners, EventArgsObject>(
101 | eventFilter: TypedEventFilter
102 | ): this;
103 |
104 | listeners(eventName?: string): Array;
105 | off(eventName: string, listener: Listener): this;
106 | on(eventName: string, listener: Listener): this;
107 | once(eventName: string, listener: Listener): this;
108 | removeListener(eventName: string, listener: Listener): this;
109 | removeAllListeners(eventName?: string): this;
110 |
111 | queryFilter, EventArgsObject>(
112 | event: TypedEventFilter,
113 | fromBlockOrBlockhash?: string | number | undefined,
114 | toBlock?: string | number | undefined
115 | ): Promise>>;
116 |
117 | interface: MockExpansionInterface;
118 |
119 | functions: {
120 | claimFeeAmount(overrides?: CallOverrides): Promise<[BigNumber]>;
121 |
122 | "claimFeeAmount()"(overrides?: CallOverrides): Promise<[BigNumber]>;
123 |
124 | claimFeeRecipient(overrides?: CallOverrides): Promise<[string]>;
125 |
126 | "claimFeeRecipient()"(overrides?: CallOverrides): Promise<[string]>;
127 |
128 | lootExpansionTokenUri(
129 | lootId: BigNumberish,
130 | overrides?: CallOverrides
131 | ): Promise<[string]>;
132 |
133 | "lootExpansionTokenUri(uint256)"(
134 | lootId: BigNumberish,
135 | overrides?: CallOverrides
136 | ): Promise<[string]>;
137 |
138 | maxSupply(overrides?: CallOverrides): Promise<[BigNumber]>;
139 |
140 | "maxSupply()"(overrides?: CallOverrides): Promise<[BigNumber]>;
141 |
142 | setFee(
143 | _feeAmount: BigNumberish,
144 | overrides?: Overrides & { from?: string | Promise }
145 | ): Promise;
146 |
147 | "setFee(uint256)"(
148 | _feeAmount: BigNumberish,
149 | overrides?: Overrides & { from?: string | Promise }
150 | ): Promise;
151 |
152 | setRecipient(
153 | _feeRecipient: string,
154 | overrides?: Overrides & { from?: string | Promise }
155 | ): Promise;
156 |
157 | "setRecipient(address)"(
158 | _feeRecipient: string,
159 | overrides?: Overrides & { from?: string | Promise }
160 | ): Promise;
161 | };
162 |
163 | claimFeeAmount(overrides?: CallOverrides): Promise;
164 |
165 | "claimFeeAmount()"(overrides?: CallOverrides): Promise;
166 |
167 | claimFeeRecipient(overrides?: CallOverrides): Promise;
168 |
169 | "claimFeeRecipient()"(overrides?: CallOverrides): Promise;
170 |
171 | lootExpansionTokenUri(
172 | lootId: BigNumberish,
173 | overrides?: CallOverrides
174 | ): Promise;
175 |
176 | "lootExpansionTokenUri(uint256)"(
177 | lootId: BigNumberish,
178 | overrides?: CallOverrides
179 | ): Promise;
180 |
181 | maxSupply(overrides?: CallOverrides): Promise;
182 |
183 | "maxSupply()"(overrides?: CallOverrides): Promise;
184 |
185 | setFee(
186 | _feeAmount: BigNumberish,
187 | overrides?: Overrides & { from?: string | Promise }
188 | ): Promise;
189 |
190 | "setFee(uint256)"(
191 | _feeAmount: BigNumberish,
192 | overrides?: Overrides & { from?: string | Promise }
193 | ): Promise;
194 |
195 | setRecipient(
196 | _feeRecipient: string,
197 | overrides?: Overrides & { from?: string | Promise }
198 | ): Promise;
199 |
200 | "setRecipient(address)"(
201 | _feeRecipient: string,
202 | overrides?: Overrides & { from?: string | Promise }
203 | ): Promise;
204 |
205 | callStatic: {
206 | claimFeeAmount(overrides?: CallOverrides): Promise;
207 |
208 | "claimFeeAmount()"(overrides?: CallOverrides): Promise;
209 |
210 | claimFeeRecipient(overrides?: CallOverrides): Promise;
211 |
212 | "claimFeeRecipient()"(overrides?: CallOverrides): Promise;
213 |
214 | lootExpansionTokenUri(
215 | lootId: BigNumberish,
216 | overrides?: CallOverrides
217 | ): Promise;
218 |
219 | "lootExpansionTokenUri(uint256)"(
220 | lootId: BigNumberish,
221 | overrides?: CallOverrides
222 | ): Promise