-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat(IntentSource): vault based intents #128
base: AUDIT
Are you sure you want to change the base?
Conversation
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.
It's looking great! I left a couple of questions
contracts/IntentSource.sol
Outdated
function intentVaultAddress( | ||
Intent calldata intent | ||
) internal view returns (address) { |
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.
Can the intentVaultAddress
function be a pure function since it's not reading any state or is it required to access calldata?
contracts/IntentSource.sol
Outdated
function withdrawRewards(Intent calldata intent) public { | ||
bytes32 intentHash = keccak256(abi.encode(intent)); | ||
address claimant = SimpleProver(intent.prover).provenIntents( | ||
intentHash | ||
); | ||
|
||
if (claimant != address(0) && !claimed[intentHash]) { | ||
vaultClaimant = claimant; | ||
claimed[intentHash] = true; | ||
|
||
emit Withdrawal(intentHash, claimant); | ||
} else { | ||
if (block.timestamp < intent.expiryTime) { | ||
revert UnauthorizedWithdrawal(intentHash); |
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.
Should we mark the intent as claimed when the intent has expired and the creator claims it back?
can this PR be against main rather than AUDIT? just dont want to mix those changes up order-wise |
# Conflicts: # contracts/Inbox.sol # contracts/IntentSource.sol # contracts/interfaces/IInbox.sol # contracts/interfaces/IIntentSource.sol # contracts/types/Intent.sol # yarn.lock
559341f
to
f01475e
Compare
IntentSource
: storage-less intents