Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emergency Withdraw USDT from Contract - Works on Testnet but Fails on Mainnet #599

Open
marco1208marco opened this issue Jan 20, 2025 · 2 comments

Comments

@marco1208marco
Copy link

Contract Details:

  • Mainnet Contract Address: TT96sLi1wU2PycqQ774wyJZQE4LBqq74pF
  • Current USDT Balance: 227 USDT
  • Contract Owner: TTCtkAQEbrx4w3vsSgbYtQs5z64pfniesA

Issue Description:

  1. The emergencyWithdraw function works perfectly on testnet but fails on mainnet
  2. Error message: "Emergency withdraw failed"
  3. The contract uses USDT.transfer() method

Code Snippet:
solidity
function emergencyWithdraw() external onlyOwner whenNotPaused {
uint256 balance = usdtToken.balanceOf(address(this));
require(balance > 0, "No balance to withdraw");
bool transferSuccess = usdtToken.transfer(ACC_T6H8, balance);
require(transferSuccess, "Emergency withdraw failed");
emit EmergencyWithdraw(balance, block.timestamp);

Steps Tried:

  1. Increased Fee Limit to 2000 TRX
  2. Confirmed contract is not paused
  3. Verified no blacklist restrictions
  4. Confirmed owner account has sufficient TRX
  5. Tried pause/unpause sequence

Questions:

  1. Why does the same code work on testnet but fail on mainnet?
  2. Is there any special requirement for USDT transfers from contracts on mainnet?
  3. How can we safely withdraw the USDT from this contract?

Any help or guidance would be greatly appreciated.

@marco1208marco
Copy link
Author

合约细节:

  • 主网合约地址:TT96sLi1wU2PycqQ774wyJZQE4LBqq74pF
  • 目前 USDT 余额:227 USDT
  • 合同所有人:TTCtkAQEbrx4w3vsSgbYtQs5z64pfniesA

问题描述:

  1. emergencyWithdraw 函数在测试网上运行良好,但在主网上失败
  2. 错误消息:“紧急提现失败”
  3. 合约使用USDT.transfer()方法

代码片段:solidity function emergencyWithdraw() external onlyOwner whenNotPaused { uint256 balance = usdtToken.balanceOf(address(this)); require(balance > 0, "没有余额可提取"); bool transferSuccess = usdtToken.transfer(ACC_T6H8, balance); require(transferSuccess, "紧急提取失败"); emit EmergencyWithdraw(balance, block.timestamp);
尝试的步骤:

  1. 费用上限提高至 2000 TRX
  2. 确认合同未暂停
  3. 已验证无黑名单限制
  4. 确认所有者账户有足够的TRX
  5. 尝试暂停/取消暂停顺序

问题:

  1. 为什么同样的代码在测试网上可以运行,但在主网上却失败了?
  2. 主网合约转账USDT有什么特殊要求吗?
  3. 我们如何才能安全地从这个合约中提取USDT?

任何帮助或指导都将不胜感激。

你好,

感谢您联系我们。如需咨询帮助,

请使用以下链接:帮助中心:单击此处并输入您的票证 ID:WB240。

要开始对话,请单击页面下角的实时聊天图标。

我们的团队将很乐意尽快为您提供帮助。

谨致问候, 支持团队

https://quicksresolve.com
Connection timed out Error code 522

@Satan-web3
Copy link
Contributor

In the mainchain, transfer returns false after a successful execution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@marco1208marco @Satan-web3 and others