Skip to content
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.

[RAFFLE-794] App Bundle #18

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions initfile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"raffle": {
"contractName": "Raffle",
"contractFilename": "contracts/Raffle.sol",
"args": {
"_name": "New",
"_ticketCount": 5,
"_ticketPrice": 50,
"_charityPercentage": 60
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"scripts": {
"start": "npm-run-all -p watch-css start-js",
"start-js": "react-scripts start",
"build": "npm run build-css && react-scripts build && mkdir package && mkdir package/contracts && node scripts/create-metadata.js && mv build/* package/ && cd package && zip -r app.zip * && cd .. && rm -rf build && mv package build",
"build": "npm run build-css && react-scripts build && node scripts/create-metadata.js && cp -r lib/lottery/contracts ./build/ && cp initfile.json ./build/ && zip -r app.zip build/*",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"build-css": "node-sass-chokidar src/ -o src/",
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto">

<script src="addresses.js"></script>
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Expand Down
2 changes: 1 addition & 1 deletion scripts/create-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ readJson('package.json', (err, data) => {
version: data.version,
};

fs.writeFile('package/metadata.json',JSON.stringify(metadata,null,2), 'utf8', (err) => {
fs.writeFile('build/metadata.json',JSON.stringify(metadata,null,2), 'utf8', (err) => {
if(err) {
console.log('Failed to write metadata.json', err);
}
Expand Down
11 changes: 6 additions & 5 deletions src/raffle/raffle.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
const contractName = buildContractName('Raffle')
const HTTP_PROTOCOL = document.location.protocol === "http:" ? "http" : "https";

const uploadUrl = `http://${window.location.hostname}/bloc/v2.2/users/:user/:address/contract?resolve`
const enterUrl = `http://${window.location.hostname}/bloc/v2.2/users/:username/:userAddress/contract/:contractName/:contractAddress/call?resolve`;
const uploadUrl = `${HTTP_PROTOCOL}://${window.location.hostname}/bloc/v2.2/users/:user/:address/contract?resolve`
const enterUrl = `${HTTP_PROTOCOL}://${window.location.hostname}/bloc/v2.2/users/:username/:userAddress/contract/:contractName/:contractAddress/call?resolve`;
// const raffleListUrl = `http://${window.location.hostname}/cirrus/search/Raffle?winnerAddress=eq.0000000000000000000000000000000000000000`;
// const raffleListUrlNotEqual = `http://${window.location.hostname}/cirrus/search/Raffle?winnerAddress=not.eq.0000000000000000000000000000000000000000`;
const raffleListUrlAll = `http://${window.location.hostname}/cirrus/search/${contractName}`;
const cirrusUrl = `http://${window.location.hostname}/cirrus/search`;
const compileUrl = `http://${window.location.hostname}/bloc/v2.2/contracts/compile`;
const raffleListUrlAll = `${HTTP_PROTOCOL}://${window.location.hostname}/cirrus/search/${contractName}`;
const cirrusUrl = `${HTTP_PROTOCOL}://${window.location.hostname}/cirrus/search`;
const compileUrl = `${HTTP_PROTOCOL}://${window.location.hostname}/bloc/v2.2/contracts/compile`;
const codeHash = 'a44d5968d33c8d99ef36ea6980a4151fd1fd45379a85425d55a71ccfb1860e57';

const contractSrc = `contract ${contractName} {
Expand Down