5️⃣Refuel SaaS
Last updated
Last updated
User Wallet on chain A and Chain B
ZeroWayGasRefuelV1 smart contract
Saas partner wallet
Zeroway wallet
Hyperlane infrastructure contracts
ZeroWayGasRefuelV1 is a smart contract designed for interchain ETH transfers between different Ethereum L2 chains. Smart contract also supports SaaS (Solution as a Service) option allowing Zeroway to add partners who can integrate our contracts into their ecosystem and receive a share from all user transfers initiated from their own frontend directly into the specified wallet. in simple words, contract alows users to transfer ETH between chains and partners - to gain income without a need to support any bridge solutions.
Coponents described above are presented here:
1-2. A user requests information aboult refuel volume limitations using refuelSettings(...)
method
3-5. A user requests fee parameters for the indicated refuel using calculateRefuelFee(...)
method ( or calculateRefuelFeeBatch(...) method
)
6-7. User initiate transactional partnerRefuel(...) method
(ortransactional partnerRefuelBatch(...)method
), indicating the parther adress from the whitelist.
8-9. The paid fee will be distributed between user and parther according to the whileist settings
10-12. The crosschain intaraction is being processed
13-17. User receives his payment in the recepint chain
If any problem arises, user can withdraw his finds using withdrawDebt(...)
method when the ETH balance of the contract will be enough. Gas refuel contract tracs and stores all the transfers even with zero balance in it.
A method used to receive actual refuel settings
Returns RefuelSettings
structure from which minRefuelAmount
and maxRefuelAmount
can be tacken
RefuelSettings structure :
A method used for fee calculation
A method used for fee calculation for refuel batch
A method used for ETH transfer with indicated partner
target_
: user address where ETH are transferred
amount_
: refuel amount
destinationDomain_
: target chain ID
partner_
: partner address where fee share is transferred
Returns the whole fee size and Hyperlane message ID.
A method used for batch ETH transfer with indicated partner
targets_
: user adresses array
amounts_
: refuel amounts array
destinationDomains_
: target chain IDs array
partner_
: partner address
Returns the whole fee size and Hyperlane message ID.
A method used to check user balance in the contract.
user
: user address
Returns user balance in the contract.
This method is needed to check if a user has any unwithdrawn funds from the contract which he can withdraw. The balance accures if the transfer was not successful because of any reasons.
A method used to withdraw user balance from the contract.
to_
: an address where ETH will be withdrawn
This method is used to withdraw user balance. It's nessessory in cases when the revious transcation has failed because of any reasons and funds remain in contract.
Partner initializing https://basescan.org/tx/0x18b2d084853f879d1faf5223a9e7eb810b6a42b464ab5d36839a687651ed7c5e
Partner refuel transaction initializing in Basehttps://basescan.org/tx/0x1ac6ea47eae9e4e7c3be0402f298027c9907925ac71904b661300af993ef462e
Parner refuel transaction exexution in recepint chainhttps://arbiscan.io/tx/0xa98a5e611462af6f5752c555e437aa05d0b322cb99c3d8fd229ebbbb28e4016f
Transaction in Hyperlane explorerhttps://explorer.hyperlane.xyz/message/0xf74dd3d9a44c3ffd66c38c9777b025469be1141d179960a3b5b95f5148169359
The list of cotracts and identifiers in supported chains
Сеть | ChainId (Destination domain) | Контракт | Адрес контракта |
---|---|---|---|
Optimism | 10 | ZeroWayGasRefuelV1 | |
Arbitrum | 42161 | ZeroWayGasRefuelV1 | |
Base | 8453 | ZeroWayGasRefuelV1 | |
Scroll | 534352 | ZeroWayGasRefuelV1 | |
Manta | 169 | ZeroWayGasRefuelV1 | |
Linea | 59144 | ZeroWayGasRefuelV1 | |
Mode | 34443 | ZeroWayGasRefuelV1 | |
Blast | 81457 | ZeroWayGasRefuelV1 | |
Taiko | 167000 | ZeroWayGasRefuelV1 | |
Redstone | 690 | ZeroWayGasRefuelV1 | |
Ancient8 | 888888888 | ZeroWayGasRefuelV1 | |
Zora | 7777777 | ZeroWayGasRefuelV1 |
The connection of partners is carried out by the owner of the contract through the following methods:
addSAASPartner
: adding new partner
updateSAASPartner
: updating partner senntings
removeSAASPartner
: deliting partner
Partner parameters are stored in thesaasPartnerSetting
mapping where address is used as a key and setting stracture is used as a value