guys anyone knows how to send legacy tx with ethers?
May 9, 2023, 4:14 PM
if I set manually {type: 0} it gives me error
May 9, 2023, 4:15 PM
does the blockchain support legacy tx?
May 9, 2023, 4:17 PM
yes
this is what is set once it fail
May 9, 2023, 4:17 PM
which tx type are u referring to?
May 9, 2023, 4:17 PM
type 0
legacy
May 9, 2023, 4:17 PM
which error?
May 9, 2023, 4:18 PM
intrinsic gas too low
May 9, 2023, 4:18 PM
it should be a problem with gas price
May 9, 2023, 4:19 PM
yes but on arbitrum it is fixed
and the one I set is alread >=
May 9, 2023, 4:19 PM
did you hardcode the gasprice in case the rpc is giving a wrong one?
May 9, 2023, 4:20 PM
yep
but still giving me that error and type: null,
May 9, 2023, 4:20 PM
mmhh any reason why you need that to be type 0?
May 9, 2023, 4:21 PM
I wanted to test something
and I needed it to be 0
May 9, 2023, 4:22 PM
what if you try issuing the same tx on another chain?
May 9, 2023, 4:25 PM
address weth = address(WETH);
why?
why?
May 9, 2023, 5:41 PM
WETH is the Interface. I make use of it to execute functions like safeTransferFrom
May 9, 2023, 5:42 PM
you convert an interface to an address?
May 9, 2023, 5:42 PM
to then convert again to the same interface
May 9, 2023, 5:43 PM
on polygon MATIC is erc20
just for info
May 9, 2023, 5:43 PM
Somewhat. The interface is some handpicked functions from the main contract
The MATIC is the gas of the Testnet chain. So it's the ETHER there
May 9, 2023, 5:43 PM
did you read what I wrote?
May 9, 2023, 5:44 PM
if you do that on polygon you turn matic to wmatic
May 9, 2023, 5:45 PM
https://mumbai.polygonscan.com/address/0x0000000000000000000000000000000000001010
May 9, 2023, 5:46 PM
that's not an issue it behaves like eth on matic
May 9, 2023, 5:46 PM
@Steffqing
May 9, 2023, 5:46 PM
otherwise payable functions wouldn't exist on it
May 9, 2023, 5:46 PM
this is matic
May 9, 2023, 5:47 PM
Didn't comprehend fully π
May 9, 2023, 5:48 PM
check
May 9, 2023, 5:49 PM
So what's the wrapping doing π
May 9, 2023, 5:49 PM
nothing
matic to matic
May 9, 2023, 5:49 PM
no there's matic to wmatic
May 9, 2023, 5:49 PM
But the payable function executed π
May 9, 2023, 5:49 PM
but that function doesn't do it
May 9, 2023, 5:49 PM
literally 1:1 as google says
May 9, 2023, 5:49 PM
the deposit on wmatic yes
May 9, 2023, 5:50 PM
15 seconds to write a question to google
May 9, 2023, 5:50 PM
share the wmatic address
that you are using
May 9, 2023, 5:50 PM
https://polygonscan.com/address/0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270#writeContract
May 9, 2023, 5:51 PM
this is mainnet
May 9, 2023, 5:51 PM
oh I missed the previous mumbai link
May 9, 2023, 5:51 PM
I created mine btw
May 9, 2023, 5:52 PM
When moon?
May 9, 2023, 5:52 PM
show the code then
wtf
May 9, 2023, 5:52 PM
Is it easy to learn Solidity?
May 9, 2023, 5:52 PM
0x69567CfFE9918dBeF4cD24b30FDdce4c13389Dcf
May 9, 2023, 5:52 PM
https://mumbai.polygonscan.com/tx/0x96dbc5b260cb49a0710a900c02330290ba894cf8fef1b0194be84b32ac8c0735#eventlog here I only see events emittedby MATIC
May 9, 2023, 5:52 PM
It's the standard weth code from WETH on Ethereum chain
I couldn't verify the contract, else you'd see the code
May 9, 2023, 5:55 PM
the one I tagged
when you deposit to weth contract
you don't receive anything
May 9, 2023, 5:57 PM
I'm actually just noticing that now
I checked all contract and wallet balances. It's zero
But it's the same contract I use in the Remix VM and I get my balances correctly
I just want to know one thing before I redeploy this contracts, is there a way I can make the contract not to accept Ether deposit if prevApr isn't 0?
May 9, 2023, 6:00 PM
If you own the weth contract just put this check in the deposit
May 9, 2023, 6:01 PM
check the prevApr
if it isn't 0, require(msg.value == 0)
if it isn't 0, require(msg.value == 0)
May 9, 2023, 6:01 PM
It's meant to go to Mainnet. That's why I'm trying to use industry standard WETH contract
So my single check that calls the deposit function is almost basically useless?
May 9, 2023, 6:02 PM
what
May 9, 2023, 6:02 PM
I have a check. If (prevApr == 0)
Then require msg.value to be >= amount.
And then call deposit. All in this if check
If the if statement is false, the deposit shouldn't work. The require statement should be obsolete and the user should move straight into _openBid()
Then require msg.value to be >= amount.
And then call deposit. All in this if check
If the if statement is false, the deposit shouldn't work. The require statement should be obsolete and the user should move straight into _openBid()
This was the way I saw it, now I don't know if it's the contract with the issue (the MATIC) or I missed something out in the code logic
May 9, 2023, 6:05 PM
nope
because if prevApr is not0
it will just skip the check
May 9, 2023, 6:05 PM
It will skip the code in the if block right?
But the contract still takes up the MATIC
But the contract still takes up the MATIC
May 9, 2023, 6:06 PM
because it is payable
function bidInETH(uint16 _proposedInterest, bytes32 _id) external payable whenNotPaused nonReentrant {
LoanContract storage _loanContract = borrowContract[_id];
uint16 prevApr = _loanContract.bids[_msgSender()];
uint _amount = _loanContract.amount;
_openBid(_proposedInterest, _id, _loanContract);
}
LoanContract storage _loanContract = borrowContract[_id];
uint16 prevApr = _loanContract.bids[_msgSender()];
uint _amount = _loanContract.amount;
_openBid(_proposedInterest, _id, _loanContract);
}
this is what get executed
there is no block for matic as you see
May 9, 2023, 6:07 PM
I do insert the msg.value from my js function. So, how do I restrain the function from taking this ether then?
Sorry if you explained before and I didn't get it
Sorry if you explained before and I didn't get it
May 9, 2023, 6:08 PM
i just told you
function bidInETH(uint16 _proposedInterest, bytes32 _id) external payable whenNotPaused nonReentrant {
LoanContract storage _loanContract = borrowContract[_id];
uint16 prevApr = _loanContract.bids[_msgSender()];
if(prevApr != 0) require(msg.value == 0)
...
}
LoanContract storage _loanContract = borrowContract[_id];
uint16 prevApr = _loanContract.bids[_msgSender()];
if(prevApr != 0) require(msg.value == 0)
...
}
May 9, 2023, 6:09 PM
π₯²π₯²
Got it. Thanks. Mostly, I'll have to watch how I execute the function on the Frontend then
Cause I specify the msg.value in the function call
I just added an else{}
Neat? ππ
Neat? ππ
May 9, 2023, 6:11 PM
not needed
no idea of what you need to do
May 9, 2023, 6:12 PM
I added the else to the if(prevApr == 0)
I haven't tested that function yet. Cause I didn't see my WETH. I'll try and see if I hit any blocks
May 9, 2023, 6:13 PM
https://twitter.com/shoucccc/status/1656024552340860928?t=V0jcQ5fnDozeHGp8WxGyQg&s=19
May 9, 2023, 7:57 PM
fuck if only that was deployed on bsc I'd have caught that lol
speaking of relayers... idk what's wrong with defender, even updating everytime the autotask it keeps executing as he wants :/
May 9, 2023, 11:27 PM
forum ;P
if i recall correctly, there is someone from OZ here, but i don't think they read so often
May 9, 2023, 11:31 PM
I'll try making another post there
here it is https://forum.openzeppelin.com/t/autotask-issues-transactions-before-the-time-indicated-by-the-cronjob/36121
the timestamps drive me crazy, it doesn't make senseπ€―
May 10, 2023, 12:00 AM
mhm ye it's kinda dancing :S
oh wait, what if you set the new autotask before sending the tx?
or before the .wait()
May 10, 2023, 12:02 AM
so 1) issue tx 2) update autotask 3) wait for mined tx?
I thought about the current order as first I make the tx, wait it gets mined and then once it is mined I update the autotask to restart the counter of the cronjob (ideally)
May 10, 2023, 12:04 AM
that's the best way, but it will delay and make the schedule not precise, as the .wait() may lag a bit, depending on the RPC you're connected to
scheduling it before the .wait() is kinda dangerous because it depends on the tx and the overall project.
Can the tx be sent if the previous one is failed? can the tx be reverted? how it should be handled if it revert?
Can the tx be sent if the previous one is failed? can the tx be reverted? how it should be handled if it revert?
May 10, 2023, 12:11 AM
to me as long as the being not precise adds some seconds instead of subtracting them that's fine
May 10, 2023, 12:12 AM
Try scheduling it before waiting for it's confirmation then, let me know if it works
May 10, 2023, 12:30 AM
just changed it and the behavior looks the same
May 10, 2023, 12:38 AM
At this point it's probably the delay of lambda functions to start, but they're pretty fast as far as i tried them
May 10, 2023, 12:40 AM
yeah what bothers me is that it's not even a delay, I'd be ok with it, it anticipates and I see no logic behind this π΅βπ«
just tried changing to "execute every 5 minutes" and it keeps executing it about every minute...π€
try upping gaslimit, @FreezyDev had a similar issue earlier
(I recommend trying on a fork before btw)
May 10, 2023, 1:12 AM
no it's not a test, I needed to bridge some assets to matic
yes , I thn doubled the gas limit, still the same
nvm I'll get from cex
btw market cooling off, gas prices should go down if it stays like this π
May 10, 2023, 1:19 AM
you could still see if the tx on arbitrum side would work
May 10, 2023, 1:20 AM
nah it doesn't get passed only
shows some rpc error thn says intrinsic gas too low
maybr problem with the rpc im using
btw do you guys know any vps server that allows to run nodes (preferably services with a freemium plan)
linea on Twitter space said their stress test led to some of the congestion
and their task is over yesterday so goerli just got useless
500k bots and people have been testing all the testnet crosschain bridges the past week
May 10, 2023, 2:26 AM
π’π’
well any token that has supply burn should be fine
May 10, 2023, 6:50 AM
Try using chainlinks solution. Bit more expensive, but works pretty well. Still using it for my twap
May 10, 2023, 7:32 AM