Skip to content

BNB Vault: Low gas fees, smart savings, and easy card payments.

License

Notifications You must be signed in to change notification settings

altaga/BNB-Vault

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BNB Vault

BNB Vault: low gas transfers, smart savings, and easy card payments.

Fast Links:

Mainnet Verified Contracts:

System Diagrams:

  • Main Account: Within the schematics you can see that we have our main wallet, which is a Non Custodial Wallet, to which you will have to save its mnemonic at the time of its creation.

  • Savings Account: This wallet, like the previous one, is a Non Custodial Wallet, which will save the savings on each transaction according to the chosen savings protocol.

  • Card Account: Esa cuenta a diferencia de las dos anteriores es una Multi Owner Account Abstraction basada en Alchemy MOAA SDK. Con esta cuenta podemos ejecutar pagos desde esta misma desde una cuenta en cloud y que el usuario mantenga el poder completo de sus assets.

Screens:

BNB Vault is a blockchain wallet and platform that empowers undeserved communities through saving. Employing novel Blockchain technologies through BSC such as low gas payments and optimized savings. It also combines it with TradFi via seamless card payments.

Wallet:

Our main screen is our Main Account, which is a traditional wallet to manage our assets. All balances and coins are in Mainnet and the code for this screen is as follows.

In turn, this tab integrates the contract of Batch Balances, which allows us to obtain all the balances of all the ERC20 Tokens in the BSC ecosystem from a single RPC Call this improve the RPC calls and UI for the users.

const tokenBalances = new ethers.Contract(
    BatchTokenBalancesAddress,
    abiBatchTokenBalances,
    this.provider,
);
const [balanceTemp, tempBalances, tempDecimals] = await Promise.all([
    this.provider.getBalance(publicKey),
    tokenBalances.batchBalanceOf(publicKey, tokensArray),
    tokenBalances.batchDecimals(tokensArray),
]);

All technical implementations for this tab are included here.

Send:

This screen is important and allows us to make transfers from our wallet.

It should be remembered that if the Savings account is active, one more transaction will be added to the final transfer to our savings account. All this is very easy to do with BSC.

All technical implementations for this tab are included here.

Receive:

With this screen, you can easily show your Wallet to receive funds, whether BNB or ERC20 Token.

All technical implementations for this tab are included here.

Payment:

In this tab we intend to make it the same as using a traditional POS, this allows us to enter the amount to be charged in USD and to be able to make the payment with one of our virtual cards. And this is the function code:

Todos los pagos que se realizan en esta pantalla tienen que ser realizados con la tarjeta fisica, ya que es la que esta ligada a la Multi Owner Account Abstraction. Este proceso se realiza en Card Tab

All technical implementations for this tab are included here.

Savings:

The savings account is a Non Custodial Wallet which allows us to have savings based on protocols. We will explain these protocols a little later. However, on this screen you can withdraw the savings according to the defined date and the code on this screen is the next.

All technical implementations for this tab are included here.

Savings Protocol:

  • Balanced Protocol, this protocol performs a weighted rounding according to the amount to be paid in the transaction, so that the larger the transaction, the greater the savings, in order not to affect the user. And this is the function code:

      export function balancedSavingToken(number, usd1, usd2) {
          const balance = number * usd1;
          let amount = 0;
          if (balance <= 1) {
              amount = 1;
          } else if (balance > 1 && balance <= 10) {
              amount = Math.ceil(balance);
          } else if (balance > 10 && balance <= 100) {
              const intBalance = parseInt(balance, 10);
              const value = parseInt(Math.round(intBalance).toString().slice(-2), 10);
              let unit = parseInt(Math.round(intBalance).toString().slice(-1), 10);
              let decimal = parseInt(Math.round(intBalance).toString().slice(-2, -1), 10);
              if (unit < 5) {
              unit = '5';
              decimal = decimal.toString();
              } else {
              unit = '0';
              decimal = (decimal   1).toString();
              }
              amount = intBalance - value   parseInt(decimal   unit, 10);
          } else if (balance > 100) {
              const intBalance = parseInt(Math.floor(balance / 10), 10);
              amount = (intBalance   1) * 10;
          }
          return new Decimal(amount).sub(new Decimal(balance)).div(usd2).toNumber();
      }
    
  • Percentage protocol, unlike the previous protocol, this one aims to always save a percentage selected in the UI.

      export function percentageSaving(number, percentage) {
          return number * (percentage / 100);
      }
    

All technical implementations for this tab are included here.

Cards:

Finally, in the cards section, we can create a virtual card, which will help us make payments without the need for our wallet directly with a physical card in any POS terminal with BNBVault. Es importante aclarar que al tener una Multi Owner Account Abstraction Wallet, de forma decentralizada el usuario sigue teniendo el control completo de su wallet. Y solo es posible realizar los pagos con tarjeta con el hash que este tiene al realizar un pago contactless.

All technical implementations for this tab are included here.

About

BNB Vault: Low gas fees, smart savings, and easy card payments.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages