Skip to content

Commit

Permalink
decrease contracts compile optimize times for reduce contract size
Browse files Browse the repository at this point in the history
  • Loading branch information
ququzone committed Feb 3, 2024
1 parent 50a4de6 commit 3ee2334
Show file tree
Hide file tree
Showing 19 changed files with 19 additions and 20 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ jobs:
- name: Run Forge build
run: |
forge --version
# forge build --sizes
forge build
forge build --sizes
id: build

- name: Run Forge tests
Expand Down
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ out = 'foundry-out'
libs = ['lib']
auto_detect_solc = true
solc_version = '0.8.19'
optimizer_runs = 800
optimizer_runs = 100
via_ir = true
ffi = true
fs_permissions = [{ access = "read-write", path = ".forge-snapshots/"}, { access = "read", path = "./foundry-out"}]
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ const _abi = [
] as const;

const _bytecode =
"0x6080604052346200031d5762000c82803803806200001d8162000322565b9283398101906040818303126200031d5780516001600160401b03908181116200031d57836200004f91840162000348565b91602093848201518381116200031d576200006b920162000348565b82518281116200021d576003918254916001958684811c9416801562000312575b88851014620002fc578190601f94858111620002a6575b5088908583116001146200023f5760009262000233575b505060001982861b1c191690861b1783555b80519384116200021d5760049586548681811c9116801562000212575b82821014620001fd57838111620001b2575b508092851160011462000144575093839491849260009562000138575b50501b92600019911b1c19161790555b6040516108c79081620003bb8239f35b01519350388062000118565b92919084601f1981168860005285600020956000905b898383106200019757505050106200017c575b50505050811b01905562000128565b01519060f884600019921b161c19169055388080806200016d565b8587015189559097019694850194889350908101906200015a565b87600052816000208480880160051c820192848910620001f3575b0160051c019087905b828110620001e6575050620000fb565b60008155018790620001d6565b92508192620001cd565b602288634e487b7160e01b6000525260246000fd5b90607f1690620000e9565b634e487b7160e01b600052604160045260246000fd5b015190503880620000ba565b90889350601f19831691876000528a6000209260005b8c8282106200028f575050841162000276575b505050811b018355620000cc565b015160001983881b60f8161c1916905538808062000268565b8385015186558c9790950194938401930162000255565b90915085600052886000208580850160051c8201928b8610620002f2575b918a91869594930160051c01915b828110620002e2575050620000a3565b600081558594508a9101620002d2565b92508192620002c4565b634e487b7160e01b600052602260045260246000fd5b93607f16936200008c565b600080fd5b6040519190601f01601f191682016001600160401b038111838210176200021d57604052565b919080601f840112156200031d5782516001600160401b0381116200021d576020906200037e601f8201601f1916830162000322565b928184528282870101116200031d5760005b818110620003a657508260009394955001015290565b85810183015184820184015282016200039056fe608060408181526004918236101561001657600080fd5b600092833560e01c91826306fdde03146104c557508163095ea7b31461049b57816318160ddd1461047c57816323b872dd146103b1578163313ce56714610395578163395093511461032f57816370a08231146102f957816395d89b41146101da578163a457c2d71461011957508063a9059cbb146100e95763dd62ed3e1461009e57600080fd5b346100e557806003193601126100e557806020926100ba6105ea565b6100c2610605565b6001600160a01b0391821683526001865283832091168252845220549051908152f35b5080fd5b50346100e557806003193601126100e5576020906101126101086105ea565b602435903361061b565b5160018152f35b905082346101d757826003193601126101d7576101346105ea565b91836024359233815260016020528181206001600160a01b038616825260205220549082821061016e5760208561011285850387336107b8565b608490602086519162461bcd60e51b8352820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152fd5b80fd5b8383346100e557816003193601126100e557805190828454600181811c908083169283156102ef575b60209384841081146102dc578388529081156102c0575060011461026b575b505050829003601f01601f191682019267ffffffffffffffff84118385101761025857508291826102549252826105a1565b0390f35b634e487b7160e01b815260418552602490fd5b8787529192508591837f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b8385106102ac5750505050830101858080610222565b805488860183015293019284908201610296565b60ff1916878501525050151560051b8401019050858080610222565b634e487b7160e01b895260228a52602489fd5b91607f1691610203565b5050346100e55760203660031901126100e557806020926001600160a01b036103206105ea565b16815280845220549051908152f35b8284346101d757816003193601126101d7576103496105ea565b33825260016020528282206001600160a01b038216835260205282822054916024358301809311610382576020846101128585336107b8565b634e487b7160e01b815260118552602490fd5b5050346100e557816003193601126100e5576020905160128152f35b839150346100e55760603660031901126100e5576103cd6105ea565b6103d5610605565b9184604435946001600160a01b038416815260016020528181203382526020522054906000198203610410575b60208661011287878761061b565b848210610439575091839161042e60209695610112950333836107b8565b919394819350610402565b606490602087519162461bcd60e51b8352820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152fd5b5050346100e557816003193601126100e5576020906002549051908152f35b5050346100e557806003193601126100e5576020906101126104bb6105ea565b60243590336107b8565b8490843461059d578260031936011261059d5782600354600181811c90808316928315610593575b60209384841081146102dc578388529081156102c0575060011461053d57505050829003601f01601f191682019267ffffffffffffffff84118385101761025857508291826102549252826105a1565b600387529192508591837fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b83851061057f5750505050830101858080610222565b805488860183015293019284908201610569565b91607f16916104ed565b8280fd5b6020808252825181830181905290939260005b8281106105d657505060409293506000838284010152601f8019910116010190565b8181018601518482016040015285016105b4565b600435906001600160a01b038216820361060057565b600080fd5b602435906001600160a01b038216820361060057565b6001600160a01b0380911691821561074d57169182156106fc5760008281528060205260408120549180831061069157604082827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef958760209652828652038282205586815220818154019055604051908152a3565b60405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608490fd5b60405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608490fd5b60405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608490fd5b6001600160a01b0380911691821561086957169182156108195760207f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925918360005260018252604060002085600052825280604060002055604051908152a3565b60405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608490fd5b60405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608490fdfea164736f6c6343000813000a";
"0x6080604052346200031d5762000c01803803806200001d8162000322565b9283398101906040818303126200031d5780516001600160401b03908181116200031d57836200004f91840162000348565b91602093848201518381116200031d576200006b920162000348565b82518281116200021d576003918254916001958684811c9416801562000312575b88851014620002fc578190601f94858111620002a6575b5088908583116001146200023f5760009262000233575b505060001982861b1c191690861b1783555b80519384116200021d5760049586548681811c9116801562000212575b82821014620001fd57838111620001b2575b508092851160011462000144575093839491849260009562000138575b50501b92600019911b1c19161790555b6040516108469081620003bb8239f35b01519350388062000118565b92919084601f1981168860005285600020956000905b898383106200019757505050106200017c575b50505050811b01905562000128565b01519060f884600019921b161c19169055388080806200016d565b8587015189559097019694850194889350908101906200015a565b87600052816000208480880160051c820192848910620001f3575b0160051c019087905b828110620001e6575050620000fb565b60008155018790620001d6565b92508192620001cd565b602288634e487b7160e01b6000525260246000fd5b90607f1690620000e9565b634e487b7160e01b600052604160045260246000fd5b015190503880620000ba565b90889350601f19831691876000528a6000209260005b8c8282106200028f575050841162000276575b505050811b018355620000cc565b015160001983881b60f8161c1916905538808062000268565b8385015186558c9790950194938401930162000255565b90915085600052886000208580850160051c8201928b8610620002f2575b918a91869594930160051c01915b828110620002e2575050620000a3565b600081558594508a9101620002d2565b92508192620002c4565b634e487b7160e01b600052602260045260246000fd5b93607f16936200008c565b600080fd5b6040519190601f01601f191682016001600160401b038111838210176200021d57604052565b919080601f840112156200031d5782516001600160401b0381116200021d576020906200037e601f8201601f1916830162000322565b928184528282870101116200031d5760005b818110620003a657508260009394955001015290565b85810183015184820184015282016200039056fe608060408181526004918236101561001657600080fd5b600092833560e01c91826306fdde031461049057508163095ea7b31461046657816318160ddd1461044757816323b872dd1461037d578163313ce5671461036157816339509351146102fa57816370a08231146102c357816395d89b41146101c1578163a457c2d71461011957508063a9059cbb146100e95763dd62ed3e1461009e57600080fd5b346100e557806003193601126100e557806020926100ba610598565b6100c26105b3565b6001600160a01b0391821683526001865283832091168252845220549051908152f35b5080fd5b50346100e557806003193601126100e557602090610112610108610598565b60243590336105c9565b5160018152f35b905082346101be57826003193601126101be57610134610598565b918360243592338152600160205281812060018060a01b038616825260205220549082821061016d576020856101128585038733610737565b608490602086519162461bcd60e51b8352820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152fd5b80fd5b8383346100e557816003193601126100e557805190828454600181811c908083169283156102b9575b60209384841081146102a65783885290811561028a5750600114610252575b505050829003601f01601f191682019267ffffffffffffffff84118385101761023f575082918261023b92528261054f565b0390f35b634e487b7160e01b815260418552602490fd5b919250868652828620918387935b8385106102765750505050830101858080610209565b805488860183015293019284908201610260565b60ff1916878501525050151560051b8401019050858080610209565b634e487b7160e01b895260228a52602489fd5b91607f16916101ea565b5050346100e55760203660031901126100e55760209181906001600160a01b036102eb610598565b16815280845220549051908152f35b8284346101be57816003193601126101be57610314610598565b338252600160209081528383206001600160a01b038316845290528282205460243581019290831061034e57602084610112858533610737565b634e487b7160e01b815260118552602490fd5b5050346100e557816003193601126100e5576020905160128152f35b839150346100e55760603660031901126100e557610399610598565b6103a16105b3565b91846044359460018060a01b0384168152600160205281812033825260205220549060001982036103db575b6020866101128787876105c9565b84821061040457509183916103f96020969561011295033383610737565b9193948193506103cd565b606490602087519162461bcd60e51b8352820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152fd5b5050346100e557816003193601126100e5576020906002549051908152f35b5050346100e557806003193601126100e557602090610112610486610598565b6024359033610737565b8490843461054b578260031936011261054b5782600354600181811c90808316928315610541575b60209384841081146102a65783885290811561028a575060011461050857505050829003601f01601f191682019267ffffffffffffffff84118385101761023f575082918261023b92528261054f565b91925060038652828620918387935b83851061052d5750505050830101858080610209565b805488860183015293019284908201610517565b91607f16916104b8565b8280fd5b6020808252825181830181905290939260005b82811061058457505060409293506000838284010152601f8019910116010190565b818101860151848201604001528501610562565b600435906001600160a01b03821682036105ae57565b600080fd5b602435906001600160a01b03821682036105ae57565b6001600160a01b039081169182156106e457169182156106935760008281528060205260408120549180831061063f57604082827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef958760209652828652038282205586815220818154019055604051908152a3565b60405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608490fd5b60405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608490fd5b60405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608490fd5b6001600160a01b039081169182156107e857169182156107985760207f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925918360005260018252604060002085600052825280604060002055604051908152a3565b60405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608490fd5b60405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608490fdfea164736f6c6343000813000a";

type ERC20ConstructorParams =
| [signer?: Signer]
Expand Down
Loading

0 comments on commit 3ee2334

Please sign in to comment.