thanks a lot for the response..can i PLS take it a bit more in depth..i've been trying for ages..
sc2 is justswapfactory (in TRX) like uniswap (in ETH), i want to execute trxToTokenSwapOutput so buy a token.
sc1 is my sc and I have this function :

function calltrxToTokenSwapOutput2(uint256 amount_sent, uint256 _tokens_bought) external payable returns(uint256){
address(Factoryaddy).transfer(amount_sent);
address(IJustswapExchange(Factoryaddy)).call(abi.encodeWithSignature("trxToTokenSwapOutput(uint256,uint256)",_tokens_bought,26231916));
}

- IJustswapExchange is the factory interface which has :
function trxToTokenSwapOutput(uint256 tokens_bought, uint256 deadline) external payable returns(uint256);
- my callvalue is 1 trx, so i send 1 trx, sc1 sends 1 trx to sc2

Dec 23, 2020, 9:52 PM
but sc2 does not send token back. This version reverts
the version below doesn't revert but no token is sent back :
function calltrxToTokenSwapOutput2(uint256 amount_sent, uint256 _tokens_bought) external payable returns(uint256){
address(Factoryaddy).transfer(amount_sent);
address(Factoryaddy).call(abi.encodeWithSignature("trxToTokenSwapOutput(uint256,uint256)",_tokens_bought,26231916));
}
Dec 23, 2020, 9:54 PM

© 2024 Draquery.com All rights reserved.