Skip to content

Commit

Permalink
Fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
CostinCarabas committed Oct 2, 2023
1 parent 56675a9 commit 0c3d5a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion contracts/paymaster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Also gives some headaches for crypto users as well for the first steps of onboar
Imagine those people who bridge their NFTs or those who bridge USDC to a new account.
The new account can’t do anything until it does not have some eGLD to pay for the transactions.

In order for users to onboard faster to xPortal (even when it was called Maiar) we introduced the concept of relayed transactions (we have v1, v2 and soon v3 of it).
In order for users to onboard faster to xPortal we introduced the concept of relayed transactions (we have v1, v2 and soon v3 of it).
This means a relayer can wrap the user transaction inside a relayedTX and in this case the relayer pays for the gas, but the user’s transaction is getting executed.
Right now, the relayers we use are free of charge, thus they do this service for new users for free, but they actually need eGLD to do the transactions.
When we speak about a few hundred users, this is not an issue, but when you want to scale up relaying transactions to thousands/millions of users, it becomes unsustainable.
Expand Down
11 changes: 4 additions & 7 deletions contracts/paymaster/tests/paymaster_blackbox_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ fn test_forward_call_no_fee_payment() {
.call(state.paymaster_contract.forward_execution(
state.relayer_address.clone(),
state.callee_user_address.clone(),
managed_buffer!(b"add"),
b"add" ,
MultiValueVec::<Vec<u8>>::new(),
))
.expect(TxExpect::user_error("str:There is no fee for payment!")),
Expand All @@ -184,11 +184,10 @@ fn test_forward_call_user() {
.call(state.paymaster_contract.forward_execution(
state.relayer_address.clone(),
state.callee_user_address.clone(),
managed_buffer!(b"add"),
b"add",
MultiValueVec::<Vec<u8>>::new(),
))
.esdt_transfer(FEE_TOKEN_ID_EXPR, 0, FEE_AMOUNT)
.expect(TxExpect::ok()),
)
.check_state_step(CheckStateStep::new().put_account(
RELAYER_ADDRESS_EXPR,
Expand All @@ -213,10 +212,9 @@ fn test_forward_call_sc_adder() {
.call(state.paymaster_contract.forward_execution(
state.relayer_address.clone(),
state.callee_sc_adder_contract.to_address(),
managed_buffer!(b"add"),
b"add",
MultiValueVec::from([top_encode_to_vec_u8_or_panic(&ADDITIONAL_ADD_VALUE)]),
))
.expect(TxExpect::ok()),
);

let expected_adder_sum = INITIAL_ADD_VALUE + ADDITIONAL_ADD_VALUE;
Expand Down Expand Up @@ -252,10 +250,9 @@ fn test_forward_call_sc_adder_multiple_payments() {
.call(state.paymaster_contract.forward_execution(
state.relayer_address.clone(),
state.callee_sc_adder_contract.to_address(),
managed_buffer!(b"add"),
b"add",
MultiValueVec::from([top_encode_to_vec_u8_or_panic(&ADDITIONAL_ADD_VALUE)]),
))
.expect(TxExpect::ok()),
);

let expected_adder_sum = INITIAL_ADD_VALUE + ADDITIONAL_ADD_VALUE;
Expand Down

0 comments on commit 0c3d5a8

Please sign in to comment.