0
type investment is record [
    amount:tez;
    deadline:timestamp
] 
type investor is map (address,investment)
type user_data is record [
    balance:tez;
    is_invested:bool;
    investment:investor
]
type storage is map(address,user_data)



type parameter is
  Deposit 
| Withdraw of tez


type return is list (operation) * storage

// Four entrypoints

function deposit (const store : storage) : return is
block {
    patch store[Tezos.sender] with record [
        balance = balance + Tezos.amount;
        is_invested = false ;
        investment= map [] ;
    ] 

} with ((nil:list(operation)),store)

function withdraw (const store : storage; const delta : tez) : return is 
block{
    const bal : option(tez) = store[Tezos.sender].balance ;
    case bal of [
        Some (val) -> block { skip }
    |   None -> failwith ("Not Deposited Yet Pls Deposit")
    ]
    patch store[Tezos.sender] with record [balance=balance - delta];
    const op :operation = Tezos.transaction(unit,del,Tezos.sender) ;

}with (list[op],store)


(* Main access point that dispatches to the entrypoints according to
   the smart contract parameter. *)

function main (const action : parameter; const store : storage) : return is 
block { skip } with case action of [
    Deposit  -> deposit (store)
  | Withdraw (n) -> withdraw (store, n)
  ]

getting this error pls help me to find whats wrong

Error: File "/tmp/tmp-1NTQaEbbUJIbd.ligo", line 36, characters 49-50:
Ill-formed block of statements.
At this point, if the statement is complete, one of the following is
expected:
  * another statement (instruction or declaration);
  * a closing brace '}' if there are no more statements.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.