Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gluk64 committed May 13, 2019
1 parent a95a7ce commit becb997
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,5 +181,5 @@ flatten:
$(call flatten_file,Exitor.sol)
$(call flatten_file,Transactor.sol)

source: flatten
source: #flatten
@node contracts/scripts/publish-source.js
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,5 @@ So you need to rebuild the code on every change (to be automated).
### Publish source code on etherscan

```
franklin source
franklin flatten source
```
17 changes: 10 additions & 7 deletions contracts/scripts/publish-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ const fs = require('fs');
const FILE = 'deploy.log'
const deployLog = fs.readFileSync(FILE, 'utf8');

const ENV_FILE = process.env.ENV_FILE
const config = fs.readFileSync(ENV_FILE, 'utf8');

const ABI = JSON.parse(fs.readFileSync('./contracts/build/contracts/FranklinProxy.json', 'utf8')).abi
const Constructor = ABI.find(i => i.type === 'constructor')

console.log(Constructor)

function addr(name) {
let part = deployLog
part = part.split("Starting migrations...")[1]
Expand Down Expand Up @@ -60,12 +61,14 @@ async function publish(name, contractaddress, constructorArguements) {
}

async function main() {
//console.log('provider:', process.env.WEB3_URL)
//console.log('ETHERSCAN_API_KEY:', process.env.ETHERSCAN_API_KEY)


let regex = /CONTRACT_ADDR=(.*)/g
let fromConfig = '0x'+regex.exec(config)[1]
console.log(fromConfig)

let FranklinProxy = addr('FranklinProxy')
if (FranklinProxy !== '0x'+process.env.CONTRACT_ADDR) {
console.error(`FranklinProxy contract addresses mismatch: form env = 0x${process.env.CONTRACT_ADDR}, from ${FILE} = ${FranklinProxy}`)
if (FranklinProxy !== fromConfig) {
console.error(`FranklinProxy contract addresses mismatch: form env = ${fromConfig}, from ${FILE} = ${FranklinProxy}`)
process.exit(1)
}

Expand Down

0 comments on commit becb997

Please sign in to comment.