Open
Description
i am trying a thing where recieve funds will instantaniously transfered to a predefined wallet.
after the transfer the transaction passes but the funds get stuck in the contract.
note: this code works alright in EVM chains
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.6;
contract TRXForwarder {
address payable public immutable destination;
event TRXForwarded(uint256 amount);
constructor(address payable _destination) {
// require(_destination != address(0), "Invalid address");
destination = _destination;
}
receive() external payable {
require(msg.value > 0, "No TRX sent");
payable(destination).call{value: msg.value}("");
}
fallback() external payable {
require(msg.value > 0, "No TRX sent");
payable(destination).call{value: msg.value}("");
}
Activity