hacked contract
hacked contract
Unfortunately, the contract we created with great hopes last night was hacklendi. we still do not understand how it is, the owner's address is changed. we are trying to figure this out because we want to fix it in our next contract. Please click to go to the contract.
Is there anyone who can help me?
1 Answer
1
Here's a function that anyone can call to make themselves owner:
owner
function HTX () public
owner = msg.sender;
uint256 devTokens = 1000000000e8;
distr(owner, devTokens);
This was probably meant to be a constructor. In current versions of Solidity, this should be:
constructor() public {
...
but it's also still acceptable (but deprecated) to use a function with the same name as the contract. In this case:
function HitexToken() public {
...
Well, you can call
HTX() and become the owner again, but I don't see the point. There are no more tokens and no more ether. (And anyone can come along at any time to become owner again.)– smarx
Aug 26 at 16:47
HTX()
owner
owner
I am trying to change the owner address but "ALERT: Transaction Error. Exception thrown in contract code." I get an error. ibb.co/dgpoiU
– hit
Aug 26 at 18:00
Is the account you're using currently the
owner? You can't call transferOwnership unless you're the owner.– smarx
Aug 26 at 18:04
owner
transferOwnership
owner
no. This is the old account holder. this creator address. then hacked and changed. I am trying to make the address again as the owner of this contract. am applying the wrong method?
– hit
Aug 26 at 18:30
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Thank you very much for your reply. well, Is there a way to get this contract back?
– hit
Aug 26 at 16:40