Skip to content

v12: Flexible spending limit with time intervals; Allow multiple contract calls in one operation; Many improvements, bug fixes, and refactorings

Compare
Choose a tag to compare
@polymorpher polymorpher released this 15 Sep 11:25
· 1646 commits to master since this release
911d402
  • Daily limit is superseded by "spending limit", a similar mechanism which allows the spending amount to be reset at arbitrary fixed time interval. This enables use cases such as:
    • Red Packet (see #116), which funds inside the wallet can be withdrawn every 30 seconds or so
    • Parental control by a monthly allowance
    • SaaS subscription
    • and many more
  • Spending limit and interval can now be set to any value in expert mode
  • The contract now supports executing multiple operations in one transaction. This means the user only need to type in the authenticator code once to authorize all the operations, instead of typing one code for each operations. Because of that, the user experience in some cases would be significantly improved after we implement corresponding code at the client side. For example, when the user swap some tokens into ONE (or others tokens) using "Swap", they no longer need to make separate authorizations (and wait twice as long) to "Approve SushiSwap to spend your token" then to "Confirm the swap". Now it can be done in one go.
    • This will be critical for use cases such as Red Packet (#116) since NFT, tokens, and funds need to be transferred simultaneously to the Red Packet 1wallet when the user creates a Red Packet.
  • Many other improvements:
    • Delete button in address dropdown input box no longer cause the address to be selected and the dropdown menu collapsed (which sometimes results a messy, buggy UI)
    • Address input boxes are now displaying label and domain name of the address correctly after the address is selected
    • Removed erroneous, instant error message (e.g. wallet is outdated) after a new wallet is created or restored.
    • Relayer no longer applies overzealous rate limiting mechanism on errors
    • Fixed an issue on iOS Safari such that the background of the Upgrade screen is not displayed correctly (translucent blur background was not correctly applied)
  • Internally:
    • A new library SpendingManager is created. Spending related contract code is moved to the library
    • Nonce related functionalities are moved to CommitManager
    • More abstractions and structures are created (e.g. CoreSettings), and related code refactored
    • Constructors of 1wallet and its usage in relayer and client are improved
    • Created some library and cache management scripts under relayer
    • See more in #135