Skip to content

Commit cbbf100

Browse files
committed
v3.0.0
1 parent 3e91af5 commit cbbf100

65 files changed

Lines changed: 725 additions & 670 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,5 @@ lerna-debug.log*
88

99
*.js.map
1010
build
11-
cache
1211
coverage
1312
coverage.json
14-
15-
artifacts/build-info
16-
artifacts/**/*.dbg.json

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# General Meta Wrapper Contract for ERC20
1+
General ERC20 -> ERC1155 Token Wrapper Contract
2+
===============================================
23

3-
Wrapper contract offering meta-transaction methods to any token compliant with the ERC-20 standard.
4-
5-
As well, it allows any ERC-20 token to function with an ERC-1155 contract.
4+
Allows any ERC-20 token to be wrapped inside of an ERC-1155 contract, and thereby
5+
allows an ERC-20 token to function as an ERC-1155 contract.
66

77
## How does it work?
88

hardhat.config.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ import 'hardhat-gas-reporter'
77
import 'solidity-coverage'
88

99
const config: HardhatUserConfig = {
10-
paths: {
11-
artifacts: './artifacts'
12-
},
1310
solidity: {
1411
version: '0.7.4',
1512
settings: {
@@ -23,6 +20,10 @@ const config: HardhatUserConfig = {
2320
}
2421
}
2522
},
23+
paths: {
24+
root: 'src',
25+
tests: '../tests'
26+
},
2627
networks: {
2728
ganache: {
2829
url: 'http://127.0.0.1:8545',

package.json

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,46 @@
11
{
22
"name": "erc20-meta-token",
3-
"version": "2.2.0",
4-
"description": "General ERC-1155 Transaction Wrapper Contract for ERC20s",
3+
"private": true,
4+
"workspaces": ["src"],
5+
"description": "General ERC-1155 Transaction Wrapper Contract for ERC20 Tokens",
56
"repository": "https://github.com/0xsequence/erc20-meta-token",
67
"license": "Apache-2.0",
78
"scripts": {
89
"build": "yarn clean && yarn compile && yarn gen:typings",
9-
"clean": "rimraf artifacts && rimraf typings/contracts && rimraf cache",
10+
"clean": "rimraf src/artifacts && rimraf src/typings/contracts && rimraf src/cache",
1011
"compile": "hardhat --max-memory 4096 compile",
11-
"gen:typings": "rimraf typings/contracts && typechain --target ethers-v5 --outDir typings/contracts './artifacts/!(build-info)/**/*[^dbg].json'",
12+
"gen:typings": "rimraf src/typings/contracts && typechain --target ethers-v5 --outDir src/typings/contracts './src/artifacts/!(build-info)/**/*[^dbg].json'",
1213
"test": "yarn build && yarn concurrently -k --success first 'yarn start:ganache' 'yarn test:ganache'",
1314
"test:hardhat": "hardhat test tests/*.spec.ts",
1415
"test:ganache": "hardhat --network ganache test tests/*.spec.ts",
1516
"test:gas-report": "REPORT_GAS=true yarn test",
1617
"test:benchmark": "hardhat --network ganache test tests/*.bench.ts",
1718
"lint": "yarn lint:ts && yarn lint:sol",
1819
"lint:fix": "yarn lint:ts:fix && yarn lint:sol:fix",
19-
"lint:sol": "solhint './contracts/**/*.sol'",
20-
"lint:sol:fix": "solhint './contracts/**/*.sol' --fix",
20+
"lint:sol": "solhint './src/contracts/**/*.sol'",
21+
"lint:sol:fix": "solhint './src/contracts/**/*.sol' --fix",
2122
"lint:ts": "eslint -c .eslintrc.js './**/*.ts'",
2223
"lint:ts:fix": "eslint -c .eslintrc.js --fix './**/*.ts'",
2324
"format": "prettier --write ./**/*.ts",
2425
"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}",
2526
"start:ganache:verbose": "yarn run start:ganache --verbose",
26-
"stop:ganache": "ps aux | grep ganache-cli | grep -v grep | awk '{print $2}' | xargs kill -9"
27+
"stop:ganache": "ps aux | grep ganache-cli | grep -v grep | awk '{print $2}' | xargs kill -9",
28+
"release": "yarn publish src"
2729
},
2830
"dependencies": {
29-
"multi-token-standard": "2.2.0"
3031
},
3132
"devDependencies": {
3233
"@nomiclabs/hardhat-ethers": "^2.0.2",
3334
"@nomiclabs/hardhat-truffle5": "^2.0.0",
3435
"@nomiclabs/hardhat-web3": "^2.0.0",
35-
"@typechain/ethers-v5": "^6.0.0",
36+
"@typechain/ethers-v5": "^6.0.3",
3637
"@types/chai": "^4.2.15",
3738
"@types/chai-as-promised": "^7.1.3",
3839
"@types/chai-string": "^1.4.2",
3940
"@types/mocha": "^8.2.0",
4041
"@types/node": "^14.14.16",
41-
"@typescript-eslint/eslint-plugin": "^4.17.0",
42-
"@typescript-eslint/parser": "^4.17.0",
42+
"@typescript-eslint/eslint-plugin": "^4.18.0",
43+
"@typescript-eslint/parser": "^4.18.0",
4344
"chai": "^4.3.4",
4445
"chai-as-promised": "^7.1.1",
4546
"chai-bignumber": "^3.0.0",
@@ -67,13 +68,6 @@
6768
"ERC1155",
6869
"ethereum"
6970
],
70-
"files": [
71-
"README.md",
72-
"LICENSE",
73-
"artifacts",
74-
"contracts",
75-
"typings"
76-
],
7771
"config": {
7872
"mnemonic": "test test test test test test test test test test test junk",
7973
"ganacheChainID": 127001,

src/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
cache
2+
artifacts/build-info
3+
artifacts/**/*.dbg.json

src/.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
cache
2+
artifacts/build-info
3+
artifacts/**/*.dbg.json

src/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
@0xsequence/erc20-meta-token
2+
============================
3+
4+
Allows any ERC-20 token to be wrapped inside of an ERC-1155 contract, and thereby
5+
allows an ERC-20 token to function as an ERC-1155 contract.
6+
7+
For more information see, [github.com/0xsequence/erc-1155](https://github.com/0xsequence/erc20-meta-token)
8+
9+
10+
## Getting started
11+
12+
### Install
13+
14+
`npm install @0xsequence/erc20-meta-token` or `yarn add @0xsequence/erc20-meta-token`
15+
16+
### Usage from Solidity
17+
18+
```solidity
19+
pragma solidity ^0.7.4;
20+
21+
import '@0xsequence/erc20-meta-token/contracts/wrapper/ERC20Wrapper.sol';
22+
23+
contract MyERC20MetaToken is ERC20Wrapper {
24+
...
25+
}
26+
```
27+
28+
## NOTES
29+
30+
`@0xsequence/erc20-meta-token` includes the following files in its package distribution:
31+
32+
* `artifacts` -- hardhat output of contract compilation
33+
* `typings` -- ethers v5 typings for easier interfacing with the contract abis
34+
35+
36+
## LICENSE
37+
38+
Copyright (c) 2017-present [Horizon Blockchain Games Inc](https://horizon.io).
39+
40+
Licensed under [Apache-2.0](https://github.com/0xsequence/erc-1155/blob/master/LICENSE)

artifacts/multi-token-standard/contracts/interfaces/IERC1155.sol/IERC1155.json renamed to src/artifacts/@0xsequence/erc-1155/contracts/interfaces/IERC1155.sol/IERC1155.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"_format": "hh-sol-artifact-1",
33
"contractName": "IERC1155",
4-
"sourceName": "multi-token-standard/contracts/interfaces/IERC1155.sol",
4+
"sourceName": "@0xsequence/erc-1155/contracts/interfaces/IERC1155.sol",
55
"abi": [
66
{
77
"anonymous": false,

artifacts/multi-token-standard/contracts/interfaces/IERC1155TokenReceiver.sol/IERC1155TokenReceiver.json renamed to src/artifacts/@0xsequence/erc-1155/contracts/interfaces/IERC1155TokenReceiver.sol/IERC1155TokenReceiver.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"_format": "hh-sol-artifact-1",
33
"contractName": "IERC1155TokenReceiver",
4-
"sourceName": "multi-token-standard/contracts/interfaces/IERC1155TokenReceiver.sol",
4+
"sourceName": "@0xsequence/erc-1155/contracts/interfaces/IERC1155TokenReceiver.sol",
55
"abi": [
66
{
77
"inputs": [

artifacts/multi-token-standard/contracts/interfaces/IERC1271Wallet.sol/IERC1271Wallet.json renamed to src/artifacts/@0xsequence/erc-1155/contracts/interfaces/IERC1271Wallet.sol/IERC1271Wallet.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"_format": "hh-sol-artifact-1",
33
"contractName": "IERC1271Wallet",
4-
"sourceName": "multi-token-standard/contracts/interfaces/IERC1271Wallet.sol",
4+
"sourceName": "@0xsequence/erc-1155/contracts/interfaces/IERC1271Wallet.sol",
55
"abi": [
66
{
77
"inputs": [

0 commit comments

Comments
 (0)