-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ETHEREUM-CONTRACTS] | #1038 | Allow regular contracts to be the target of callAppAction
#1238
Conversation
- remove isAppActive modifier from `Superfluid.sol` and `ISuperfluid.sol` - remove `HOST_NOT_A_SUPER_APP` and `HOST_SUPER_APP_IS_JAILED` custom errors - create new `NonSuperAppContractMock.sol` to test `callAppAction` and `callAppActionWithContext` on a non-super app contract - Add two functions to `SuperAppMocks` to test `callAppActionWithContext` on our non-superApp contract
Changelog ReminderReminder to update the CHANGELOG.md for any of the modified packages in this PR.
|
Contract A ** foo (app action) |
@@ -646,7 +646,6 @@ contract Superfluid is | |||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's also ban calling this
(the host contract itself) as target.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also remove the ISuperApp type, and call app e.g. "target"
closing this PR for now |
Description
Motivation: To relax the requirement that
callAppAction
can only be used on super app contracts.Context: This change allows all contracts to be the target of
callAppAction
as long as thefunction
on the contract satisfies two requirements:function
you want to call viacallAppAction
must takebytes
(the passed context from the host) as the last parameter.function
, that is, untouched.This was achieved simply by deleting the
isAppActive
modifier fromSuperfluid.sol
,ISuperfluid.sol
and any associated custom errors only used by this modifer.Issue: #1038
Type of change
How Has This Been Tested?
I have added tests to ensure that non-super app contracts can be the target of
callAppAction
andcallAppActionWithContext
.callAppAction
reverting when passing invalid calldatacallAppAction
reverting when an EOA is the target, ctx is malformatted because bytes returned is "0x"callAppAction
callAppActionWithContext
callAppActionWithContext
given that we ignore the context passed by the host via the initialcallAppAction
and pass in our own context