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

Don't leak "verified" types in AssetAtomicExchangeCompilation.*Instance parameters #7

Open
greenhat opened this issue Feb 12, 2020 · 0 comments

Comments

@greenhat
Copy link
Member

Expose API where parameter types are only from sigma and not "verified" copies.
To avoid conversion at call-site:

  def contractInstance(tokenPrice: Long, sellerPk: Address): ErgoContract = {
    import org.ergoplatform.sigma.verified.VerifiedTypeConverters._
    val sellerPkProp = sigmastate.eval.SigmaDsl.SigmaProp(sellerPk.getPublicKey)
    val verifiedContract = AssetsAtomicExchangeCompilation.sellerContractInstance(tokenPrice, sellerPkProp)
    new ErgoTreeContract(verifiedContract.ergoTree)
  }

from http://github.com/aslesarenko/ergo-tool/blob/d893998bb8036c598afbddba58cf740c74f35e45/src/main/scala-2.12/org/ergoplatform/appkit/ergotool/dex/CreateSellOrderCmd.scala#L113-L113

@greenhat greenhat self-assigned this Feb 12, 2020
@greenhat greenhat removed their assignment Oct 8, 2021
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

1 participant