Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Commit

Permalink
Add contract data to npm (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilanolkies authored Feb 7, 2020
1 parent c296306 commit 62e1b76
Show file tree
Hide file tree
Showing 6 changed files with 228 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
node_modules/
.secret
build/
.vscode/
.vscode
ReverseRegistrarData.json
NameResolverData.json
10 changes: 10 additions & 0 deletions addresses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"ReverseRegistrar": {
"rskMainnet": "0xd25c3f94a743b93ecffecbe691beea51c3c2d9d1",
"rskTestnet": "0xc1cb803d5169e0a9894bf0f8dcdf83090999842a"
},
"NameResolver": {
"rskMainnet": "0x4b1a11bf6723e60b9d2e02aa3ece34e24bde77d9",
"rskTestnet": "0x8587385ad60038bb181affdf687c4d1b80c4787e"
}
}
27 changes: 27 additions & 0 deletions datagen.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const fs = require('fs');

const addresses = require('./addresses');

const reverseRegistrarBuild = require('./build/contracts/ReverseRegistrar');

const reverseRegistrarData = {
abi: reverseRegistrarBuild.abi,
address: {
rskMainnet: addresses.ReverseRegistrar.rskMainnet,
rskTestnet: addresses.ReverseRegistrar.rskTestnet,
},
};

fs.writeFileSync('./ReverseRegistrarData.json', JSON.stringify(reverseRegistrarData));

const nameResolverBuild = require('./build/contracts/NameResolver');

const nameResolverData = {
abi: nameResolverBuild.abi,
address: {
rskMainnet: addresses.NameResolver.rskMainnet,
rskTestnet: addresses.NameResolver.rskTestnet,
},
};

fs.writeFileSync('./NameResolverData.json', JSON.stringify(nameResolverData));
179 changes: 178 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{
"name": "@rsksmart/rns-reverse",
"version": "1.0.0",
"version": "1.0.1",
"description": "RNS Reverse",
"files": [
"/contracts",
"!/contracts/Migrations.sol"
"!/contracts/Migrations.sol",
"/ReverseRegistrarData.json",
"/NameResolverData.json"
],
"scripts": {
"prepublish": "npx truffle compile && node ./datagen.js",
"test": "truffle test"
},
"repository": {
Expand All @@ -32,6 +35,7 @@
"@truffle/hdwallet-provider": "^1.0.18",
"chai": "^4.2.0",
"eth-ens-namehash": "^2.0.8",
"openzeppelin-test-helpers": "^0.4.3"
"openzeppelin-test-helpers": "^0.4.3",
"truffle": "^5.1.12"
}
}
Loading

0 comments on commit 62e1b76

Please sign in to comment.