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

vyper.exceptions.CompilerPanic: Number of arguments mismatched: add [] #2249

Closed
maria988 opened this issue Dec 9, 2020 · 3 comments
Closed

Comments

@maria988
Copy link

maria988 commented Dec 9, 2020

Version Information

  • vyper Version (output of vyper --version):0.2.7
  • OS: osx/linux/win
  • Python Version (output of python --version):3.7
  • Environment (output of pip freeze):

What's your issue about?

Please include information like:

  • full output of the error you received
    Err. RefID: vyper-in-FpAkBxI5i1NJMVX.vy
    vyper.exceptions.CompilerPanic: Number of arguments mismatched: add []

This is an unhandled internal compiler error. Please create an issue on Github to notify the developers.
https://github.com/vyperlang/vyper/issues/new?template=bug.md

  • what command you ran
    #seleccionar un valor predeterminado o llenar el deposito

struct Gasofalineria:
litros: uint256
precio_litro: uint256

struct surtidor:
uso: bool
cliente: address
tope: uint256
combustible: String[3]
pagado: uint256
selec: uint256

empresa: public(address)

gasolinera: public(HashMap[String[3],Gasofalineria])
surtidores: public(HashMap[uint256,surtidor])
maximo: uint256
seleccion: public(HashMap[uint256,uint256])

@external
def init(_precio95: uint256,_precio98: uint256,_precioN: uint256,_precioP: uint256,_maximo: uint256,
_litros95: uint256,_litros98: uint256,_litrosN: uint256,_litrosP: uint256,
_p1: uint256,_p2: uint256,_p3: uint256,_p4: uint256,_p5: uint256,_p6: uint256,_p7: uint256):
assert _precio95 > 0
assert _precio98 > 0
assert _precioN > 0
assert _precioP > 0
assert _maximo > 0
assert _maximo >= _litros95
assert _maximo >= _litros98
assert _maximo >= _litrosN
assert _maximo >= _litrosP
assert _p1 > 0
assert _p2 > _p1
assert _p3 > _p2
assert _p4 > _p3
assert _p5 > _p4
assert _p6 > _p5
assert _p7 > _p6
self.empresa = msg.sender
self.gasolinera["G95"] = Gasofalineria({litros: _litros95,precio_litro: _precio95})
self.gasolinera["G98"] = Gasofalineria({litros: _litros98,precio_litro: _precio98})
self.gasolinera["DiN"] = Gasofalineria({litros: _litrosN,precio_litro: _precioN})
self.gasolinera["DiP"] = Gasofalineria({litros: _litrosP,precio_litro: _precioP})
self.maximo = _maximo
self.seleccion[1] = _p1
self.seleccion[2] = _p2
self.seleccion[3] = _p3
self.seleccion[4] = _p4
self.seleccion[5] = _p5
self.seleccion[6] = _p6
self.seleccion[7] = _p7

@payable
@external
def echargasolina(calle: uint256, comb: String[3],sel: uint256):
assert (calle == 1 and not (self.surtidores[1].uso)) or (calle == 2 and not (self.surtidores[2].uso))
assert (comb == "G95") or (comb == "G98") or (comb == "DiN") or (comb == "DiP")
assert sel < 8
assert sel > 0
assert msg.value == self.seleccion[sel]
assert self.gasolinera[comb].litros >= self.gasolinera[comb].precio_litro * msg.value

self.surtidores[calle] = surtidor({uso:True,cliente: msg.sender,tope: self.gasolinera[comb].precio_litro * msg.value,combustible:comb,pagado:msg.value,selec:sel})

@external
def parar(calle: uint256, litros: uint256,lleno: bool):
assert self.surtidores[calle].uso
assert (self.surtidores[calle].tope == litros or lleno)
self.surtidores[calle].uso = False
self.gasolinera[self.surtidores[calle].combustible].litros -= litros
if self.surtidores[calle].selec == 7:
send(self.surtidores[calle].cliente,(self.gasolinera[self.surtidores[calle].combustible].precio_litro )(self.surtidores[calle].tope - litros))
send(self.empresa, litros
self.gasolinera[self.surtidores[calle].combustible].precio_litro)

else:
    send(self.empresa,self.surtidores[calle].pagado)
self.surtidores[calle] = empty(surtidor)

@external
def surtir(cantidad:uint256 ,comb: String[3]):
assert msg.sender == self.empresa
assert (comb == "G95") or (comb == "G98") or (comb == "DiN") or (comb == "DiP")
assert self.gasolinera[comb].litros + cantidad <= self.maximo
self.gasolinera[comb].litros += cantidad

@external
def cambiar_precio(comb: String[3],precio: uint256):
assert msg.sender == self.empresa
assert precio > 0
assert (comb == "G95") or (comb == "G98") or (comb == "DiN") or (comb == "DiP")
self.gasolinera[comb].precio_litro = precio

  • the code that caused the failure (see this link for help with formatting code)

How can it be fixed?

Fill this in if you know how to fix it.

@iamdefinitelyahuman
Copy link
Contributor

Can you try this with the v0.2.8 release? I believe it's a duplicate of #2237 and so already fixed.

@maria988
Copy link
Author

maria988 commented Dec 9, 2020 via email

@iamdefinitelyahuman
Copy link
Contributor

Not a problem :)

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

2 participants