Skip to content

Commit

Permalink
release version 0.11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kostysh committed Mar 5, 2020
1 parent 3575d81 commit 937fe63
Show file tree
Hide file tree
Showing 7 changed files with 388 additions and 316 deletions.
10 changes: 5 additions & 5 deletions .openzeppelin/ropsten-Directory.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"version": "0.11.0",
"version": "0.11.1",
"contract": {
"name": "Directory",
"implementation": "0x8542dd0f10CC91887547d000850117A45bc53203",
"proxy": "0x9846aA2862c8C120583C395b5e8f219457a6AA1c"
"implementation": "0xAFaEbFC3785416E9259B2a6F0ab62B07F21f5470",
"proxy": "0xF1Dd1412189Ed1757200B08C3293f7a8f08DCdac"
},
"owner": "0xA0B74BFE28223c9e08d6DBFa74B5bf4Da763f959",
"proxyAdmin": null,
"blockNumber": 7460137
"proxyAdmin": "0x418547B504D4e2c64dE6fCd37BeD1Fd740416558",
"blockNumber": 7461013
}
10 changes: 5 additions & 5 deletions .openzeppelin/ropsten-DirectoryIndex.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"version": "0.11.0",
"version": "0.11.1",
"contract": {
"name": "DirectoryIndex",
"implementation": "0x65BD764E50ea2DF2745020F42E3124D1E667A28B",
"proxy": "0x493309447C8bb15Aebff4D4f62B17C3d50414C54"
"implementation": "0x3662823F4a5bb045365f3d7424Ea8c8B5Cf7Ab49",
"proxy": "0xeD0f263e005e306de3F8Af9d74D1B3F8edEb33A3"
},
"owner": "0xA0B74BFE28223c9e08d6DBFa74B5bf4Da763f959",
"proxyAdmin": null,
"blockNumber": 7460152
"proxyAdmin": "0x7702e5E832d772fDD38C5d01B47651e4DfA2bfa2",
"blockNumber": 7461027
}
91 changes: 50 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,87 +35,96 @@ npm run lint
- [Directory](./docs/Directory.md)
- [DirectoryIndex](./docs/DirectoryIndex.md)

## Contracts ABIs

Install the package

```bash
$ npm i @windingtree/org.id-directories
```

Import ABIs in the your JavaScript code

```javascript
const {
DirectoryContract,
DirectoryIndexContract,
DirectoryInterfaceContract,
DirectoryIndexInterfaceContract
} = require('@windingtree/org.id-directories');
```

## Directory deployment

All deployments, upgrades, transactions and calls can be hadled using our [command line tools](./management/tools/README.md):

```bash
$ ./management/tools/index.js --network development cmd=contract name=Directory initMethod=initialize initArgs=0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1,hotels,[ORGID_ADDRESS] from=0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1
$ orgid-tools --network ropsten cmd=deploy name=Directory from=0xA0B74BFE28223c9e08d6DBFa74B5bf4Da763f959 initMethod=initialize initArgs=0xA0B74BFE28223c9e08d6DBFa74B5bf4Da763f959,hotel,0xc8fD300bE7e4613bCa573ad820a6F1f0b915CfcA
```

The result will look like:

```bash
WindingTree Command Line Interface
Version: 0.10.0
Contract name: Directory
Actual version: 0.10.0
Last known version: 0.10.0
App address: 0xDb56f2e9369E0D7bD191099125a3f6C370F8ed15
Proxy admin: 0x5f8e26fAcC23FA4cbd87b8d9Dbbd33D5047abDE1
Contract implementation: 0x21a59654176f2689d12E828B77a783072CD26680
New deployment
Contract proxy: 0x4bf749ec68270027C5910220CEAB30Cc284c7BA2
Deployment of the contract: Directory
Version: 0.11.1
Owner address: 0xA0B74BFE28223c9e08d6DBFa74B5bf4Da763f959
Initializing method: initialize
Initializing arguments: [ '0xA0B74BFE28223c9e08d6DBFa74B5bf4Da763f959',
'hotel',
'0xc8fD300bE7e4613bCa573ad820a6F1f0b915CfcA' ]
Contract deployed at address: 0xF1Dd1412189Ed1757200B08C3293f7a8f08DCdac
```

Auto-generated deployment configuration will be saved on the `./openzeppelin` repository folder and will look like:

```json
"version": "0.10.0",
{
"version": "0.11.1",
"contract": {
"name": "Directory",
"implementation": "0x21a59654176f2689d12E828B77a783072CD26680",
"proxy": "0x4bf749ec68270027C5910220CEAB30Cc284c7BA2"
"implementation": "0xAFaEbFC3785416E9259B2a6F0ab62B07F21f5470",
"proxy": "0xF1Dd1412189Ed1757200B08C3293f7a8f08DCdac"
},
"owner": "0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1",
"app": "0xDb56f2e9369E0D7bD191099125a3f6C370F8ed15",
"proxyAdmin": "0x5f8e26fAcC23FA4cbd87b8d9Dbbd33D5047abDE1",
"implementationDirectory": "0x6eD79Aa1c71FD7BdBC515EfdA3Bd4e26394435cC",
"package": "0xA94B7f0465E98609391C623d0560C5720a3f2D33",
"blockNumber": 26
"owner": "0xA0B74BFE28223c9e08d6DBFa74B5bf4Da763f959",
"proxyAdmin": "0x418547B504D4e2c64dE6fCd37BeD1Fd740416558",
"blockNumber": 7461013
}
```

The filename of the configuration file is formed according to mask:
`./[NETWORK_NAME]-[CONTRACT_NAME].json`
`./<NETWORK_NAME>-<CONTRACT_NAME>.json`

`development` network has `private` name, so the name of file will be `private-Directory.json`

## DirectoryIndex deployment

```bash
$ ./management/tools/index.js --network development cmd=contract name=DirectoryIndex initMethod=initialize initArgs=0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1 from=0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1
$ orgid-tools --network ropsten cmd=deploy name=DirectoryIndex from=0xA0B74BFE28223c9e08d6DBFa74B5bf4Da763f959 initMethod=initialize initArgs=0xA0B74BFE28223c9e08d6DBFa74B5bf4Da763f959
```

The result will look like:

```bash
WindingTree Command Line Interface
Version: 0.10.0
Contract name: DirectoryIndex
Actual version: 0.10.0
Last known version: 0.10.0
App address: 0xaD888d0Ade988EbEe74B8D4F39BF29a8d0fe8A8D
Proxy admin: 0xA586074FA4Fe3E546A132a16238abe37951D41fE
Contract implementation: 0x2D8BE6BF0baA74e0A907016679CaE9190e80dD0A
New deployment
Contract proxy: 0x5b9b42d6e4B2e4Bf8d42Eba32D46918e10899B66
Deployment of the contract: DirectoryIndex
Version: 0.11.1
Owner address: 0xA0B74BFE28223c9e08d6DBFa74B5bf4Da763f959
Initializing method: initialize
Initializing arguments: [ '0xA0B74BFE28223c9e08d6DBFa74B5bf4Da763f959' ]
Contract deployed at address: 0xeD0f263e005e306de3F8Af9d74D1B3F8edEb33A3
```

Auto-generated deployment configuration will be saved in the file `./openzeppelin/private-DirectoryIndex.json`

```json
{
"version": "0.10.0",
"version": "0.11.1",
"contract": {
"name": "DirectoryIndex",
"implementation": "0x2D8BE6BF0baA74e0A907016679CaE9190e80dD0A",
"proxy": "0x5b9b42d6e4B2e4Bf8d42Eba32D46918e10899B66"
"implementation": "0x3662823F4a5bb045365f3d7424Ea8c8B5Cf7Ab49",
"proxy": "0xeD0f263e005e306de3F8Af9d74D1B3F8edEb33A3"
},
"owner": "0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1",
"app": "0xaD888d0Ade988EbEe74B8D4F39BF29a8d0fe8A8D",
"proxyAdmin": "0xA586074FA4Fe3E546A132a16238abe37951D41fE",
"implementationDirectory": "0x5017A545b09ab9a30499DE7F431DF0855bCb7275",
"package": "0x7C728214be9A0049e6a86f2137ec61030D0AA964",
"blockNumber": 35
"owner": "0xA0B74BFE28223c9e08d6DBFa74B5bf4Da763f959",
"proxyAdmin": "0x7702e5E832d772fDD38C5d01B47651e4DfA2bfa2",
"blockNumber": 7461027
}
```
6 changes: 2 additions & 4 deletions management/tools/commands/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ module.exports = async (options) => {

// Setup upgradeability project
const project = new ProxyAdminProject(name, null, null, txParams);
const proxyAdmin = await project.getAdminAddress();

// Deployment of the contract
const proxy = await project.createProxy(ContractSchema, Object.assign(
Expand All @@ -102,8 +101,7 @@ module.exports = async (options) => {
},
!initArgsParsed ? {} : {
initArgs: applyArgs(initArgsParsed, {
'[OWNER]': from,
'[PROXY_ADMIN]': proxyAdmin
'[OWNER]': from
})
}
));
Expand All @@ -113,7 +111,7 @@ module.exports = async (options) => {
// Creation of the deployment configuration file
deploymentConfig.version = packageJson.version;
deploymentConfig.owner = from;
deploymentConfig.proxyAdmin = proxyAdmin;
deploymentConfig.proxyAdmin = await project.getAdminAddress();
deploymentConfig.contract.name = name;
deploymentConfig.contract.proxy = proxy.address;
deploymentConfig.contract.implementation =
Expand Down
6 changes: 2 additions & 4 deletions management/tools/commands/upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ module.exports = async (options) => {
txParams,
deploymentConfig.proxyAdmin
);
const proxyAdmin = await project.getAdminAddress();

// Upgrading of the contract
const proxy = await project.upgradeProxy(
Expand All @@ -123,17 +122,16 @@ module.exports = async (options) => {
!initArgsParsed ? {} : {
initArgs: applyArgs(initArgsParsed, {
'[OWNER]': from,
'[PROXY_ADMIN]': proxyAdmin
'[PROXY_ADMIN]': deploymentConfig.proxyAdmin
})
}
));

log('COntract upgraded at address', proxy.address);
log('Contract upgraded at address', proxy.address);

// Creation of the deployment configuration file
deploymentConfig.version = packageJson.version;
deploymentConfig.owner = from;
deploymentConfig.proxyAdmin = proxyAdmin;
deploymentConfig.contract.name = name;
deploymentConfig.contract.proxy = proxy.address;
deploymentConfig.contract.implementation =
Expand Down

0 comments on commit 937fe63

Please sign in to comment.