Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
scx1332 committed Mar 11, 2024
1 parent 63e4fec commit 4b4bca4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/erc20_payment_lib/config-payments.toml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ transaction-timeout = 100
token = { address = "0x8888888815bf4DB87e57B609A50f938311EEd068", symbol = "tGLM" }
multi-contract = { address = "0xAaAAAaA00E1841A63342db7188abA84BDeE236c7", max-at-once = 10 }
mint-contract = { address = "0xFACe100969FF47EB58d2CF603321B581A84bcEaC", max-glm-allowed = 400 }
lock-contract = { address = "0xcbc31E0e3F1c81e45DF105779A45Afb99B93FCC7" }
lock-contract = { address = "0xD8b2D4e53350075333c2f6B90314518e01F42b2f" }
faucet-client = { max-eth-allowed = 0.009, faucet-srv = "_holesky-faucet._tcp", faucet-host = "faucet.testnet.golem.network", faucet-lookup-domain = "dev.golem.network", faucet-srv-port = 4002 }
confirmation-blocks = 0
block-explorer-url = "https://holesky.etherscan.io"
Expand Down
4 changes: 3 additions & 1 deletion crates/erc20_payment_lib/src/sender/batching.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ pub async fn gather_transactions_batch_multi(
log::debug!("Processing token transfer {:?}", token_transfer);
if let Some(token_addr) = token_transfer.token_addr.as_ref() {
if !payment_setup.skip_multi_contract_check {
if let Some(multi_contract_address) = chain_setup.multi_contract_address.as_ref() {
if token_transfer.deposit_id.is_some() {
//no allowance needed, because we are paying from locked deposit
} else if let Some(multi_contract_address) = chain_setup.multi_contract_address.as_ref() {
//this is some arbitrary number.
let minimum_allowance: U256 = U256::max_value() / U256::from(2);

Expand Down
4 changes: 2 additions & 2 deletions yatestnet/contracts/contracts/LockPayment.sol
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ contract LockPayment {
Deposit memory deposit = deposits[id];
require(msg.sender == deposit.spender, "msg.sender == deposit.spender");
require(addr != deposit.spender, "cannot transfer to spender");
require(GLM.transferFrom(msg.sender, addr, amount), "transferFrom failed");
require(GLM.transferFrom(address(this), addr, amount), "transferFrom failed");
require(deposit.amount >= amount, "deposit.amount >= amount");
deposit.amount -= amount;
deposits[id].amount = deposit.amount;
Expand All @@ -167,7 +167,7 @@ contract LockPayment {
address addr = address(bytes20(payment));
uint128 amount = uint128(uint256(payment) % 2 ** 96);
require(addr != deposit.spender, "cannot transfer to spender");
require(GLM.transferFrom(msg.sender, addr, amount), "transferFrom failed");
require(GLM.transferFrom(address(this), addr, amount), "transferFrom failed");
require(deposit.amount >= amount, "deposit.amount >= amount");
deposit.amount -= amount;
}
Expand Down

0 comments on commit 4b4bca4

Please sign in to comment.