Skip to content

Commit

Permalink
whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
dbanks12 committed Aug 4, 2023
1 parent 70ddc7e commit 44b67e1
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ contract NonNativeToken {
// Should eventually be hidden:
inputs: PrivateContextInputs,
//*********************************/
initial_supply: Field,
initial_supply: Field,
owner: Field,
) -> distinct pub abi::PrivateCircuitPublicInputs {
let storage = Storage::init();
Expand All @@ -78,14 +78,14 @@ contract NonNativeToken {
}

// Mint Private Function
// This mint function differs to the typical token mint function as it only allows minting
// This mint function differs to the typical token mint function as it only allows minting
// upon consuming valid messages from a token portal contract
fn mint(
//*********************************/
// Should eventually be hidden:
inputs: PrivateContextInputs,
//*********************************/
amount: Field,
amount: Field,
owner: Field,
// This field should be hidden
msg_key: Field,
Expand Down Expand Up @@ -118,8 +118,8 @@ contract NonNativeToken {
// Should eventually be hidden:
inputs: PrivateContextInputs,
//*********************************/
amount: Field,
sender: Field,
amount: Field,
sender: Field,
recipient: Field, // ethereum address in the field
callerOnL1: Field, // ethereum address that can call this function on the L1 portal (0x0 if anyone can call)
) -> distinct pub abi::PrivateCircuitPublicInputs {
Expand All @@ -139,14 +139,14 @@ contract NonNativeToken {
}

// Mint Public Function
// This mint function differs to the typical token mint function as it only allows minting
// This mint function differs to the typical token mint function as it only allows minting
// upon consuming valid messages from a token portal contract
open fn mintPublic(
//*********************************/
// Should eventually be hidden:
inputs: PublicContextInputs,
//*********************************/
amount: Field,
amount: Field,
owner_address: Field,
// This field should be hidden
msg_key: Field,
Expand Down Expand Up @@ -181,7 +181,7 @@ contract NonNativeToken {
) {
let storage = Storage::init();
let public_balances = storage.public_balances;

let sender = inputs.call_context.msg_sender;
let sender_balance = public_balances.at(sender);

Expand All @@ -190,7 +190,7 @@ contract NonNativeToken {
if (current_sender_balance as u120) > (amount as u120) {
// User has sufficient balance so we decrement it by `amount`
let _void1 = sender_balance.write(current_sender_balance - amount);
}
}
// TODO: Revert if there is not enough balance

let content = get_withdraw_content_hash(amount, recipient, callerOnL1);
Expand All @@ -207,8 +207,8 @@ contract NonNativeToken {
// Should eventually be hidden:
inputs: PrivateContextInputs,
//*********************************/
amount: Field,
sender: Field,
amount: Field,
sender: Field,
recipient: Field,
) -> distinct pub abi::PrivateCircuitPublicInputs {
let storage = Storage::init();
Expand Down Expand Up @@ -304,7 +304,7 @@ contract NonNativeToken {

// enqueue a public function to perform the public state update.
let thisAddress = inputs.call_context.storage_contract_address;

// addUnshieldedBalance selector (in decimal)
// recompute by: `cast keccak addUnshieldedBalance(field,field)` -> convert to decimal
let pubEntryPointSelector = 753269941;
Expand All @@ -331,7 +331,7 @@ contract NonNativeToken {
) -> Field {
let storage = Storage::init();
let owner_balance = storage.balances.at(owner);

balance_utils::get_balance(owner_balance.storage_slot)
}

Expand Down

0 comments on commit 44b67e1

Please sign in to comment.