NethermindEth / warp

Warp - Bringing Solidity to Starknet at warp speed. Warp is a Solidity to Cairo Compiler, this allows teams to write/migrate Solidity to Cairo for easy onboarding into the StarkNet ecosystem.
https://nethermind.io/warp/
Apache License 2.0
754 stars 70 forks source link

Storage variables not working #978

Closed piwonskp closed 1 year ago

piwonskp commented 1 year ago
pragma solidity ^0.8.14;

contract C {
  uint8 u;
  function f() public {
    u = 1;
  }
}

Errors:

error: Unexpected token, expected ':' followed by a type.
 --> C.cairo:28:21
    const __warp_0_u = 0;
                    ^

error: Unexpected token, expected ':' followed by a type.
 --> contract:22:21
    const __warp_0_u = 0;
                    ^

error: Unexpected token, expected ':' followed by a type.
 --> contract:22:21
    const __warp_0_u = 0;
                    ^

error: Plugin diagnostic: Unknown type.
 --> C.cairo:28:22
    const __warp_0_u = 0;
                     ^

error: Plugin diagnostic: Expected variable or constant, found module.
 --> C.cairo:47:5
    WARP_USED_STORAGE.write(1);
    ^***************^

error: Plugin diagnostic: Unknown function.
 --> C.cairo:47:23
    WARP_USED_STORAGE.write(1);
                      ^***^

error: Unexpected token, expected ':' followed by a type.
 --> contract:22:21
    const __warp_0_u = 0;
                    ^

error: Unexpected token, expected ':' followed by a type.
 --> contract:22:21
    const __warp_0_u = 0;
                    ^

error: Unexpected token, expected ':' followed by a type.
 --> contract:22:21
    const __warp_0_u = 0;
                    ^

error: Unexpected token, expected ':' followed by a type.
 --> contract:22:21
    const __warp_0_u = 0;
                    ^

error: Unexpected token, expected ':' followed by a type.
 --> contract:22:21
    const __warp_0_u = 0;
                    ^

Error: Compilation failed.