I am currently trying to create a simple program that does tax payments using Geth. I created a function in a smart contract that takes in a user's tax identification (don't mind this, I don't believe it is part of the problem), the amount they want to deposit, and the address to send the amount to.
My function is as below:
function payTaxes(string memory _taxID, uint _amount, address _to) public payable {
if (msg.sender!= gov6) {
if (taxStructs[msg.sender][_taxID].bracket != 1) {
if (taxStructs[msg.sender][_taxID].taxessettled = false) {
address payable to = payable(_to);
to.transfer(_amount);
taxStructs[msg.sender][_taxID].taxessettled = true;
taxStructs[msg.sender][_taxID].taxdue = 0;
}
}
}
}
The code compiles and all, but I don't see that an amount is being transferred to the destination address. Also, I put a flag that says if the payment is made, the variable taxessettled becomes true, but it is still always false.
Below is a screenshot of the transaction:
Can anybody advise what I'm doing wrong?
Thanks.