You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All reentrant calls will happen in the context of a call so in order to be successful contracts with REENTRANT permission will also need to have some AllowedCalls permissions.
if a contract has:
REENTRANT permission
list of multiple allowed calls (one call that will mint and another one that will approve for example)
At the moment I cannot limit the reentrancy to a specific call (for example approve call).
WithexecuteRelayCall(...):
If a signer has the reentrancy permission. All his signed payload could possibly be used in a reentrancy context. However With the below solution we can also limit it to signer + specific allowed calls
Solution
I think we could modify our allowed call standard and append it by 1 byte related to Reantrancy.
The new standard could be: Standard:Address:Function:ReentrancyBool
Implementation
When verifying AllowedCalls, since we know whether the call is a reentrant call, we can add a bool isReentrantCallparameters to _verifyAllowedCall(...) and check if this particular call is allowed as a reentrant call.
function_verifyAllowedCall(...,boolisReentrantCall)internalview{
...
boolisAllowedReentrant=true;for(uint256ii=0;ii<allowedCallsLength;ii+=30){bytesmemorychunk=BytesLib.slice(allowedCalls,ii+1,29);
...
//if isReentrantCall is true, we check that the last byte value is FFif(isReentrantCall&&bytes1(bytes29(chunk)<<224)!=0xFF){
isAllowedReentrant =false;}if(isAllowedStandard&&isAllowedAddress&&isAllowedFunction&&isAllowedReentrant)return;}revertNotAllowedCall(from,to,selector);}
The text was updated successfully, but these errors were encountered:
With
execute(...)
:All reentrant calls will happen in the context of a call so in order to be successful contracts with
REENTRANT
permission will also need to have some AllowedCalls permissions.if a contract has:
mint
and another one that willapprove
for example)At the moment I cannot limit the reentrancy to a specific call (for example
approve
call).With
executeRelayCall(...)
:If a signer has the reentrancy permission. All his signed payload could possibly be used in a reentrancy context. However With the below solution we can also limit it to signer + specific allowed calls
Solution
I think we could modify our allowed call standard and append it by 1 byte related to Reantrancy.
The new standard could be:
Standard:Address:Function:ReentrancyBool
Implementation
When verifying
AllowedCalls
, since we know whether the call is a reentrant call, we can add abool isReentrantCall
parameters to_verifyAllowedCall(...)
and check if this particular call is allowed as a reentrant call.The text was updated successfully, but these errors were encountered: