Variable Finance introduces two new products to the market,
Onchain PoS (Proof Of Sale) verified & entirely run by the smart contracts with real-time gross settlements under an efficient approval mechanism.
An Approvals Manager for managing all the D-Apps you've approved for efficient & secure management of ERC20s. Currently on ethereum mainnet supporting CIRCLE DOLLAR (USDC), Compound (COMP) and Uniswap (UNI) Tokens.
ERC20s represents a wider class of assets ranging from a dollar to gold to liquidity in a defi pool. So we're looking to exploit the value of these assets by enabling holders to use them in their day-to-day activities. Like spending an LP token for buying coffee at Starbucks. Currently, it would be difficult for us to declare the value of the LP token so we implemented the PoC with wBTC, COMP & USDC that have well established and stable price feeds through chainlink.
The user walks into a store and scan qr code and pays their ERC20 tokens in stores. It would be similar to the traditional approach where the merchant would have a payment pointer to which the user can pay their tokens.
Decentralized Merchant Network - All merchant information including the logo is updated to IPFS and their hash is stored to the merchant oracle (variable merchant oracle).
https://www.variable.finance/merchants-list (Served from the graph, IPFS & smart contract)
https://www.variable.finance/tokens-list (We can list all ERC20 tokens with a chainlink price oracle)
We use chainlink for fetching real-time price and use our conversion inside the POS contract that resolved the value to the amount to be paid by the use for equivalent USD. Any other payment provided can use this smart contract to build their internal payment infrastructure.
We're working on an on-chain POS gateway(Started but unable to complete in 3-weeks) for allowing smart contracts to process multiple token payments. Currently most of them depend on the native token of the blockchain but we wish to enable smart contracts to accept any token payment not just the native token or wrapped native token for wider acceptance & ease of use.
The current ERC20 protocol allows third parties to transfer tokens only if they approve them before the transaction, making things more difficult for onboarding new users to the platform as there would be two transactions.
ERC20 approvals consume approximately 50,000 GAS for every smart contract to use the token inside them, which can avoid using a single approval manager for all the ERC20 tickets that could control all the payments.
We should acknowledge that the ERC20 approvals are one of the biggest gas guzzlers, and it takes up 1/3 of the total transaction on the ethereum network. So by removing the approval mechanism in play, we could allow room for other transactions to be allowed on the network.
The ERC-20 allowance mechanism is susceptible to the multiple withdrawal attack/SWC-114 and encourages antipatterns such as using the "infinite" allowance. The wide prevalence of upgradeable contracts has made the conditions favourable for these attacks to happen in the wild.
We don't even know how much we've approved for which application. So we plan to streamline it through our application.
Our PoS (Proof Of Sale) smart contract is self-governed. Once the oracle & token contracts are set, it will automatically process payments using a payment pointer (added by the merchant to merchant oracle). Hence the settlement happens in real-time. The client application / smart contract doesn't need to worry about approving/handling approvals; they can process payment using TICKER & USD value.
The POS(Proof of Sale) smart contract has a locking mechanism that allows users to lock their accounts from transferring; they can set limits per transaction and other cool features that cannot be added using current ERC20 approvals.
https://variable.finance (Approvals manager on ETH mainnet & POS on ETH Kovan testnet) Approvals Manager - https://variable.finance/dashboard/approvals-manager (Mainnet Ethereum) Paying Merchant - https://variable.finance/merchants/pay (KOVAN testnet) Merchant Dashboard - https://variable.finance/merchants/dashboard (KOVAN testnet)
All merchant routes will connect to Kovan Testnet & others will be on the mainnet. We will change this once we push our app live on the mainnet.
This project uses basic web3 wallets to allow users to interact with the system like metamask, wallet connect & coinbase wallet.
This app used three major cryptocurrencies as payment options for its users. They are COMP, UNI, wBTC & USDC.
Real-time price feeds powered by "Chainlink"
We used solidity alongside truffle for the smart contract development. Both Ethereum mainnet & Testnets are being used. The project also used the "The Graph" protocol for indexing & querying information.
Real-time price feeds are fetched from chainlink oracles. The frontend interaction to a blockchain is built using ethers & the client app is built using React & Redux.