0

I am trying to interact with another contract (Curve finance) via my own contract. (eg get prices, to execute trades , etc)

The thing is , the contract is written in Vyper. https://etherscan.io/address/0xA5407eAE9Ba41422680e2e00537571bcC53efBfD#readContract

I am unable to import https://github.com/curvefi/curve-contract/blob/master/contracts/pools/susd/StableSwapSUSD.vy to my remix project as it would error when compile - ParserError: Expected pragma import directive or contract/interface/library/struct/enum/definition.

I would like to ask how to create a contract instance for contracts written in vyper. I am able to get the ABI from etherscan, but I do not know how to proceed further from here.

Thank you in advance.

0

I'm not exactly sure if you'd like to create a new instance of the contract or simply utilize the existing one. So let's answer both.

  1. New instance. You have to be able to compile the contract into bytecode. So either you need a Vyper compiler or you need to get the bytecode and deploy that - unsure with what tools bytecode could be deployed.

  2. Existing instance. You basically need either the source code or an interface of its functionality. Since you can't use the source code you need an interface for it. If they don't provide one (you can probably manually change a Vyper interface into a Solidity interface) you can try creating it by hand by looking at the ABI. Probably some tools also exist for this but, again, unsure which tools could be used.

1
  • Thanks alot , I have found a solidity version the code. – Holmes Sep 14 '20 at 4:32

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.