I'd like to reward weth out of an erc20 contract - contract collects fees/taxes, those will be rewarded to holders - every holder can manually claim the staked rewards - how is it possible to claim weth out of a erc20 token? can anybody help? contract is ready, only got a problem with swapexactETHfortokensSupportingFeeOnTransferToken and pathing..Anybody?
Aug 13, 2021, 1:58 PM
you should use swapTokensForTokens to get WETH
Aug 13, 2021, 2:00 PM
but the fees are already collected as ETH within the contract
Aug 13, 2021, 2:00 PM
you can swap it with WETH contracts
https://etherscan.io/token/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
use deposit
Aug 13, 2021, 2:01 PM
do u mind, checking the contract, or at least the reward section?
Aug 13, 2021, 2:04 PM
I've use it earlyer, should be like this
IWBNB(_wbnb).deposit{ value: reward }();
reward = reward.mul(1 wei);
IWBNB(_wbnb).transfer(address(_lottery), reward);
reward = reward.mul(1 wei);
IWBNB(_wbnb).transfer(address(_lottery), reward);
very weird
If I remove console.log then I get the error
hahaah
it's sucks when forking a mainnet using Infura
indeed
Aug 13, 2021, 2:33 PM