0

I'm trying to call an Exchange SmartContract which is POORLY designed/implemented and forces you to sign your own parameters instead of using msg.sender (and provides no alternative). <-- I've just seen its not poorly designed, they limit the contract to themselves... weird

I'm calling this Exchange from my own SmartContract.

Someone could tell me a way (if possible) to tell my SmartContract to sign some parameters? I can't sign from outside, because I don't have my SmartContract private key.

-Lets say I have "uint one, uint two, address three" and I want to get the "r,v,s" of those three parameters signed with my Smart Contract address (all this done using Solidity).

Thanks!,

1

Bad news. Your contract doesn't have a known private key because generating one isn't part of the process. They aren't meant to, by design.

So no, there is no way to compel it to sign something on its own behalf. The fact that smart contracts cannot participate in such signing schemes is a well-known limitation.

Hopefully, the exchange doesn't have any of your assets. In my opinion, if r,v,s is the requirement for withdrawal, then r,v,s should be the requirement for deposit to prevent any assets from becoming marooned.

Hope it helps.

  • Thanks! That was my assumption too, was hoping to have some magic appear. No, the exchange doesn't have any asset (its not for withdraw, its for the trade function which I'm trying to automate so the users of my contract have some guarantees), so no problem there, I'm @ development phase. I don't get why instead of using msg.sender they are asking me to sign my own parameters, but whatever... will go to better implemented exchanges (aka, not IDEX). – BiS Dec 17 '18 at 19:18
  • 1
    @BiS I thought I should chime in, as I'm very familiar with IDEX's contract. Their exchange is unique in that they are the ONLY ones who can control the flow of trades. This allows the DEX to support a "high-volume" of transactions, ie NO waiting for confirmations. Basically, they preserve the ORDER of incoming trade requests so that everything "eventually" settles correctly. The reason for forcing you to sign is for your own protection; so that they cannot move your tokens without your express permission. FYI, this "signature" model has made them the #1 DEX (in trade volume). – nyusternie Mar 6 at 5:25
  • Yeah I realized that they are enforcing it that way so they can do everything off-chain and then just settle after writing the comment. I should have said more contract-oriented exchanges – BiS Mar 10 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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