Skip to content

Commit 9d7f47d

Browse files
author
Augusto Lemble
authored
Merge pull request #322 from levelkdev/develop
BCDapp v0.2.1
2 parents 4088669 + da45fb4 commit 9d7f47d

File tree

13 files changed

+117
-39
lines changed

13 files changed

+117
-39
lines changed

.openzeppelin/mainnet.json

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,34 @@
488488
}
489489
},
490490
"solidityLibs": {},
491-
"proxies": {},
491+
"proxies": {
492+
"BC-DAPP/DecentralizedAutonomousTrust": [
493+
{
494+
"address": "0xa1d65E8fB6e87b60FECCBc582F7f97804B725521",
495+
"version": "0.1.0",
496+
"implementation": "0x845856776D110a200Cf41f35C9428C938e72E604",
497+
"admin": "0xFBD9B2773127Ea0A05509f16FD4AACC84F3b9829",
498+
"kind": "Upgradeable"
499+
}
500+
],
501+
"BC-DAPP/Multicall": [
502+
{
503+
"address": "0x742121cD0BB9784c1f17f25B8da1bF3445b93ED4",
504+
"kind": "NonProxy",
505+
"bytecodeHash": "daa7a021eecb7d6e3a847506aa7589e5a9bbdabd6fe91c538a1d9fb37b7fd577"
506+
}
507+
],
508+
"BC-DAPP/TokenVesting": [
509+
{
510+
"address": "0xBd12eBb77eF167a5FF93b7E572b33f2526aE3fd0",
511+
"kind": "NonProxy",
512+
"bytecodeHash": "e4bee0a315de0cc8106ca7ec0db7b5f62da96a7d01a624818a748557f73764ff"
513+
}
514+
]
515+
},
492516
"manifestVersion": "2.2",
493-
"version": "0.1.0"
517+
"version": "0.1.0",
518+
"proxyAdmin": {
519+
"address": "0x07eD323e96b5b37f49432CE86277A56015e7FB5e"
520+
}
494521
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "BC-DAPP",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"description": "Decentralized app for fundraising in DXdao.",
55
"scripts": {
66
"start": "./scripts/start.sh",

public/dangerous.svg

Lines changed: 14 additions & 0 deletions
Loading

scripts/deploy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ ZWeb3.initialize(web3.currentProvider);
3434
let contractsDeployed = {'contracts': {}};
3535
if (fs.existsSync('src/config/contracts.json'))
3636
contractsDeployed = JSON.parse(fs.readFileSync('src/config/contracts.json', 'utf-8'));
37-
const toDeploy = JSON.parse(fs.readFileSync('src/config/toDeploy.json', 'utf-8'));
37+
let toDeploy = JSON.parse(fs.readFileSync('src/config/toDeploy.json', 'utf-8'));
3838

3939
async function main() {
4040
const contracts = await deployDAT(web3, toDeploy.DATinfo);
41-
41+
toDeploy.DATinfo.fromBlock = (await web3.eth.getBlock('latest')).number;
4242
contractsDeployed.contracts[network] = {
4343
multicall: contracts.multicall.address,
4444
DAT: contracts.dat.address,

scripts/deployContracts.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,23 +81,16 @@ async function main() {
8181

8282
console.log(`Using account: ${deployer}`, ' \n');
8383
console.log(`Deploy DAT with config: ${JSON.stringify(deployOptions, null, 2)}`, ' \n');
84-
84+
8585
contracts.proxyAdmin = await ProxyAdmin.new({
8686
from: deployer
8787
});
8888
console.log(`ProxyAdmin deployed ${contracts.proxyAdmin.address}`);
8989

90-
contracts.tokenVesting = await TokenVesting.new({
91-
from: deployer
92-
});
93-
94-
contracts.datImplementation = await DATContract.new({
95-
from: deployer
96-
});
97-
console.log(`DAT implementation deployed ${contracts.datImplementation.address}`);
90+
console.log(`Using DAT implementation 0x845856776D110a200Cf41f35C9428C938e72E604`);
9891

9992
contracts.datProxy = await AdminUpgradeabilityProxy.new(
100-
contracts.datImplementation.address, // logic
93+
"0x845856776D110a200Cf41f35C9428C938e72E604", // logic
10194
contracts.proxyAdmin.address, // admin
10295
[], // data
10396
{
@@ -120,6 +113,9 @@ async function main() {
120113
).send({ from: deployer });
121114

122115
// Deploy token vesting
116+
contracts.tokenVesting = await TokenVesting.new({
117+
from: deployer
118+
});
123119
await contracts.tokenVesting.methods.initialize(
124120
deployOptions.control, new moment().unix(), deployOptions.vestingCliff,
125121
deployOptions.vestingDuration, false, deployOptions.control

scripts/dev.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ npx truffle compile && rm -rf contracts/build && mv build/contracts contracts/bu
4747
rm .openzeppelin/dev-*.json ||:
4848
npx oz push --network develop
4949
node scripts/copyContracts.js
50-
node scripts/deploy.js -- --network develop &
50+
rm src/config/contracts.json ||:
51+
node scripts/deploy.js -- --network develop
52+
node scripts/loadDeployments.js
5153
sleep 3
5254
FORCE_COLOR=true REACT_APP_ETH_NETWORKS="develop,mainnet,kovan" node scripts/start.js | cat

scripts/loadDeployments.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ async function loadDeployment(network) {
2323
let contractsDeployed = {'contracts': {}};
2424
if (fs.existsSync('src/config/contracts.json'))
2525
contractsDeployed = JSON.parse(fs.readFileSync('src/config/contracts.json', 'utf-8'));
26-
2726
const datContract = DATContract.at(proxies['BC-DAPP/DecentralizedAutonomousTrust'][0].address);
28-
27+
const fromBlock = (network == 'mainnet') ? 10012634 : (network == 'kovan') ? 18000000 : 0;
2928
contractsDeployed.contracts[network] = {
3029
multicall: proxies['BC-DAPP/Multicall'][0].address,
3130
DAT: proxies['BC-DAPP/DecentralizedAutonomousTrust'][0].address,
3231
implementationAddress: proxies['BC-DAPP/DecentralizedAutonomousTrust'][0].implementation,
3332
collateral: zeroAddress,
3433
DATinfo: {
34+
fromBlock: fromBlock,
3535
"collateralType": "ETH",
3636
"name": await datContract.methods.name().call(),
3737
"symbol": await datContract.methods.symbol().call(),
@@ -46,7 +46,7 @@ async function loadDeployment(network) {
4646
},
4747
};
4848

49-
fs.writeFileSync('src/config/contracts.json', JSON.stringify(contractsDeployed, null, 2), {encoding:'utf8',flag:'w'})
49+
await fs.writeFileSync('src/config/contracts.json', JSON.stringify(contractsDeployed, null, 2), {encoding:'utf8',flag:'w'})
5050
console.log('Deployment configuration loaded for network '+network);
5151
}
5252

src/App.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
--red-text: #FF4081;
88
--blue-onHover: #4864FE;
99
--blue-onHover-border: #2545FE;
10+
--dangerous-alert: #D32F2F;
1011
--wrong-network-border: #D81B60;
1112
--wrong-network-border-hover: #C2185B;
1213
--wrong-network-hover: #E91E63;

src/components/Footer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,16 @@ const Footer = () => {
7575
}
7676
target="#"
7777
>
78-
Version 0.2.0
78+
Version 0.2.1
7979
</a>
8080
</FooterItem>
8181
<FooterDivider></FooterDivider>
8282
<FooterItem>
83-
{etherscanAddress(chainId,"Proxy",proxyContract)}
83+
{etherscanToken(chainId,"Token Contract",proxyContract, false)}
8484
</FooterItem>
8585
<FooterDivider></FooterDivider>
8686
<FooterItem>
87-
{etherscanAddress(chainId,"Contract",contract)}
87+
{etherscanAddress(chainId,"Logic Contract",contract)}
8888
</FooterItem>
8989
<FooterDivider></FooterDivider>
9090
<FooterItem>

src/components/LandingPage/Footer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ const Footer = () => {
5757
<FooterItem>
5858
<a
5959
href={
60-
'https://github.com/levelkdev/BC-DAPP/tree/v0.2.0'
60+
'https://github.com/levelkdev/BC-DAPP/tree/v0.2.1'
6161
}
6262
target="#"
6363
>
64-
Version 0.2.0
64+
Version 0.2.1
6565
</a>
6666
</FooterItem>
6767
<FooterDivider></FooterDivider>

0 commit comments

Comments
 (0)