Skip to content

Commit b96a6a0

Browse files
committed
ERC1155: Add skeleton
1 parent 834f8c8 commit b96a6a0

File tree

9 files changed

+93
-0
lines changed

9 files changed

+93
-0
lines changed

erc1155/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./build

erc1155/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# ERC1155
2+
https://eips.ethereum.org/EIPS/eip-1155
3+
4+
## Run tests
5+
```bash
6+
$ truffle test --network ganache
7+
```

erc1155/contracts/Migrations.sol

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
pragma solidity >=0.4.21 <0.6.0;
2+
3+
contract Migrations {
4+
address public owner;
5+
uint public last_completed_migration;
6+
7+
constructor() public {
8+
owner = msg.sender;
9+
}
10+
11+
modifier restricted() {
12+
if (msg.sender == owner) _;
13+
}
14+
15+
function setCompleted(uint completed) public restricted {
16+
last_completed_migration = completed;
17+
}
18+
19+
function upgrade(address new_address) public restricted {
20+
Migrations upgraded = Migrations(new_address);
21+
upgraded.setCompleted(last_completed_migration);
22+
}
23+
}

erc1155/contracts/erc1155.vy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Author: Sören Steiger, github.com/ssteiger
2+
# License: MIT
3+
4+
# ERC1155 Token Standard
5+
# https://eips.ethereum.org/EIPS/eip-1155
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var Migrations = artifacts.require("./Migrations.sol");
2+
3+
module.exports = function(deployer) {
4+
deployer.deploy(Migrations);
5+
};
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var ERC1155 = artifacts.require("erc1155");
2+
3+
module.exports = function(deployer) {
4+
//deployer.deploy(ERC1155, name, symbol, decimals, totalSupply);
5+
};

erc1155/test/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## Run tests
2+
```bash
3+
$ truffle test --network ganache
4+
```

erc1155/test/erc1155.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const ERC1155Abstraction = artifacts.require('erc1155');
2+
3+
contract('ERC1155', (accounts) => {
4+
/*
5+
beforeEach(async () => {
6+
ERC1155 = await ERC1155Abstraction.new(
7+
8+
{ from: accounts[0] }
9+
);
10+
});
11+
*/
12+
});

erc1155/truffle.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
* Use this file to configure your truffle project. It's seeded with some
3+
* common settings for different networks and features like migrations,
4+
* compilation and testing. Uncomment the ones you need or modify
5+
* them to suit your project as necessary.
6+
*
7+
* More information about configuration can be found at:
8+
*
9+
* truffleframework.com/docs/advanced/configuration
10+
*
11+
* To deploy via Infura you'll need a wallet provider (like truffle-hdwallet-provider)
12+
* to sign your transactions before they're sent to a remote public node. Infura API
13+
* keys are available for free at: infura.io/register
14+
*
15+
* You'll also need a mnemonic - the twelve word phrase the wallet uses to generate
16+
* public/private key pairs. If you're publishing your code to GitHub make sure you load this
17+
* phrase from a file you've .gitignored so it doesn't accidentally become public.
18+
*
19+
*/
20+
21+
module.exports = {
22+
networks: {
23+
ganache: {
24+
host: '127.0.0.1',
25+
port: 7545,
26+
network_id: '*', // match any network id
27+
from: '0x954e72fdc51Cf919203067406fB337Ed4bDC8CdA', // account address from which to deploy
28+
gas: 4000000,
29+
}
30+
}
31+
}

0 commit comments

Comments
 (0)