Skip to content
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

Smart Contracts hbar Allowance and Approval #906

Merged
merged 20 commits into from
Apr 22, 2024

Conversation

lukelee-sl
Copy link
Member

Description:
This HIP describes a proposal to enable hbar allowance and approvals from smart contracts. This will allow developers to grant allowances from an EOA or a contract from within smart contracts code rather than having to resort to using HAPI for this functionality

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Signed-off-by: lukelee-sl <[email protected]>
@lukelee-sl lukelee-sl self-assigned this Feb 26, 2024
Copy link

netlify bot commented Feb 26, 2024

Deploy Preview for hedera-hips ready!

Name Link
🔨 Latest commit c581f77
🔍 Latest deploy log https://app.netlify.com/sites/hedera-hips/deploys/662159a931bf230008f37b7a
😎 Deploy Preview https://deploy-preview-906--hedera-hips.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Signed-off-by: lukelee-sl <[email protected]>
Signed-off-by: lukelee-sl <[email protected]>
@lukelee-sl lukelee-sl requested a review from mgarbs February 27, 2024 00:15
lukelee-sl and others added 7 commits March 5, 2024 10:33
Signed-off-by: lukelee-sl <[email protected]>
Signed-off-by: lukelee-sl <[email protected]>
Signed-off-by: lukelee-sl <[email protected]>
Signed-off-by: lukelee-sl <[email protected]>
Assign number to hip

Signed-off-by: Michael Garber <[email protected]>
Copy link
Contributor

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, left some feedback

HIP/hip-906.md Outdated Show resolved Hide resolved
HIP/hip-906.md Outdated Show resolved Hide resolved
HIP/hip-906.md Outdated Show resolved Hide resolved
HIP/hip-906.md Show resolved Hide resolved
HIP/hip-906.md Outdated Show resolved Hide resolved
HIP/hip-906.md Show resolved Hide resolved
HIP/hip-906.md Outdated Show resolved Hide resolved
HIP/hip-906.md Show resolved Hide resolved
Signed-off-by: lukelee-sl <[email protected]>
@se7enarianelabs
Copy link
Contributor

We believe that the functionality introduced in this HIP is valuable. However, it does not address the specific issue we outlined in detail here. We require the capability for a contract to spend users' HBAR if it has received explicit spending approval.

Signed-off-by: lukelee-sl <[email protected]>
@kantorcodes
Copy link
Contributor

kantorcodes commented Apr 2, 2024

Hey team! This particular issue would provide a lot of value to our launchpad. The current bug introduced by the allowance mechanisms prevents us from being able to send any NFT that includes a fallback fee. This is a significant blocker for smart contracts.

… a section discussing notification of update events

Signed-off-by: lukelee-sl <[email protected]>
HIP/hip-906.md Outdated
}
```

Once the above functionality has been implemented in services, an EOA or contract with hbars will be able to call the `hbarAllownace` and `hbarApprove` functions as follows:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hbarAllownace -> hbarAllowance

HIP/hip-906.md Outdated

## Key Benefits and Possible Use Cases
Key benefits include:
1. Better developer experience. Develops will not have to use the SDK to perform tasks that will be available via this HIP.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Develops -> Developers ?

HIP/hip-906.md Outdated
## Updates via HAPI

It is possible that the approved allowances for a spender can be spent or increased by submitting a separate approval transaction via
HAPI. In this case, the smart contract would not be aware of these changes in state could possibly hold stale state. While it would be possible
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence is not fully clear. Probably you meant:

would not be aware of these changes in state and it could possibly hold stale state?

Signed-off-by: lukelee-sl <[email protected]>
Nana-EC
Nana-EC previously approved these changes Apr 17, 2024
Signed-off-by: Michael Garber <[email protected]>
@mgarbs mgarbs merged commit c6526bf into hashgraph:main Apr 22, 2024
6 checks passed
kimbor pushed a commit to kimbor/hedera-improvement-proposal that referenced this pull request Jun 24, 2024
Signed-off-by: lukelee-sl <[email protected]>
Signed-off-by: Michael Garber <[email protected]>
Co-authored-by: Michael Garber <[email protected]>
Signed-off-by: Kim Rader <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants