1

Might have royally messed up here, but I added an address via command line with ./tezos-client add address stakingfacilities tz1WpeqFaBG9Jm73Dmgqamy8eF8NWLz9JCoY

(for stakingfacilities baker in Germany)

Then initiated a smart contract with tezos-client originate contract k1 transferring 4633 from k1 running "$(cat manager.tz)" --init '"tz1WpeqFaBG9Jm73Dmgqamy8eF8NWLz9JCoY"' --burn-cap 0.489

Now when I try to move the tezos with ./tezos-client transfer 1 from k1 to mack-2

I get the error "Unknown secret key for tz1WpeqFaBG9Jm73Dmgqamy8eF8NWLz9JCoY"

Any idea how to cancel the smart contract or remove the funds? Transactions don't work on Galleon or Tezbox...

8
  • can you clarify your origination call is correct, as it seems like you are transferring from the same alias you are giving to the contract to be created which shouldn't work
    – cousinit
    Commented Dec 1, 2019 at 3:10
  • Then initiated a smart contract with tezos-client originate contract mack-2 transferring 4633 from k1 running "$(cat manager.tz)" --init '"tz1WpeqFaBG9Jm73Dmgqamy8eF8NWLz9JCoY"' --burn-cap 0.489
    – Mack Baise
    Commented Dec 1, 2019 at 3:11
  • what is the address of the new contract you created, have you looked it up on better call dev or some other tool to see if it was created as you expected
    – cousinit
    Commented Dec 1, 2019 at 3:13
  • So when I try to send coins from the Kt1 address I get "Unknown secret key for tz1WpeqFaBG9Jm73Dmgqamy8eF8NWLz9JCoY", then when I remove the tz1 address with "./tezos-client forget address stakingfacilities" and try to transfer the coins the error is "no keys for the source contract manager"
    – Mack Baise
    Commented Dec 1, 2019 at 3:13
  • Is there a way to completely cancel the smart contract?
    – Mack Baise
    Commented Dec 1, 2019 at 3:14

2 Answers 2

2

You created a contract which can only transfer funds when it receives a call to do so from its "manager" account which was specified at origination and is the only value the contract has in its storage.

The contract can be seen here https://better-call.dev/main/KT1VSiaepk9USGAHDjJQAm4aaYRC6J8dTBHG/operations

You can see that the storage has the value tz1WpeqFaBG9Jm73Dmgqamy8eF8NWLz9JCoY as that is what you provided in the --init of the origination you submitted. The code of the contract you specified only allows the contract to transfer funds when called to do so by the account in storage.

This means you must sign the call with the secret key for tz1WpeqFaBG9Jm73Dmgqamy8eF8NWLz9JCoY. If you don't possess that key then you need to get the holder of that key to make the call for you as effectively they now are in control of the funds in the contract you created.

Best practice would be to only create such contracts with a 0 or minimal transfer to test them before transferring in additional funds.

6
  • Oh dang... hope I can get this figured out then. I'll send them a message.
    – Mack Baise
    Commented Dec 1, 2019 at 3:30
  • The guy who gave me directions in the Tezos stack exchange told me to use the --init parameter to specify a baker.... tezos.stackexchange.com/questions/1803/…
    – Mack Baise
    Commented Dec 1, 2019 at 3:37
  • Does that mean they can import the KT1 address then send the funds back?
    – Mack Baise
    Commented Dec 1, 2019 at 3:40
  • I'm not certain if they can send the call to the "do" entry point without also being the actual manager of the contract. You should search for and if you don't find ask a question such as "How to format the call to the "do" entry point on manager.tz contracts in order to transfer funds to account X" As that is what they will need to do for you.
    – cousinit
    Commented Dec 1, 2019 at 3:52
  • crazy, I hope the coins aren't stuck in limboland
    – Mack Baise
    Commented Dec 1, 2019 at 4:13
0

if your tezos are locked in a KT1 delegation contract (thanks to galleon abandoning ship) :

  1. find your delegation contract address on https://tzkt.io :
  • go to your manager address list of operation
  • search for "to created delegator contract KT1"
  • mouse over the KT1 address and copy it for later
  1. load your galleon wallet with umami wallet (from seed or file as you were doing with galleon) or any other web3 wallet should work

  2. browse to https://better-call.dev/mainnet/KT1.../interact/do =>replace KT1... with your KT1 address

  3. click on the wallet logo top right, chose mainnet then umami (or your other web3 wallet) then allow better call dev in umami (or your other web3 wallet)

  4. back to better call dev page you should see an avatar top right & your manager address when clicking it

  5. if you're not on interact tab of your delegation contract browse to it (paste your KT1 in the search input, browse to it, click on interact

  • left side, Entry point chose do
  • empty checked :
  • in the do input, paste :
{ DROP ;
 NIL operation ;
 PUSH key_hash "tz1..." ;
 IMPLICIT_ACCOUNT ;
 PUSH mutez 100000000 ;
 UNIT ;
 TRANSFER_TOKENS ;
 CONS }

replace tz1... with your manager address

replace 100000000 with desired amount - NB: 100000000 === 100 XTZ !!!

  1. under optional / settings
  • set source and sender to your manager address (click on fill)
  • set amount to 0
  1. click on execute then simulate, if the simulation fails you probably have an error somewhere (check your amount in the do is no more than what you have locked and that you have some xtz to pay the fee in the manager address) otherwise you should see the details of the tx with an internal transaction sending back the tezos to your manager account.

  2. If simulation is successful, click on execute then wallet, then allow the tx to be broadcasted in your web3 wallet.

done !

(& to pay me a beer for having helped you unlock your coins => tz1ZK9e1ehUvAnNtpuuWBjGmq5ZoQC812W51 cheers !)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.