-
-
Notifications
You must be signed in to change notification settings - Fork 789
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
Cannot use external contract addresses as function arguments in Vyper contract interface #1375
Comments
Yup! Someone else ran into this bug. Was fixed in #1373, but not released yet |
The latest changes still don't seem to let me compile uniswap :(. I updated from the master branch: pipenv install -e "git+https://github.com/ethereum/vyper.git@master#egg=vyper" then tried to change
The last one returns the following error: vyper.exceptions.TypeMismatchException: line 68:15 Typecasting from base type address(ERC20) to address(ERC20) unavailable |
I think that's our April Fool's joke this year, isn't is @jacqueswww? Please tell me that error is a joke. Please. |
@fubuloubu @Pet3ris Use |
@Pet3ris if you use the original setup with master, all should be well.
Additionally if you want to compile the current mainnet uniswap contract you have to use vyper beta 4. |
I just tested this code on master, and it's all 👍 : from vyper.interfaces import ERC20
contract Factory:
def getExchange(token_addr: address) -> address: constant
factory: Factory
token: ERC20
@public
def test():
assert self.factory.getExchange(self.token) == self |
Thanks @jacqueswww, @fubuloubu for the clarification, works now! |
Please feel free to close. |
Closed, in favour of #1376 |
I'm trying to compile the Uniswap Exchange contract using the latest
vyper
compiler.I first updated the ERC20 references to the new
token: ERC20
definition and set up an importfrom vyper.interfaces import ERC20
.The next issue is with the
getExchange()
function in the Factory interface.This occurs on the following line:
I tried to solve it by amending the
getExchange
interface to:but this produces another error:
Any thoughts on how to get this to compile?
Vyper version
The text was updated successfully, but these errors were encountered: