Compare commits

..

1 Commits

Author SHA1 Message Date
hueso
b01ffed0b2 make KS undivisible
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2022-09-01 22:09:50 -03:00
10 changed files with 16 additions and 30 deletions

View File

@@ -1,4 +1,4 @@
[![npm](https://img.shields.io/npm/v/@kredits/contracts.svg)](https://www.npmjs.com/package/@kredits/contracts)
[![npm](https://img.shields.io/npm/v/kredits-contracts.svg)](https://www.npmjs.com/package/kredits-contracts)
# Kredits Contracts

File diff suppressed because one or more lines are too long

View File

@@ -1,10 +1,4 @@
{
"31": {
"Contributor": "0xf1073Dab6e305583F95e451Cba449bB867a6e3Fd",
"Contribution": "0x1C531F824e339cD37D75B7F391cB8E42e0E0d4bd",
"Token": "0x56F64C3BB45e6a248F4C783f5a1633E53D6A2371",
"Reimbursement": "0x9C5fFBFba2570A9b31D60338453C5480Ce74B342"
},
"1337": {
"Contributor": "0xCc66f9A3cA2670972938FAD91d0865c4a62DFB25",
"Contribution": "0x8999CaBc43E28202c5A2257f2a95A45b1F8A62BD",

View File

@@ -69,10 +69,7 @@ class Kredits {
if (wallet) {
signer = wallet.connect(ethProvider);
} else if (ethProvider.getSigner) {
// Only useful for reading data, not writing. The (unused) address is
// necessary because without an address, ethers.js will try to look up
// the provider's account 0, which doesn't work on our public RSK nodes.
signer = ethProvider.getSigner('0xfa77675540E550b911a6AABF3805ac17C6641ec1');
signer = ethProvider.getSigner();
}
return new Kredits(ethProvider, signer, kreditsOptions);
}

4
package-lock.json generated
View File

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

View File

@@ -1,7 +1,7 @@
{
"name": "@kredits/contracts",
"version": "7.0.1",
"description": "Smart contracts and JavaScript API for Kredits",
"name": "kredits-contracts",
"version": "7.0.0-beta.0",
"description": "Ethereum contracts and npm wrapper for Kredits",
"main": "./lib/kredits.js",
"directories": {
"test": "test"

View File

@@ -6,8 +6,6 @@ async function main() {
await kredits.init();
console.log(`Using Contribution at: ${kredits.Contribution.contract.address}`);
const count = await kredits.Contribution.count;
console.log(`Currently ${count} entries`);
try {
const data = fs.readFileSync("./data/contributions.json");
@@ -30,11 +28,11 @@ async function main() {
c.hashDigest, c.hashFunction, c.hashSize,
confirmedAtBlock, c.vetoed
);
console.log(`Adding contribution #${contributionId}: ${result.hash}`);
await result.wait();
// await result.wait();
console.log(`Added contribution #${contributionId}: ${result.hash}`);
};
} catch(e) {
console.error(e);
console.log(e);
}
}

View File

@@ -6,8 +6,7 @@ async function main() {
await kredits.init();
console.log(`Using Contributor at: ${kredits.Contributor.contract.address}`);
const count = await kredits.Contributor.count;
console.log(`Currently ${count} entries`);
try {
const data = fs.readFileSync("./data/contributors.json");
const contributors = JSON.parse(data);
@@ -23,11 +22,11 @@ async function main() {
contributor.hashFunction,
contributor.hashSize,
);
console.log(`Adding contributor #${contributorId}: ${result.hash}`);
await result.wait();
// await result.wait();
console.log(`Added contributor #${contributorId}: ${result.hash}`);
};
} catch(e) {
console.error(e);
console.log(e);
}
}

View File

@@ -6,8 +6,6 @@ async function main() {
await kredits.init();
console.log(`Using Contributor at: ${kredits.Contributor.contract.address}`);
const count = await kredits.Contributors.count;
console.log(`Currently ${count} entries`);
const table = new Table({
head: ['ID', 'Account', 'Name', 'Core?', 'Balance', 'Kredits earned', 'Contributions count', 'IPFS']

View File

@@ -95,7 +95,7 @@ describe("Contributor contract", async function () {
expect(c['balance']).to.equal(0);
await Contributor.connect(addr1).withdraw();
c = await Contributor.getContributorById(2);
expect(c['balance']).to.equal(6500);
expect(c['balance'].toString()).to.equal("6500000000000000000000");
expect(c['kreditsWithdrawn']).to.equal(6500);
});