Compare commits

..

4 Commits

Author SHA1 Message Date
53955126ff 7.0.0-beta.0 2022-07-16 16:27:56 +02:00
1d1f2bb4ed Merge pull request #218 from 67P/feature/217-rsk_deployment
Refactor deployment script, add error handling
2022-07-16 11:04:55 +02:00
42a2945692 Merge pull request #219 from 67P/feature/217-rsk_deployment-1
Fix typo and add more logs
2022-07-16 11:04:08 +02:00
12326ce73f Fix typo and add more logs 2022-07-15 18:19:06 +02:00
3 changed files with 62 additions and 30 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "kredits-contracts", "name": "kredits-contracts",
"version": "6.0.0", "version": "7.0.0-beta.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "kredits-contracts", "name": "kredits-contracts",
"version": "6.0.0", "version": "7.0.0-beta.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@kosmos/schemas": "^3.1.0", "@kosmos/schemas": "^3.1.0",

View File

@@ -1,6 +1,6 @@
{ {
"name": "kredits-contracts", "name": "kredits-contracts",
"version": "6.0.0", "version": "7.0.0-beta.0",
"description": "Ethereum contracts and npm wrapper for Kredits", "description": "Ethereum contracts and npm wrapper for Kredits",
"main": "./lib/kredits.js", "main": "./lib/kredits.js",
"directories": { "directories": {

View File

@@ -22,7 +22,7 @@ async function main() {
let contract = await upgrades.deployProxy(contractFactories[contractName], params) let contract = await upgrades.deployProxy(contractFactories[contractName], params)
.catch(handleError); .catch(handleError);
contracts[contractName.toLowerCase()] = contract; contracts[contractName] = contract;
await contract.deployed().then(() => { await contract.deployed().then(() => {
console.log(`${contractName} deployed to:`, contract.address); console.log(`${contractName} deployed to:`, contract.address);
@@ -34,36 +34,68 @@ async function main() {
const blocksVetoPeriod = 40320; // 7 days; 15 seconds block time const blocksVetoPeriod = 40320; // 7 days; 15 seconds block time
// await deployContractProxy('Contributor'); await deployContractProxy('Contributor');
// await deployContractProxy('Contribution', [ blocksVetoPeriod ]); await deployContractProxy('Contribution', [ blocksVetoPeriod ]);
await deployContractProxy('Token'); await deployContractProxy('Token');
// await deployContractProxy('Reimbursement'); await deployContractProxy('Reimbursement');
// await contracts.Contributor console.log('Calling Contributor#setTokenContract')
// .setTokenContract(contracts.Token.address) await contracts.Contributor.functions
// .then(res => res.wait()).catch(handleError); .setTokenContract(contracts.Token.address)
// await contracts.Contributor .then(res => {
// .setContributionContract(contracts.Contribution.address) console.log(`...transaction published: ${res.hash}`);
// .then(res => res.wait()).catch(handleError); return res.wait();
// }).catch(handleError);
// await contracts.Contribution
// .setTokenContract(contracts.Token.address)
// .then(res => res.wait()).catch(handleError);
// await contracts.Contribution
// .setContributorContract(contracts.Contributor.address)
// .then(res => res.wait()).catch(handleError);
// await contracts.Token console.log('Calling Contributor#setContributionContract')
// .setContributionContract(contracts.Contribution.address) await contracts.Contributor.functions
// .then(res => res.wait()).catch(handleError); .setContributionContract(contracts.Contribution.address)
await contracts.Token .then(res => {
// .setContributorContract(contracts.Contributor.address) console.log(`...transaction published: ${res.hash}`);
.setContributorContract('0xEb4100b5939E243f69873A8E463eDa0aE84e43E8') return res.wait();
.then(res => res.wait()).catch(handleError); }).catch(handleError);
// await contracts.Reimbursement
// .setContributorContract(contracts.Contributor.address) console.log('Calling Contribution#setTokenContract')
// .then(res => res.wait()).catch(handleError); await contracts.Contribution.functions
.setTokenContract(contracts.Token.address)
.then(res => {
console.log(`...transaction published: ${res.hash}`);
return res.wait();
}).catch(handleError);
console.log('Calling Contribution#setContributorContract')
await contracts.Contribution.functions
.setContributorContract(contracts.Contributor.address)
.then(res => {
console.log(`...transaction published: ${res.hash}`);
return res.wait();
}).catch(handleError);
console.log('Calling Token#setContributionContract')
await contracts.Token.functions
.setContributionContract(contracts.Contribution.address)
.then(res => {
console.log(`...transaction published: ${res.hash}`);
return res.wait();
}).catch(handleError);
console.log('Calling Token#setContributorContract')
await contracts.Token.functions
.setContributorContract(contracts.Contributor.address)
.then(res => {
console.log(`...transaction published: ${res.hash}`);
return res.wait();
}).catch(handleError);
console.log('Calling Reimbursement#setContributorContract')
await contracts.Reimbursement.functions
.setContributorContract(contracts.Contributor.address)
.then(res => {
console.log(`...transaction published: ${res.hash}`);
return res.wait();
}).catch(handleError);
const addresses = { const addresses = {
Contributor: contracts.Contributor.address, Contributor: contracts.Contributor.address,