Closed ZzzzHui closed 2 months ago
Why not make it a library?
It won't be able to access its storage anyway when called by the application contract via DELEGATECALL
.
I'd also rename it to something like LibERC20Transfer
Why not make it a library? It won't be able to access its storage anyway when called by the application contract via
DELEGATECALL
.
It's basically the same in this case to be a contract and library. But library
is indeed a better name, so I will change contract
to library
.
It's basically the same in this case to be a contract and library. But
library
is indeed a better name, so I will changecontract
tolibrary
.
It's not just about naming. In Solidity, they have different semantics. For example, state variables cannot be declared. This avoids programming errors. So, if the contract is going to be called via DELEGATECALL
, it's good practice to declare it as a library.
I think we should keep these delegate libraries in a separate folder, rather than mixing together with existing internal libraries. I think we could put them in the folder called delegate
. What do you think?
I think we should keep these delegate libraries in a separate folder, rather than mixing together with existing internal libraries. I think we could put them in the folder called
delegate
. What do you think?
The word "delegate" can be confusing for those familiar with "delegated proof-of-staking". Maybe delegatecall
?
I think we should keep these delegate libraries in a separate folder, rather than mixing together with existing internal libraries. I think we could put them in the folder called
delegate
. What do you think?The word "delegate" can be confusing for those familiar with "delegated proof-of-staking". Maybe
delegatecall
?
Yes. delegatecall
will work.
Also, would be nice, if possible, to add test cases to Application.t.sol to test the DELEGATECALL voucher feature. :-)
I agree that would be better.
I call it delegate and create the folder
delegate
. Let me know if you think it should be named something else