https://ethereum.stackexchange.com/a/124027

  • Get rid of any library (like that of OpenZeppelin’s Enumerable or Ownable) whose only few functions you would need. Instead, define those specific functions yourself. (이 방법은 실제로 stellaiam 개발시 사용해봄 효과 있음)
  • Identify any public variables that can be made private, the compiler adds a getter function by itself which adds to the code size.
  • If you have a lot of comments, get rid of them or shorten them.
  • The last resort: try to shorten the error message, variable names.

.

.

.

modifier에 코드를 작성해서 그냥 사용하지 말고 다른 함수에 코드를 작성하고 modifier에서는 함수를 호출하는 방식으로 하면 사이즈가 줄어든다. 실제 Ownable 코드를 확인해 보면 이미 안에 이런 형식 형식으로 작성되어있다. 그래서 stellaiam개발시 사용해보지는 못했다.

 https://youtu.be/XDqD3X8DCiw

Comments are closed.

Post Navigation