Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

feat: check if allowance is needed #19

Merged
merged 1 commit into from
Aug 7, 2023

Conversation

sebastiendan
Copy link
Member

Description

This PR makes ERC20 allowance approval conditional to the absence of existing large enough allowance. Thanks to this new feature, an ERC20 token transfer across subnet can be reduced in most cases to one single transaction.

Fixes TOO-275

Additions and Changes

New feature (non-breaking change which adds functionality)

  • The useApproveAllowance hook now exposes a getCurrentAllowance callback that can be used to verify if a new allowance is needed

Breaking changes

  • useApproveAllowance is renamed to useAllowance

PR Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added or updated tests that comprehensively prove my change is effective or that my feature works

@sebastiendan sebastiendan self-assigned this Aug 7, 2023
@sebastiendan sebastiendan temporarily deployed to devnet-1 August 7, 2023 16:17 — with GitHub Actions Inactive
@sebastiendan sebastiendan temporarily deployed to devnet-1 August 7, 2023 16:19 — with GitHub Actions Inactive
@sebastiendan sebastiendan merged commit 0da9d38 into main Aug 7, 2023
3 checks passed
@sebastiendan sebastiendan deleted the feat/check-need-for-allowance branch August 7, 2023 16:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant