Create scripts to generate Proxy contracts from source stored in the `auth-os-application` submodule

- To execute it with the current submodule:
  - `./scripts/generateProxyContracts.sh`
- To execute it from a particular commit in the submodule:
  - `./scripts/generateProxyContracts.sh 1234567`
  - where `1234567` is the commit hash
This commit is contained in:
fernandomg 2018-08-23 19:17:36 -03:00
parent 9151160ddb
commit abcccde2d2
4 changed files with 57 additions and 0 deletions

16
scripts/extractContent.js Normal file
View File

@ -0,0 +1,16 @@
const fs = require('fs')
const fileName = process.argv.slice(2)[0]
const extractContent = fileName => {
fs.readFile('../public/contracts/' + fileName + '.json', (err, file) => {
if (err) throw err
fs.writeFileSync('../public/contracts/' + fileName + '.abi', JSON.stringify(JSON.parse(file.toString()).abi))
fs.writeFileSync('../public/contracts/' + fileName + '.bin', JSON.parse(file.toString()).bytecode)
})
}
try {
extractContent(fileName)
} catch (e) {
console.error(e)
}

View File

@ -0,0 +1,16 @@
#!/bin/bash
dutchPath=submodules/auth-os-applications/TokenWizard/crowdsale/DutchCrowdsale
cd $dutchPath
npm i
cd scripts
./flatten.sh
cd ..
npx truffle compile flats/DutchProxy.sol
cd ../../../../..
rm public/contracts/Dutch*.*
cp $dutchPath/flats/DutchProxy.sol public/contracts/
cp $dutchPath/build/contracts/DutchProxy.json public/contracts/
cd scripts
node ./extractContent.js DutchProxy
cd ..
rm ./public/contracts/DutchProxy.json

View File

@ -0,0 +1,16 @@
#!/bin/bash
mintedPath=submodules/auth-os-applications/TokenWizard/crowdsale/MintedCappedCrowdsale
cd $mintedPath
npm i
cd scripts
./flatten.sh
cd ..
npx truffle compile flats/MintedCappedProxy.sol
cd ../../../../..
rm public/contracts/MintedCapped*.*
cp $mintedPath/flats/MintedCappedProxy.sol public/contracts/
cp $mintedPath/build/contracts/MintedCappedProxy.json public/contracts/
cd scripts
node ./extractContent.js MintedCappedProxy
cd ..
rm ./public/contracts/MintedCappedProxy.json

View File

@ -0,0 +1,9 @@
#!/bin/bash
if [ $# -eq 1 ]
then
cd submodules/auth-os-applications
git reset --hard $1
cd ../..
fi
./scripts/generateDutchProxyContract.sh
./scripts/generateMintedCappedProxyContract.sh