Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Theerathat Pornprinya
FilmChain Marketplace
Commits
12771064
Commit
12771064
authored
Jun 25, 2020
by
Theerathat Pornprinya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update to final archive
parent
cdfe1ec1
Changes
57
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
57 changed files
with
600 additions
and
280 deletions
+600
-280
ethereum/build/CreateProduct.json
ethereum/build/CreateProduct.json
+1
-1
ethereum/build/Marketplace.json
ethereum/build/Marketplace.json
+1
-1
ethereum/contracts/Marketplace.sol
ethereum/contracts/Marketplace.sol
+42
-13
ethereum/newproduct.js
ethereum/newproduct.js
+1
-1
filmchain_token_sale/build/contracts/FilmChainToken.json
filmchain_token_sale/build/contracts/FilmChainToken.json
+37
-37
filmchain_token_sale/build/contracts/FilmChainTokenSales.json
...chain_token_sale/build/contracts/FilmChainTokenSales.json
+30
-2
filmchain_token_sale/build/contracts/Migrations.json
filmchain_token_sale/build/contracts/Migrations.json
+183
-183
filmchain_token_sale/src/index.html
filmchain_token_sale/src/index.html
+64
-1
filmchain_token_sale/src/js/app.js
filmchain_token_sale/src/js/app.js
+143
-1
filmchain_token_sale/truffle-config.js
filmchain_token_sale/truffle-config.js
+6
-0
final_report.pdf
final_report.pdf
+0
-0
node_modules/.cache/babel-loader/04e302de85de2427590ac15a0e1ffd6a5ace4650.json.gz
...l-loader/04e302de85de2427590ac15a0e1ffd6a5ace4650.json.gz
+0
-0
node_modules/.cache/babel-loader/0c1f644ee301536de6a8f5a54c42003aa7845b04.json.gz
...l-loader/0c1f644ee301536de6a8f5a54c42003aa7845b04.json.gz
+0
-0
node_modules/.cache/babel-loader/0edc458be1daf146a7666659fad555daa0381130.json.gz
...l-loader/0edc458be1daf146a7666659fad555daa0381130.json.gz
+0
-0
node_modules/.cache/babel-loader/1a7436fbd3b7a08234b6432bb4eedca017e0c884.json.gz
...l-loader/1a7436fbd3b7a08234b6432bb4eedca017e0c884.json.gz
+0
-0
node_modules/.cache/babel-loader/28e5462ce3f96ff04512f01b06f6dc87a9b1116e.json.gz
...l-loader/28e5462ce3f96ff04512f01b06f6dc87a9b1116e.json.gz
+0
-0
node_modules/.cache/babel-loader/2ef11b7ced44f999e3cb587452ee84543ebb343b.json.gz
...l-loader/2ef11b7ced44f999e3cb587452ee84543ebb343b.json.gz
+0
-0
node_modules/.cache/babel-loader/2f296281871db2ee38006a36190c7d2647cf14da.json.gz
...l-loader/2f296281871db2ee38006a36190c7d2647cf14da.json.gz
+0
-0
node_modules/.cache/babel-loader/323a0b4acdd573de091c19751cf6708bb6df93fd.json.gz
...l-loader/323a0b4acdd573de091c19751cf6708bb6df93fd.json.gz
+0
-0
node_modules/.cache/babel-loader/38740eec5c714b0e2f779a20bcfc52ab40ffc046.json.gz
...l-loader/38740eec5c714b0e2f779a20bcfc52ab40ffc046.json.gz
+0
-0
node_modules/.cache/babel-loader/3cf76da1984e5254d66bd6c5807a1c1e8dbe66ea.json.gz
...l-loader/3cf76da1984e5254d66bd6c5807a1c1e8dbe66ea.json.gz
+0
-0
node_modules/.cache/babel-loader/4282403b9a04bdcbe274d4ef865340df9c5fb1b4.json.gz
...l-loader/4282403b9a04bdcbe274d4ef865340df9c5fb1b4.json.gz
+0
-0
node_modules/.cache/babel-loader/46fe31d0d0142d148320212b5975c073c774cbc6.json.gz
...l-loader/46fe31d0d0142d148320212b5975c073c774cbc6.json.gz
+0
-0
node_modules/.cache/babel-loader/5b7ca69e742a8b978759c855c3837ae7acc920bb.json.gz
...l-loader/5b7ca69e742a8b978759c855c3837ae7acc920bb.json.gz
+0
-0
node_modules/.cache/babel-loader/5cf6e8a8aaaf989ee29e1b422735423241fce25e.json.gz
...l-loader/5cf6e8a8aaaf989ee29e1b422735423241fce25e.json.gz
+0
-0
node_modules/.cache/babel-loader/60ec790b96ea51c903d924116d8a09cf46d564e2.json.gz
...l-loader/60ec790b96ea51c903d924116d8a09cf46d564e2.json.gz
+0
-0
node_modules/.cache/babel-loader/610481b40e211b25cd3c8d343fa1a2551a1ea1dc.json.gz
...l-loader/610481b40e211b25cd3c8d343fa1a2551a1ea1dc.json.gz
+0
-0
node_modules/.cache/babel-loader/65d01c56debd37dcf293cb4fe3fdebaf48ed5870.json.gz
...l-loader/65d01c56debd37dcf293cb4fe3fdebaf48ed5870.json.gz
+0
-0
node_modules/.cache/babel-loader/69b56db26788991c2475764e222866ae4f49b868.json.gz
...l-loader/69b56db26788991c2475764e222866ae4f49b868.json.gz
+0
-0
node_modules/.cache/babel-loader/742bd76182a6876cfda0d5b2d8b22af845c14fdc.json.gz
...l-loader/742bd76182a6876cfda0d5b2d8b22af845c14fdc.json.gz
+0
-0
node_modules/.cache/babel-loader/7cc995636ccbd2787c32182b4abb56ed2b570a9f.json.gz
...l-loader/7cc995636ccbd2787c32182b4abb56ed2b570a9f.json.gz
+0
-0
node_modules/.cache/babel-loader/81a6f87efbbd16edcfda77bd2d3a613290a9c190.json.gz
...l-loader/81a6f87efbbd16edcfda77bd2d3a613290a9c190.json.gz
+0
-0
node_modules/.cache/babel-loader/8448d0c88b4ae0026a5e638ae54a7b05a788335b.json.gz
...l-loader/8448d0c88b4ae0026a5e638ae54a7b05a788335b.json.gz
+0
-0
node_modules/.cache/babel-loader/8de2f6ab5acab7798e4f1c400238d74341bf4ac0.json.gz
...l-loader/8de2f6ab5acab7798e4f1c400238d74341bf4ac0.json.gz
+0
-0
node_modules/.cache/babel-loader/8df589077678f39e3bf05d34b4435bb2fc50feb2.json.gz
...l-loader/8df589077678f39e3bf05d34b4435bb2fc50feb2.json.gz
+0
-0
node_modules/.cache/babel-loader/8f31bdd552a59de32bab4d54af6abeb6ddf79db9.json.gz
...l-loader/8f31bdd552a59de32bab4d54af6abeb6ddf79db9.json.gz
+0
-0
node_modules/.cache/babel-loader/9efd99aab368666c414782fc618ba235636adda1.json.gz
...l-loader/9efd99aab368666c414782fc618ba235636adda1.json.gz
+0
-0
node_modules/.cache/babel-loader/a03c3d8d4164571a946e69f8ffe0243998888eea.json.gz
...l-loader/a03c3d8d4164571a946e69f8ffe0243998888eea.json.gz
+0
-0
node_modules/.cache/babel-loader/b7d550a151fc88f3f6fe502ee73f7e1e6108dcf4.json.gz
...l-loader/b7d550a151fc88f3f6fe502ee73f7e1e6108dcf4.json.gz
+0
-0
node_modules/.cache/babel-loader/b98f3f84d53f17c0d42a28caee2fa4ba1a17703b.json.gz
...l-loader/b98f3f84d53f17c0d42a28caee2fa4ba1a17703b.json.gz
+0
-0
node_modules/.cache/babel-loader/bd307dd2c304a09e24be1bbfd52d5ae5368b6aa9.json.gz
...l-loader/bd307dd2c304a09e24be1bbfd52d5ae5368b6aa9.json.gz
+0
-0
node_modules/.cache/babel-loader/cc418b8d76c09ef2d63200d177eb6873ebbf7039.json.gz
...l-loader/cc418b8d76c09ef2d63200d177eb6873ebbf7039.json.gz
+0
-0
node_modules/.cache/babel-loader/cfee2becd03166cfcb6deeb3f5cf318349e9bdc3.json.gz
...l-loader/cfee2becd03166cfcb6deeb3f5cf318349e9bdc3.json.gz
+0
-0
node_modules/.cache/babel-loader/da557e97151465cc0b18e310a438a13dd60b7243.json.gz
...l-loader/da557e97151465cc0b18e310a438a13dd60b7243.json.gz
+0
-0
node_modules/.cache/babel-loader/dbcadd4239e5bd45c97bc0331a19f5b354447c42.json.gz
...l-loader/dbcadd4239e5bd45c97bc0331a19f5b354447c42.json.gz
+0
-0
node_modules/.cache/babel-loader/ee941f898d12fafcc2e9fcd120f6baa88493a38b.json.gz
...l-loader/ee941f898d12fafcc2e9fcd120f6baa88493a38b.json.gz
+0
-0
node_modules/.cache/babel-loader/f154d874becc21611e9c5644e7000edbd51ddc9c.json.gz
...l-loader/f154d874becc21611e9c5644e7000edbd51ddc9c.json.gz
+0
-0
node_modules/.cache/babel-loader/f2f28449fd01d60e4d8d9e68592e30ee7839ff05.json.gz
...l-loader/f2f28449fd01d60e4d8d9e68592e30ee7839ff05.json.gz
+0
-0
node_modules/.cache/babel-loader/f5165a765ae54c341662f2ae0aa97ec8231c58d9.json.gz
...l-loader/f5165a765ae54c341662f2ae0aa97ec8231c58d9.json.gz
+0
-0
node_modules/.cache/babel-loader/fab455e03ec856f4c3ae1313f6c0dde846541783.json.gz
...l-loader/fab455e03ec856f4c3ae1313f6c0dde846541783.json.gz
+0
-0
node_modules/.cache/babel-loader/fce9395f0f72d0be312b4e3cd75d6c78faf15941.json.gz
...l-loader/fce9395f0f72d0be312b4e3cd75d6c78faf15941.json.gz
+0
-0
node_modules/.cache/babel-loader/fe70af98ea5c5b6579442ebff46018447eb79aa9.json.gz
...l-loader/fe70af98ea5c5b6579442ebff46018447eb79aa9.json.gz
+0
-0
pages/index.js
pages/index.js
+36
-2
pages/products/checkout/buycheckout.js
pages/products/checkout/buycheckout.js
+11
-6
pages/products/new.js
pages/products/new.js
+11
-3
pages/products/show.js
pages/products/show.js
+10
-8
pages/user/view-info.js
pages/user/view-info.js
+24
-21
No files found.
ethereum/build/CreateProduct.json
View file @
12771064
This diff is collapsed.
Click to expand it.
ethereum/build/Marketplace.json
View file @
12771064
This diff is collapsed.
Click to expand it.
ethereum/contracts/Marketplace.sol
View file @
12771064
...
...
@@ -63,6 +63,7 @@ contract CreateProduct {
return
_id
;
}
// return user information
function
getUser
(
address
_addressId
)
public
view
returns
(
address
,
string
,
string
,
string
,
address
[])
{
// need to add check whether user exist
...
...
@@ -88,11 +89,12 @@ contract CreateProduct {
loginAddress
=
address
(
0
);
}
function
newProduct
(
string
description
,
uint
amountToRecoup
,
uint
amountAlreadyRecouped
,
uint
percentage
,
address
movieAddress
,
address
groupAddress
,
uint
stakeholderType
)
public
{
// create new stakes
function
newProduct
(
string
title
,
string
description
,
uint
amountToRecoup
,
uint
amountAlreadyRecouped
,
uint
percentage
,
address
movieAddress
,
address
groupAddress
,
uint
stakeholderType
)
public
{
// check login is true first
require
(
login
==
true
);
address
product
=
new
Marketplace
(
description
,
amountToRecoup
,
amountAlreadyRecouped
,
percentage
,
movieAddress
,
groupAddress
,
stakeholderType
,
msg
.
sender
);
address
product
=
new
Marketplace
(
title
,
description
,
amountToRecoup
,
amountAlreadyRecouped
,
percentage
,
movieAddress
,
groupAddress
,
stakeholderType
,
msg
.
sender
,
address
(
this
)
);
deployedProducts
.
push
(
product
);
emit
ProductCreated
(
msg
.
sender
,
product
);
...
...
@@ -101,12 +103,14 @@ contract CreateProduct {
user
.
stakeholders
.
push
(
product
);
}
// return stakeholders of a specific client address
function
getAllStakeholdersFromUserAddress
(
address
_id
)
public
view
returns
(
address
[])
{
uint
userId
=
getUserIdFromAddress
(
_id
);
User
storage
user
=
users
[
userId
];
return
user
.
stakeholders
;
}
// add the parameter to the stakeholder
function
addStakeholderToOwner
(
address
userAddress
,
address
contractAddress
)
public
{
uint
userId
=
getUserIdFromAddress
(
userAddress
);
User
storage
user
=
users
[
userId
];
...
...
@@ -133,11 +137,12 @@ contract CreateProduct {
}
}
// return the arrays of available stakes on the market
function
getDeployedProducts
()
public
view
returns
(
address
[])
{
return
deployedProducts
;
}
// return number of stakes on the market
function
getDeployedProductsCount
()
public
view
returns
(
uint
)
{
return
deployedProducts
.
length
;
}
...
...
@@ -215,6 +220,7 @@ contract Marketplace {
// Attributes for stakeholder
address
public
manager
;
uint
public
listedPrice
;
string
public
title
;
string
public
productDescription
;
ProductCondition
public
productCondition
;
bool
public
purchased
;
...
...
@@ -260,8 +266,9 @@ contract Marketplace {
}
function
Marketplace
(
string
description
,
uint
amountToRecoup
,
uint
amountAlreadyRecouped
,
uint
percentageVal
,
address
movieAddressId
,
address
groupAddressId
,
uint
stakeholderTypeVal
,
address
creator
)
public
{
function
Marketplace
(
string
_title
,
string
description
,
uint
amountToRecoup
,
uint
amountAlreadyRecouped
,
uint
percentageVal
,
address
movieAddressId
,
address
groupAddressId
,
uint
stakeholderTypeVal
,
address
creator
,
address
factoryContact
)
public
{
manager
=
creator
;
title
=
_title
;
productDescription
=
description
;
productCondition
=
ProductCondition
.
NOTDEPLOYED
;
fixedAmountToRecoup
=
amountToRecoup
;
...
...
@@ -284,6 +291,7 @@ contract Marketplace {
stakeholderType
=
StakeholderType
.
Expense
;
}
factoryContractAddress
=
factoryContact
;
// Set highest offer and bidder to initial state
highestBidder
=
address
(
0
);
highestOfferPrice
=
0
;
...
...
@@ -412,7 +420,7 @@ contract Marketplace {
}
// withdraw offer from the offerlist
function
withdrawOffer
(
uint
id
)
public
{
Offer
storage
offer
=
offers
[
id
];
require
(
msg
.
sender
==
offer
.
offerAddress
||
msg
.
sender
==
manager
);
...
...
@@ -421,21 +429,23 @@ contract Marketplace {
delete
offers
[
id
];
}
// Accept the highest offer that is listed
function
acceptOffer
()
public
restricted
{
purchased
=
true
;
offerOwnership
(
highestBidder
);
claimProductOwnershipOffer
();
}
// refund buyer by adding to the amountToRefund mapping
function
refundBuyer
(
uint
id
)
public
{
Offer
storage
offer
=
offers
[
id
];
address
refundAddress
=
offer
.
offerAddress
;
if
(
refund
>
0
)
{
Offer
storage
offer
=
offers
[
id
];
address
refundAddress
=
offer
.
offerAddress
;
if
(
refund
>
0
)
{
// set refund amount to 0 to prevent user to try to refund again
amountToRefund
[
refundAddress
]
=
0
;
refundAddress
.
transfer
(
refund
);
}
}
}
...
...
@@ -461,17 +471,35 @@ contract Marketplace {
function
claimProductOwnership
()
public
{
manager
.
transfer
(
listedPrice
*
1000000000000000000
);
//update stakeholders for old first
address
oldManager
=
manager
;
manager
=
newProductOwner
;
CreateProduct
c
=
CreateProduct
(
factoryContractAddress
);
c
.
updateStakeholders
(
oldManager
);
c
.
updateStakeholders
(
manager
);
newProductOwner
=
address
(
0
);
productCondition
=
ProductCondition
.
NOTDEPLOYED
;
delete
offers
;
highestBidder
=
address
(
0
);
highestOfferPrice
=
0
;
highestOfferMessage
=
""
;
}
function
claimProductOwnershipOffer
()
public
{
manager
.
transfer
(
highestOfferPrice
);
address
oldManager
=
manager
;
manager
=
newProductOwner
;
CreateProduct
c
=
CreateProduct
(
factoryContractAddress
);
c
.
updateStakeholders
(
oldManager
);
c
.
updateStakeholders
(
manager
);
newProductOwner
=
address
(
0
);
productCondition
=
ProductCondition
.
NOTDEPLOYED
;
delete
offers
;
highestBidder
=
address
(
0
);
highestOfferPrice
=
0
;
highestOfferMessage
=
""
;
}
function
getOfferInfo
()
public
view
returns
(
address
,
uint
,
string
)
{
...
...
@@ -480,7 +508,7 @@ contract Marketplace {
);
}
function
getProductInfo
()
public
view
returns
(
address
,
uint
,
string
,
ProductCondition
,
bool
,
address
,
StakeholderType
,
uint
,
uint
,
uint
,
address
,
address
)
{
function
getProductInfo
()
public
view
returns
(
address
,
uint
,
string
,
ProductCondition
,
bool
,
address
,
StakeholderType
,
uint
,
uint
,
uint
,
address
,
address
,
string
)
{
return
(
manager
,
listedPrice
,
...
...
@@ -493,7 +521,8 @@ contract Marketplace {
amountRecouped
,
percentage
,
movieAddress
,
groupAddress
groupAddress
,
title
);
}
...
...
ethereum/newproduct.js
View file @
12771064
...
...
@@ -4,7 +4,7 @@ import CreateProduct from './build/CreateProduct.json';
const
instance
=
new
web3
.
eth
.
Contract
(
JSON
.
parse
(
CreateProduct
.
interface
),
'
0x
13cf4f41d7A0Fe06C4D8cC92dC5Ef6087C8Ec95
5
'
'
0x
F4d7CC060db884D89dc388ee0F6D4585ED5348F
5
'
);
export
default
instance
;
filmchain_token_sale/build/contracts/FilmChainToken.json
View file @
12771064
...
...
@@ -814,7 +814,7 @@
"name"
:
"msg"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
257
,
"referencedDeclaration"
:
405
,
"src"
:
"597:3:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_magic_message"
,
...
...
@@ -1229,7 +1229,7 @@
"name"
:
"msg"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
257
,
"referencedDeclaration"
:
405
,
"src"
:
"1076:3:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_magic_message"
,
...
...
@@ -1294,10 +1294,10 @@
"name"
:
"require"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[
260
,
261
408
,
409
],
"referencedDeclaration"
:
260
,
"referencedDeclaration"
:
408
,
"src"
:
"1059:7:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_function_require_pure$_t_bool_$returns$__$"
,
...
...
@@ -1354,7 +1354,7 @@
"name"
:
"msg"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
257
,
"referencedDeclaration"
:
405
,
"src"
:
"1113:3:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_magic_message"
,
...
...
@@ -1496,7 +1496,7 @@
"name"
:
"msg"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
257
,
"referencedDeclaration"
:
405
,
"src"
:
"1191:3:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_magic_message"
,
...
...
@@ -1760,7 +1760,7 @@
"name"
:
"msg"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
257
,
"referencedDeclaration"
:
405
,
"src"
:
"1350:3:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_magic_message"
,
...
...
@@ -1854,7 +1854,7 @@
"name"
:
"msg"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
257
,
"referencedDeclaration"
:
405
,
"src"
:
"1407:3:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_magic_message"
,
...
...
@@ -2172,10 +2172,10 @@
"name"
:
"require"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[
260
,
261
408
,
409
],
"referencedDeclaration"
:
260
,
"referencedDeclaration"
:
408
,
"src"
:
"1584:7:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_function_require_pure$_t_bool_$returns$__$"
,
...
...
@@ -2266,7 +2266,7 @@
"name"
:
"msg"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
257
,
"referencedDeclaration"
:
405
,
"src"
:
"1661:3:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_magic_message"
,
...
...
@@ -2331,10 +2331,10 @@
"name"
:
"require"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[
260
,
261
408
,
409
],
"referencedDeclaration"
:
260
,
"referencedDeclaration"
:
408
,
"src"
:
"1631:7:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_function_require_pure$_t_bool_$returns$__$"
,
...
...
@@ -2564,7 +2564,7 @@
"name"
:
"msg"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
257
,
"referencedDeclaration"
:
405
,
"src"
:
"1786:3:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_magic_message"
,
...
...
@@ -3407,7 +3407,7 @@
"name"
:
"msg"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
257
,
"referencedDeclaration"
:
405
,
"src"
:
"597:3:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_magic_message"
,
...
...
@@ -3822,7 +3822,7 @@
"name"
:
"msg"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
257
,
"referencedDeclaration"
:
405
,
"src"
:
"1076:3:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_magic_message"
,
...
...
@@ -3887,10 +3887,10 @@
"name"
:
"require"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[
260
,
261
408
,
409
],
"referencedDeclaration"
:
260
,
"referencedDeclaration"
:
408
,
"src"
:
"1059:7:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_function_require_pure$_t_bool_$returns$__$"
,
...
...
@@ -3947,7 +3947,7 @@
"name"
:
"msg"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
257
,
"referencedDeclaration"
:
405
,
"src"
:
"1113:3:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_magic_message"
,
...
...
@@ -4089,7 +4089,7 @@
"name"
:
"msg"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
257
,
"referencedDeclaration"
:
405
,
"src"
:
"1191:3:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_magic_message"
,
...
...
@@ -4353,7 +4353,7 @@
"name"
:
"msg"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
257
,
"referencedDeclaration"
:
405
,
"src"
:
"1350:3:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_magic_message"
,
...
...
@@ -4447,7 +4447,7 @@
"name"
:
"msg"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
257
,
"referencedDeclaration"
:
405
,
"src"
:
"1407:3:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_magic_message"
,
...
...
@@ -4765,10 +4765,10 @@
"name"
:
"require"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[
260
,
261
408
,
409
],
"referencedDeclaration"
:
260
,
"referencedDeclaration"
:
408
,
"src"
:
"1584:7:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_function_require_pure$_t_bool_$returns$__$"
,
...
...
@@ -4859,7 +4859,7 @@
"name"
:
"msg"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
257
,
"referencedDeclaration"
:
405
,
"src"
:
"1661:3:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_magic_message"
,
...
...
@@ -4924,10 +4924,10 @@
"name"
:
"require"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[
260
,
261
408
,
409
],
"referencedDeclaration"
:
260
,
"referencedDeclaration"
:
408
,
"src"
:
"1631:7:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_function_require_pure$_t_bool_$returns$__$"
,
...
...
@@ -5157,7 +5157,7 @@
"name"
:
"msg"
,
"nodeType"
:
"Identifier"
,
"overloadedDeclarations"
:
[],
"referencedDeclaration"
:
257
,
"referencedDeclaration"
:
405
,
"src"
:
"1786:3:0"
,
"typeDescriptions"
:
{
"typeIdentifier"
:
"t_magic_message"
,
...
...
@@ -5527,12 +5527,12 @@
}
},
"links"
:
{},
"address"
:
"0x
bAc6Ab0a86b0Fb2d88A30Be0D2801b261F5F5df1
"
,
"transactionHash"
:
"0x5
6a7bdd3f10a6019c318420fba96437d3281fdc8f6dc0a90e78236d8273dee6c
"
"address"
:
"0x
22c005e3A2088aEeD6B3dfEa097aD10d75440E32
"
,
"transactionHash"
:
"0x5
42820ee1dc64fe3598443c89cd04337023a808075ad04ab5fb09f26814f01d9
"
}
},
"schemaVersion"
:
"3.0.23"
,
"updatedAt"
:
"2020-06-22T
06
:2
4
:5
9.251
Z"
,
"updatedAt"
:
"2020-06-22T
13
:2
1
:5
3.538
Z"
,
"networkType"
:
"ethereum"
,
"devdoc"
:
{
"methods"
:
{}
...
...
filmchain_token_sale/build/contracts/FilmChainTokenSales.json
View file @
12771064
...
...
@@ -4148,9 +4148,37 @@
"name"
:
"solc"
,
"version"
:
"0.5.16+commit.9c3226ce.Emscripten.clang"
},
"networks"
:
{},
"networks"
:
{
"5777"
:
{
"events"
:
{
"0xcb1913a166c275800ee1bc5548f97de4caa1abe905d5e0fadd17ce3da2773e73"
:
{
"anonymous"
:
false
,
"inputs"
:
[
{
"indexed"
:
true
,
"internalType"
:
"address"
,
"name"
:
"beneficiary"
,
"type"
:
"address"
},
{
"indexed"
:
false
,
"internalType"
:
"uint256"
,
"name"
:
"_value"
,
"type"
:
"uint256"
}
],
"name"
:
"TokensSell"
,
"type"
:
"event"
}
},
"links"
:
{},
"address"
:
"0x01F43e301480748E83b61F9202F6e645840dcb81"
,
"transactionHash"
:
"0x1192e98672c70f388d31f75a476e9996c1f248761173e6c093205f9735b23894"
}
},
"schemaVersion"
:
"3.0.23"
,
"updatedAt"
:
"2020-06-22T09:53:17.812Z"
,
"updatedAt"
:
"2020-06-22T13:21:53.557Z"
,
"networkType"
:
"ethereum"
,
"devdoc"
:
{
"methods"
:
{}
},
...
...
filmchain_token_sale/build/contracts/Migrations.json
View file @
12771064
This diff is collapsed.
Click to expand it.
filmchain_token_sale/src/index.html
View file @
12771064
...
...
@@ -8,7 +8,70 @@
<link
href=
"css/bootstrap.min.css"
rel=
"stylesheet"
>
</head>
<body>
<h1>
FilmChain Tokens Sales Initial Coin Offering
</h1>
<div
class=
"container"
style=
"width: 700px;"
>
<div
class=
"row"
>
<div
class=
"col-lg-12"
>
<h1
class=
"text-center"
>
FilmChain Tokens Sales Initial Coin Offering
</h1>
</div>
<hr
/>
<br
/>
</div>
<div
id=
"loader"
>
<p
class=
"text-center"
>
Page Loading...
</p>
</div>
<div
id=
"content"
class=
"text-center"
style=
"display: none;"
>
<h3>
FilmChain Token (FTC)!
</h3>
<br
/>
<h5>
This is a platform that allows FilmChain Token sales. In order to buy FilmChain Tokens,
insert amount of tokens you want to buy inside the input fields and click Buy Tokens.
</h5>
<h5>
MetaMask
will popup to confirm the transaction with the blockchain.
</h5>
<br
/>
<p>
1 FilmChain Token =
<span
class=
"token-price"
></span>
Ether.
</p>
<p>
You currently have
<span
class=
"ftc-balance"
></span>
FTC.
</p>
<br
/>
<form
onSubmit=
"App.buyTokens(); return false;"
role=
"form"
>
<div
class=
"form-group"
>
<div
class=
"input-group"
>
<input
id=
"numberOfTokens"
class=
"form-control input-lg"
type=
"number"
name=
"number"
value=
"1"
min=
"1"
pattern=
"[0-9]"
>
</input>
<span
class=
"input-group-btn"
>
<button
type=
"submit"
class=
"btn btn-primary btn-lg"
>
Buy Tokens
</button>
</span>
</div>
</div>
</form>
<br
/>
<div
class=
"progress"
>
<div
id=
"progress"
class=
"progress-bar progress-bar-striped active"
aria-valuemin=
"0"
aria-valuemax=
"100"
>
</div>
</div>
<p><span
class=
"num-sold-tokens"
></span>
/
<span
class=
"tokens-free"
></span>
tokens sold
</p>
<hr
/>
<p
id=
"accountAddress"
>
</p>
</div>
</div>
<script
src=
"https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"
></script>
<script
src=
"js/bootstrap.min.js"
></script>
<script
src=
"js/web3.min.js"
></script>
...
...
filmchain_token_sale/src/js/app.js
View file @
12771064
console
.
log
(
"
App file is executed
"
);
App
=
{
web3Provider
:
null
,
contracts
:
{},
account
:
'
0x0
'
,
loading
:
false
,
tokenPrice
:
100000000000000
,
numSoldTokens
:
0
,
tokensFree
:
800000
,
init
:
function
()
{
console
.
log
(
"
App starting...
"
)
return
App
.
initWeb3
();
},
initWeb3
:
function
()
{
if
(
typeof
web3
!==
'
undefined
'
)
{
// If a web3 instance is already provided by Meta Mask.
App
.
web3Provider
=
web3
.
currentProvider
;
web3
=
new
Web3
(
web3
.
currentProvider
);
}
else
{
// Specify default instance if no web3 instance provided
App
.
web3Provider
=
new
Web3
.
providers
.
HttpProvider
(
'
http://localhost:7545
'
);
web3
=
new
Web3
(
App
.
web3Provider
);
}
return
App
.
initContracts
();
},
initContracts
:
function
()
{
$
.
getJSON
(
"
FilmChainTokenSales.json
"
,
function
(
filmChainTokenSales
)
{
App
.
contracts
.
FilmChainTokenSales
=
TruffleContract
(
filmChainTokenSales
);
App
.
contracts
.
FilmChainTokenSales
.
setProvider
(
App
.
web3Provider
);
App
.
contracts
.
FilmChainTokenSales
.
deployed
().
then
(
function
(
filmChainTokenSales
)
{
console
.
log
(
"
FilmChain Token Sale Address:
"
,
filmChainTokenSales
.
address
);
});
}).
done
(
function
()
{
$
.
getJSON
(
"
FilmChainToken.json
"
,
function
(
filmChainToken
)
{
App
.
contracts
.
FilmChainToken
=
TruffleContract
(
filmChainToken
);
App
.
contracts
.
FilmChainToken
.
setProvider
(
App
.
web3Provider
);
App
.
contracts
.
FilmChainToken
.
deployed
().
then
(
function
(
filmChainToken
)
{