Skip to content

Commit 7927d21

Browse files
authored
fix!: avoid "game", "join", "place" (#45)
- rename build-game1-start - strike "game" from test-contract.js, CONTRIBUTING.md - update repo URLs - strike "game" - strike "game" from package names - avoid "game" in contract filename - rename contract instance, brand, keywords - avoid "game" in ui, incl invitation maker
1 parent 6591244 commit 7927d21

19 files changed

+276
-222
lines changed

CONTRIBUTING.md

+73-16
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,103 @@ yarn test
77
```
88

99
```
10-
$ yarn test
11-
yarn run v1.22.19
10+
yarn run v1.22.21
1211
$ ava --verbose
1312
14-
✔ bundle-source › bundleSource() bundles the contract for use with zoe (3.3s)
15-
...
13+
start proposal module evaluating
14+
bundles/ add: assetContract from /home/connolly/projects/dapp-offer-up/contract/src/offer-up.contract.js
15+
✔ bundle-source › bundleSource() bundles the contract for use with zoe (1s)
16+
ℹ 7fffb45de65f0c887401d4a5c5185ad87d41e3842d6eb2e10559a06c747358fe0dc5ef41fd4c04457c5e9bb27ed85e48ea1ff8bdeac524063b7743205f4817e6
17+
ℹ Object @Alleged: BundleInstallation {}
18+
bundles/ bundled 85 files in bundle-assetContract.js at 2024-01-23T02:30:57.437Z
19+
startOfferUpContract()...
1620
✔ contract › Install the contract
1721
ℹ Object @Alleged: BundleInstallation {}
18-
✔ contract › Start the contract (1.3s)
19-
...
20-
✔ contract › Alice trades: give some play money, want some game places (1.3s)
22+
✔ contract › Start the contract (901ms)
23+
ℹ terms: {
24+
tradePrice: {
25+
brand: Object @Alleged: PlayMoney brand {},
26+
value: 5n,
27+
},
28+
}
29+
ℹ Object @Alleged: InstanceHandle {}
30+
CoreEval script: started contract Object [Alleged: InstanceHandle] {}
31+
✔ contract › Alice trades: give some play money, want items (939ms)
2132
ℹ Object @Alleged: InstanceHandle {}
2233
ℹ Alice gives {
2334
Price: {
2435
brand: Object @Alleged: PlayMoney brand {},
2536
value: 5n,
2637
},
2738
}
28-
ℹ Alice payout brand Object @Alleged: Place brand {}
39+
ℹ Alice payout brand Object @Alleged: Item brand {}
2940
ℹ Alice payout value Object @copyBag {
3041
payload: [
3142
[
32-
'Park Place',
43+
'scroll',
3344
1n,
3445
],
3546
[
36-
'Boardwalk',
47+
'map',
3748
1n,
3849
],
3950
],
4051
}
41-
✔ contract › Trade in IST rather than play money (8.5s)
42-
...
43-
✔ contract › use the code that will go on chain to start the contract (8.5s)
44-
...
45-
52+
CoreEval script: share via agoricNames: Object [Alleged: Item brand] {}
53+
offerUp (re)started
54+
----- OfferUp.2 2 trade give { Price: { brand: Object [Alleged: PlayMoney brand] {}, value: 5n } } want Object [copyBag] { payload: [ [ 'scroll', 1n ], [ 'map', 1n ] ] }
55+
bundles/ add: centralSupply from /home/connolly/projects/dapp-offer-up/node_modules/@agoric/vats/src/centralSupply.js
56+
bundles/ bundled 132 files in bundle-centralSupply.js at 2024-01-23T02:30:59.505Z
57+
----- OfferUp.2 2 trade give {
58+
Price: { brand: Object [Alleged: ZDEFAULT brand] {}, value: 250000n }
59+
} want Object [copyBag] { payload: [ [ 'scroll', 1n ], [ 'map', 1n ] ] }
60+
✔ contract › Trade in IST rather than play money (2.5s)
61+
ℹ Alice gives {
62+
Price: {
63+
brand: Object @Alleged: ZDEFAULT brand {},
64+
value: 250000n,
65+
},
66+
}
67+
ℹ Alice payout brand Object @Alleged: Item brand {}
68+
ℹ Alice payout value Object @copyBag {
69+
payload: [
70+
[
71+
'scroll',
72+
1n,
73+
],
74+
[
75+
'map',
76+
1n,
77+
],
78+
],
79+
}
80+
✔ contract › use the code that will go on chain to start the contract (2.5s)
81+
ℹ Alice gives {
82+
Price: {
83+
brand: Object @Alleged: ZDEFAULT brand {},
84+
value: 250000n,
85+
},
86+
}
87+
ℹ Alice payout brand Object @Alleged: Item brand {}
88+
ℹ Alice payout value Object @copyBag {
89+
payload: [
90+
[
91+
'scroll',
92+
1n,
93+
],
94+
[
95+
'map',
96+
1n,
97+
],
98+
],
99+
}
100+
----- OfferUp.2 2 trade give {
101+
Price: { brand: Object [Alleged: ZDEFAULT brand] {}, value: 250000n }
102+
} want Object [copyBag] { payload: [ [ 'scroll', 1n ], [ 'map', 1n ] ] }
46103
47104
48105
6 tests passed
49-
Done in 12.74s.
106+
Done in 4.74s.
50107
```
51108

52109
Any `Error#1: changed ...` diagnostics are benign reports of updated files

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Agoric App Starter: Simple Game
1+
# Agoric Dapp Starter: Offer Up
22

33
This is a simple app for the [Agoric smart contract platform](https://docs.agoric.com/).
44

_agstate/agoric-servers/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "game-places-agservers",
2+
"name": "offer-up-agservers",
33
"version": "0.0.1",
4-
"description": "Agoric server instances for dapp-game-places",
4+
"description": "Agoric server instances for dapp-offer-up",
55
"private": true,
66
"type": "module",
77
"scripts": {

api/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"$note": "@agoric/[email protected] expects an api/package.json",
3-
"name": "game-places-api",
3+
"name": "offer-up-api",
44
"version": "0.1.0"
55
}

contract/.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
start-game1-permit.json
2-
start-game1.js
1+
start-offer-up-permit.json
2+
start-offer-up.js
33
bundles/

contract/Makefile

+5-3
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,19 @@ print-key: /root/.agoric/user1.key
103103
@agd keys show user1 -a --keyring-backend="test"
104104
@echo
105105

106-
start-contract: start-game1.js start-game1-permit.json install-bundles
106+
SCRIPT=start-offer-up.js
107+
PERMIT=start-offer-up-permit.json
108+
start-contract: $(SCRIPT) $(PERMIT) install-bundles
107109
scripts/propose-start-contract.sh
108110

109111
install-bundles: bundles/bundle-list
110112
./scripts/install-bundles.sh
111113

112114
build-proposal: bundles/bundle-list
113115

114-
bundles/bundle-list start-game1.js start-game1-permit.json:
116+
bundles/bundle-list $(SCRIPT) $(PERMIT):
115117
./scripts/build-proposal.sh
116118

117119

118120
clean:
119-
@rm -rf start-game1.js start-game1-permit.json bundles/
121+
@rm -rf $(SCRIPT) $(PERMIT) bundles/

contract/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "game-places-contract",
2+
"name": "offer-up-contract",
33
"version": "0.1.0",
44
"private": true,
5-
"description": "Game Asset Contract",
5+
"description": "Offer Up Contract",
66
"type": "module",
77
"scripts": {
88
"start:docker": "docker compose up -d",
@@ -11,7 +11,7 @@
1111
"docker:make": "docker compose exec agd make -C /workspace/contract",
1212
"make:help": "make list",
1313
"start": "yarn docker:make clean start-contract print-key",
14-
"build": "agoric run scripts/build-game1-start.js",
14+
"build": "agoric run scripts/build-contract-deployer.js",
1515
"test": "ava --verbose",
1616
"lint": "eslint '**/*.js'",
1717
"lint:fix": "eslint --fix '**/*.js'"
@@ -60,14 +60,14 @@
6060
"keywords": [],
6161
"repository": {
6262
"type": "git",
63-
"url": "git+https://github.com/agoric-labs/dapp-join-game"
63+
"url": "git+https://github.com/Agoric/dapp-offer-up"
6464
},
6565
"author": "Agoric",
6666
"license": "Apache-2.0",
6767
"bugs": {
68-
"url": "https://github.com/agoric-labs/dapp-join-game/issues"
68+
"url": "https://github.com/Agoric/dapp-offer-up/issues"
6969
},
70-
"homepage": "https://github.com/agoric-labs/dapp-join-game#readme",
70+
"homepage": "https://github.com/Agoric/dapp-offer-up#readme",
7171
"eslintConfig": {
7272
"parserOptions": {
7373
"sourceType": "module",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* @file Permission Contract Deployment builder
3+
*
4+
* Usage:
5+
* agoric run build-contract-deployer.js
6+
*/
7+
8+
import { makeHelpers } from '@agoric/deploy-script-support';
9+
import { getManifestForOfferUp } from '../src/offer-up-proposal.js';
10+
11+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').ProposalBuilder} */
12+
export const offerUpProposalBuilder = async ({ publishRef, install }) => {
13+
return harden({
14+
sourceSpec: '../src/offer-up-proposal.js',
15+
getManifestCall: [
16+
getManifestForOfferUp.name,
17+
{
18+
offerUpRef: publishRef(
19+
install(
20+
'../src/offer-up.contract.js',
21+
'../bundles/bundle-offer-up.js',
22+
{
23+
persist: true,
24+
},
25+
),
26+
),
27+
},
28+
],
29+
});
30+
};
31+
32+
/** @type {DeployScriptFunction} */
33+
export default async (homeP, endowments) => {
34+
const { writeCoreProposal } = await makeHelpers(homeP, endowments);
35+
await writeCoreProposal('start-offer-up', offerUpProposalBuilder);
36+
};

contract/scripts/build-game1-start.js

-34
This file was deleted.

contract/scripts/build-proposal.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
cd /workspace/contract
55

66
mkdir -p bundles
7-
(agoric run ./scripts/build-game1-start.js )>/tmp/,run.log
7+
(agoric run ./scripts/build-contract-deployer.js )>/tmp/,run.log
88
./scripts/parseProposals.mjs </tmp/,run.log \
99
| jq -r '.bundles[]' | sort -u > bundles/bundle-list
1010

contract/scripts/propose-start-contract.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ set -xueo pipefail
33

44
cd /workspace/contract
55

6-
SCRIPT=start-game1.js
7-
PERMIT=start-game1-permit.json
6+
SCRIPT=start-offer-up.js
7+
PERMIT=start-offer-up-permit.json
88
ls -sh "$SCRIPT" "$PERMIT"
99

1010
PROPOSAL=$(agd query gov proposals --output json | jq -c '.proposals | length | .+1')
1111

1212
make fund-acct
1313

1414
agd tx gov submit-proposal swingset-core-eval "$PERMIT" "$SCRIPT" \
15-
--title="Start Game Place Contract" --description="Evaluate $SCRIPT" \
15+
--title="Start Offer Up Contract" --description="Evaluate $SCRIPT" \
1616
--deposit=10000000ubld --gas=auto --gas-adjustment=1.2 \
1717
--from user1 --chain-id agoriclocal --keyring-backend=test \
1818
--yes -b block

contract/src/gameAssetContract.js

-70
This file was deleted.

0 commit comments

Comments
 (0)