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

#1023 #1024

Closed jeetabhi01 closed 1 year ago

jeetabhi01 commented 1 year ago

Moved abibuiltins to builtinHandler directory. resolves #1023

jeetabhi01 commented 1 year ago

You need to change as well the location where abiBuiltin is call. From src/transpiler.ts to src/passes/builtinHandler/index.ts

Could you please provide some more information on this one?

rodrigo-pino commented 1 year ago

Hi @jeetabhi01 , sorry for not being clear. The way Warp work is that through several passes we handle different parts of the Solidity source code. One of those passes handle all builtins. When the pass that handled the abi builtin was made, it was as a standalone pass in src/passes/abiBuiltins.ts which get then instantiated in src/transpiler.ts in the applyPasses function. It should be instead define in src/passes/builtinHandler/ and be called instead by the code src/apsses/builtinHandler/index.ts

rodrigo-pino commented 1 year ago

@jeetabhi01 do you need any more help, how it is going?

jeetabhi01 commented 1 year ago

@jeetabhi01 do you need any more help, how it is going?

Oh I am sorry for late reply, Actually I am unable to find where the individual pass is implemented I tried debugging it but couldn't find it.

$ bin/warp transpile exampleContracts/ERC20.sol
Unexpected error during transpilation
Error: Unknown pass key: Abi in pass prerequisite of Events
    at /home/jeet_abhi01/Documents/Projects/warp/build/utils/cli.js:45:23
    at Set.forEach (<anonymous>)
    at /home/jeet_abhi01/Documents/Projects/warp/build/utils/cli.js:43:22
    at Array.forEach (<anonymous>)
    at parsePassOrder (/home/jeet_abhi01/Documents/Projects/warp/build/utils/cli.js:40:19)
    at applyPasses (/home/jeet_abhi01/Documents/Projects/warp/build/transpiler.js:86:52)
    at transpile (/home/jeet_abhi01/Documents/Projects/warp/build/transpiler.js:14:22)
    at Command.runTranspile (/home/jeet_abhi01/Documents/Projects/warp/build/cli.js:84:36)
    at Command.listener [as _actionHandler] (/home/jeet_abhi01/Documents/Projects/warp/node_modules/commander/lib/command.js:481:17)
    at /home/jeet_abhi01/Documents/Projects/warp/node_modules/commander/lib/command.js:1236:65
    at Command._chainOrCall (/home/jeet_abhi01/Documents/Projects/warp/node_modules/commander/lib/command.js:1152:12)
    at Command._parseCommand (/home/jeet_abhi01/Documents/Projects/warp/node_modules/commander/lib/command.js:1236:27)
    at Command._dispatchSubcommand (/home/jeet_abhi01/Documents/Projects/warp/node_modules/commander/lib/command.js:1058:25)
    at Command._parseCommand (/home/jeet_abhi01/Documents/Projects/warp/node_modules/commander/lib/command.js:1201:19)
    at Command.parse (/home/jeet_abhi01/Documents/Projects/warp/node_modules/commander/lib/command.js:890:10)
    at Object.<anonymous> (/home/jeet_abhi01/Documents/Projects/warp/build/index.js:4:15)
Transpilation failed