Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Commit

Permalink
updated check-size script to show percentage
Browse files Browse the repository at this point in the history
  • Loading branch information
EdNoepel committed Oct 23, 2022
1 parent 3486473 commit c7e1e95
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 4 additions & 5 deletions check-size.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#!/bin/bash
s=$(brownie compile --size)
s=$(brownie compile --size | sed 's/\x1b\[[0-9;]*m//g') # strip ansi color from brownie output
echo "${s}"
regex='============ Deployment Bytecode Sizes ============\s*(\w+)\s+-\s+([0-9,B]+)\s+\('
regex='============ Deployment Bytecode Sizes ============\s*(\w+)\s+-\s+([0-9,B]+)\s+\(([0-9.]+%)\)'
[[ "$s" =~ $regex ]]
largest_contract=${BASH_REMATCH[1]}
largest_size=$(echo "${BASH_REMATCH[2]}" | sed -e 's/,//g' -e 's/B//g')
largest_percent=${BASH_REMATCH[3]}

limit=24576
echo "$largest_contract is $largest_size bytes ($largest_percent of $limit byte size limit)."
if (( largest_size > limit)); then
echo "$largest_contract is $largest_size bytes (over size limit of $limit bytes)."
exit 1
else
echo "$largest_contract is $largest_size bytes (under size limit of $limit bytes)."
fi;
1 change: 0 additions & 1 deletion src/base/Pool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
pragma solidity 0.8.14;

import '@clones/Clone.sol';
import "forge-std/console.sol";
import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
Expand Down

0 comments on commit c7e1e95

Please sign in to comment.