keep-starknet-strange / vault

Empower Your Assets, Redefine Control.
https://vlt.finance
MIT License
18 stars 16 forks source link

Migrate to starknet foundry #83

Open LucasLvy opened 2 weeks ago

LucasLvy commented 2 weeks ago

Currently the cairo part uses the base testing framework. We need to migrate to use starknet foundry. doc

mubarak23 commented 2 weeks ago

I will like to handle this

kindly assign

LucasLvy commented 2 weeks ago

assigned, feel free to reach out if you have any question

mubarak23 commented 1 week ago

can i deploy separate contract for different deceleration that has classhash

LucasLvy commented 1 week ago

I'm not sure i understand the question. If the question is: "Can i deploy multiple contracts that have the same class hash" then the answer is yes

mubarak23 commented 1 week ago

for each contract, i will create a function that deploy it.

mubarak23 commented 1 week ago

@LucasLvy am able to deploy all the contract via snforge,

i need to refactor the 32 test cases one by one,

this will take a bit of time,

i will keep you posted as am proceeding with the test

LucasLvy commented 1 week ago

sounds good, you can also open a draft pr now so it's easier to track the progress

mubarak23 commented 1 week ago

@LucasLvy am using this address as admin

let address = contract_address_const::<0x123>() 
for 
component.initializer(address, address, address);

which set the admin

but i keep getting the following error

Failure data:
    "Only admin"

is there a specific admin we are using.

mubarak23 commented 1 week ago

sounds good, you can also open a draft pr now so it's easier to track the progress sure i will

LucasLvy commented 1 week ago

Hard to say without the code, open the PR plz so i can see exactly where it comes from

mubarak23 commented 1 week ago

Hard to say without the code, open the PR plz so i can see exactly where it comes from

sure let me push a draft PR

LucasLvy commented 1 week ago

Can you dm me on telegram it'll be easier to chat. My username is lucasLvy

LucasLvy commented 1 week ago

the problem is the following:

// This line changes all the calls to the contract deployed at admin_address so that get_caller_address() returns admin_address
start_prank(CheatTarget::One(admin_address), admin_address);
// What you really want to do is prank the component to think that admin address is calling him
// The component isn't deployed so you can't specify an address as cheat target so you can just do this
start_prank(CheatTarget::All, admin_address);