Hey, I am using EthAnhor on Ropsten using wrapped UST but I am running into issues receiving the resulting aUST back.
Here’s a few snippets
// step 1:
// approve IERC0 first
// step 2:
function initiateSupply(
uint256 amount
) external returns (address) {
// transfer from user to contract
IERC20(wrappedUST).transferFrom(msg.sender, address(this), amount);
// approve contract transfer to routerv2
IERC20(wrappedUST).approve(address(router), amount);
address _operation = router.initDepositStable(
amount
);
return _operation;
}
// step 3:
function finishSupply(
address _operation
) external {
router.finishDepositStable(_operation);
}
function initiateSupplyInFull(
uint256 amount
) external {
// transfer from user to contract
IERC20(wrappedUST).transferFrom(msg.sender, address(this), amount);
// approve contract transfer to routerv2
IERC20(wrappedUST).approve(address(router), amount);
address _operation = router.initDepositStable(
amount
);
router.finishDepositStable(_operation);
}
The first way gives me: “Operation: not enough token”.
initiateSupplyInFull gives same error but no tx is made
// or with
// step 2:
function supply(
uint256 amount
) external {
router.depositStable(msg.sender, amount);
}
I assume this automatically would send back the aUST to the msg.sender designated in depositSupply but I don’t receive it.
If I manually attempt a finishDepositStable I get: “Router: invalid status for finish” (just a desp attempt)
I have noticed USDC works from checking other tx’s in testnet but I can’t get my hands on any
Is the code I’m using not correct