This repository has been archived by the owner on Aug 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jingleizhang
committed
Jan 28, 2021
1 parent
ea7df30
commit 12d1ff8
Showing
7 changed files
with
245 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// This simple script tells you how big your contract byte code is and how much you have until you exceed | ||
// the current block limit as defined by EIP170. | ||
|
||
const argv = require("minimist")(process.argv.slice(), { string: ["contract"] }); | ||
const contractName = argv.contract; | ||
|
||
if (!contractName) { | ||
console.log("Please enter the contract name as a parameter as `--contract <name>`."); | ||
return; | ||
} | ||
var child = require("child_process").exec("truffle compile"); | ||
child.stdout.pipe(process.stdout); | ||
child.on("exit", function() { | ||
console.log("finished compiling 🚀!"); | ||
console.log("loading", contractName + ".json"); | ||
let obj = require("./../build/contracts/" + contractName + ".json"); | ||
|
||
const byteCodeSize = (obj.bytecode.length - 2) / 2; | ||
const remainingSize = 2 ** 14 + 2 ** 13 - (obj.bytecode.length - 2) / 2; | ||
console.log("Contract is", byteCodeSize, "bytes in size."); | ||
console.log("This leaves a total of", remainingSize, "bytes within the EIP170 limit 🔥."); | ||
|
||
process.exit(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
source /etc/bashrc | ||
|
||
BIN=ganache-cli | ||
|
||
res=`ps aux | grep ${BIN} | grep -v grep | awk '{print $2}'` | ||
if [ "$res" == "" ]; then | ||
echo "the ${BIN} is not running, begin startup..." | ||
else | ||
echo 'current running pid is '$res', begin to stopping...' | ||
|
||
kill -9 `ps aux | grep ${BIN} |egrep -v "grep"|awk '{print $2}'` && sleep 1s && echo -e "${BIN} killed successfully" | ||
fi | ||
|
||
ganache-cli --chainId="0x2a" --networkId="0x2a" --port="8545" --mnemonic "copy obey episode awake damp vacant protect hold wish primary travel shy" --gasLimit=3000000000000 --gasPrice=20000 | ||
|
Oops, something went wrong.