Skip to content

Commit ab42f18

Browse files
committed
chore(docs): updated readme for truffle, ipfs docs
1 parent 31013be commit ab42f18

File tree

4 files changed

+1501
-1502
lines changed

4 files changed

+1501
-1502
lines changed

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
## CommitPool Single Player Smart Contract repository
22

3-
43
[CommitPool](http://commitpool.com/) helps people meet their personal goals by holding themselves accountable. CommitPool users stake money to credibly commit to meeting their goals, and lose their stake when they don’t.
54

65
Our MVP focuses on a single goal type for individuals, hence the Single Player mode.
@@ -21,12 +20,18 @@ Buidler
2120
2. ```npx buidler node```
2221
3. In second terminal```npx buidler run --network localhost scripts/deploy.ts ```
2322

24-
Ganache
23+
Buidler & Ganache
2524

2625
1. Use node 12 (using nvm is recommended)
2726
2. Start Ganache on port 8545
2827
3. In second terminal```npx buidler run --network localhost scripts/deploy.ts ```
2928

29+
Truffle
30+
31+
1. Use node 12 (using nvm is recommended)
32+
2. Start Ganache on port 8545
33+
3. In terminal```truffle migrate```
34+
3035
#### Deploying to Matic
3136
1. ```npm install truffle -g```
3237

@@ -35,7 +40,7 @@ Mumbai Testnet configured in ```./truffle-config.js```
3540
Test deployment using Truffle against a runnning Ganache instance: ```truffle migrate```
3641
Deploy to Mumbai testnet: ```truffle migrate --network matic```
3742

38-
Verify deployment using contract address at the [Matic Explorer](https://explorer-mumbai.maticvigil.com/)
43+
Verify contract address at the [Matic Explorer](https://explorer-mumbai.maticvigil.com/)
3944

4045
*Verifying & publishing the contract code*
4146

@@ -49,7 +54,13 @@ Quite note on setting up Matic:
4954
* Request funds at [faucet](https://faucet.matic.network/)
5055
* Use this wallet's seed phrase in the .env file to pay the deployment
5156

52-
#### Interacting with the contract
57+
Interaction with the contract on Matic via Truffle:
58+
1. ```truffle console --network matic```
59+
2. ```compile```
60+
3. ```var singlePlayerCommit = await SinglePlayerCommit.at('<ADDRESS FROM DEPLOYMENT>')```
61+
4. To test: ```await contractTest.activityKeyList(0)```
62+
63+
#### Interacting with the contract using Buidler
5364
After deploying to a local node
5465
1. ```npx buidler console --network localhost ```
5566
2. ```const CommitPool = await ethers.getContractFactory("SinglePlayerCommit")```

contracts/SinglePlayerCommit.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ contract SinglePlayerCommit is ChainlinkClient, Ownable {
255255
require(commitment.endTime < block.timestamp, "SPC::processCommitment - commitment is still active");
256256
require(commitment.endTime < commitment.lastActivityUpdate, "SPC::processCommitment - update activity");
257257

258-
require(_commitmentSettlement(commitment), "SPC::processCommitmentUser - reconciliation failed");
258+
require(_commitmentSettlement(commitment), "SPC::processCommitmentUser - settlement failed");
259259

260260
emit CommitmentEnded(committer, commitment.met, commitment.stake);
261261
}
@@ -267,7 +267,7 @@ contract SinglePlayerCommit is ChainlinkClient, Ownable {
267267
require(commitments[msg.sender].exists, "SPC::processCommitmentUser - commitment does not exist");
268268
Commitment storage commitment = commitments[msg.sender];
269269

270-
require(_commitmentSettlement(commitment), "SPC::processCommitmentUser - reconciliation failed");
270+
require(_commitmentSettlement(commitment), "SPC::processCommitmentUser - settlement failed");
271271
emit CommitmentEnded(msg.sender, commitment.met, commitment.stake);
272272
}
273273

0 commit comments

Comments
 (0)