Skip to content

Commit

Permalink
feat(deploy): allow autoswap and myFirstDapp deploys
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Nov 3, 2019
1 parent 04de7b0 commit 876038c
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 13 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"tape-promise": "^4.0.0"
},
"dependencies": {
"@agoric/bundle-source": "^1.0.2",
"@agoric/bundle-source": "^1.0.3",
"@agoric/captp": "^1.0.2",
"@agoric/evaluate": "^2.1.3",
"@agoric/eventual-send": "^0.4.4",
Expand Down
3 changes: 3 additions & 0 deletions template/contract/deploy-autoswap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import deployContract from './deploy';

export default (homeP, priv) => deployContract(homeP, priv, 'autoswap');
10 changes: 4 additions & 6 deletions template/contract/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ import fs from 'fs';
import harden from '@agoric/harden';

const DAPP_NAME = "@DIR@";
const CONTRACT_NAME = 'myFirstDapp';

export default async function deployContract(homeP, { bundleSource, pathResolve }) {
export default async function deployContract(homeP, { bundleSource, pathResolve }, CONTRACT_NAME = 'myFirstDapp') {

// Create a source bundle for the "myFirstDapp" smart contract.
//const { source, moduleFormat } = await bundleSource(`./myFirstDapp.js`);
const { source, moduleFormat } = await bundleSource(`./autoswap.js`);
const { source, moduleFormat } = await bundleSource(`./${CONTRACT_NAME}.js`);

// =====================
// === AWAITING TURN ===
Expand Down Expand Up @@ -109,8 +107,8 @@ export default async function deployContract(homeP, { bundleSource, pathResolve
// === AWAITING TURN ===
// =====================

console.log('- myFirstDapp installation made', CONTRACT_NAME, '=>', installationHandle);
console.log('- myFirstDapp instance made', CONTRACT_NAME, '=>', instanceId);
console.log('- installation made', CONTRACT_NAME, '=>', installationHandle);
console.log('- instance made', CONTRACT_NAME, '=>', instanceId);
console.log(liquidityOk);

// Save the instanceId somewhere where the UI can find it.
Expand Down
1 change: 1 addition & 0 deletions template/contract/myFirstDapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const makeContract = harden((zoe, terms) => {
// Let's make sure the swap offer that we get has the correct
// structure.
const isValidSimpleSwapOffer = myPayoutRules => {
console.log(myPayoutRules);
const kindsOfferFirst = ['offerExactly', 'wantExactly', 'wantAtLeast'];
const kindsWantFirst = ['wantExactly', 'offerExactly', 'wantAtLeast'];
return (
Expand Down
3 changes: 3 additions & 0 deletions template/ui/.env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
REACT_APP_DAPP_API_URL="http://127.0.0.1:8000"
REACT_APP_WALLET_BRIDGE_URL="http://127.0.0.1:8000"
REACT_APP_CONTRACT_ID=""
6 changes: 3 additions & 3 deletions template/ui/.env.local.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
REACT_APP_DAPP_API_URL=""
REACT_APP_WALLET_BRIDGE_URL=""
REACT_APP_CONTRACT_ID=""
REACT_APP_DAPP_API_URL="http://127.0.0.1:8000"
REACT_APP_WALLET_BRIDGE_URL="http://127.0.0.1:8000"
REACT_APP_CONTRACT_ID=""

0 comments on commit 876038c

Please sign in to comment.