diff --git a/README.md b/README.md
index 170c1b83a1..b494edd07e 100644
--- a/README.md
+++ b/README.md
@@ -56,16 +56,16 @@ Run `fe --help` to explore further options.
The following is a simple contract implemented in Fe.
```rust
+struct Signed {
+ book_msg: String<100>
+}
+
contract GuestBook {
messages: Map
>
- event Signed {
- book_msg: String<100>
- }
-
pub fn sign(self, ctx: Context, book_msg: String<100>) {
self.messages[ctx.msg_sender()] = book_msg
- emit Signed(ctx, book_msg: book_msg)
+ ctx.emit(Signed(book_msg: book_msg))
}
pub fn get_msg(self, addr: address) -> String<100> {
diff --git a/crates/analyzer/src/constants.rs b/crates/analyzer/src/constants.rs
index 54e27646aa..25f75d0d3b 100644
--- a/crates/analyzer/src/constants.rs
+++ b/crates/analyzer/src/constants.rs
@@ -1 +1,4 @@
+pub const EMITTABLE_TRAIT_NAME: &str = "Emittable";
+pub const EMIT_FN_NAME: &str = "emit";
+pub const INDEXED: &str = "indexed";
pub const MAX_INDEXED_EVENT_FIELDS: usize = 3;
diff --git a/crates/analyzer/src/context.rs b/crates/analyzer/src/context.rs
index cc73e031e8..588831917d 100644
--- a/crates/analyzer/src/context.rs
+++ b/crates/analyzer/src/context.rs
@@ -6,7 +6,7 @@ use crate::{
};
use crate::namespace::items::{
- ContractId, DiagnosticSink, EventId, FunctionId, FunctionSigId, Item, TraitId,
+ ContractId, DiagnosticSink, FunctionId, FunctionSigId, Item, TraitId,
};
use crate::namespace::types::{Generic, SelfDecl, Type, TypeId};
use crate::AnalyzerDb;
@@ -408,7 +408,6 @@ impl Location {
#[derive(Default, Clone, Debug, PartialEq, Eq)]
pub struct FunctionBody {
pub expressions: IndexMap,
- pub emits: IndexMap,
// Map match statements to the corresponding [`PatternMatrix`]
pub matches: IndexMap,
// Map lhs of variable declaration to type.
diff --git a/crates/analyzer/src/db.rs b/crates/analyzer/src/db.rs
index ef73e82594..1c5d42cfda 100644
--- a/crates/analyzer/src/db.rs
+++ b/crates/analyzer/src/db.rs
@@ -1,7 +1,7 @@
use crate::namespace::items::{
- self, ContractFieldId, ContractId, DepGraphWrapper, EnumVariantKind, EventId, FunctionId,
- FunctionSigId, ImplId, IngotId, Item, ModuleConstantId, ModuleId, StructFieldId, StructId,
- TraitId, TypeAliasId,
+ self, ContractFieldId, ContractId, DepGraphWrapper, EnumVariantKind, FunctionId, FunctionSigId,
+ ImplId, IngotId, Item, ModuleConstantId, ModuleId, StructFieldId, StructId, TraitId,
+ TypeAliasId,
};
use crate::namespace::types::{self, Type, TypeId};
use crate::{
@@ -51,8 +51,6 @@ pub trait AnalyzerDb: SourceDb + Upcast + UpcastMut
#[salsa::interned]
fn intern_function(&self, data: Rc) -> FunctionId;
#[salsa::interned]
- fn intern_event(&self, data: Rc) -> EventId;
- #[salsa::interned]
fn intern_type(&self, data: Type) -> TypeId;
// Ingot
@@ -132,11 +130,6 @@ pub trait AnalyzerDb: SourceDb + Upcast + UpcastMut
#[salsa::invoke(queries::contracts::contract_call_function)]
fn contract_call_function(&self, id: ContractId) -> Analysis>;
- #[salsa::invoke(queries::contracts::contract_all_events)]
- fn contract_all_events(&self, id: ContractId) -> Rc<[EventId]>;
- #[salsa::invoke(queries::contracts::contract_event_map)]
- fn contract_event_map(&self, id: ContractId) -> Analysis>>;
-
#[salsa::invoke(queries::contracts::contract_all_fields)]
fn contract_all_fields(&self, id: ContractId) -> Rc<[ContractFieldId]>;
#[salsa::invoke(queries::contracts::contract_field_map)]
@@ -206,10 +199,6 @@ pub trait AnalyzerDb: SourceDb + Upcast + UpcastMut
#[salsa::invoke(queries::impls::impl_function_map)]
fn impl_function_map(&self, id: ImplId) -> Analysis>>;
- // Event
- #[salsa::invoke(queries::events::event_type)]
- fn event_type(&self, event: EventId) -> Analysis>;
-
// Type
#[salsa::invoke(queries::types::all_impls)]
fn all_impls(&self, ty: TypeId) -> Rc<[ImplId]>;
diff --git a/crates/analyzer/src/db/queries.rs b/crates/analyzer/src/db/queries.rs
index ea055d276d..07d640ba41 100644
--- a/crates/analyzer/src/db/queries.rs
+++ b/crates/analyzer/src/db/queries.rs
@@ -1,6 +1,5 @@
pub mod contracts;
pub mod enums;
-pub mod events;
pub mod functions;
pub mod impls;
pub mod ingots;
diff --git a/crates/analyzer/src/db/queries/contracts.rs b/crates/analyzer/src/db/queries/contracts.rs
index 7e0fd54b0b..3f1aa8fc5e 100644
--- a/crates/analyzer/src/db/queries/contracts.rs
+++ b/crates/analyzer/src/db/queries/contracts.rs
@@ -1,16 +1,13 @@
use crate::db::{Analysis, AnalyzerDb};
use crate::errors;
use crate::namespace::items::{
- self, ContractFieldId, ContractId, DepGraph, DepGraphWrapper, DepLocality, EventId, FunctionId,
- Item, TypeDef,
+ self, ContractFieldId, ContractId, DepGraph, DepGraphWrapper, DepLocality, FunctionId, Item,
+ TypeDef,
};
use crate::namespace::scopes::ItemScope;
use crate::namespace::types::{self, Type};
use crate::traversal::types::type_desc;
-use crate::{
- context::{AnalyzerContext, NamedThing},
- namespace::types::TypeId,
-};
+use crate::{context::AnalyzerContext, namespace::types::TypeId};
use fe_common::diagnostics::Label;
use fe_parser::ast;
use indexmap::map::{Entry, IndexMap};
@@ -23,16 +20,13 @@ pub fn contract_all_functions(db: &dyn AnalyzerDb, contract: ContractId) -> Rc<[
let module = contract.module(db);
let body = &contract.data(db).ast.kind.body;
body.iter()
- .filter_map(|stmt| match stmt {
- ast::ContractStmt::Event(_) => None,
- ast::ContractStmt::Function(node) => {
- Some(db.intern_function(Rc::new(items::Function::new(
- db,
- node,
- Some(Item::Type(TypeDef::Contract(contract))),
- module,
- ))))
- }
+ .map(|stmt| match stmt {
+ ast::ContractStmt::Function(node) => db.intern_function(Rc::new(items::Function::new(
+ db,
+ node,
+ Some(Item::Type(TypeDef::Contract(contract))),
+ module,
+ ))),
})
.collect()
}
@@ -51,17 +45,6 @@ pub fn contract_function_map(
continue;
}
- if let Some(event) = contract.event(db, def_name) {
- scope.name_conflict_error(
- "function",
- def_name,
- &NamedThing::Item(Item::Event(event)),
- Some(event.name_span(db)),
- def.kind.sig.kind.name.span,
- );
- continue;
- }
-
if let Ok(Some(named_item)) = scope.resolve_name(def_name, func.name_span(db)) {
scope.name_conflict_error(
"function",
@@ -269,54 +252,6 @@ pub fn contract_call_function(
}
}
-/// A `Vec` of all events defined within the contract, including those with
-/// duplicate names.
-pub fn contract_all_events(db: &dyn AnalyzerDb, contract: ContractId) -> Rc<[EventId]> {
- let body = &contract.data(db).ast.kind.body;
- body.iter()
- .filter_map(|stmt| match stmt {
- ast::ContractStmt::Function(_) => None,
- ast::ContractStmt::Event(node) => Some(db.intern_event(Rc::new(items::Event {
- ast: node.clone(),
- module: contract.module(db),
- contract: Some(contract),
- }))),
- })
- .collect()
-}
-
-pub fn contract_event_map(
- db: &dyn AnalyzerDb,
- contract: ContractId,
-) -> Analysis>> {
- let scope = ItemScope::new(db, contract.module(db));
- let mut map = IndexMap::::new();
-
- let contract_name = contract.name(db);
- for event in db.contract_all_events(contract).iter() {
- let node = &event.data(db).ast;
-
- match map.entry(node.name().into()) {
- Entry::Occupied(entry) => {
- scope.duplicate_name_error(
- &format!("duplicate event names in `contract {}`", contract_name,),
- entry.key(),
- entry.get().data(db).ast.span,
- node.span,
- );
- }
- Entry::Vacant(entry) => {
- entry.insert(*event);
- }
- }
- }
-
- Analysis {
- value: Rc::new(map),
- diagnostics: scope.diagnostics.take().into(),
- }
-}
-
/// All field ids, including those with duplicate names
pub fn contract_all_fields(db: &dyn AnalyzerDb, contract: ContractId) -> Rc<[ContractFieldId]> {
contract
diff --git a/crates/analyzer/src/db/queries/events.rs b/crates/analyzer/src/db/queries/events.rs
deleted file mode 100644
index fd7a4548b4..0000000000
--- a/crates/analyzer/src/db/queries/events.rs
+++ /dev/null
@@ -1,115 +0,0 @@
-use crate::constants::MAX_INDEXED_EVENT_FIELDS;
-use crate::context::AnalyzerContext;
-use crate::db::Analysis;
-use crate::errors::TypeError;
-use crate::namespace::items::EventId;
-use crate::namespace::scopes::ItemScope;
-use crate::namespace::types;
-use crate::traversal::types::type_desc;
-use crate::AnalyzerDb;
-use fe_common::diagnostics::Label;
-use fe_common::utils::humanize::pluralize_conditionally;
-use fe_parser::ast;
-use fe_parser::node::Node;
-use std::collections::HashMap;
-use std::rc::Rc;
-
-// Event fields aren't interned for now, but they probably should be. If/when
-// events are handled as normal type definitions, the current setup will run
-// into a salsa cycle if a user tries to define an event that contains itself.
-
-pub fn event_type(db: &dyn AnalyzerDb, event: EventId) -> Analysis> {
- let mut scope = ItemScope::new(db, event.module(db));
-
- let ast::Event {
- name: event_name,
- fields: field_nodes,
- pub_qual: _,
- } = &event.data(db).ast.kind;
-
- let mut names = HashMap::new();
- let mut indexed_count = 0;
- let fields = field_nodes
- .iter()
- .enumerate()
- .filter_map(|(index, field)| {
- let ast::EventField {
- is_idx,
- name,
- typ: typ_node,
- } = &field.kind;
-
- let typ = type_desc(&mut scope, typ_node).and_then(|typ| match typ {
- typ if typ.has_fixed_size(scope.db()) => Ok(typ),
- _ => Err(TypeError::new(scope.error(
- "event field type must have a fixed size",
- typ_node.span,
- "this can't be used as an event field",
- ))),
- });
-
- // If we've already seen the max number of indexed fields,
- // ignore the `idx` qualifier on this one. We'll emit an error below.
- indexed_count += *is_idx as usize;
-
- if let Some(dup_idx) = names.get(&name.kind) {
- let dup_field: &Node = &field_nodes[*dup_idx];
- scope.fancy_error(
- &format!("duplicate field names in `event {}`", &event_name.kind,),
- vec![
- Label::primary(
- dup_field.span,
- format!("`{}` first defined here", name.kind),
- ),
- Label::secondary(field.span, format!("`{}` redefined here", name.kind)),
- ],
- vec![],
- );
- None
- } else {
- names.insert(&name.kind, index);
- Some(types::EventField {
- name: name.kind.clone(),
- typ,
- is_indexed: *is_idx,
- })
- }
- })
- .collect();
-
- if indexed_count > MAX_INDEXED_EVENT_FIELDS {
- let excess_count = indexed_count - MAX_INDEXED_EVENT_FIELDS;
-
- let mut labels = field_nodes
- .iter()
- .filter_map(|field| {
- field
- .kind
- .is_idx
- .then(|| Label::primary(field.span, String::new()))
- })
- .collect::>();
- labels.last_mut().unwrap().message = format!("{} indexed fields", indexed_count);
-
- scope.fancy_error(
- &format!(
- "more than three indexed fields in `event {}`",
- event_name.kind
- ),
- labels,
- vec![format!(
- "Note: Remove the `idx` keyword from at least {} {}.",
- excess_count,
- pluralize_conditionally("field", excess_count)
- )],
- );
- }
-
- Analysis {
- value: Rc::new(types::Event {
- name: event_name.kind.clone(),
- fields,
- }),
- diagnostics: scope.diagnostics.take().into(),
- }
-}
diff --git a/crates/analyzer/src/db/queries/functions.rs b/crates/analyzer/src/db/queries/functions.rs
index 4ba89b6193..86af976b73 100644
--- a/crates/analyzer/src/db/queries/functions.rs
+++ b/crates/analyzer/src/db/queries/functions.rs
@@ -436,11 +436,6 @@ pub fn function_dependency_graph(db: &dyn AnalyzerDb, function: FunctionId) -> D
}
}
- directs.extend(
- body.emits
- .values()
- .map(|event| (root, Item::Event(*event), DepLocality::Local)),
- );
directs.extend(
body.var_types
.values()
diff --git a/crates/analyzer/src/db/queries/module.rs b/crates/analyzer/src/db/queries/module.rs
index 8648864a7d..3e35f45027 100644
--- a/crates/analyzer/src/db/queries/module.rs
+++ b/crates/analyzer/src/db/queries/module.rs
@@ -2,8 +2,8 @@ use crate::context::{Analysis, AnalyzerContext, Constant, NamedThing};
use crate::display::Displayable;
use crate::errors::{self, ConstEvalError, TypeError};
use crate::namespace::items::{
- Contract, ContractId, Enum, Event, Function, Impl, ImplId, Item, ModuleConstant,
- ModuleConstantId, ModuleId, ModuleSource, Struct, StructId, Trait, TraitId, TypeAlias, TypeDef,
+ Contract, ContractId, Enum, Function, Impl, ImplId, Item, ModuleConstant, ModuleConstantId,
+ ModuleId, ModuleSource, Struct, StructId, Trait, TraitId, TypeAlias, TypeDef,
};
use crate::namespace::scopes::ItemScope;
use crate::namespace::types::{self, TypeId};
@@ -101,11 +101,6 @@ pub fn module_all_items(db: &dyn AnalyzerDb, module: ModuleId) -> Rc<[Item]> {
module,
})))),
ast::ModuleStmt::Pragma(_) | ast::ModuleStmt::Use(_) | ast::ModuleStmt::Impl(_) => None,
- ast::ModuleStmt::Event(node) => Some(Item::Event(db.intern_event(Rc::new(Event {
- ast: node.clone(),
- module,
- contract: None,
- })))),
ast::ModuleStmt::ParseError(_) => None,
})
.collect()
diff --git a/crates/analyzer/src/db/queries/structs.rs b/crates/analyzer/src/db/queries/structs.rs
index 2ad679d1ec..f3e7cf8a10 100644
--- a/crates/analyzer/src/db/queries/structs.rs
+++ b/crates/analyzer/src/db/queries/structs.rs
@@ -1,4 +1,5 @@
use crate::builtins;
+use crate::constants::MAX_INDEXED_EVENT_FIELDS;
use crate::context::AnalyzerContext;
use crate::db::Analysis;
use crate::errors::TypeError;
@@ -10,7 +11,8 @@ use crate::namespace::scopes::ItemScope;
use crate::namespace::types::{Type, TypeId};
use crate::traversal::types::type_desc;
use crate::AnalyzerDb;
-use fe_parser::ast;
+use fe_common::utils::humanize::pluralize_conditionally;
+use fe_parser::{ast, Label};
use indexmap::map::{Entry, IndexMap};
use smol_str::SmolStr;
use std::rc::Rc;
@@ -39,10 +41,25 @@ pub fn struct_field_map(
let scope = ItemScope::new(db, struct_.module(db));
let mut fields = IndexMap::::new();
+ let mut indexed_count = 0;
let struct_name = struct_.name(db);
for field in db.struct_all_fields(struct_).iter() {
let node = &field.data(db).ast;
+ if field.is_indexed(db) {
+ indexed_count += 1;
+ }
+
+ // Multiple attributes are currently still rejected by the parser so we only need to check the name here
+ if !field.attributes(db).is_empty() && !field.is_indexed(db) {
+ let span = field.data(db).ast.kind.attributes.first().unwrap().span;
+ scope.error(
+ "Invalid attribute",
+ span,
+ "illegal name. Only `indexed` supported.",
+ );
+ }
+
match fields.entry(node.name().into()) {
Entry::Occupied(entry) => {
scope.duplicate_name_error(
@@ -58,6 +75,33 @@ pub fn struct_field_map(
}
}
+ if indexed_count > MAX_INDEXED_EVENT_FIELDS {
+ let excess_count = indexed_count - MAX_INDEXED_EVENT_FIELDS;
+
+ let mut labels = fields
+ .iter()
+ .filter_map(|(_, field)| {
+ field
+ .is_indexed(db)
+ .then(|| Label::primary(field.span(db), String::new()))
+ })
+ .collect::>();
+ labels.last_mut().unwrap().message = format!("{} indexed fields", indexed_count);
+
+ scope.fancy_error(
+ &format!(
+ "more than three indexed fields in `event {}`",
+ struct_.name(db)
+ ),
+ labels,
+ vec![format!(
+ "Note: Remove the `indexed` attribute from at least {} {}.",
+ excess_count,
+ pluralize_conditionally("field", excess_count)
+ )],
+ );
+ }
+
Analysis::new(Rc::new(fields), scope.diagnostics.take().into())
}
@@ -70,6 +114,7 @@ pub fn struct_field_type(
let mut scope = ItemScope::new(db, field_data.parent.module(db));
let ast::Field {
+ attributes: _,
is_pub: _,
is_const,
name: _,
diff --git a/crates/analyzer/src/db/queries/types.rs b/crates/analyzer/src/db/queries/types.rs
index 486e8f1bb1..96feefa36e 100644
--- a/crates/analyzer/src/db/queries/types.rs
+++ b/crates/analyzer/src/db/queries/types.rs
@@ -20,7 +20,6 @@ pub fn all_impls(db: &dyn AnalyzerDb, ty: TypeId) -> Rc<[ImplId]> {
.iter()
.flat_map(|module_id| module_id.all_impls(db).to_vec())
.collect::>();
-
db.ingot_external_ingots(db.root_ingot())
.values()
.flat_map(|ingot| ingot.all_modules(db).to_vec())
diff --git a/crates/analyzer/src/namespace/items.rs b/crates/analyzer/src/namespace/items.rs
index 406bcf2e95..e280f18e8c 100644
--- a/crates/analyzer/src/namespace/items.rs
+++ b/crates/analyzer/src/namespace/items.rs
@@ -1,3 +1,4 @@
+use crate::constants::{EMITTABLE_TRAIT_NAME, INDEXED};
use crate::context::{self, Analysis, Constant, NamedThing};
use crate::display::{DisplayWithDb, Displayable};
use crate::errors::{self, IncompleteItem, TypeError};
@@ -30,9 +31,6 @@ pub enum Item {
// Any of the items inside TypeDef (struct, alias, etc)
// could be optionally generic.
GenericType(GenericType),
- // Events aren't normal types; they *could* be moved into
- // TypeDef, but it would have consequences.
- Event(EventId),
Trait(TraitId),
Impl(ImplId),
Function(FunctionId),
@@ -50,7 +48,6 @@ impl Item {
Item::Trait(id) => id.name(db),
Item::Impl(id) => id.name(db),
Item::GenericType(id) => id.name(),
- Item::Event(id) => id.name(db),
Item::Function(id) => id.name(db),
Item::BuiltinFunction(id) => id.as_ref().into(),
Item::Intrinsic(id) => id.as_ref().into(),
@@ -65,7 +62,6 @@ impl Item {
Item::Type(id) => id.name_span(db),
Item::Trait(id) => Some(id.name_span(db)),
Item::GenericType(_) => None,
- Item::Event(id) => Some(id.name_span(db)),
Item::Function(id) => Some(id.name_span(db)),
Item::Constant(id) => Some(id.name_span(db)),
Item::BuiltinFunction(_)
@@ -87,7 +83,6 @@ impl Item {
| Self::GenericType(_) => true,
Self::Type(id) => id.is_public(db),
Self::Trait(id) => id.is_public(db),
- Self::Event(id) => id.is_public(db),
Self::Function(id) => id.is_public(db),
Self::Constant(id) => id.is_public(db),
}
@@ -102,7 +97,6 @@ impl Item {
Item::Type(_)
| Item::Trait(_)
| Item::Impl(_)
- | Item::Event(_)
| Item::Function(_)
| Item::Constant(_)
| Item::Ingot(_)
@@ -124,7 +118,6 @@ impl Item {
Item::Type(_) | Item::GenericType(_) => "type",
Item::Trait(_) => "trait",
Item::Impl(_) => "impl",
- Item::Event(_) => "event",
Item::Function(_) | Item::BuiltinFunction(_) => "function",
Item::Intrinsic(_) => "intrinsic function",
Item::Constant(_) => "constant",
@@ -139,7 +132,6 @@ impl Item {
Item::Module(module) => module.items(db),
Item::Type(val) => val.items(db),
Item::GenericType(_)
- | Item::Event(_)
| Item::Trait(_)
| Item::Impl(_)
| Item::Function(_)
@@ -155,7 +147,6 @@ impl Item {
Item::Trait(id) => Some(id.parent(db)),
Item::Impl(id) => Some(id.parent(db)),
Item::GenericType(_) => None,
- Item::Event(id) => Some(id.parent(db)),
Item::Function(id) => Some(id.parent(db)),
Item::Constant(id) => Some(id.parent(db)),
Item::Module(id) => Some(id.parent(db)),
@@ -250,7 +241,6 @@ impl Item {
Item::Type(id) => id.sink_diagnostics(db, sink),
Item::Trait(id) => id.sink_diagnostics(db, sink),
Item::Impl(id) => id.sink_diagnostics(db, sink),
- Item::Event(id) => id.sink_diagnostics(db, sink),
Item::Function(id) => id.sink_diagnostics(db, sink),
Item::GenericType(_) | Item::BuiltinFunction(_) | Item::Intrinsic(_) => {}
Item::Constant(id) => id.sink_diagnostics(db, sink),
@@ -997,7 +987,6 @@ impl ContractId {
.function(db, name)
.filter(|f| !f.takes_self(db))
.map(Item::Function)
- .or_else(|| self.event(db, name).map(Item::Event))
{
Ok(Some(NamedThing::Item(item)))
} else {
@@ -1033,16 +1022,6 @@ impl ContractId {
db.contract_public_function_map(*self)
}
- /// Lookup an event by name.
- pub fn event(&self, db: &dyn AnalyzerDb, name: &str) -> Option {
- self.events(db).get(name).copied()
- }
-
- /// A map of events defined within the contract.
- pub fn events(&self, db: &dyn AnalyzerDb) -> Rc> {
- db.contract_event_map(*self).value
- }
-
pub fn parent(&self, db: &dyn AnalyzerDb) -> Item {
Item::Module(self.data(db).module)
}
@@ -1068,12 +1047,6 @@ impl ContractId {
.iter()
.for_each(|field| field.sink_diagnostics(db, sink));
- // events
- db.contract_event_map(*self).sink_diagnostics(sink);
- db.contract_all_events(*self)
- .iter()
- .for_each(|event| event.sink_diagnostics(db, sink));
-
// functions
db.contract_init_function(*self).sink_diagnostics(sink);
db.contract_call_function(*self).sink_diagnostics(sink);
@@ -1465,6 +1438,20 @@ impl StructFieldId {
pub fn data(&self, db: &dyn AnalyzerDb) -> Rc {
db.lookup_intern_struct_field(*self)
}
+ pub fn attributes(&self, db: &dyn AnalyzerDb) -> Vec {
+ self.data(db)
+ .ast
+ .kind
+ .attributes
+ .iter()
+ .map(|node| node.kind.clone())
+ .collect()
+ }
+
+ pub fn is_indexed(&self, db: &dyn AnalyzerDb) -> bool {
+ self.attributes(db).contains(&INDEXED.into())
+ }
+
pub fn typ(&self, db: &dyn AnalyzerDb) -> Result {
db.struct_field_type(*self).value
}
@@ -1891,6 +1878,11 @@ impl TraitId {
}
pub fn is_implemented_for(&self, db: &dyn AnalyzerDb, ty: TypeId) -> bool {
+ // All structs automagically implement the Emittable trait
+ if self.is_std_trait(db, EMITTABLE_TRAIT_NAME) && ty.is_struct(db) {
+ return true;
+ }
+
ty.get_all_impls(db)
.iter()
.any(|val| &val.trait_id(db) == self)
@@ -1900,6 +1892,10 @@ impl TraitId {
self.module(db).is_in_std(db)
}
+ pub fn is_std_trait(&self, db: &dyn AnalyzerDb, name: &str) -> bool {
+ self.is_in_std(db) && self.name(db).to_lowercase() == name.to_lowercase()
+ }
+
pub fn parent(&self, db: &dyn AnalyzerDb) -> Item {
Item::Module(self.data(db).module)
}
@@ -1932,51 +1928,6 @@ impl TraitId {
}
}
-#[derive(Debug, PartialEq, Eq, Hash, Clone)]
-pub struct Event {
- pub ast: Node,
- pub module: ModuleId,
- pub contract: Option,
-}
-
-#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Copy, Clone)]
-pub struct EventId(pub(crate) u32);
-impl_intern_key!(EventId);
-
-impl EventId {
- pub fn name(&self, db: &dyn AnalyzerDb) -> SmolStr {
- self.data(db).ast.name().into()
- }
- pub fn span(&self, db: &dyn AnalyzerDb) -> Span {
- self.data(db).ast.span
- }
- pub fn name_span(&self, db: &dyn AnalyzerDb) -> Span {
- self.data(db).ast.kind.name.span
- }
- pub fn data(&self, db: &dyn AnalyzerDb) -> Rc {
- db.lookup_intern_event(*self)
- }
- pub fn is_public(&self, db: &dyn AnalyzerDb) -> bool {
- self.data(db).ast.kind.pub_qual.is_some()
- }
- pub fn typ(&self, db: &dyn AnalyzerDb) -> Rc {
- db.event_type(*self).value
- }
- pub fn module(&self, db: &dyn AnalyzerDb) -> ModuleId {
- self.data(db).module
- }
- pub fn parent(&self, db: &dyn AnalyzerDb) -> Item {
- if let Some(contract_id) = self.data(db).contract {
- Item::Type(TypeDef::Contract(contract_id))
- } else {
- Item::Module(self.module(db))
- }
- }
- pub fn sink_diagnostics(&self, db: &dyn AnalyzerDb, sink: &mut impl DiagnosticSink) {
- sink.push_all(db.event_type(*self).diagnostics.iter());
- }
-}
-
pub trait DiagnosticSink {
fn push(&mut self, diag: &Diagnostic);
fn push_all<'a>(&mut self, iter: impl Iterator- ) {
diff --git a/crates/analyzer/src/namespace/scopes.rs b/crates/analyzer/src/namespace/scopes.rs
index 9ac1218cbd..27b90a073e 100644
--- a/crates/analyzer/src/namespace/scopes.rs
+++ b/crates/analyzer/src/namespace/scopes.rs
@@ -4,7 +4,7 @@ use crate::context::{
AnalyzerContext, CallType, Constant, ExpressionAttributes, FunctionBody, NamedThing,
};
use crate::errors::{AlreadyDefined, FatalError, IncompleteItem, TypeError};
-use crate::namespace::items::{EventId, FunctionId, ModuleId};
+use crate::namespace::items::{FunctionId, ModuleId};
use crate::namespace::items::{Item, TypeDef};
use crate::namespace::types::{Type, TypeId};
use crate::pattern_analysis::PatternMatrix;
@@ -197,21 +197,6 @@ impl<'a> FunctionScope<'a> {
self.function.signature(self.db).return_type.clone()
}
- /// Attribute contextual information to an emit statement node.
- ///
- /// # Panics
- ///
- /// Panics if an entry already exists for the node id.
- pub fn add_emit(&self, node: &Node
, event: EventId) {
- debug_assert!(matches!(node.kind, ast::FuncStmt::Emit { .. }));
- self.add_node(node);
- self.body
- .borrow_mut()
- .emits
- .insert(node.id, event)
- .expect_none("emit statement attributes already exist");
- }
-
pub fn map_variable_type(&self, node: &Node, typ: TypeId) {
self.add_node(node);
self.body
diff --git a/crates/analyzer/src/namespace/types.rs b/crates/analyzer/src/namespace/types.rs
index 5e855fb1c7..a257518377 100644
--- a/crates/analyzer/src/namespace/types.rs
+++ b/crates/analyzer/src/namespace/types.rs
@@ -99,6 +99,9 @@ impl TypeId {
pub fn is_string(&self, db: &dyn AnalyzerDb) -> bool {
self.typ(db).as_string().is_some()
}
+ pub fn is_struct(&self, db: &dyn AnalyzerDb) -> bool {
+ matches!(self.typ(db), Type::Struct(_))
+ }
pub fn as_struct(&self, db: &dyn AnalyzerDb) -> Option {
self.typ(db).as_struct()
}
@@ -450,19 +453,6 @@ impl Integer {
}
}
-#[derive(Clone, Debug, PartialEq, Eq, Hash)]
-pub struct Event {
- pub name: SmolStr,
- pub fields: Vec,
-}
-
-#[derive(Clone, Debug, PartialEq, Eq, Hash)]
-pub struct EventField {
- pub name: SmolStr,
- pub typ: Result,
- pub is_indexed: bool,
-}
-
impl Type {
pub fn id(&self, db: &dyn AnalyzerDb) -> TypeId {
db.intern_type(self.clone())
diff --git a/crates/analyzer/src/traversal/call_args.rs b/crates/analyzer/src/traversal/call_args.rs
index 93f719e7b9..4c65ce58ed 100644
--- a/crates/analyzer/src/traversal/call_args.rs
+++ b/crates/analyzer/src/traversal/call_args.rs
@@ -1,7 +1,7 @@
use crate::context::{AnalyzerContext, DiagnosticVoucher};
use crate::display::Displayable;
use crate::errors::{FatalError, TypeError};
-use crate::namespace::types::{EventField, FunctionParam, Generic, Type, TypeId};
+use crate::namespace::types::{FunctionParam, Generic, Type, TypeId};
use crate::traversal::expressions::assignable_expr;
use fe_common::{diagnostics::Label, utils::humanize::pluralize_conditionally};
use fe_common::{Span, Spanned};
@@ -23,15 +23,6 @@ impl LabeledParameter for FunctionParam {
}
}
-impl LabeledParameter for EventField {
- fn label(&self) -> Option<&str> {
- Some(&self.name)
- }
- fn typ(&self) -> Result {
- self.typ.clone()
- }
-}
-
impl LabeledParameter for (SmolStr, Result) {
fn label(&self) -> Option<&str> {
Some(&self.0)
diff --git a/crates/analyzer/src/traversal/expressions.rs b/crates/analyzer/src/traversal/expressions.rs
index 2c9715046d..df7024418b 100644
--- a/crates/analyzer/src/traversal/expressions.rs
+++ b/crates/analyzer/src/traversal/expressions.rs
@@ -1044,20 +1044,6 @@ fn expr_call_named_thing(
id.typ(context.db())?.display(context.db()),
),
))),
- NamedThing::Item(Item::Event(_)) => Err(FatalError::new(context.fancy_error(
- &format!("`{}` is not callable", func.kind),
- vec![Label::primary(
- func.span,
- &format!(
- "`{}` is an event, and can't be constructed in this context",
- func.kind
- ),
- )],
- vec![format!(
- "Hint: to emit an event, use `emit {}(..)`",
- func.kind
- )],
- ))),
NamedThing::Item(Item::Trait(_)) => Err(FatalError::new(context.error(
&format!("`{}` is not callable", func.kind),
func.span,
diff --git a/crates/analyzer/src/traversal/functions.rs b/crates/analyzer/src/traversal/functions.rs
index 9663aad94e..a43b624612 100644
--- a/crates/analyzer/src/traversal/functions.rs
+++ b/crates/analyzer/src/traversal/functions.rs
@@ -1,10 +1,10 @@
use crate::context::{AnalyzerContext, ExpressionAttributes, Location, NamedThing};
use crate::display::Displayable;
-use crate::namespace::items::{EnumVariantId, Item};
+use crate::namespace::items::EnumVariantId;
use crate::namespace::scopes::{BlockScope, BlockScopeType};
-use crate::namespace::types::{EventField, Type, TypeId};
+use crate::namespace::types::{Type, TypeId};
use crate::pattern_analysis::PatternMatrix;
-use crate::traversal::{assignments, call_args, declarations, expressions};
+use crate::traversal::{assignments, declarations, expressions};
use crate::{
errors::{self, FatalError},
namespace::items::EnumVariantKind,
@@ -35,7 +35,6 @@ fn func_stmt(scope: &mut BlockScope, stmt: &Node) -> Result<(), Fa
VarDecl { .. } => declarations::var_decl(scope, stmt),
ConstantDecl { .. } => declarations::const_decl(scope, stmt),
Assign { .. } => assignments::assign(scope, stmt),
- Emit { .. } => emit(scope, stmt),
AugAssign { .. } => assignments::aug_assign(scope, stmt),
For { .. } => for_loop(scope, stmt),
While { .. } => while_loop(scope, stmt),
@@ -552,97 +551,6 @@ fn while_loop(scope: &mut BlockScope, stmt: &Node) -> Result<(), F
}
}
-fn emit(scope: &mut BlockScope, stmt: &Node) -> Result<(), FatalError> {
- if let fe::FuncStmt::Emit { name, args } = &stmt.kind {
- match scope.resolve_name(&name.kind, name.span)? {
- None => {
- scope.error(
- &format!("undefined event: `{}`", name.kind),
- name.span,
- "undefined event",
- );
- }
- Some(NamedThing::Item(Item::Event(event))) => {
- scope.root.add_emit(stmt, event);
-
- // Check visibility of event.
- if !event.is_public(scope.db()) && event.module(scope.db()) != scope.module() {
- let module_name = event.module(scope.db()).name(scope.db());
- scope.fancy_error(
- &format!(
- "the event `{}` is private",
- name.kind,
- ),
- vec![
- Label::primary(name.span, "this event is not `pub`"),
- Label::secondary(
- event.data(scope.db()).ast.span,
- format!("`{}` is defined here", name.kind)
- ),
- ],
- vec![
- format!("`{}` can only be used within `{}`", name.kind, module_name),
- format!("Hint: use `pub event {event}` to make `{event}` visible from outside of `{module}`", event=name.kind, module=module_name),
- ],
- );
- }
-
- if let Some(context_type) = scope.get_context_type() {
- // we add ctx to the list of expected params
- let params_with_ctx = [
- vec![EventField {
- name: "ctx".into(),
- typ: Ok(context_type),
- is_indexed: false,
- }],
- event.typ(scope.db()).fields.clone(),
- ]
- .concat();
- call_args::validate_named_args(
- scope,
- &name.kind,
- name.span,
- args,
- ¶ms_with_ctx,
- )?;
- } else {
- scope.fancy_error(
- "`Context` is not defined",
- vec![
- Label::primary(
- stmt.span,
- "`ctx` must be defined and passed into the event",
- ),
- Label::secondary(
- scope.parent_function().name_span(scope.db()),
- "Note: declare `ctx` in this function signature",
- ),
- Label::secondary(
- scope.parent_function().name_span(scope.db()),
- "Example: `pub fn foo(ctx: Context, ...)`",
- ),
- ],
- vec!["Example: emit MyEvent(ctx, ...)".into()],
- );
- }
- }
- Some(named_thing) => {
- scope.error(
- "`emit` expects an event",
- name.span,
- &format!(
- "`{}` is a {} name; expected an event",
- &name.kind,
- named_thing.item_kind_display_name(),
- ),
- );
- }
- }
- return Ok(());
- }
- unreachable!()
-}
-
fn assert(scope: &mut BlockScope, stmt: &Node) -> Result<(), FatalError> {
if let fe::FuncStmt::Assert { test, msg } = &stmt.kind {
let test_type = expressions::value_expr(scope, test, None)?.typ;
diff --git a/crates/analyzer/tests/analysis.rs b/crates/analyzer/tests/analysis.rs
index ecb8bbb517..10b28d9b9b 100644
--- a/crates/analyzer/tests/analysis.rs
+++ b/crates/analyzer/tests/analysis.rs
@@ -1,6 +1,5 @@
use fe_analyzer::display::Displayable;
use fe_analyzer::namespace::items::{self, IngotId, IngotMode, Item, ModuleId, TypeDef};
-use fe_analyzer::namespace::types::TypeId;
use fe_analyzer::{AnalyzerDb, TestDb};
use fe_common::diagnostics::{diagnostics_string, print_diagnostics, Diagnostic, Label, Severity};
use fe_common::files::{FileKind, Utf8Path};
@@ -351,11 +350,6 @@ fn build_snapshot(db: &dyn AnalyzerDb, module: items::ModuleId) -> String {
.map(|field| (field.data(db).ast.span, field.typ(db).unwrap()))
.collect::>(),
),
- contract
- .events(db)
- .values()
- .flat_map(|id| event_diagnostics(*id, db))
- .collect(),
contract
.functions(db)
.values()
@@ -382,7 +376,6 @@ fn build_snapshot(db: &dyn AnalyzerDb, module: items::ModuleId) -> String {
id.span(db),
&id.typ(db).unwrap().display(db),
)],
- Item::Event(id) => event_diagnostics(*id, db),
// Built-in stuff
Item::Type(TypeDef::Primitive(_))
| Item::GenericType(_)
@@ -461,10 +454,6 @@ fn function_diagnostics(fun: items::FunctionId, db: &dyn AnalyzerDb) -> Vec Vec Vec {
- // Event field spans are a bit of a hassle right now
- label_in_non_overlapping_groups(
- db,
- &event
- .data(db)
- .ast
- .kind
- .fields
- .iter()
- .map(|node| node.span)
- .zip(
- event
- .typ(db)
- .fields
- .iter()
- .map(|field| field.typ.clone().unwrap()),
- )
- .collect::>(),
- )
-}
-
fn lookup_spans(
node_attrs: &IndexMap,
spans: &HashMap,
diff --git a/crates/analyzer/tests/errors.rs b/crates/analyzer/tests/errors.rs
index 781754373d..2c460a0f7f 100644
--- a/crates/analyzer/tests/errors.rs
+++ b/crates/analyzer/tests/errors.rs
@@ -131,9 +131,6 @@ test_stmt! { call_balance_with_arg, "unsafe { std::evm::balance(address(0)) }" }
test_stmt! { clone_arg_count, "let x: Array = [5, 6]\nlet y: Array = x.clone(y)" }
test_stmt! { continue_without_loop, "continue" }
test_stmt! { continue_without_loop_2, "if true { continue }" }
-test_stmt! { emit_undefined_event, "emit MyEvent()" }
-test_stmt! { emit_type_name, "emit u8()" }
-test_stmt! { emit_variable, "let x: u8 = 10\nemit x()" }
test_stmt! { int_type_generic_arg_list, "let x: u256<>" }
test_stmt! { int_type_generic_arg, "let x: u256<10>" }
test_stmt! { int_type_constructor_generic_arg_list, "u256<>(10)" }
@@ -227,7 +224,6 @@ test_file! { call_generic_function_with_unsatisfied_bound}
test_file! { call_builtin_object }
test_file! { call_create_with_wrong_type }
test_file! { call_create2_with_wrong_type }
-test_file! { call_event_with_wrong_types }
test_file! { call_static_function_without_double_colon }
test_file! { call_undefined_function_on_external_contract }
test_file! { call_undefined_function_on_memory_struct }
@@ -245,7 +241,6 @@ test_file! { const_generics_param }
test_file! { const_local }
test_file! { duplicate_arg_in_contract_method }
test_file! { duplicate_contract_in_module }
-test_file! { duplicate_event_in_contract }
test_file! { duplicate_field_in_contract }
test_file! { duplicate_field_in_struct }
test_file! { duplicate_method_in_contract }
@@ -255,9 +250,9 @@ test_file! { duplicate_var_in_child_scope }
test_file! { duplicate_var_in_contract_method }
test_file! { duplicate_var_in_for_loop }
test_file! { duplicate_generic_params }
-test_file! { emit_bad_args }
test_file! { external_call_type_error }
test_file! { external_call_wrong_number_of_params }
+test_file! { emittable_not_implementable }
test_file! { contract_function_with_generic_params }
test_file! { indexed_event }
test_file! { invalid_compiler_version }
@@ -269,6 +264,7 @@ test_file! { invalid_impl_type }
test_file! { invalid_impl_location }
test_file! { invalid_msg_field }
test_file! { invalid_string_field }
+test_file! { invalid_struct_attribute }
test_file! { invalid_struct_field }
test_file! { invalid_tuple_field }
test_file! { invalid_tx_field }
@@ -348,11 +344,9 @@ test_file! { ctx_undeclared }
test_file! { ctx_missing_internal_call }
test_file! { ctx_missing_create }
test_file! { ctx_missing_load }
-test_file! { ctx_missing_event }
test_file! { ctx_builtins_param_incorrect_type }
test_file! { ctx_undefined_create }
test_file! { ctx_undefined_create2 }
-test_file! { ctx_undefined_event }
test_file! { uninit_values }
test_file! { invalid_repeat_length }
test_file! { invalid_struct_pub_qualifier }
diff --git a/crates/analyzer/tests/snapshots/analysis__abi_encoding_stress.snap b/crates/analyzer/tests/snapshots/analysis__abi_encoding_stress.snap
index 52f35296b6..af992074e4 100644
--- a/crates/analyzer/tests/snapshots/analysis__abi_encoding_stress.snap
+++ b/crates/analyzer/tests/snapshots/analysis__abi_encoding_stress.snap
@@ -18,35 +18,35 @@ note:
note:
┌─ abi_encoding_stress.fe:9:5
│
- 9 │ my_addrs: Array
+ 9 │ pub my_addrs: Array
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Array
+10 │ pub my_u128: u128
+ │ ^^^^^^^^^^^^^^^^^ u128
+11 │ pub my_string: String<10>
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^ String<10>
+12 │ pub my_u16s: Array
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Array
+13 │ pub my_bool: bool
+ │ ^^^^^^^^^^^^^^^^^ bool
+14 │ pub my_bytes: Array
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Array
+
+note:
+ ┌─ abi_encoding_stress.fe:18:5
+ │
+18 │ my_addrs: Array
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Array
-10 │ my_u128: u128
+19 │ my_u128: u128
│ ^^^^^^^^^^^^^ u128
-11 │ my_string: String<10>
+20 │ my_string: String<10>
│ ^^^^^^^^^^^^^^^^^^^^^ String<10>
-12 │ my_u16s: Array
+21 │ my_u16s: Array
│ ^^^^^^^^^^^^^^^^^^^^^^^^ Array
-13 │ my_bool: bool
+22 │ my_bool: bool
│ ^^^^^^^^^^^^^ bool
-14 │ my_bytes: Array
+23 │ my_bytes: Array
│ ^^^^^^^^^^^^^^^^^^^^^^^^ Array
-note:
- ┌─ abi_encoding_stress.fe:17:9
- │
-17 │ my_addrs: Array
- │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Array
-18 │ my_u128: u128
- │ ^^^^^^^^^^^^^ u128
-19 │ my_string: String<10>
- │ ^^^^^^^^^^^^^^^^^^^^^ String<10>
-20 │ my_u16s: Array
- │ ^^^^^^^^^^^^^^^^^^^^^^^^ Array
-21 │ my_bool: bool
- │ ^^^^^^^^^^^^^ bool
-22 │ my_bytes: Array
- │ ^^^^^^^^^^^^^^^^^^^^^^^^ Array
-
note:
┌─ abi_encoding_stress.fe:25:5
│
@@ -434,86 +434,98 @@ note:
┌─ abi_encoding_stress.fe:85:5
│
85 │ ╭ pub fn emit_my_event(self, ctx: Context) {
-86 │ │ emit MyEvent(ctx, my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem())
+86 │ │ ctx.emit(MyEvent(my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem()))
87 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }] -> ()
note:
- ┌─ abi_encoding_stress.fe:86:22
+ ┌─ abi_encoding_stress.fe:86:9
+ │
+86 │ ctx.emit(MyEvent(my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem()))
+ │ ^^^ ^^^^ Foo: Value
+ │ │
+ │ Context: Memory
+
+note:
+ ┌─ abi_encoding_stress.fe:86:36
+ │
+86 │ ctx.emit(MyEvent(my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem()))
+ │ ^^^^^^^^^^^^^ Array: Storage { nonce: Some(0) }
+
+note:
+ ┌─ abi_encoding_stress.fe:86:36
│
-86 │ emit MyEvent(ctx, my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem())
- │ ^^^ ^^^^ Foo: Value
- │ │
- │ Context: Memory
+86 │ ctx.emit(MyEvent(my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem()))
+ │ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^ Foo: Value
+ │ │
+ │ Array: Storage { nonce: Some(0) } => Memory
note:
- ┌─ abi_encoding_stress.fe:86:37
+ ┌─ abi_encoding_stress.fe:86:69
│
-86 │ emit MyEvent(ctx, my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem())
- │ ^^^^^^^^^^^^^ Array: Storage { nonce: Some(0) }
+86 │ ctx.emit(MyEvent(my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem()))
+ │ ^^^^^^^^^^^^ ^^^^ Foo: Value
+ │ │
+ │ u128: Storage { nonce: Some(1) } => Value
note:
- ┌─ abi_encoding_stress.fe:86:37
+ ┌─ abi_encoding_stress.fe:86:94
│
-86 │ emit MyEvent(ctx, my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem())
- │ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^ Foo: Value
- │ │
- │ Array: Storage { nonce: Some(0) } => Memory
+86 │ ctx.emit(MyEvent(my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem()))
+ │ ^^^^^^^^^^^^^^ String<10>: Storage { nonce: Some(2) }
note:
- ┌─ abi_encoding_stress.fe:86:70
+ ┌─ abi_encoding_stress.fe:86:94
│
-86 │ emit MyEvent(ctx, my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem())
- │ ^^^^^^^^^^^^ ^^^^ Foo: Value
- │ │
- │ u128: Storage { nonce: Some(1) } => Value
+86 │ ctx.emit(MyEvent(my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem()))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ Foo: Value
+ │ │
+ │ String<10>: Storage { nonce: Some(2) } => Memory
note:
- ┌─ abi_encoding_stress.fe:86:95
+ ┌─ abi_encoding_stress.fe:86:128
│
-86 │ emit MyEvent(ctx, my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem())
- │ ^^^^^^^^^^^^^^ String<10>: Storage { nonce: Some(2) }
+86 │ ctx.emit(MyEvent(my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem()))
+ │ ^^^^^^^^^^^^ Array: Storage { nonce: Some(3) }
note:
- ┌─ abi_encoding_stress.fe:86:95
+ ┌─ abi_encoding_stress.fe:86:128
│
-86 │ emit MyEvent(ctx, my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem())
- │ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ Foo: Value
- │ │
- │ String<10>: Storage { nonce: Some(2) } => Memory
+86 │ ctx.emit(MyEvent(my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem()))
+ │ ^^^^^^^^^^^^^^^^^^^^^ ^^^^ Foo: Value
+ │ │
+ │ Array: Storage { nonce: Some(3) } => Memory
note:
- ┌─ abi_encoding_stress.fe:86:129
+ ┌─ abi_encoding_stress.fe:86:160
│
-86 │ emit MyEvent(ctx, my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem())
- │ ^^^^^^^^^^^^ Array: Storage { nonce: Some(3) }
+86 │ ctx.emit(MyEvent(my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem()))
+ │ ^^^^^^^^^^^^ ^^^^ Foo: Value
+ │ │
+ │ bool: Storage { nonce: Some(4) } => Value
note:
- ┌─ abi_encoding_stress.fe:86:129
+ ┌─ abi_encoding_stress.fe:86:184
│
-86 │ emit MyEvent(ctx, my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem())
- │ ^^^^^^^^^^^^^^^^^^^^^ ^^^^ Foo: Value
- │ │
- │ Array: Storage { nonce: Some(3) } => Memory
+86 │ ctx.emit(MyEvent(my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem()))
+ │ ^^^^^^^^^^^^^ Array: Storage { nonce: Some(5) }
note:
- ┌─ abi_encoding_stress.fe:86:161
+ ┌─ abi_encoding_stress.fe:86:184
│
-86 │ emit MyEvent(ctx, my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem())
- │ ^^^^^^^^^^^^ ^^^^ Foo: Value
- │ │
- │ bool: Storage { nonce: Some(4) } => Value
+86 │ ctx.emit(MyEvent(my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem()))
+ │ ^^^^^^^^^^^^^^^^^^^^^^ Array: Storage { nonce: Some(5) } => Memory
note:
- ┌─ abi_encoding_stress.fe:86:185
+ ┌─ abi_encoding_stress.fe:86:18
│
-86 │ emit MyEvent(ctx, my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem())
- │ ^^^^^^^^^^^^^ Array: Storage { nonce: Some(5) }
+86 │ ctx.emit(MyEvent(my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem()))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ MyEvent: Memory
note:
- ┌─ abi_encoding_stress.fe:86:185
+ ┌─ abi_encoding_stress.fe:86:9
│
-86 │ emit MyEvent(ctx, my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem())
- │ ^^^^^^^^^^^^^^^^^^^^^^ Array: Storage { nonce: Some(5) } => Memory
+86 │ ctx.emit(MyEvent(my_addrs: self.my_addrs.to_mem(), my_u128: self.my_u128, my_string: self.my_string.to_mem(), my_u16s: self.my_u16s.to_mem(), my_bool: self.my_bool, my_bytes: self.my_bytes.to_mem()))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
diff --git a/crates/analyzer/tests/snapshots/analysis__data_copying_stress.snap b/crates/analyzer/tests/snapshots/analysis__data_copying_stress.snap
index 690799b08a..0dbef5e33f 100644
--- a/crates/analyzer/tests/snapshots/analysis__data_copying_stress.snap
+++ b/crates/analyzer/tests/snapshots/analysis__data_copying_stress.snap
@@ -6,26 +6,26 @@ expression: "build_snapshot(&db, module)"
note:
┌─ data_copying_stress.fe:2:5
│
-2 │ my_string: String<42>
- │ ^^^^^^^^^^^^^^^^^^^^^ String<42>
-3 │ my_other_string: String<42>
- │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ String<42>
-4 │ my_u256: u256
- │ ^^^^^^^^^^^^^ u256
-5 │ my_other_u256: u256
- │ ^^^^^^^^^^^^^^^^^^^ u256
-6 │ my_nums: Array
- │ ^^^^^^^^^^^^^^^^^^^^^^^ Array
-7 │ my_addrs: Array
- │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Array
+2 │ pub my_string: String<42>
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^ String<42>
+3 │ pub my_u256: u256
+ │ ^^^^^^^^^^^^^^^^^ u256
note:
- ┌─ data_copying_stress.fe:10:9
+ ┌─ data_copying_stress.fe:7:5
│
-10 │ my_string: String<42>
- │ ^^^^^^^^^^^^^^^^^^^^^ String<42>
-11 │ my_u256: u256
- │ ^^^^^^^^^^^^^ u256
+ 7 │ my_string: String<42>
+ │ ^^^^^^^^^^^^^^^^^^^^^ String<42>
+ 8 │ my_other_string: String<42>
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ String<42>
+ 9 │ my_u256: u256
+ │ ^^^^^^^^^^^^^ u256
+10 │ my_other_u256: u256
+ │ ^^^^^^^^^^^^^^^^^^^ u256
+11 │ my_nums: Array
+ │ ^^^^^^^^^^^^^^^^^^^^^^^ Array
+12 │ my_addrs: Array
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Array
note:
┌─ data_copying_stress.fe:14:5
@@ -571,18 +571,30 @@ note:
┌─ data_copying_stress.fe:69:5
│
69 │ ╭ fn emit_my_event_internal(ctx: Context, _ my_string: String<42>, _ my_u256: u256) {
-70 │ │ emit MyEvent(ctx, my_string, my_u256)
+70 │ │ ctx.emit(MyEvent(my_string, my_u256))
71 │ │ }
│ ╰─────^ self: None, params: [{ label: None, name: ctx, typ: Context }, { label: Some("_"), name: my_string, typ: String<42> }, { label: Some("_"), name: my_u256, typ: u256 }] -> ()
note:
- ┌─ data_copying_stress.fe:70:22
+ ┌─ data_copying_stress.fe:70:9
│
-70 │ emit MyEvent(ctx, my_string, my_u256)
- │ ^^^ ^^^^^^^^^ ^^^^^^^ u256: Value
- │ │ │
- │ │ String<42>: Memory
- │ Context: Memory
+70 │ ctx.emit(MyEvent(my_string, my_u256))
+ │ ^^^ ^^^^^^^^^ ^^^^^^^ u256: Value
+ │ │ │
+ │ │ String<42>: Memory
+ │ Context: Memory
+
+note:
+ ┌─ data_copying_stress.fe:70:18
+ │
+70 │ ctx.emit(MyEvent(my_string, my_u256))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ MyEvent: Memory
+
+note:
+ ┌─ data_copying_stress.fe:70:9
+ │
+70 │ ctx.emit(MyEvent(my_string, my_u256))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
note:
┌─ data_copying_stress.fe:73:5
diff --git a/crates/analyzer/tests/snapshots/analysis__erc20_token.snap b/crates/analyzer/tests/snapshots/analysis__erc20_token.snap
index 1085f02449..0ff8be2368 100644
--- a/crates/analyzer/tests/snapshots/analysis__erc20_token.snap
+++ b/crates/analyzer/tests/snapshots/analysis__erc20_token.snap
@@ -4,320 +4,322 @@ expression: "build_snapshot(&db, module)"
---
note:
- ┌─ erc20_token.fe:2:5
+ ┌─ erc20_token.fe:3:5
│
-2 │ _balances: Map
- │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Map
-3 │ _allowances: Map>
- │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Map>
-4 │ _total_supply: u256
- │ ^^^^^^^^^^^^^^^^^^^ u256
-5 │ _name: String<100>
- │ ^^^^^^^^^^^^^^^^^^ String<100>
-6 │ _symbol: String<100>
- │ ^^^^^^^^^^^^^^^^^^^^ String<100>
-7 │ _decimals: u8
- │ ^^^^^^^^^^^^^ u8
+3 │ pub owner: address
+ │ ^^^^^^^^^^^^^^^^^^ address
+4 │ #indexed
+5 │ pub spender: address
+ │ ^^^^^^^^^^^^^^^^^^^^ address
+6 │ pub value: u256
+ │ ^^^^^^^^^^^^^^^ u256
+
+note:
+ ┌─ erc20_token.fe:11:5
+ │
+11 │ pub from: address
+ │ ^^^^^^^^^^^^^^^^^ address
+12 │ #indexed
+13 │ pub to: address
+ │ ^^^^^^^^^^^^^^^ address
+14 │ pub value: u256
+ │ ^^^^^^^^^^^^^^^ u256
+
+note:
+ ┌─ erc20_token.fe:18:5
+ │
+18 │ _balances: Map
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Map
+19 │ _allowances: Map>
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Map>
+20 │ _total_supply: u256
+ │ ^^^^^^^^^^^^^^^^^^^ u256
+21 │ _name: String<100>
+ │ ^^^^^^^^^^^^^^^^^^ String<100>
+22 │ _symbol: String<100>
+ │ ^^^^^^^^^^^^^^^^^^^^ String<100>
+23 │ _decimals: u8
+ │ ^^^^^^^^^^^^^ u8
note:
- ┌─ erc20_token.fe:10:9
- │
-10 │ idx owner: address
- │ ^^^^^^^^^^^^^^^^^^ address
-11 │ idx spender: address
- │ ^^^^^^^^^^^^^^^^^^^^ address
-12 │ value: u256
- │ ^^^^^^^^^^^ u256
-
-note:
- ┌─ erc20_token.fe:16:9
- │
-16 │ idx from: address
- │ ^^^^^^^^^^^^^^^^^ address
-17 │ idx to: address
- │ ^^^^^^^^^^^^^^^ address
-18 │ value: u256
- │ ^^^^^^^^^^^ u256
-
-note:
- ┌─ erc20_token.fe:28:5
+ ┌─ erc20_token.fe:32:5
│
-28 │ ╭ pub fn name(self) -> String<100> {
-29 │ │ return self._name.to_mem()
-30 │ │ }
+32 │ ╭ pub fn name(self) -> String<100> {
+33 │ │ return self._name.to_mem()
+34 │ │ }
│ ╰─────^ self: Some(Mutable), params: [] -> String<100>
note:
- ┌─ erc20_token.fe:29:16
+ ┌─ erc20_token.fe:33:16
│
-29 │ return self._name.to_mem()
+33 │ return self._name.to_mem()
│ ^^^^ ERC20: Value
note:
- ┌─ erc20_token.fe:29:16
+ ┌─ erc20_token.fe:33:16
│
-29 │ return self._name.to_mem()
+33 │ return self._name.to_mem()
│ ^^^^^^^^^^ String<100>: Storage { nonce: Some(3) }
note:
- ┌─ erc20_token.fe:29:16
+ ┌─ erc20_token.fe:33:16
│
-29 │ return self._name.to_mem()
+33 │ return self._name.to_mem()
│ ^^^^^^^^^^^^^^^^^^^ String<100>: Storage { nonce: Some(3) } => Memory
note:
- ┌─ erc20_token.fe:32:5
+ ┌─ erc20_token.fe:36:5
│
-32 │ ╭ pub fn symbol(self) -> String<100> {
-33 │ │ return self._symbol.to_mem()
-34 │ │ }
+36 │ ╭ pub fn symbol(self) -> String<100> {
+37 │ │ return self._symbol.to_mem()
+38 │ │ }
│ ╰─────^ self: Some(Mutable), params: [] -> String<100>
note:
- ┌─ erc20_token.fe:33:16
+ ┌─ erc20_token.fe:37:16
│
-33 │ return self._symbol.to_mem()
+37 │ return self._symbol.to_mem()
│ ^^^^ ERC20: Value
note:
- ┌─ erc20_token.fe:33:16
+ ┌─ erc20_token.fe:37:16
│
-33 │ return self._symbol.to_mem()
+37 │ return self._symbol.to_mem()
│ ^^^^^^^^^^^^ String<100>: Storage { nonce: Some(4) }
note:
- ┌─ erc20_token.fe:33:16
+ ┌─ erc20_token.fe:37:16
│
-33 │ return self._symbol.to_mem()
+37 │ return self._symbol.to_mem()
│ ^^^^^^^^^^^^^^^^^^^^^ String<100>: Storage { nonce: Some(4) } => Memory
note:
- ┌─ erc20_token.fe:36:5
+ ┌─ erc20_token.fe:40:5
│
-36 │ ╭ pub fn decimals(self) -> u8 {
-37 │ │ return self._decimals
-38 │ │ }
+40 │ ╭ pub fn decimals(self) -> u8 {
+41 │ │ return self._decimals
+42 │ │ }
│ ╰─────^ self: Some(Mutable), params: [] -> u8
note:
- ┌─ erc20_token.fe:37:16
+ ┌─ erc20_token.fe:41:16
│
-37 │ return self._decimals
+41 │ return self._decimals
│ ^^^^ ERC20: Value
note:
- ┌─ erc20_token.fe:37:16
+ ┌─ erc20_token.fe:41:16
│
-37 │ return self._decimals
+41 │ return self._decimals
│ ^^^^^^^^^^^^^^ u8: Storage { nonce: Some(5) } => Value
note:
- ┌─ erc20_token.fe:40:5
+ ┌─ erc20_token.fe:44:5
│
-40 │ ╭ pub fn totalSupply(self) -> u256 {
-41 │ │ return self._total_supply
-42 │ │ }
+44 │ ╭ pub fn totalSupply(self) -> u256 {
+45 │ │ return self._total_supply
+46 │ │ }
│ ╰─────^ self: Some(Mutable), params: [] -> u256
note:
- ┌─ erc20_token.fe:41:16
+ ┌─ erc20_token.fe:45:16
│
-41 │ return self._total_supply
+45 │ return self._total_supply
│ ^^^^ ERC20: Value
note:
- ┌─ erc20_token.fe:41:16
+ ┌─ erc20_token.fe:45:16
│
-41 │ return self._total_supply
+45 │ return self._total_supply
│ ^^^^^^^^^^^^^^^^^^ u256: Storage { nonce: Some(2) } => Value
note:
- ┌─ erc20_token.fe:44:5
+ ┌─ erc20_token.fe:48:5
│
-44 │ ╭ pub fn balanceOf(self, _ account: address) -> u256 {
-45 │ │ return self._balances[account]
-46 │ │ }
+48 │ ╭ pub fn balanceOf(self, _ account: address) -> u256 {
+49 │ │ return self._balances[account]
+50 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: Some("_"), name: account, typ: address }] -> u256
note:
- ┌─ erc20_token.fe:45:16
+ ┌─ erc20_token.fe:49:16
│
-45 │ return self._balances[account]
+49 │ return self._balances[account]
│ ^^^^ ERC20: Value
note:
- ┌─ erc20_token.fe:45:16
+ ┌─ erc20_token.fe:49:16
│
-45 │ return self._balances[account]
+49 │ return self._balances[account]
│ ^^^^^^^^^^^^^^ ^^^^^^^ address: Value
│ │
│ Map: Storage { nonce: Some(0) }
note:
- ┌─ erc20_token.fe:45:16
+ ┌─ erc20_token.fe:49:16
│
-45 │ return self._balances[account]
+49 │ return self._balances[account]
│ ^^^^^^^^^^^^^^^^^^^^^^^ u256: Storage { nonce: None } => Value
note:
- ┌─ erc20_token.fe:48:5
+ ┌─ erc20_token.fe:52:5
│
-48 │ ╭ pub fn transfer(self, ctx: Context, recipient: address, value: u256) -> bool {
-49 │ │ self._transfer(ctx, sender: ctx.msg_sender(), recipient, value)
-50 │ │ return true
-51 │ │ }
+52 │ ╭ pub fn transfer(self, ctx: Context, recipient: address, value: u256) -> bool {
+53 │ │ self._transfer(ctx, sender: ctx.msg_sender(), recipient, value)
+54 │ │ return true
+55 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: recipient, typ: address }, { label: None, name: value, typ: u256 }] -> bool
note:
- ┌─ erc20_token.fe:49:9
+ ┌─ erc20_token.fe:53:9
│
-49 │ self._transfer(ctx, sender: ctx.msg_sender(), recipient, value)
+53 │ self._transfer(ctx, sender: ctx.msg_sender(), recipient, value)
│ ^^^^ ^^^ ^^^ Context: Memory
│ │ │
│ │ Context: Memory
│ ERC20: Value
note:
- ┌─ erc20_token.fe:49:37
+ ┌─ erc20_token.fe:53:37
│
-49 │ self._transfer(ctx, sender: ctx.msg_sender(), recipient, value)
+53 │ self._transfer(ctx, sender: ctx.msg_sender(), recipient, value)
│ ^^^^^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^ u256: Value
│ │ │
│ │ address: Value
│ address: Value
note:
- ┌─ erc20_token.fe:49:9
+ ┌─ erc20_token.fe:53:9
│
-49 │ self._transfer(ctx, sender: ctx.msg_sender(), recipient, value)
+53 │ self._transfer(ctx, sender: ctx.msg_sender(), recipient, value)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
-50 │ return true
+54 │ return true
│ ^^^^ bool: Value
note:
- ┌─ erc20_token.fe:53:5
+ ┌─ erc20_token.fe:57:5
│
-53 │ ╭ pub fn allowance(self, owner: address, spender: address) -> u256 {
-54 │ │ return self._allowances[owner][spender]
-55 │ │ }
+57 │ ╭ pub fn allowance(self, owner: address, spender: address) -> u256 {
+58 │ │ return self._allowances[owner][spender]
+59 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: owner, typ: address }, { label: None, name: spender, typ: address }] -> u256
note:
- ┌─ erc20_token.fe:54:16
+ ┌─ erc20_token.fe:58:16
│
-54 │ return self._allowances[owner][spender]
+58 │ return self._allowances[owner][spender]
│ ^^^^ ERC20: Value
note:
- ┌─ erc20_token.fe:54:16
+ ┌─ erc20_token.fe:58:16
│
-54 │ return self._allowances[owner][spender]
+58 │ return self._allowances[owner][spender]
│ ^^^^^^^^^^^^^^^^ ^^^^^ address: Value
│ │
│ Map>: Storage { nonce: Some(1) }
note:
- ┌─ erc20_token.fe:54:16
+ ┌─ erc20_token.fe:58:16
│
-54 │ return self._allowances[owner][spender]
+58 │ return self._allowances[owner][spender]
│ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^ address: Value
│ │
│ Map: Storage { nonce: None }
note:
- ┌─ erc20_token.fe:54:16
+ ┌─ erc20_token.fe:58:16
│
-54 │ return self._allowances[owner][spender]
+58 │ return self._allowances[owner][spender]
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Storage { nonce: None } => Value
note:
- ┌─ erc20_token.fe:57:5
+ ┌─ erc20_token.fe:61:5
│
-57 │ ╭ pub fn approve(self, ctx: Context, spender: address, value: u256) -> bool {
-58 │ │ self._approve(ctx, owner: ctx.msg_sender(), spender, value)
-59 │ │ return true
-60 │ │ }
+61 │ ╭ pub fn approve(self, ctx: Context, spender: address, value: u256) -> bool {
+62 │ │ self._approve(ctx, owner: ctx.msg_sender(), spender, value)
+63 │ │ return true
+64 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: spender, typ: address }, { label: None, name: value, typ: u256 }] -> bool
note:
- ┌─ erc20_token.fe:58:9
+ ┌─ erc20_token.fe:62:9
│
-58 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value)
+62 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value)
│ ^^^^ ^^^ ^^^ Context: Memory
│ │ │
│ │ Context: Memory
│ ERC20: Value
note:
- ┌─ erc20_token.fe:58:35
+ ┌─ erc20_token.fe:62:35
│
-58 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value)
+62 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value)
│ ^^^^^^^^^^^^^^^^ ^^^^^^^ ^^^^^ u256: Value
│ │ │
│ │ address: Value
│ address: Value
note:
- ┌─ erc20_token.fe:58:9
+ ┌─ erc20_token.fe:62:9
│
-58 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value)
+62 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
-59 │ return true
+63 │ return true
│ ^^^^ bool: Value
note:
- ┌─ erc20_token.fe:62:5
+ ┌─ erc20_token.fe:66:5
│
-62 │ ╭ pub fn transferFrom(self, ctx: Context, sender: address, recipient: address, value: u256) -> bool {
-63 │ │ assert self._allowances[sender][ctx.msg_sender()] >= value
-64 │ │ self._transfer(ctx, sender, recipient, value)
-65 │ │ self._approve(ctx, owner: sender, spender: ctx.msg_sender(), value: self._allowances[sender][ctx.msg_sender()] - value)
-66 │ │ return true
-67 │ │ }
+66 │ ╭ pub fn transferFrom(self, ctx: Context, sender: address, recipient: address, value: u256) -> bool {
+67 │ │ assert self._allowances[sender][ctx.msg_sender()] >= value
+68 │ │ self._transfer(ctx, sender, recipient, value)
+69 │ │ self._approve(ctx, owner: sender, spender: ctx.msg_sender(), value: self._allowances[sender][ctx.msg_sender()] - value)
+70 │ │ return true
+71 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: sender, typ: address }, { label: None, name: recipient, typ: address }, { label: None, name: value, typ: u256 }] -> bool
note:
- ┌─ erc20_token.fe:63:16
+ ┌─ erc20_token.fe:67:16
│
-63 │ assert self._allowances[sender][ctx.msg_sender()] >= value
+67 │ assert self._allowances[sender][ctx.msg_sender()] >= value
│ ^^^^ ERC20: Value
note:
- ┌─ erc20_token.fe:63:16
+ ┌─ erc20_token.fe:67:16
│
-63 │ assert self._allowances[sender][ctx.msg_sender()] >= value
+67 │ assert self._allowances[sender][ctx.msg_sender()] >= value
│ ^^^^^^^^^^^^^^^^ ^^^^^^ address: Value
│ │
│ Map>: Storage { nonce: Some(1) }
note:
- ┌─ erc20_token.fe:63:16
+ ┌─ erc20_token.fe:67:16
│
-63 │ assert self._allowances[sender][ctx.msg_sender()] >= value
+67 │ assert self._allowances[sender][ctx.msg_sender()] >= value
│ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ Context: Memory
│ │
│ Map: Storage { nonce: None }
note:
- ┌─ erc20_token.fe:63:41
+ ┌─ erc20_token.fe:67:41
│
-63 │ assert self._allowances[sender][ctx.msg_sender()] >= value
+67 │ assert self._allowances[sender][ctx.msg_sender()] >= value
│ ^^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ erc20_token.fe:63:16
+ ┌─ erc20_token.fe:67:16
│
-63 │ assert self._allowances[sender][ctx.msg_sender()] >= value
+67 │ assert self._allowances[sender][ctx.msg_sender()] >= value
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ u256: Value
│ │
│ u256: Storage { nonce: None } => Value
note:
- ┌─ erc20_token.fe:63:16
+ ┌─ erc20_token.fe:67:16
│
-63 │ assert self._allowances[sender][ctx.msg_sender()] >= value
+67 │ assert self._allowances[sender][ctx.msg_sender()] >= value
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bool: Value
-64 │ self._transfer(ctx, sender, recipient, value)
+68 │ self._transfer(ctx, sender, recipient, value)
│ ^^^^ ^^^ ^^^^^^ ^^^^^^^^^ ^^^^^ u256: Value
│ │ │ │ │
│ │ │ │ address: Value
@@ -326,11 +328,11 @@ note:
│ ERC20: Value
note:
- ┌─ erc20_token.fe:64:9
+ ┌─ erc20_token.fe:68:9
│
-64 │ self._transfer(ctx, sender, recipient, value)
+68 │ self._transfer(ctx, sender, recipient, value)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
-65 │ self._approve(ctx, owner: sender, spender: ctx.msg_sender(), value: self._allowances[sender][ctx.msg_sender()] - value)
+69 │ self._approve(ctx, owner: sender, spender: ctx.msg_sender(), value: self._allowances[sender][ctx.msg_sender()] - value)
│ ^^^^ ^^^ ^^^^^^ ^^^ Context: Memory
│ │ │ │
│ │ │ address: Value
@@ -338,702 +340,750 @@ note:
│ ERC20: Value
note:
- ┌─ erc20_token.fe:65:52
+ ┌─ erc20_token.fe:69:52
│
-65 │ self._approve(ctx, owner: sender, spender: ctx.msg_sender(), value: self._allowances[sender][ctx.msg_sender()] - value)
+69 │ self._approve(ctx, owner: sender, spender: ctx.msg_sender(), value: self._allowances[sender][ctx.msg_sender()] - value)
│ ^^^^^^^^^^^^^^^^ ^^^^ ERC20: Value
│ │
│ address: Value
note:
- ┌─ erc20_token.fe:65:77
+ ┌─ erc20_token.fe:69:77
│
-65 │ self._approve(ctx, owner: sender, spender: ctx.msg_sender(), value: self._allowances[sender][ctx.msg_sender()] - value)
+69 │ self._approve(ctx, owner: sender, spender: ctx.msg_sender(), value: self._allowances[sender][ctx.msg_sender()] - value)
│ ^^^^^^^^^^^^^^^^ ^^^^^^ address: Value
│ │
│ Map>: Storage { nonce: Some(1) }
note:
- ┌─ erc20_token.fe:65:77
+ ┌─ erc20_token.fe:69:77
│
-65 │ self._approve(ctx, owner: sender, spender: ctx.msg_sender(), value: self._allowances[sender][ctx.msg_sender()] - value)
+69 │ self._approve(ctx, owner: sender, spender: ctx.msg_sender(), value: self._allowances[sender][ctx.msg_sender()] - value)
│ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ Context: Memory
│ │
│ Map: Storage { nonce: None }
note:
- ┌─ erc20_token.fe:65:102
+ ┌─ erc20_token.fe:69:102
│
-65 │ self._approve(ctx, owner: sender, spender: ctx.msg_sender(), value: self._allowances[sender][ctx.msg_sender()] - value)
+69 │ self._approve(ctx, owner: sender, spender: ctx.msg_sender(), value: self._allowances[sender][ctx.msg_sender()] - value)
│ ^^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ erc20_token.fe:65:77
+ ┌─ erc20_token.fe:69:77
│
-65 │ self._approve(ctx, owner: sender, spender: ctx.msg_sender(), value: self._allowances[sender][ctx.msg_sender()] - value)
+69 │ self._approve(ctx, owner: sender, spender: ctx.msg_sender(), value: self._allowances[sender][ctx.msg_sender()] - value)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ u256: Value
│ │
│ u256: Storage { nonce: None } => Value
note:
- ┌─ erc20_token.fe:65:77
+ ┌─ erc20_token.fe:69:77
│
-65 │ self._approve(ctx, owner: sender, spender: ctx.msg_sender(), value: self._allowances[sender][ctx.msg_sender()] - value)
+69 │ self._approve(ctx, owner: sender, spender: ctx.msg_sender(), value: self._allowances[sender][ctx.msg_sender()] - value)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
note:
- ┌─ erc20_token.fe:65:9
+ ┌─ erc20_token.fe:69:9
│
-65 │ self._approve(ctx, owner: sender, spender: ctx.msg_sender(), value: self._allowances[sender][ctx.msg_sender()] - value)
+69 │ self._approve(ctx, owner: sender, spender: ctx.msg_sender(), value: self._allowances[sender][ctx.msg_sender()] - value)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
-66 │ return true
+70 │ return true
│ ^^^^ bool: Value
note:
- ┌─ erc20_token.fe:69:5
+ ┌─ erc20_token.fe:73:5
│
-69 │ ╭ pub fn increaseAllowance(self, ctx: Context, spender: address, addedValue: u256) -> bool {
-70 │ │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] + addedValue)
-71 │ │ return true
-72 │ │ }
+73 │ ╭ pub fn increaseAllowance(self, ctx: Context, spender: address, addedValue: u256) -> bool {
+74 │ │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] + addedValue)
+75 │ │ return true
+76 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: spender, typ: address }, { label: None, name: addedValue, typ: u256 }] -> bool
note:
- ┌─ erc20_token.fe:70:9
+ ┌─ erc20_token.fe:74:9
│
-70 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] + addedValue)
+74 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] + addedValue)
│ ^^^^ ^^^ ^^^ Context: Memory
│ │ │
│ │ Context: Memory
│ ERC20: Value
note:
- ┌─ erc20_token.fe:70:35
+ ┌─ erc20_token.fe:74:35
│
-70 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] + addedValue)
+74 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] + addedValue)
│ ^^^^^^^^^^^^^^^^ ^^^^^^^ ^^^^ ERC20: Value
│ │ │
│ │ address: Value
│ address: Value
note:
- ┌─ erc20_token.fe:70:69
+ ┌─ erc20_token.fe:74:69
│
-70 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] + addedValue)
+74 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] + addedValue)
│ ^^^^^^^^^^^^^^^^ ^^^ Context: Memory
│ │
│ Map>: Storage { nonce: Some(1) }
note:
- ┌─ erc20_token.fe:70:86
+ ┌─ erc20_token.fe:74:86
│
-70 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] + addedValue)
+74 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] + addedValue)
│ ^^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ erc20_token.fe:70:69
+ ┌─ erc20_token.fe:74:69
│
-70 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] + addedValue)
+74 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] + addedValue)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^ address: Value
│ │
│ Map: Storage { nonce: None }
note:
- ┌─ erc20_token.fe:70:69
+ ┌─ erc20_token.fe:74:69
│
-70 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] + addedValue)
+74 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] + addedValue)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^ u256: Value
│ │
│ u256: Storage { nonce: None } => Value
note:
- ┌─ erc20_token.fe:70:69
+ ┌─ erc20_token.fe:74:69
│
-70 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] + addedValue)
+74 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] + addedValue)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
note:
- ┌─ erc20_token.fe:70:9
+ ┌─ erc20_token.fe:74:9
│
-70 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] + addedValue)
+74 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] + addedValue)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
-71 │ return true
+75 │ return true
│ ^^^^ bool: Value
note:
- ┌─ erc20_token.fe:74:5
+ ┌─ erc20_token.fe:78:5
│
-74 │ ╭ pub fn decreaseAllowance(self, ctx: Context, spender: address, subtractedValue: u256) -> bool {
-75 │ │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] - subtractedValue)
-76 │ │ return true
-77 │ │ }
+78 │ ╭ pub fn decreaseAllowance(self, ctx: Context, spender: address, subtractedValue: u256) -> bool {
+79 │ │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] - subtractedValue)
+80 │ │ return true
+81 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: spender, typ: address }, { label: None, name: subtractedValue, typ: u256 }] -> bool
note:
- ┌─ erc20_token.fe:75:9
+ ┌─ erc20_token.fe:79:9
│
-75 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] - subtractedValue)
+79 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] - subtractedValue)
│ ^^^^ ^^^ ^^^ Context: Memory
│ │ │
│ │ Context: Memory
│ ERC20: Value
note:
- ┌─ erc20_token.fe:75:35
+ ┌─ erc20_token.fe:79:35
│
-75 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] - subtractedValue)
+79 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] - subtractedValue)
│ ^^^^^^^^^^^^^^^^ ^^^^^^^ ^^^^ ERC20: Value
│ │ │
│ │ address: Value
│ address: Value
note:
- ┌─ erc20_token.fe:75:69
+ ┌─ erc20_token.fe:79:69
│
-75 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] - subtractedValue)
+79 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] - subtractedValue)
│ ^^^^^^^^^^^^^^^^ ^^^ Context: Memory
│ │
│ Map>: Storage { nonce: Some(1) }
note:
- ┌─ erc20_token.fe:75:86
+ ┌─ erc20_token.fe:79:86
│
-75 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] - subtractedValue)
+79 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] - subtractedValue)
│ ^^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ erc20_token.fe:75:69
+ ┌─ erc20_token.fe:79:69
│
-75 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] - subtractedValue)
+79 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] - subtractedValue)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^ address: Value
│ │
│ Map: Storage { nonce: None }
note:
- ┌─ erc20_token.fe:75:69
+ ┌─ erc20_token.fe:79:69
│
-75 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] - subtractedValue)
+79 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] - subtractedValue)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ u256: Value
│ │
│ u256: Storage { nonce: None } => Value
note:
- ┌─ erc20_token.fe:75:69
+ ┌─ erc20_token.fe:79:69
│
-75 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] - subtractedValue)
+79 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] - subtractedValue)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
note:
- ┌─ erc20_token.fe:75:9
+ ┌─ erc20_token.fe:79:9
│
-75 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] - subtractedValue)
+79 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value: self._allowances[ctx.msg_sender()][spender] - subtractedValue)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
-76 │ return true
+80 │ return true
│ ^^^^ bool: Value
note:
- ┌─ erc20_token.fe:79:5
+ ┌─ erc20_token.fe:83:5
│
-79 │ ╭ fn _transfer(self, ctx: Context, sender: address, recipient: address, value: u256) {
-80 │ │ assert sender != address(0)
-81 │ │ assert recipient != address(0)
-82 │ │ _before_token_transfer(from: sender, to: recipient, value)
+83 │ ╭ fn _transfer(self, ctx: Context, sender: address, recipient: address, value: u256) {
+84 │ │ assert sender != address(0)
+85 │ │ assert recipient != address(0)
+86 │ │ _before_token_transfer(from: sender, to: recipient, value)
· │
-85 │ │ emit Transfer(ctx, from: sender, to: recipient, value)
-86 │ │ }
+89 │ │ ctx.emit(Transfer(from: sender, to: recipient, value))
+90 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: sender, typ: address }, { label: None, name: recipient, typ: address }, { label: None, name: value, typ: u256 }] -> ()
note:
- ┌─ erc20_token.fe:80:16
+ ┌─ erc20_token.fe:84:16
│
-80 │ assert sender != address(0)
+84 │ assert sender != address(0)
│ ^^^^^^ ^ u256: Value
│ │
│ address: Value
note:
- ┌─ erc20_token.fe:80:26
+ ┌─ erc20_token.fe:84:26
│
-80 │ assert sender != address(0)
+84 │ assert sender != address(0)
│ ^^^^^^^^^^ address: Value
note:
- ┌─ erc20_token.fe:80:16
+ ┌─ erc20_token.fe:84:16
│
-80 │ assert sender != address(0)
+84 │ assert sender != address(0)
│ ^^^^^^^^^^^^^^^^^^^^ bool: Value
-81 │ assert recipient != address(0)
+85 │ assert recipient != address(0)
│ ^^^^^^^^^ ^ u256: Value
│ │
│ address: Value
note:
- ┌─ erc20_token.fe:81:29
+ ┌─ erc20_token.fe:85:29
│
-81 │ assert recipient != address(0)
+85 │ assert recipient != address(0)
│ ^^^^^^^^^^ address: Value
note:
- ┌─ erc20_token.fe:81:16
+ ┌─ erc20_token.fe:85:16
│
-81 │ assert recipient != address(0)
+85 │ assert recipient != address(0)
│ ^^^^^^^^^^^^^^^^^^^^^^^ bool: Value
-82 │ _before_token_transfer(from: sender, to: recipient, value)
+86 │ _before_token_transfer(from: sender, to: recipient, value)
│ ^^^^^^ ^^^^^^^^^ ^^^^^ u256: Value
│ │ │
│ │ address: Value
│ address: Value
note:
- ┌─ erc20_token.fe:82:9
+ ┌─ erc20_token.fe:86:9
│
-82 │ _before_token_transfer(from: sender, to: recipient, value)
+86 │ _before_token_transfer(from: sender, to: recipient, value)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
-83 │ self._balances[sender] = self._balances[sender] - value
+87 │ self._balances[sender] = self._balances[sender] - value
│ ^^^^ ERC20: Value
note:
- ┌─ erc20_token.fe:83:9
+ ┌─ erc20_token.fe:87:9
│
-83 │ self._balances[sender] = self._balances[sender] - value
+87 │ self._balances[sender] = self._balances[sender] - value
│ ^^^^^^^^^^^^^^ ^^^^^^ address: Value
│ │
│ Map: Storage { nonce: Some(0) }
note:
- ┌─ erc20_token.fe:83:9
+ ┌─ erc20_token.fe:87:9
│
-83 │ self._balances[sender] = self._balances[sender] - value
+87 │ self._balances[sender] = self._balances[sender] - value
│ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ERC20: Value
│ │
│ u256: Storage { nonce: None }
note:
- ┌─ erc20_token.fe:83:34
+ ┌─ erc20_token.fe:87:34
│
-83 │ self._balances[sender] = self._balances[sender] - value
+87 │ self._balances[sender] = self._balances[sender] - value
│ ^^^^^^^^^^^^^^ ^^^^^^ address: Value
│ │
│ Map: Storage { nonce: Some(0) }
note:
- ┌─ erc20_token.fe:83:34
+ ┌─ erc20_token.fe:87:34
│
-83 │ self._balances[sender] = self._balances[sender] - value
+87 │ self._balances[sender] = self._balances[sender] - value
│ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ u256: Value
│ │
│ u256: Storage { nonce: None } => Value
note:
- ┌─ erc20_token.fe:83:34
+ ┌─ erc20_token.fe:87:34
│
-83 │ self._balances[sender] = self._balances[sender] - value
+87 │ self._balances[sender] = self._balances[sender] - value
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-84 │ self._balances[recipient] = self._balances[recipient] + value
+88 │ self._balances[recipient] = self._balances[recipient] + value
│ ^^^^ ERC20: Value
note:
- ┌─ erc20_token.fe:84:9
+ ┌─ erc20_token.fe:88:9
│
-84 │ self._balances[recipient] = self._balances[recipient] + value
+88 │ self._balances[recipient] = self._balances[recipient] + value
│ ^^^^^^^^^^^^^^ ^^^^^^^^^ address: Value
│ │
│ Map: Storage { nonce: Some(0) }
note:
- ┌─ erc20_token.fe:84:9
+ ┌─ erc20_token.fe:88:9
│
-84 │ self._balances[recipient] = self._balances[recipient] + value
+88 │ self._balances[recipient] = self._balances[recipient] + value
│ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ERC20: Value
│ │
│ u256: Storage { nonce: None }
note:
- ┌─ erc20_token.fe:84:37
+ ┌─ erc20_token.fe:88:37
│
-84 │ self._balances[recipient] = self._balances[recipient] + value
+88 │ self._balances[recipient] = self._balances[recipient] + value
│ ^^^^^^^^^^^^^^ ^^^^^^^^^ address: Value
│ │
│ Map: Storage { nonce: Some(0) }
note:
- ┌─ erc20_token.fe:84:37
+ ┌─ erc20_token.fe:88:37
│
-84 │ self._balances[recipient] = self._balances[recipient] + value
+88 │ self._balances[recipient] = self._balances[recipient] + value
│ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ u256: Value
│ │
│ u256: Storage { nonce: None } => Value
note:
- ┌─ erc20_token.fe:84:37
+ ┌─ erc20_token.fe:88:37
│
-84 │ self._balances[recipient] = self._balances[recipient] + value
+88 │ self._balances[recipient] = self._balances[recipient] + value
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-85 │ emit Transfer(ctx, from: sender, to: recipient, value)
- │ ^^^ ^^^^^^ ^^^^^^^^^ ^^^^^ u256: Value
- │ │ │ │
- │ │ │ address: Value
- │ │ address: Value
- │ Context: Memory
+89 │ ctx.emit(Transfer(from: sender, to: recipient, value))
+ │ ^^^ ^^^^^^ ^^^^^^^^^ ^^^^^ u256: Value
+ │ │ │ │
+ │ │ │ address: Value
+ │ │ address: Value
+ │ Context: Memory
+
+note:
+ ┌─ erc20_token.fe:89:18
+ │
+89 │ ctx.emit(Transfer(from: sender, to: recipient, value))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Transfer: Memory
note:
- ┌─ erc20_token.fe:88:5
+ ┌─ erc20_token.fe:89:9
+ │
+89 │ ctx.emit(Transfer(from: sender, to: recipient, value))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
+
+note:
+ ┌─ erc20_token.fe:92:5
│
-88 │ ╭ fn _mint(self, ctx: Context, account: address, value: u256) {
-89 │ │ assert account != address(0)
-90 │ │ _before_token_transfer(from: address(0), to: account, value)
-91 │ │ self._total_supply = self._total_supply + value
-92 │ │ self._balances[account] = self._balances[account] + value
-93 │ │ emit Transfer(ctx, from: address(0), to: account, value)
-94 │ │ }
+92 │ ╭ fn _mint(self, ctx: Context, account: address, value: u256) {
+93 │ │ assert account != address(0)
+94 │ │ _before_token_transfer(from: address(0), to: account, value)
+95 │ │ self._total_supply = self._total_supply + value
+96 │ │ self._balances[account] = self._balances[account] + value
+97 │ │ ctx.emit(Transfer(from: address(0), to: account, value))
+98 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: account, typ: address }, { label: None, name: value, typ: u256 }] -> ()
note:
- ┌─ erc20_token.fe:89:16
+ ┌─ erc20_token.fe:93:16
│
-89 │ assert account != address(0)
+93 │ assert account != address(0)
│ ^^^^^^^ ^ u256: Value
│ │
│ address: Value
note:
- ┌─ erc20_token.fe:89:27
+ ┌─ erc20_token.fe:93:27
│
-89 │ assert account != address(0)
+93 │ assert account != address(0)
│ ^^^^^^^^^^ address: Value
note:
- ┌─ erc20_token.fe:89:16
+ ┌─ erc20_token.fe:93:16
│
-89 │ assert account != address(0)
+93 │ assert account != address(0)
│ ^^^^^^^^^^^^^^^^^^^^^ bool: Value
-90 │ _before_token_transfer(from: address(0), to: account, value)
+94 │ _before_token_transfer(from: address(0), to: account, value)
│ ^ u256: Value
note:
- ┌─ erc20_token.fe:90:38
+ ┌─ erc20_token.fe:94:38
│
-90 │ _before_token_transfer(from: address(0), to: account, value)
+94 │ _before_token_transfer(from: address(0), to: account, value)
│ ^^^^^^^^^^ ^^^^^^^ ^^^^^ u256: Value
│ │ │
│ │ address: Value
│ address: Value
note:
- ┌─ erc20_token.fe:90:9
+ ┌─ erc20_token.fe:94:9
│
-90 │ _before_token_transfer(from: address(0), to: account, value)
+94 │ _before_token_transfer(from: address(0), to: account, value)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
-91 │ self._total_supply = self._total_supply + value
+95 │ self._total_supply = self._total_supply + value
│ ^^^^ ERC20: Value
note:
- ┌─ erc20_token.fe:91:9
+ ┌─ erc20_token.fe:95:9
│
-91 │ self._total_supply = self._total_supply + value
+95 │ self._total_supply = self._total_supply + value
│ ^^^^^^^^^^^^^^^^^^ ^^^^ ERC20: Value
│ │
│ u256: Storage { nonce: Some(2) }
note:
- ┌─ erc20_token.fe:91:30
+ ┌─ erc20_token.fe:95:30
│
-91 │ self._total_supply = self._total_supply + value
+95 │ self._total_supply = self._total_supply + value
│ ^^^^^^^^^^^^^^^^^^ ^^^^^ u256: Value
│ │
│ u256: Storage { nonce: Some(2) } => Value
note:
- ┌─ erc20_token.fe:91:30
+ ┌─ erc20_token.fe:95:30
│
-91 │ self._total_supply = self._total_supply + value
+95 │ self._total_supply = self._total_supply + value
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-92 │ self._balances[account] = self._balances[account] + value
+96 │ self._balances[account] = self._balances[account] + value
│ ^^^^ ERC20: Value
note:
- ┌─ erc20_token.fe:92:9
+ ┌─ erc20_token.fe:96:9
│
-92 │ self._balances[account] = self._balances[account] + value
+96 │ self._balances[account] = self._balances[account] + value
│ ^^^^^^^^^^^^^^ ^^^^^^^ address: Value
│ │
│ Map: Storage { nonce: Some(0) }
note:
- ┌─ erc20_token.fe:92:9
+ ┌─ erc20_token.fe:96:9
│
-92 │ self._balances[account] = self._balances[account] + value
+96 │ self._balances[account] = self._balances[account] + value
│ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ERC20: Value
│ │
│ u256: Storage { nonce: None }
note:
- ┌─ erc20_token.fe:92:35
+ ┌─ erc20_token.fe:96:35
│
-92 │ self._balances[account] = self._balances[account] + value
+96 │ self._balances[account] = self._balances[account] + value
│ ^^^^^^^^^^^^^^ ^^^^^^^ address: Value
│ │
│ Map: Storage { nonce: Some(0) }
note:
- ┌─ erc20_token.fe:92:35
+ ┌─ erc20_token.fe:96:35
│
-92 │ self._balances[account] = self._balances[account] + value
+96 │ self._balances[account] = self._balances[account] + value
│ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ u256: Value
│ │
│ u256: Storage { nonce: None } => Value
note:
- ┌─ erc20_token.fe:92:35
+ ┌─ erc20_token.fe:96:35
│
-92 │ self._balances[account] = self._balances[account] + value
+96 │ self._balances[account] = self._balances[account] + value
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-93 │ emit Transfer(ctx, from: address(0), to: account, value)
- │ ^^^ ^ u256: Value
- │ │
- │ Context: Memory
+97 │ ctx.emit(Transfer(from: address(0), to: account, value))
+ │ ^^^ ^ u256: Value
+ │ │
+ │ Context: Memory
note:
- ┌─ erc20_token.fe:93:34
+ ┌─ erc20_token.fe:97:33
│
-93 │ emit Transfer(ctx, from: address(0), to: account, value)
- │ ^^^^^^^^^^ ^^^^^^^ ^^^^^ u256: Value
- │ │ │
- │ │ address: Value
- │ address: Value
+97 │ ctx.emit(Transfer(from: address(0), to: account, value))
+ │ ^^^^^^^^^^ ^^^^^^^ ^^^^^ u256: Value
+ │ │ │
+ │ │ address: Value
+ │ address: Value
note:
- ┌─ erc20_token.fe:96:5
+ ┌─ erc20_token.fe:97:18
+ │
+97 │ ctx.emit(Transfer(from: address(0), to: account, value))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Transfer: Memory
+
+note:
+ ┌─ erc20_token.fe:97:9
+ │
+97 │ ctx.emit(Transfer(from: address(0), to: account, value))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
+
+note:
+ ┌─ erc20_token.fe:100:5
│
- 96 │ ╭ fn _burn(self, ctx: Context, account: address, value: u256) {
- 97 │ │ assert account != address(0)
- 98 │ │ _before_token_transfer(from: account, to: address(0), value)
- 99 │ │ self._balances[account] = self._balances[account] - value
-100 │ │ self._total_supply = self._total_supply - value
-101 │ │ emit Transfer(ctx, from: account, to: address(0), value)
-102 │ │ }
+100 │ ╭ fn _burn(self, ctx: Context, account: address, value: u256) {
+101 │ │ assert account != address(0)
+102 │ │ _before_token_transfer(from: account, to: address(0), value)
+103 │ │ self._balances[account] = self._balances[account] - value
+104 │ │ self._total_supply = self._total_supply - value
+105 │ │ ctx.emit(Transfer(from: account, to: address(0), value))
+106 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: account, typ: address }, { label: None, name: value, typ: u256 }] -> ()
note:
- ┌─ erc20_token.fe:97:16
- │
-97 │ assert account != address(0)
- │ ^^^^^^^ ^ u256: Value
- │ │
- │ address: Value
+ ┌─ erc20_token.fe:101:16
+ │
+101 │ assert account != address(0)
+ │ ^^^^^^^ ^ u256: Value
+ │ │
+ │ address: Value
note:
- ┌─ erc20_token.fe:97:27
- │
-97 │ assert account != address(0)
- │ ^^^^^^^^^^ address: Value
+ ┌─ erc20_token.fe:101:27
+ │
+101 │ assert account != address(0)
+ │ ^^^^^^^^^^ address: Value
note:
- ┌─ erc20_token.fe:97:16
- │
-97 │ assert account != address(0)
- │ ^^^^^^^^^^^^^^^^^^^^^ bool: Value
-98 │ _before_token_transfer(from: account, to: address(0), value)
- │ ^^^^^^^ ^ u256: Value
- │ │
- │ address: Value
+ ┌─ erc20_token.fe:101:16
+ │
+101 │ assert account != address(0)
+ │ ^^^^^^^^^^^^^^^^^^^^^ bool: Value
+102 │ _before_token_transfer(from: account, to: address(0), value)
+ │ ^^^^^^^ ^ u256: Value
+ │ │
+ │ address: Value
note:
- ┌─ erc20_token.fe:98:51
- │
-98 │ _before_token_transfer(from: account, to: address(0), value)
- │ ^^^^^^^^^^ ^^^^^ u256: Value
- │ │
- │ address: Value
+ ┌─ erc20_token.fe:102:51
+ │
+102 │ _before_token_transfer(from: account, to: address(0), value)
+ │ ^^^^^^^^^^ ^^^^^ u256: Value
+ │ │
+ │ address: Value
note:
- ┌─ erc20_token.fe:98:9
- │
-98 │ _before_token_transfer(from: account, to: address(0), value)
- │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
-99 │ self._balances[account] = self._balances[account] - value
- │ ^^^^ ERC20: Value
+ ┌─ erc20_token.fe:102:9
+ │
+102 │ _before_token_transfer(from: account, to: address(0), value)
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
+103 │ self._balances[account] = self._balances[account] - value
+ │ ^^^^ ERC20: Value
note:
- ┌─ erc20_token.fe:99:9
- │
-99 │ self._balances[account] = self._balances[account] - value
- │ ^^^^^^^^^^^^^^ ^^^^^^^ address: Value
- │ │
- │ Map: Storage { nonce: Some(0) }
+ ┌─ erc20_token.fe:103:9
+ │
+103 │ self._balances[account] = self._balances[account] - value
+ │ ^^^^^^^^^^^^^^ ^^^^^^^ address: Value
+ │ │
+ │ Map: Storage { nonce: Some(0) }
note:
- ┌─ erc20_token.fe:99:9
- │
-99 │ self._balances[account] = self._balances[account] - value
- │ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ERC20: Value
- │ │
- │ u256: Storage { nonce: None }
+ ┌─ erc20_token.fe:103:9
+ │
+103 │ self._balances[account] = self._balances[account] - value
+ │ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ERC20: Value
+ │ │
+ │ u256: Storage { nonce: None }
note:
- ┌─ erc20_token.fe:99:35
- │
-99 │ self._balances[account] = self._balances[account] - value
- │ ^^^^^^^^^^^^^^ ^^^^^^^ address: Value
- │ │
- │ Map: Storage { nonce: Some(0) }
+ ┌─ erc20_token.fe:103:35
+ │
+103 │ self._balances[account] = self._balances[account] - value
+ │ ^^^^^^^^^^^^^^ ^^^^^^^ address: Value
+ │ │
+ │ Map: Storage { nonce: Some(0) }
note:
- ┌─ erc20_token.fe:99:35
- │
-99 │ self._balances[account] = self._balances[account] - value
- │ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ u256: Value
- │ │
- │ u256: Storage { nonce: None } => Value
+ ┌─ erc20_token.fe:103:35
+ │
+103 │ self._balances[account] = self._balances[account] - value
+ │ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ u256: Value
+ │ │
+ │ u256: Storage { nonce: None } => Value
note:
- ┌─ erc20_token.fe:99:35
+ ┌─ erc20_token.fe:103:35
│
- 99 │ self._balances[account] = self._balances[account] - value
+103 │ self._balances[account] = self._balances[account] - value
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-100 │ self._total_supply = self._total_supply - value
+104 │ self._total_supply = self._total_supply - value
│ ^^^^ ERC20: Value
note:
- ┌─ erc20_token.fe:100:9
+ ┌─ erc20_token.fe:104:9
│
-100 │ self._total_supply = self._total_supply - value
+104 │ self._total_supply = self._total_supply - value
│ ^^^^^^^^^^^^^^^^^^ ^^^^ ERC20: Value
│ │
│ u256: Storage { nonce: Some(2) }
note:
- ┌─ erc20_token.fe:100:30
+ ┌─ erc20_token.fe:104:30
│
-100 │ self._total_supply = self._total_supply - value
+104 │ self._total_supply = self._total_supply - value
│ ^^^^^^^^^^^^^^^^^^ ^^^^^ u256: Value
│ │
│ u256: Storage { nonce: Some(2) } => Value
note:
- ┌─ erc20_token.fe:100:30
+ ┌─ erc20_token.fe:104:30
│
-100 │ self._total_supply = self._total_supply - value
+104 │ self._total_supply = self._total_supply - value
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-101 │ emit Transfer(ctx, from: account, to: address(0), value)
- │ ^^^ ^^^^^^^ ^ u256: Value
- │ │ │
- │ │ address: Value
- │ Context: Memory
+105 │ ctx.emit(Transfer(from: account, to: address(0), value))
+ │ ^^^ ^^^^^^^ ^ u256: Value
+ │ │ │
+ │ │ address: Value
+ │ Context: Memory
note:
- ┌─ erc20_token.fe:101:47
+ ┌─ erc20_token.fe:105:46
│
-101 │ emit Transfer(ctx, from: account, to: address(0), value)
- │ ^^^^^^^^^^ ^^^^^ u256: Value
- │ │
- │ address: Value
+105 │ ctx.emit(Transfer(from: account, to: address(0), value))
+ │ ^^^^^^^^^^ ^^^^^ u256: Value
+ │ │
+ │ address: Value
note:
- ┌─ erc20_token.fe:104:5
+ ┌─ erc20_token.fe:105:18
+ │
+105 │ ctx.emit(Transfer(from: account, to: address(0), value))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Transfer: Memory
+
+note:
+ ┌─ erc20_token.fe:105:9
+ │
+105 │ ctx.emit(Transfer(from: account, to: address(0), value))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
+
+note:
+ ┌─ erc20_token.fe:108:5
│
-104 │ ╭ fn _approve(self, ctx: Context, owner: address, spender: address, value: u256) {
-105 │ │ assert owner != address(0)
-106 │ │ assert spender != address(0)
-107 │ │ self._allowances[owner][spender] = value
-108 │ │ emit Approval(ctx, owner, spender, value)
-109 │ │ }
+108 │ ╭ fn _approve(self, ctx: Context, owner: address, spender: address, value: u256) {
+109 │ │ assert owner != address(0)
+110 │ │ assert spender != address(0)
+111 │ │ self._allowances[owner][spender] = value
+112 │ │ ctx.emit(Approval(owner, spender, value))
+113 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: owner, typ: address }, { label: None, name: spender, typ: address }, { label: None, name: value, typ: u256 }] -> ()
note:
- ┌─ erc20_token.fe:105:16
+ ┌─ erc20_token.fe:109:16
│
-105 │ assert owner != address(0)
+109 │ assert owner != address(0)
│ ^^^^^ ^ u256: Value
│ │
│ address: Value
note:
- ┌─ erc20_token.fe:105:25
+ ┌─ erc20_token.fe:109:25
│
-105 │ assert owner != address(0)
+109 │ assert owner != address(0)
│ ^^^^^^^^^^ address: Value
note:
- ┌─ erc20_token.fe:105:16
+ ┌─ erc20_token.fe:109:16
│
-105 │ assert owner != address(0)
+109 │ assert owner != address(0)
│ ^^^^^^^^^^^^^^^^^^^ bool: Value
-106 │ assert spender != address(0)
+110 │ assert spender != address(0)
│ ^^^^^^^ ^ u256: Value
│ │
│ address: Value
note:
- ┌─ erc20_token.fe:106:27
+ ┌─ erc20_token.fe:110:27
│
-106 │ assert spender != address(0)
+110 │ assert spender != address(0)
│ ^^^^^^^^^^ address: Value
note:
- ┌─ erc20_token.fe:106:16
+ ┌─ erc20_token.fe:110:16
│
-106 │ assert spender != address(0)
+110 │ assert spender != address(0)
│ ^^^^^^^^^^^^^^^^^^^^^ bool: Value
-107 │ self._allowances[owner][spender] = value
+111 │ self._allowances[owner][spender] = value
│ ^^^^ ERC20: Value
note:
- ┌─ erc20_token.fe:107:9
+ ┌─ erc20_token.fe:111:9
│
-107 │ self._allowances[owner][spender] = value
+111 │ self._allowances[owner][spender] = value
│ ^^^^^^^^^^^^^^^^ ^^^^^ address: Value
│ │
│ Map>: Storage { nonce: Some(1) }
note:
- ┌─ erc20_token.fe:107:9
+ ┌─ erc20_token.fe:111:9
│
-107 │ self._allowances[owner][spender] = value
+111 │ self._allowances[owner][spender] = value
│ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^ address: Value
│ │
│ Map: Storage { nonce: None }
note:
- ┌─ erc20_token.fe:107:9
+ ┌─ erc20_token.fe:111:9
│
-107 │ self._allowances[owner][spender] = value
+111 │ self._allowances[owner][spender] = value
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ u256: Value
│ │
│ u256: Storage { nonce: None }
-108 │ emit Approval(ctx, owner, spender, value)
- │ ^^^ ^^^^^ ^^^^^^^ ^^^^^ u256: Value
- │ │ │ │
- │ │ │ address: Value
- │ │ address: Value
- │ Context: Memory
+112 │ ctx.emit(Approval(owner, spender, value))
+ │ ^^^ ^^^^^ ^^^^^^^ ^^^^^ u256: Value
+ │ │ │ │
+ │ │ │ address: Value
+ │ │ address: Value
+ │ Context: Memory
+
+note:
+ ┌─ erc20_token.fe:112:18
+ │
+112 │ ctx.emit(Approval(owner, spender, value))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Approval: Memory
note:
- ┌─ erc20_token.fe:111:5
+ ┌─ erc20_token.fe:112:9
+ │
+112 │ ctx.emit(Approval(owner, spender, value))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
+
+note:
+ ┌─ erc20_token.fe:115:5
│
-111 │ ╭ fn _setup_decimals(self, _ decimals_: u8) {
-112 │ │ self._decimals = decimals_
-113 │ │ }
+115 │ ╭ fn _setup_decimals(self, _ decimals_: u8) {
+116 │ │ self._decimals = decimals_
+117 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: Some("_"), name: decimals_, typ: u8 }] -> ()
note:
- ┌─ erc20_token.fe:112:9
+ ┌─ erc20_token.fe:116:9
│
-112 │ self._decimals = decimals_
+116 │ self._decimals = decimals_
│ ^^^^ ERC20: Value
note:
- ┌─ erc20_token.fe:112:9
+ ┌─ erc20_token.fe:116:9
│
-112 │ self._decimals = decimals_
+116 │ self._decimals = decimals_
│ ^^^^^^^^^^^^^^ ^^^^^^^^^ u8: Value
│ │
│ u8: Storage { nonce: Some(5) }
note:
- ┌─ erc20_token.fe:115:5
+ ┌─ erc20_token.fe:119:5
│
-115 │ fn _before_token_transfer(from: address, to: address, _ value: u256) {}
+119 │ fn _before_token_transfer(from: address, to: address, _ value: u256) {}
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ self: None, params: [{ label: None, name: from, typ: address }, { label: None, name: to, typ: address }, { label: Some("_"), name: value, typ: u256 }] -> ()
diff --git a/crates/analyzer/tests/snapshots/analysis__events.snap b/crates/analyzer/tests/snapshots/analysis__events.snap
index 52af8b4cc6..8a6e55de06 100644
--- a/crates/analyzer/tests/snapshots/analysis__events.snap
+++ b/crates/analyzer/tests/snapshots/analysis__events.snap
@@ -4,155 +4,204 @@ expression: "build_snapshot(&db, module)"
---
note:
- ┌─ events.fe:3:9
+ ┌─ events.fe:3:5
│
-3 │ idx num1: u256
- │ ^^^^^^^^^^^^^^ u256
-4 │ num2: u256
- │ ^^^^^^^^^^ u256
+3 │ pub num1: u256
+ │ ^^^^^^^^^^^^^^ u256
+4 │ pub num2: u256
+ │ ^^^^^^^^^^^^^^ u256
note:
- ┌─ events.fe:8:9
+ ┌─ events.fe:8:5
│
-8 │ num: u256
- │ ^^^^^^^^^ u256
-9 │ addr: address
- │ ^^^^^^^^^^^^^ address
+8 │ pub num: u256
+ │ ^^^^^^^^^^^^^ u256
+9 │ pub addr: address
+ │ ^^^^^^^^^^^^^^^^^ address
note:
- ┌─ events.fe:13:9
+ ┌─ events.fe:13:5
│
-13 │ num1: u256
- │ ^^^^^^^^^^ u256
-14 │ idx addr: address
- │ ^^^^^^^^^^^^^^^^^ address
-15 │ num2: u256
- │ ^^^^^^^^^^ u256
-16 │ my_bytes: Array
- │ ^^^^^^^^^^^^^^^^^^^^^^^^ Array
-
-note:
- ┌─ events.fe:20:9
+13 │ pub num1: u256
+ │ ^^^^^^^^^^^^^^ u256
+14 │ #indexed
+15 │ pub addr: address
+ │ ^^^^^^^^^^^^^^^^^ address
+16 │ pub num2: u256
+ │ ^^^^^^^^^^^^^^ u256
+17 │ pub my_bytes: Array
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Array
+
+note:
+ ┌─ events.fe:21:5
│
-20 │ addrs: Array
- │ ^^^^^^^^^^^^^^^^^^^^^^^^ Array
+21 │ pub addrs: Array
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Array
note:
- ┌─ events.fe:23:5
+ ┌─ events.fe:26:5
│
-23 │ ╭ pub fn emit_nums(ctx: Context) {
-24 │ │ emit Nums(ctx, num1: 26, num2: 42)
-25 │ │ }
+26 │ ╭ pub fn emit_nums(ctx: Context) {
+27 │ │ ctx.emit(Nums(num1: 26, num2: 42))
+28 │ │ }
│ ╰─────^ self: None, params: [{ label: None, name: ctx, typ: Context }] -> ()
note:
- ┌─ events.fe:24:19
+ ┌─ events.fe:27:9
│
-24 │ emit Nums(ctx, num1: 26, num2: 42)
- │ ^^^ ^^ ^^ u256: Value
- │ │ │
- │ │ u256: Value
- │ Context: Memory
+27 │ ctx.emit(Nums(num1: 26, num2: 42))
+ │ ^^^ ^^ ^^ u256: Value
+ │ │ │
+ │ │ u256: Value
+ │ Context: Memory
note:
- ┌─ events.fe:27:5
+ ┌─ events.fe:27:18
+ │
+27 │ ctx.emit(Nums(num1: 26, num2: 42))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^ Nums: Memory
+
+note:
+ ┌─ events.fe:27:9
+ │
+27 │ ctx.emit(Nums(num1: 26, num2: 42))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
+
+note:
+ ┌─ events.fe:30:5
│
-27 │ ╭ pub fn emit_bases(ctx: Context, addr: address) {
-28 │ │ emit Bases(ctx, num: 26, addr)
-29 │ │ }
+30 │ ╭ pub fn emit_bases(ctx: Context, addr: address) {
+31 │ │ ctx.emit(Bases(num: 26, addr))
+32 │ │ }
│ ╰─────^ self: None, params: [{ label: None, name: ctx, typ: Context }, { label: None, name: addr, typ: address }] -> ()
note:
- ┌─ events.fe:28:20
+ ┌─ events.fe:31:9
+ │
+31 │ ctx.emit(Bases(num: 26, addr))
+ │ ^^^ ^^ ^^^^ address: Value
+ │ │ │
+ │ │ u256: Value
+ │ Context: Memory
+
+note:
+ ┌─ events.fe:31:18
+ │
+31 │ ctx.emit(Bases(num: 26, addr))
+ │ ^^^^^^^^^^^^^^^^^^^^ Bases: Memory
+
+note:
+ ┌─ events.fe:31:9
│
-28 │ emit Bases(ctx, num: 26, addr)
- │ ^^^ ^^ ^^^^ address: Value
- │ │ │
- │ │ u256: Value
- │ Context: Memory
+31 │ ctx.emit(Bases(num: 26, addr))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
note:
- ┌─ events.fe:31:5
+ ┌─ events.fe:34:5
│
-31 │ ╭ pub fn emit_mix(ctx: Context, addr: address, my_bytes: Array) {
-32 │ │ emit Mix(ctx, num1: 26, addr, num2: 42, my_bytes)
-33 │ │ }
+34 │ ╭ pub fn emit_mix(ctx: Context, addr: address, my_bytes: Array) {
+35 │ │ ctx.emit(Mix(num1: 26, addr, num2: 42, my_bytes))
+36 │ │ }
│ ╰─────^ self: None, params: [{ label: None, name: ctx, typ: Context }, { label: None, name: addr, typ: address }, { label: None, name: my_bytes, typ: Array }] -> ()
note:
- ┌─ events.fe:32:18
+ ┌─ events.fe:35:9
+ │
+35 │ ctx.emit(Mix(num1: 26, addr, num2: 42, my_bytes))
+ │ ^^^ ^^ ^^^^ ^^ ^^^^^^^^ Array: Memory
+ │ │ │ │ │
+ │ │ │ │ u256: Value
+ │ │ │ address: Value
+ │ │ u256: Value
+ │ Context: Memory
+
+note:
+ ┌─ events.fe:35:18
+ │
+35 │ ctx.emit(Mix(num1: 26, addr, num2: 42, my_bytes))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Mix: Memory
+
+note:
+ ┌─ events.fe:35:9
│
-32 │ emit Mix(ctx, num1: 26, addr, num2: 42, my_bytes)
- │ ^^^ ^^ ^^^^ ^^ ^^^^^^^^ Array: Memory
- │ │ │ │ │
- │ │ │ │ u256: Value
- │ │ │ address: Value
- │ │ u256: Value
- │ Context: Memory
+35 │ ctx.emit(Mix(num1: 26, addr, num2: 42, my_bytes))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
note:
- ┌─ events.fe:35:5
+ ┌─ events.fe:38:5
│
-35 │ ╭ pub fn emit_addresses(ctx: Context, addr1: address, addr2: address) {
-36 │ │ let addrs: Array = [address(0); 2]
-37 │ │ addrs[0] = addr1
-38 │ │ addrs[1] = addr2
-39 │ │ emit Addresses(ctx, addrs)
-40 │ │ }
+38 │ ╭ pub fn emit_addresses(ctx: Context, addr1: address, addr2: address) {
+39 │ │ let addrs: Array = [address(0); 2]
+40 │ │ addrs[0] = addr1
+41 │ │ addrs[1] = addr2
+42 │ │ ctx.emit(Addresses(addrs))
+43 │ │ }
│ ╰─────^ self: None, params: [{ label: None, name: ctx, typ: Context }, { label: None, name: addr1, typ: address }, { label: None, name: addr2, typ: address }] -> ()
note:
- ┌─ events.fe:36:13
+ ┌─ events.fe:39:13
│
-36 │ let addrs: Array = [address(0); 2]
+39 │ let addrs: Array = [address(0); 2]
│ ^^^^^ Array
note:
- ┌─ events.fe:36:49
+ ┌─ events.fe:39:49
│
-36 │ let addrs: Array = [address(0); 2]
+39 │ let addrs: Array = [address(0); 2]
│ ^ u256: Value
note:
- ┌─ events.fe:36:41
+ ┌─ events.fe:39:41
│
-36 │ let addrs: Array = [address(0); 2]
+39 │ let addrs: Array = [address(0); 2]
│ ^^^^^^^^^^ ^ u256: Value
│ │
│ address: Value
note:
- ┌─ events.fe:36:40
+ ┌─ events.fe:39:40
│
-36 │ let addrs: Array = [address(0); 2]
+39 │ let addrs: Array = [address(0); 2]
│ ^^^^^^^^^^^^^^^ Array: Memory
-37 │ addrs[0] = addr1
+40 │ addrs[0] = addr1
│ ^^^^^ ^ u256: Value
│ │
│ Array: Memory
note:
- ┌─ events.fe:37:9
+ ┌─ events.fe:40:9
│
-37 │ addrs[0] = addr1
+40 │ addrs[0] = addr1
│ ^^^^^^^^ ^^^^^ address: Value
│ │
│ address: Memory
-38 │ addrs[1] = addr2
+41 │ addrs[1] = addr2
│ ^^^^^ ^ u256: Value
│ │
│ Array: Memory
note:
- ┌─ events.fe:38:9
+ ┌─ events.fe:41:9
│
-38 │ addrs[1] = addr2
+41 │ addrs[1] = addr2
│ ^^^^^^^^ ^^^^^ address: Value
│ │
│ address: Memory
-39 │ emit Addresses(ctx, addrs)
- │ ^^^ ^^^^^ Array: Memory
- │ │
- │ Context: Memory
+42 │ ctx.emit(Addresses(addrs))
+ │ ^^^ ^^^^^ Array: Memory
+ │ │
+ │ Context: Memory
+
+note:
+ ┌─ events.fe:42:18
+ │
+42 │ ctx.emit(Addresses(addrs))
+ │ ^^^^^^^^^^^^^^^^ Addresses: Memory
+
+note:
+ ┌─ events.fe:42:9
+ │
+42 │ ctx.emit(Addresses(addrs))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
diff --git a/crates/analyzer/tests/snapshots/analysis__external_contract.snap b/crates/analyzer/tests/snapshots/analysis__external_contract.snap
index 9287407749..01287a5fd2 100644
--- a/crates/analyzer/tests/snapshots/analysis__external_contract.snap
+++ b/crates/analyzer/tests/snapshots/analysis__external_contract.snap
@@ -4,159 +4,171 @@ expression: "build_snapshot(&db, module)"
---
note:
- ┌─ external_contract.fe:3:9
+ ┌─ external_contract.fe:2:5
│
-3 │ my_num: u256
- │ ^^^^^^^^^^^^ u256
-4 │ my_addrs: Array
- │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Array
-5 │ my_string: String<11>
- │ ^^^^^^^^^^^^^^^^^^^^^ String<11>
+2 │ pub my_num: u256
+ │ ^^^^^^^^^^^^^^^^ u256
+3 │ pub my_addrs: Array
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Array
+4 │ pub my_string: String<11>
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^ String<11>
note:
- ┌─ external_contract.fe:8:5
+ ┌─ external_contract.fe:9:5
│
- 8 │ ╭ pub fn emit_event(self, ctx: Context, my_num: u256, my_addrs: Array, my_string: String<11>) {
- 9 │ │ emit MyEvent(ctx, my_num, my_addrs, my_string)
-10 │ │ }
+ 9 │ ╭ pub fn emit_event(self, ctx: Context, my_num: u256, my_addrs: Array, my_string: String<11>) {
+10 │ │ ctx.emit(MyEvent(my_num, my_addrs, my_string))
+11 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: my_num, typ: u256 }, { label: None, name: my_addrs, typ: Array }, { label: None, name: my_string, typ: String<11> }] -> ()
note:
- ┌─ external_contract.fe:9:22
- │
-9 │ emit MyEvent(ctx, my_num, my_addrs, my_string)
- │ ^^^ ^^^^^^ ^^^^^^^^ ^^^^^^^^^ String<11>: Memory
- │ │ │ │
- │ │ │ Array: Memory
- │ │ u256: Value
- │ Context: Memory
+ ┌─ external_contract.fe:10:9
+ │
+10 │ ctx.emit(MyEvent(my_num, my_addrs, my_string))
+ │ ^^^ ^^^^^^ ^^^^^^^^ ^^^^^^^^^ String<11>: Memory
+ │ │ │ │
+ │ │ │ Array: Memory
+ │ │ u256: Value
+ │ Context: Memory
+
+note:
+ ┌─ external_contract.fe:10:18
+ │
+10 │ ctx.emit(MyEvent(my_num, my_addrs, my_string))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ MyEvent: Memory
+
+note:
+ ┌─ external_contract.fe:10:9
+ │
+10 │ ctx.emit(MyEvent(my_num, my_addrs, my_string))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
note:
- ┌─ external_contract.fe:12:5
+ ┌─ external_contract.fe:13:5
│
-12 │ ╭ pub fn build_array(self, a: u256, b: u256) -> Array {
-13 │ │ let my_array: Array = [0; 3]
-14 │ │ my_array[0] = a
-15 │ │ my_array[1] = a * b
-16 │ │ my_array[2] = b
-17 │ │ return my_array
-18 │ │ }
+13 │ ╭ pub fn build_array(self, a: u256, b: u256) -> Array {
+14 │ │ let my_array: Array = [0; 3]
+15 │ │ my_array[0] = a
+16 │ │ my_array[1] = a * b
+17 │ │ my_array[2] = b
+18 │ │ return my_array
+19 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: a, typ: u256 }, { label: None, name: b, typ: u256 }] -> Array
note:
- ┌─ external_contract.fe:13:13
+ ┌─ external_contract.fe:14:13
│
-13 │ let my_array: Array = [0; 3]
+14 │ let my_array: Array = [0; 3]
│ ^^^^^^^^ Array
note:
- ┌─ external_contract.fe:13:41
+ ┌─ external_contract.fe:14:41
│
-13 │ let my_array: Array = [0; 3]
+14 │ let my_array: Array = [0; 3]
│ ^ ^ u256: Value
│ │
│ u256: Value
note:
- ┌─ external_contract.fe:13:40
+ ┌─ external_contract.fe:14:40
│
-13 │ let my_array: Array = [0; 3]
+14 │ let my_array: Array = [0; 3]
│ ^^^^^^ Array: Memory
-14 │ my_array[0] = a
+15 │ my_array[0] = a
│ ^^^^^^^^ ^ u256: Value
│ │
│ Array: Memory
note:
- ┌─ external_contract.fe:14:9
+ ┌─ external_contract.fe:15:9
│
-14 │ my_array[0] = a
+15 │ my_array[0] = a
│ ^^^^^^^^^^^ ^ u256: Value
│ │
│ u256: Memory
-15 │ my_array[1] = a * b
+16 │ my_array[1] = a * b
│ ^^^^^^^^ ^ u256: Value
│ │
│ Array: Memory
note:
- ┌─ external_contract.fe:15:9
+ ┌─ external_contract.fe:16:9
│
-15 │ my_array[1] = a * b
+16 │ my_array[1] = a * b
│ ^^^^^^^^^^^ ^ ^ u256: Value
│ │ │
│ │ u256: Value
│ u256: Memory
note:
- ┌─ external_contract.fe:15:23
+ ┌─ external_contract.fe:16:23
│
-15 │ my_array[1] = a * b
+16 │ my_array[1] = a * b
│ ^^^^^ u256: Value
-16 │ my_array[2] = b
+17 │ my_array[2] = b
│ ^^^^^^^^ ^ u256: Value
│ │
│ Array: Memory
note:
- ┌─ external_contract.fe:16:9
+ ┌─ external_contract.fe:17:9
│
-16 │ my_array[2] = b
+17 │ my_array[2] = b
│ ^^^^^^^^^^^ ^ u256: Value
│ │
│ u256: Memory
-17 │ return my_array
+18 │ return my_array
│ ^^^^^^^^ Array: Memory
note:
- ┌─ external_contract.fe:20:5
+ ┌─ external_contract.fe:21:5
│
-20 │ ╭ pub fn pure_add(_ x: u256, _ y: u256) -> u256 {
-21 │ │ return x + y
-22 │ │ }
+21 │ ╭ pub fn pure_add(_ x: u256, _ y: u256) -> u256 {
+22 │ │ return x + y
+23 │ │ }
│ ╰─────^ self: None, params: [{ label: Some("_"), name: x, typ: u256 }, { label: Some("_"), name: y, typ: u256 }] -> u256
note:
- ┌─ external_contract.fe:21:16
+ ┌─ external_contract.fe:22:16
│
-21 │ return x + y
+22 │ return x + y
│ ^ ^ u256: Value
│ │
│ u256: Value
note:
- ┌─ external_contract.fe:21:16
+ ┌─ external_contract.fe:22:16
│
-21 │ return x + y
+22 │ return x + y
│ ^^^^^ u256: Value
note:
- ┌─ external_contract.fe:26:5
+ ┌─ external_contract.fe:27:5
│
-26 │ ╭ pub fn call_emit_event(ctx: Context, foo_address: address, my_num: u256, my_addrs: Array, my_string: String<11>) {
-27 │ │ let foo: Foo = Foo(foo_address)
-28 │ │ foo.emit_event(ctx, my_num, my_addrs, my_string)
-29 │ │ }
+27 │ ╭ pub fn call_emit_event(ctx: Context, foo_address: address, my_num: u256, my_addrs: Array, my_string: String<11>) {
+28 │ │ let foo: Foo = Foo(foo_address)
+29 │ │ foo.emit_event(ctx, my_num, my_addrs, my_string)
+30 │ │ }
│ ╰─────^ self: None, params: [{ label: None, name: ctx, typ: Context }, { label: None, name: foo_address, typ: address }, { label: None, name: my_num, typ: u256 }, { label: None, name: my_addrs, typ: Array }, { label: None, name: my_string, typ: String<11> }] -> ()
note:
- ┌─ external_contract.fe:27:13
+ ┌─ external_contract.fe:28:13
│
-27 │ let foo: Foo = Foo(foo_address)
+28 │ let foo: Foo = Foo(foo_address)
│ ^^^ Foo
note:
- ┌─ external_contract.fe:27:28
+ ┌─ external_contract.fe:28:28
│
-27 │ let foo: Foo = Foo(foo_address)
+28 │ let foo: Foo = Foo(foo_address)
│ ^^^^^^^^^^^ address: Value
note:
- ┌─ external_contract.fe:27:24
+ ┌─ external_contract.fe:28:24
│
-27 │ let foo: Foo = Foo(foo_address)
+28 │ let foo: Foo = Foo(foo_address)
│ ^^^^^^^^^^^^^^^^ Foo: Value
-28 │ foo.emit_event(ctx, my_num, my_addrs, my_string)
+29 │ foo.emit_event(ctx, my_num, my_addrs, my_string)
│ ^^^ ^^^ ^^^^^^ ^^^^^^^^ ^^^^^^^^^ String<11>: Memory
│ │ │ │ │
│ │ │ │ Array: Memory
@@ -165,69 +177,69 @@ note:
│ Foo: Value
note:
- ┌─ external_contract.fe:28:9
+ ┌─ external_contract.fe:29:9
│
-28 │ foo.emit_event(ctx, my_num, my_addrs, my_string)
+29 │ foo.emit_event(ctx, my_num, my_addrs, my_string)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
note:
- ┌─ external_contract.fe:31:5
+ ┌─ external_contract.fe:32:5
│
-31 │ ╭ pub fn call_build_array(foo_address: address, a: u256, b: u256) -> Array {
-32 │ │ let foo: Foo = Foo(foo_address)
-33 │ │ return foo.build_array(a, b)
-34 │ │ }
+32 │ ╭ pub fn call_build_array(foo_address: address, a: u256, b: u256) -> Array {
+33 │ │ let foo: Foo = Foo(foo_address)
+34 │ │ return foo.build_array(a, b)
+35 │ │ }
│ ╰─────^ self: None, params: [{ label: None, name: foo_address, typ: address }, { label: None, name: a, typ: u256 }, { label: None, name: b, typ: u256 }] -> Array
note:
- ┌─ external_contract.fe:32:13
+ ┌─ external_contract.fe:33:13
│
-32 │ let foo: Foo = Foo(foo_address)
+33 │ let foo: Foo = Foo(foo_address)
│ ^^^ Foo
note:
- ┌─ external_contract.fe:32:28
+ ┌─ external_contract.fe:33:28
│
-32 │ let foo: Foo = Foo(foo_address)
+33 │ let foo: Foo = Foo(foo_address)
│ ^^^^^^^^^^^ address: Value
note:
- ┌─ external_contract.fe:32:24
+ ┌─ external_contract.fe:33:24
│
-32 │ let foo: Foo = Foo(foo_address)
+33 │ let foo: Foo = Foo(foo_address)
│ ^^^^^^^^^^^^^^^^ Foo: Value
-33 │ return foo.build_array(a, b)
+34 │ return foo.build_array(a, b)
│ ^^^ ^ ^ u256: Value
│ │ │
│ │ u256: Value
│ Foo: Value
note:
- ┌─ external_contract.fe:33:16
+ ┌─ external_contract.fe:34:16
│
-33 │ return foo.build_array(a, b)
+34 │ return foo.build_array(a, b)
│ ^^^^^^^^^^^^^^^^^^^^^ Array: Memory
note:
- ┌─ external_contract.fe:36:5
+ ┌─ external_contract.fe:37:5
│
-36 │ ╭ pub fn add(_ x: u256, _ y: u256) -> u256 {
-37 │ │ return Foo::pure_add(x, y)
-38 │ │ }
+37 │ ╭ pub fn add(_ x: u256, _ y: u256) -> u256 {
+38 │ │ return Foo::pure_add(x, y)
+39 │ │ }
│ ╰─────^ self: None, params: [{ label: Some("_"), name: x, typ: u256 }, { label: Some("_"), name: y, typ: u256 }] -> u256
note:
- ┌─ external_contract.fe:37:30
+ ┌─ external_contract.fe:38:30
│
-37 │ return Foo::pure_add(x, y)
+38 │ return Foo::pure_add(x, y)
│ ^ ^ u256: Value
│ │
│ u256: Value
note:
- ┌─ external_contract.fe:37:16
+ ┌─ external_contract.fe:38:16
│
-37 │ return Foo::pure_add(x, y)
+38 │ return Foo::pure_add(x, y)
│ ^^^^^^^^^^^^^^^^^^^ u256: Value
diff --git a/crates/analyzer/tests/snapshots/analysis__guest_book.snap b/crates/analyzer/tests/snapshots/analysis__guest_book.snap
index bc5bc01bda..ec11fe291b 100644
--- a/crates/analyzer/tests/snapshots/analysis__guest_book.snap
+++ b/crates/analyzer/tests/snapshots/analysis__guest_book.snap
@@ -4,16 +4,16 @@ expression: "build_snapshot(&db, module)"
---
note:
- ┌─ guest_book.fe:5:5
+ ┌─ guest_book.fe:3:5
│
-5 │ messages: Map>
- │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Map>
+3 │ pub book_msg: String<100>
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^ String<100>
note:
- ┌─ guest_book.fe:9:9
- │
-9 │ book_msg: String<100>
- │ ^^^^^^^^^^^^^^^^^^^^^ String<100>
+ ┌─ guest_book.fe:10:5
+ │
+10 │ messages: Map>
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Map>
note:
┌─ guest_book.fe:14:5
@@ -22,9 +22,9 @@ note:
15 │ │ // All storage access is explicit using `self.`
16 │ │ self.messages[ctx.msg_sender()] = book_msg
17 │ │
- · │
-20 │ │ emit Signed(ctx, book_msg)
-21 │ │ }
+18 │ │ // Emit the `Signed` event.
+19 │ │ ctx.emit(Signed(book_msg))
+20 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: book_msg, typ: String<100> }] -> ()
note:
@@ -55,45 +55,57 @@ note:
│ │
│ String<100>: Storage { nonce: None }
·
-20 │ emit Signed(ctx, book_msg)
- │ ^^^ ^^^^^^^^ String<100>: Memory
- │ │
- │ Context: Memory
+19 │ ctx.emit(Signed(book_msg))
+ │ ^^^ ^^^^^^^^ String<100>: Memory
+ │ │
+ │ Context: Memory
+
+note:
+ ┌─ guest_book.fe:19:18
+ │
+19 │ ctx.emit(Signed(book_msg))
+ │ ^^^^^^^^^^^^^^^^ Signed: Memory
+
+note:
+ ┌─ guest_book.fe:19:9
+ │
+19 │ ctx.emit(Signed(book_msg))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
note:
- ┌─ guest_book.fe:23:5
+ ┌─ guest_book.fe:22:5
│
-23 │ ╭ pub fn get_msg(self, addr: address) -> String<100> {
-24 │ │ // Copying data from storage to memory
-25 │ │ // has to be done explicitly via `to_mem()`
-26 │ │ return self.messages[addr].to_mem()
-27 │ │ }
+22 │ ╭ pub fn get_msg(self, addr: address) -> String<100> {
+23 │ │ // Copying data from storage to memory
+24 │ │ // has to be done explicitly via `to_mem()`
+25 │ │ return self.messages[addr].to_mem()
+26 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: addr, typ: address }] -> String<100>
note:
- ┌─ guest_book.fe:26:16
+ ┌─ guest_book.fe:25:16
│
-26 │ return self.messages[addr].to_mem()
+25 │ return self.messages[addr].to_mem()
│ ^^^^ GuestBook: Value
note:
- ┌─ guest_book.fe:26:16
+ ┌─ guest_book.fe:25:16
│
-26 │ return self.messages[addr].to_mem()
+25 │ return self.messages[addr].to_mem()
│ ^^^^^^^^^^^^^ ^^^^ address: Value
│ │
│ Map>: Storage { nonce: Some(0) }
note:
- ┌─ guest_book.fe:26:16
+ ┌─ guest_book.fe:25:16
│
-26 │ return self.messages[addr].to_mem()
+25 │ return self.messages[addr].to_mem()
│ ^^^^^^^^^^^^^^^^^^^ String<100>: Storage { nonce: None }
note:
- ┌─ guest_book.fe:26:16
+ ┌─ guest_book.fe:25:16
│
-26 │ return self.messages[addr].to_mem()
+25 │ return self.messages[addr].to_mem()
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ String<100>: Storage { nonce: None } => Memory
diff --git a/crates/analyzer/tests/snapshots/analysis__module_level_events.snap b/crates/analyzer/tests/snapshots/analysis__module_level_events.snap
index 5cfebf1831..cef89c762f 100644
--- a/crates/analyzer/tests/snapshots/analysis__module_level_events.snap
+++ b/crates/analyzer/tests/snapshots/analysis__module_level_events.snap
@@ -4,38 +4,51 @@ expression: "build_snapshot(&db, module)"
---
note:
- ┌─ module_level_events.fe:2:5
+ ┌─ module_level_events.fe:3:5
│
-2 │ idx sender: address
+3 │ pub sender: address
│ ^^^^^^^^^^^^^^^^^^^ address
-3 │ idx receiver: address
+4 │ #indexed
+5 │ pub receiver: address
│ ^^^^^^^^^^^^^^^^^^^^^ address
-4 │ value: u256
- │ ^^^^^^^^^^^ u256
+6 │ pub value: u256
+ │ ^^^^^^^^^^^^^^^ u256
note:
- ┌─ module_level_events.fe:8:5
+ ┌─ module_level_events.fe:10:5
│
- 8 │ ╭ fn transfer(ctx: Context, to: address, value: u256) {
- 9 │ │ emit Transfer(ctx, sender: ctx.msg_sender(), receiver: to, value)
-10 │ │ }
+10 │ ╭ fn transfer(ctx: Context, to: address, value: u256) {
+11 │ │ ctx.emit(Transfer(sender: ctx.msg_sender(), receiver: to, value))
+12 │ │ }
│ ╰─────^ self: None, params: [{ label: None, name: ctx, typ: Context }, { label: None, name: to, typ: address }, { label: None, name: value, typ: u256 }] -> ()
note:
- ┌─ module_level_events.fe:9:23
- │
-9 │ emit Transfer(ctx, sender: ctx.msg_sender(), receiver: to, value)
- │ ^^^ ^^^ Context: Memory
- │ │
- │ Context: Memory
+ ┌─ module_level_events.fe:11:9
+ │
+11 │ ctx.emit(Transfer(sender: ctx.msg_sender(), receiver: to, value))
+ │ ^^^ ^^^ Context: Memory
+ │ │
+ │ Context: Memory
note:
- ┌─ module_level_events.fe:9:36
- │
-9 │ emit Transfer(ctx, sender: ctx.msg_sender(), receiver: to, value)
- │ ^^^^^^^^^^^^^^^^ ^^ ^^^^^ u256: Value
- │ │ │
- │ │ address: Value
- │ address: Value
+ ┌─ module_level_events.fe:11:35
+ │
+11 │ ctx.emit(Transfer(sender: ctx.msg_sender(), receiver: to, value))
+ │ ^^^^^^^^^^^^^^^^ ^^ ^^^^^ u256: Value
+ │ │ │
+ │ │ address: Value
+ │ address: Value
+
+note:
+ ┌─ module_level_events.fe:11:18
+ │
+11 │ ctx.emit(Transfer(sender: ctx.msg_sender(), receiver: to, value))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Transfer: Memory
+
+note:
+ ┌─ module_level_events.fe:11:9
+ │
+11 │ ctx.emit(Transfer(sender: ctx.msg_sender(), receiver: to, value))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
diff --git a/crates/analyzer/tests/snapshots/analysis__ownable.snap b/crates/analyzer/tests/snapshots/analysis__ownable.snap
index 783561b22c..edd4653542 100644
--- a/crates/analyzer/tests/snapshots/analysis__ownable.snap
+++ b/crates/analyzer/tests/snapshots/analysis__ownable.snap
@@ -4,182 +4,207 @@ expression: "build_snapshot(&db, module)"
---
note:
- ┌─ ownable.fe:2:5
+ ┌─ ownable.fe:3:5
│
-2 │ _owner: address
- │ ^^^^^^^^^^^^^^^ address
+3 │ pub previousOwner: address
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ address
+4 │ #indexed
+5 │ pub newOwner: address
+ │ ^^^^^^^^^^^^^^^^^^^^^ address
note:
- ┌─ ownable.fe:5:9
+ ┌─ ownable.fe:9:5
│
-5 │ idx previousOwner: address
- │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ address
-6 │ idx newOwner: address
- │ ^^^^^^^^^^^^^^^^^^^^^ address
+9 │ _owner: address
+ │ ^^^^^^^^^^^^^^^ address
note:
- ┌─ ownable.fe:13:5
+ ┌─ ownable.fe:15:5
│
-13 │ ╭ pub fn owner(self) -> address {
-14 │ │ return self._owner
-15 │ │ }
+15 │ ╭ pub fn owner(self) -> address {
+16 │ │ return self._owner
+17 │ │ }
│ ╰─────^ self: Some(Mutable), params: [] -> address
note:
- ┌─ ownable.fe:14:16
+ ┌─ ownable.fe:16:16
│
-14 │ return self._owner
+16 │ return self._owner
│ ^^^^ Ownable: Value
note:
- ┌─ ownable.fe:14:16
+ ┌─ ownable.fe:16:16
│
-14 │ return self._owner
+16 │ return self._owner
│ ^^^^^^^^^^^ address: Storage { nonce: Some(0) } => Value
note:
- ┌─ ownable.fe:17:5
+ ┌─ ownable.fe:19:5
│
-17 │ ╭ pub fn renounceOwnership(self, ctx: Context) {
-18 │ │ assert ctx.msg_sender() == self._owner
-19 │ │ self._owner = address(0)
-20 │ │ emit OwnershipTransferred(ctx, previousOwner: ctx.msg_sender(), newOwner: address(0))
-21 │ │ }
+19 │ ╭ pub fn renounceOwnership(self, ctx: Context) {
+20 │ │ assert ctx.msg_sender() == self._owner
+21 │ │ self._owner = address(0)
+22 │ │ ctx.emit(OwnershipTransferred(previousOwner: ctx.msg_sender(), newOwner: address(0)))
+23 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }] -> ()
note:
- ┌─ ownable.fe:18:16
+ ┌─ ownable.fe:20:16
│
-18 │ assert ctx.msg_sender() == self._owner
+20 │ assert ctx.msg_sender() == self._owner
│ ^^^ Context: Memory
note:
- ┌─ ownable.fe:18:16
+ ┌─ ownable.fe:20:16
│
-18 │ assert ctx.msg_sender() == self._owner
+20 │ assert ctx.msg_sender() == self._owner
│ ^^^^^^^^^^^^^^^^ ^^^^ Ownable: Value
│ │
│ address: Value
note:
- ┌─ ownable.fe:18:36
+ ┌─ ownable.fe:20:36
│
-18 │ assert ctx.msg_sender() == self._owner
+20 │ assert ctx.msg_sender() == self._owner
│ ^^^^^^^^^^^ address: Storage { nonce: Some(0) } => Value
note:
- ┌─ ownable.fe:18:16
+ ┌─ ownable.fe:20:16
│
-18 │ assert ctx.msg_sender() == self._owner
+20 │ assert ctx.msg_sender() == self._owner
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bool: Value
-19 │ self._owner = address(0)
+21 │ self._owner = address(0)
│ ^^^^ Ownable: Value
note:
- ┌─ ownable.fe:19:9
+ ┌─ ownable.fe:21:9
│
-19 │ self._owner = address(0)
+21 │ self._owner = address(0)
│ ^^^^^^^^^^^ ^ u256: Value
│ │
│ address: Storage { nonce: Some(0) }
note:
- ┌─ ownable.fe:19:23
+ ┌─ ownable.fe:21:23
│
-19 │ self._owner = address(0)
+21 │ self._owner = address(0)
│ ^^^^^^^^^^ address: Value
-20 │ emit OwnershipTransferred(ctx, previousOwner: ctx.msg_sender(), newOwner: address(0))
- │ ^^^ ^^^ Context: Memory
- │ │
- │ Context: Memory
+22 │ ctx.emit(OwnershipTransferred(previousOwner: ctx.msg_sender(), newOwner: address(0)))
+ │ ^^^ ^^^ Context: Memory
+ │ │
+ │ Context: Memory
+
+note:
+ ┌─ ownable.fe:22:54
+ │
+22 │ ctx.emit(OwnershipTransferred(previousOwner: ctx.msg_sender(), newOwner: address(0)))
+ │ ^^^^^^^^^^^^^^^^ ^ u256: Value
+ │ │
+ │ address: Value
+
+note:
+ ┌─ ownable.fe:22:82
+ │
+22 │ ctx.emit(OwnershipTransferred(previousOwner: ctx.msg_sender(), newOwner: address(0)))
+ │ ^^^^^^^^^^ address: Value
note:
- ┌─ ownable.fe:20:55
+ ┌─ ownable.fe:22:18
│
-20 │ emit OwnershipTransferred(ctx, previousOwner: ctx.msg_sender(), newOwner: address(0))
- │ ^^^^^^^^^^^^^^^^ ^ u256: Value
- │ │
- │ address: Value
+22 │ ctx.emit(OwnershipTransferred(previousOwner: ctx.msg_sender(), newOwner: address(0)))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ OwnershipTransferred: Memory
note:
- ┌─ ownable.fe:20:83
+ ┌─ ownable.fe:22:9
│
-20 │ emit OwnershipTransferred(ctx, previousOwner: ctx.msg_sender(), newOwner: address(0))
- │ ^^^^^^^^^^ address: Value
+22 │ ctx.emit(OwnershipTransferred(previousOwner: ctx.msg_sender(), newOwner: address(0)))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
note:
- ┌─ ownable.fe:23:5
+ ┌─ ownable.fe:25:5
│
-23 │ ╭ pub fn transferOwnership(self, ctx: Context, newOwner: address) {
-24 │ │ assert ctx.msg_sender() == self._owner
-25 │ │ assert newOwner != address(0)
-26 │ │ self._owner = newOwner
-27 │ │ emit OwnershipTransferred(ctx, previousOwner: ctx.msg_sender(), newOwner)
-28 │ │ }
+25 │ ╭ pub fn transferOwnership(self, ctx: Context, newOwner: address) {
+26 │ │ assert ctx.msg_sender() == self._owner
+27 │ │ assert newOwner != address(0)
+28 │ │ self._owner = newOwner
+29 │ │ ctx.emit(OwnershipTransferred(previousOwner: ctx.msg_sender(), newOwner))
+30 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: newOwner, typ: address }] -> ()
note:
- ┌─ ownable.fe:24:16
+ ┌─ ownable.fe:26:16
│
-24 │ assert ctx.msg_sender() == self._owner
+26 │ assert ctx.msg_sender() == self._owner
│ ^^^ Context: Memory
note:
- ┌─ ownable.fe:24:16
+ ┌─ ownable.fe:26:16
│
-24 │ assert ctx.msg_sender() == self._owner
+26 │ assert ctx.msg_sender() == self._owner
│ ^^^^^^^^^^^^^^^^ ^^^^ Ownable: Value
│ │
│ address: Value
note:
- ┌─ ownable.fe:24:36
+ ┌─ ownable.fe:26:36
│
-24 │ assert ctx.msg_sender() == self._owner
+26 │ assert ctx.msg_sender() == self._owner
│ ^^^^^^^^^^^ address: Storage { nonce: Some(0) } => Value
note:
- ┌─ ownable.fe:24:16
+ ┌─ ownable.fe:26:16
│
-24 │ assert ctx.msg_sender() == self._owner
+26 │ assert ctx.msg_sender() == self._owner
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bool: Value
-25 │ assert newOwner != address(0)
+27 │ assert newOwner != address(0)
│ ^^^^^^^^ ^ u256: Value
│ │
│ address: Value
note:
- ┌─ ownable.fe:25:28
+ ┌─ ownable.fe:27:28
│
-25 │ assert newOwner != address(0)
+27 │ assert newOwner != address(0)
│ ^^^^^^^^^^ address: Value
note:
- ┌─ ownable.fe:25:16
+ ┌─ ownable.fe:27:16
│
-25 │ assert newOwner != address(0)
+27 │ assert newOwner != address(0)
│ ^^^^^^^^^^^^^^^^^^^^^^ bool: Value
-26 │ self._owner = newOwner
+28 │ self._owner = newOwner
│ ^^^^ Ownable: Value
note:
- ┌─ ownable.fe:26:9
+ ┌─ ownable.fe:28:9
│
-26 │ self._owner = newOwner
+28 │ self._owner = newOwner
│ ^^^^^^^^^^^ ^^^^^^^^ address: Value
│ │
│ address: Storage { nonce: Some(0) }
-27 │ emit OwnershipTransferred(ctx, previousOwner: ctx.msg_sender(), newOwner)
- │ ^^^ ^^^ Context: Memory
- │ │
- │ Context: Memory
+29 │ ctx.emit(OwnershipTransferred(previousOwner: ctx.msg_sender(), newOwner))
+ │ ^^^ ^^^ Context: Memory
+ │ │
+ │ Context: Memory
+
+note:
+ ┌─ ownable.fe:29:54
+ │
+29 │ ctx.emit(OwnershipTransferred(previousOwner: ctx.msg_sender(), newOwner))
+ │ ^^^^^^^^^^^^^^^^ ^^^^^^^^ address: Value
+ │ │
+ │ address: Value
+
+note:
+ ┌─ ownable.fe:29:18
+ │
+29 │ ctx.emit(OwnershipTransferred(previousOwner: ctx.msg_sender(), newOwner))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ OwnershipTransferred: Memory
note:
- ┌─ ownable.fe:27:55
+ ┌─ ownable.fe:29:9
│
-27 │ emit OwnershipTransferred(ctx, previousOwner: ctx.msg_sender(), newOwner)
- │ ^^^^^^^^^^^^^^^^ ^^^^^^^^ address: Value
- │ │
- │ address: Value
+29 │ ctx.emit(OwnershipTransferred(previousOwner: ctx.msg_sender(), newOwner))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
diff --git a/crates/analyzer/tests/snapshots/analysis__simple_open_auction.snap b/crates/analyzer/tests/snapshots/analysis__simple_open_auction.snap
index 93dd727b82..2d8797f230 100644
--- a/crates/analyzer/tests/snapshots/analysis__simple_open_auction.snap
+++ b/crates/analyzer/tests/snapshots/analysis__simple_open_auction.snap
@@ -10,419 +10,443 @@ note:
│ ^^^^^^^^^^^^^^^^^^^^^ u256
note:
- ┌─ simple_open_auction.fe:12:5
+ ┌─ simple_open_auction.fe:13:5
│
-12 │ auction_end_time: u256
- │ ^^^^^^^^^^^^^^^^^^^^^^ u256
-13 │ beneficiary: address
- │ ^^^^^^^^^^^^^^^^^^^^ address
-14 │
-15 │ highest_bidder: address
- │ ^^^^^^^^^^^^^^^^^^^^^^^ address
-16 │ highest_bid: u256
- │ ^^^^^^^^^^^^^^^^^ u256
-17 │
-18 │ pending_returns: Map
- │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Map
-19 │
-20 │ ended: bool
- │ ^^^^^^^^^^^ bool
+13 │ pub bidder: address
+ │ ^^^^^^^^^^^^^^^^^^^ address
+14 │ pub amount: u256
+ │ ^^^^^^^^^^^^^^^^ u256
note:
- ┌─ simple_open_auction.fe:24:9
+ ┌─ simple_open_auction.fe:19:5
│
-24 │ idx bidder: address
- │ ^^^^^^^^^^^^^^^^^^^ address
-25 │ amount: u256
- │ ^^^^^^^^^^^^ u256
+19 │ pub winner: address
+ │ ^^^^^^^^^^^^^^^^^^^ address
+20 │ pub amount: u256
+ │ ^^^^^^^^^^^^^^^^ u256
note:
- ┌─ simple_open_auction.fe:29:9
+ ┌─ simple_open_auction.fe:25:5
│
-29 │ idx winner: address
- │ ^^^^^^^^^^^^^^^^^^^ address
-30 │ amount: u256
- │ ^^^^^^^^^^^^ u256
+25 │ auction_end_time: u256
+ │ ^^^^^^^^^^^^^^^^^^^^^^ u256
+26 │ beneficiary: address
+ │ ^^^^^^^^^^^^^^^^^^^^ address
+27 │
+28 │ highest_bidder: address
+ │ ^^^^^^^^^^^^^^^^^^^^^^^ address
+29 │ highest_bid: u256
+ │ ^^^^^^^^^^^^^^^^^ u256
+30 │
+31 │ pending_returns: Map
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Map
+32 │
+33 │ ended: bool
+ │ ^^^^^^^^^^^ bool
note:
- ┌─ simple_open_auction.fe:40:5
+ ┌─ simple_open_auction.fe:42:5
│
-40 │ ╭ pub fn bid(self, ctx: Context) {
-41 │ │ if ctx.block_timestamp() > self.auction_end_time {
-42 │ │ revert AuctionAlreadyEnded()
-43 │ │ }
+42 │ ╭ pub fn bid(self, ctx: Context) {
+43 │ │ if ctx.block_timestamp() > self.auction_end_time {
+44 │ │ revert AuctionAlreadyEnded()
+45 │ │ }
· │
-53 │ │ emit HighestBidIncreased(ctx, bidder: ctx.msg_sender(), amount: ctx.msg_value())
-54 │ │ }
+55 │ │ ctx.emit(HighestBidIncreased(bidder: ctx.msg_sender(), amount: ctx.msg_value()))
+56 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }] -> ()
note:
- ┌─ simple_open_auction.fe:41:12
+ ┌─ simple_open_auction.fe:43:12
│
-41 │ if ctx.block_timestamp() > self.auction_end_time {
+43 │ if ctx.block_timestamp() > self.auction_end_time {
│ ^^^ Context: Memory
note:
- ┌─ simple_open_auction.fe:41:12
+ ┌─ simple_open_auction.fe:43:12
│
-41 │ if ctx.block_timestamp() > self.auction_end_time {
+43 │ if ctx.block_timestamp() > self.auction_end_time {
│ ^^^^^^^^^^^^^^^^^^^^^ ^^^^ SimpleOpenAuction: Value
│ │
│ u256: Value
note:
- ┌─ simple_open_auction.fe:41:36
+ ┌─ simple_open_auction.fe:43:36
│
-41 │ if ctx.block_timestamp() > self.auction_end_time {
+43 │ if ctx.block_timestamp() > self.auction_end_time {
│ ^^^^^^^^^^^^^^^^^^^^^ u256: Storage { nonce: Some(0) } => Value
note:
- ┌─ simple_open_auction.fe:41:12
+ ┌─ simple_open_auction.fe:43:12
│
-41 │ if ctx.block_timestamp() > self.auction_end_time {
+43 │ if ctx.block_timestamp() > self.auction_end_time {
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bool: Value
-42 │ revert AuctionAlreadyEnded()
+44 │ revert AuctionAlreadyEnded()
│ ^^^^^^^^^^^^^^^^^^^^^ AuctionAlreadyEnded: Memory
-43 │ }
-44 │ if ctx.msg_value() <= self.highest_bid {
+45 │ }
+46 │ if ctx.msg_value() <= self.highest_bid {
│ ^^^ Context: Memory
note:
- ┌─ simple_open_auction.fe:44:12
+ ┌─ simple_open_auction.fe:46:12
│
-44 │ if ctx.msg_value() <= self.highest_bid {
+46 │ if ctx.msg_value() <= self.highest_bid {
│ ^^^^^^^^^^^^^^^ ^^^^ SimpleOpenAuction: Value
│ │
│ u256: Value
note:
- ┌─ simple_open_auction.fe:44:31
+ ┌─ simple_open_auction.fe:46:31
│
-44 │ if ctx.msg_value() <= self.highest_bid {
+46 │ if ctx.msg_value() <= self.highest_bid {
│ ^^^^^^^^^^^^^^^^ u256: Storage { nonce: Some(3) } => Value
note:
- ┌─ simple_open_auction.fe:44:12
+ ┌─ simple_open_auction.fe:46:12
│
-44 │ if ctx.msg_value() <= self.highest_bid {
+46 │ if ctx.msg_value() <= self.highest_bid {
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bool: Value
-45 │ revert BidNotHighEnough(highest_bid: self.highest_bid)
+47 │ revert BidNotHighEnough(highest_bid: self.highest_bid)
│ ^^^^ SimpleOpenAuction: Value
note:
- ┌─ simple_open_auction.fe:45:50
+ ┌─ simple_open_auction.fe:47:50
│
-45 │ revert BidNotHighEnough(highest_bid: self.highest_bid)
+47 │ revert BidNotHighEnough(highest_bid: self.highest_bid)
│ ^^^^^^^^^^^^^^^^ u256: Storage { nonce: Some(3) } => Value
note:
- ┌─ simple_open_auction.fe:45:20
+ ┌─ simple_open_auction.fe:47:20
│
-45 │ revert BidNotHighEnough(highest_bid: self.highest_bid)
+47 │ revert BidNotHighEnough(highest_bid: self.highest_bid)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ BidNotHighEnough: Memory
-46 │ }
-47 │ if self.highest_bid != 0 {
+48 │ }
+49 │ if self.highest_bid != 0 {
│ ^^^^ SimpleOpenAuction: Value
note:
- ┌─ simple_open_auction.fe:47:12
+ ┌─ simple_open_auction.fe:49:12
│
-47 │ if self.highest_bid != 0 {
+49 │ if self.highest_bid != 0 {
│ ^^^^^^^^^^^^^^^^ ^ u256: Value
│ │
│ u256: Storage { nonce: Some(3) } => Value
note:
- ┌─ simple_open_auction.fe:47:12
+ ┌─ simple_open_auction.fe:49:12
│
-47 │ if self.highest_bid != 0 {
+49 │ if self.highest_bid != 0 {
│ ^^^^^^^^^^^^^^^^^^^^^ bool: Value
-48 │ self.pending_returns[self.highest_bidder] += self.highest_bid
+50 │ self.pending_returns[self.highest_bidder] += self.highest_bid
│ ^^^^ SimpleOpenAuction: Value
note:
- ┌─ simple_open_auction.fe:48:13
+ ┌─ simple_open_auction.fe:50:13
│
-48 │ self.pending_returns[self.highest_bidder] += self.highest_bid
+50 │ self.pending_returns[self.highest_bidder] += self.highest_bid
│ ^^^^^^^^^^^^^^^^^^^^ ^^^^ SimpleOpenAuction: Value
│ │
│ Map: Storage { nonce: Some(4) }
note:
- ┌─ simple_open_auction.fe:48:34
+ ┌─ simple_open_auction.fe:50:34
│
-48 │ self.pending_returns[self.highest_bidder] += self.highest_bid
+50 │ self.pending_returns[self.highest_bidder] += self.highest_bid
│ ^^^^^^^^^^^^^^^^^^^ address: Storage { nonce: Some(2) } => Value
note:
- ┌─ simple_open_auction.fe:48:13
+ ┌─ simple_open_auction.fe:50:13
│
-48 │ self.pending_returns[self.highest_bidder] += self.highest_bid
+50 │ self.pending_returns[self.highest_bidder] += self.highest_bid
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ SimpleOpenAuction: Value
│ │
│ u256: Storage { nonce: None }
note:
- ┌─ simple_open_auction.fe:48:58
+ ┌─ simple_open_auction.fe:50:58
│
-48 │ self.pending_returns[self.highest_bidder] += self.highest_bid
+50 │ self.pending_returns[self.highest_bidder] += self.highest_bid
│ ^^^^^^^^^^^^^^^^ u256: Storage { nonce: Some(3) }
-49 │ }
-50 │ self.highest_bidder = ctx.msg_sender()
+51 │ }
+52 │ self.highest_bidder = ctx.msg_sender()
│ ^^^^ SimpleOpenAuction: Value
note:
- ┌─ simple_open_auction.fe:50:9
+ ┌─ simple_open_auction.fe:52:9
│
-50 │ self.highest_bidder = ctx.msg_sender()
+52 │ self.highest_bidder = ctx.msg_sender()
│ ^^^^^^^^^^^^^^^^^^^ ^^^ Context: Memory
│ │
│ address: Storage { nonce: Some(2) }
note:
- ┌─ simple_open_auction.fe:50:31
+ ┌─ simple_open_auction.fe:52:31
│
-50 │ self.highest_bidder = ctx.msg_sender()
+52 │ self.highest_bidder = ctx.msg_sender()
│ ^^^^^^^^^^^^^^^^ address: Value
-51 │ self.highest_bid = ctx.msg_value()
+53 │ self.highest_bid = ctx.msg_value()
│ ^^^^ SimpleOpenAuction: Value
note:
- ┌─ simple_open_auction.fe:51:9
+ ┌─ simple_open_auction.fe:53:9
│
-51 │ self.highest_bid = ctx.msg_value()
+53 │ self.highest_bid = ctx.msg_value()
│ ^^^^^^^^^^^^^^^^ ^^^ Context: Memory
│ │
│ u256: Storage { nonce: Some(3) }
note:
- ┌─ simple_open_auction.fe:51:28
+ ┌─ simple_open_auction.fe:53:28
│
-51 │ self.highest_bid = ctx.msg_value()
+53 │ self.highest_bid = ctx.msg_value()
│ ^^^^^^^^^^^^^^^ u256: Value
-52 │
-53 │ emit HighestBidIncreased(ctx, bidder: ctx.msg_sender(), amount: ctx.msg_value())
- │ ^^^ ^^^ Context: Memory
- │ │
- │ Context: Memory
+54 │
+55 │ ctx.emit(HighestBidIncreased(bidder: ctx.msg_sender(), amount: ctx.msg_value()))
+ │ ^^^ ^^^ Context: Memory
+ │ │
+ │ Context: Memory
+
+note:
+ ┌─ simple_open_auction.fe:55:46
+ │
+55 │ ctx.emit(HighestBidIncreased(bidder: ctx.msg_sender(), amount: ctx.msg_value()))
+ │ ^^^^^^^^^^^^^^^^ ^^^ Context: Memory
+ │ │
+ │ address: Value
note:
- ┌─ simple_open_auction.fe:53:47
+ ┌─ simple_open_auction.fe:55:72
│
-53 │ emit HighestBidIncreased(ctx, bidder: ctx.msg_sender(), amount: ctx.msg_value())
- │ ^^^^^^^^^^^^^^^^ ^^^ Context: Memory
- │ │
- │ address: Value
+55 │ ctx.emit(HighestBidIncreased(bidder: ctx.msg_sender(), amount: ctx.msg_value()))
+ │ ^^^^^^^^^^^^^^^ u256: Value
note:
- ┌─ simple_open_auction.fe:53:73
+ ┌─ simple_open_auction.fe:55:18
│
-53 │ emit HighestBidIncreased(ctx, bidder: ctx.msg_sender(), amount: ctx.msg_value())
- │ ^^^^^^^^^^^^^^^ u256: Value
+55 │ ctx.emit(HighestBidIncreased(bidder: ctx.msg_sender(), amount: ctx.msg_value()))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ HighestBidIncreased: Memory
note:
- ┌─ simple_open_auction.fe:56:5
+ ┌─ simple_open_auction.fe:55:9
+ │
+55 │ ctx.emit(HighestBidIncreased(bidder: ctx.msg_sender(), amount: ctx.msg_value()))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
+
+note:
+ ┌─ simple_open_auction.fe:58:5
│
-56 │ ╭ pub fn withdraw(self, ctx: Context) -> bool {
-57 │ │ let amount: u256 = self.pending_returns[ctx.msg_sender()]
-58 │ │
-59 │ │ if amount > 0 {
+58 │ ╭ pub fn withdraw(self, ctx: Context) -> bool {
+59 │ │ let amount: u256 = self.pending_returns[ctx.msg_sender()]
+60 │ │
+61 │ │ if amount > 0 {
· │
-63 │ │ return true
-64 │ │ }
+65 │ │ return true
+66 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }] -> bool
note:
- ┌─ simple_open_auction.fe:57:13
+ ┌─ simple_open_auction.fe:59:13
│
-57 │ let amount: u256 = self.pending_returns[ctx.msg_sender()]
+59 │ let amount: u256 = self.pending_returns[ctx.msg_sender()]
│ ^^^^^^ u256
note:
- ┌─ simple_open_auction.fe:57:28
+ ┌─ simple_open_auction.fe:59:28
│
-57 │ let amount: u256 = self.pending_returns[ctx.msg_sender()]
+59 │ let amount: u256 = self.pending_returns[ctx.msg_sender()]
│ ^^^^ SimpleOpenAuction: Value
note:
- ┌─ simple_open_auction.fe:57:28
+ ┌─ simple_open_auction.fe:59:28
│
-57 │ let amount: u256 = self.pending_returns[ctx.msg_sender()]
+59 │ let amount: u256 = self.pending_returns[ctx.msg_sender()]
│ ^^^^^^^^^^^^^^^^^^^^ ^^^ Context: Memory
│ │
│ Map: Storage { nonce: Some(4) }
note:
- ┌─ simple_open_auction.fe:57:49
+ ┌─ simple_open_auction.fe:59:49
│
-57 │ let amount: u256 = self.pending_returns[ctx.msg_sender()]
+59 │ let amount: u256 = self.pending_returns[ctx.msg_sender()]
│ ^^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ simple_open_auction.fe:57:28
+ ┌─ simple_open_auction.fe:59:28
│
-57 │ let amount: u256 = self.pending_returns[ctx.msg_sender()]
+59 │ let amount: u256 = self.pending_returns[ctx.msg_sender()]
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Storage { nonce: None } => Value
-58 │
-59 │ if amount > 0 {
+60 │
+61 │ if amount > 0 {
│ ^^^^^^ ^ u256: Value
│ │
│ u256: Value
note:
- ┌─ simple_open_auction.fe:59:12
+ ┌─ simple_open_auction.fe:61:12
│
-59 │ if amount > 0 {
+61 │ if amount > 0 {
│ ^^^^^^^^^^ bool: Value
-60 │ self.pending_returns[ctx.msg_sender()] = 0
+62 │ self.pending_returns[ctx.msg_sender()] = 0
│ ^^^^ SimpleOpenAuction: Value
note:
- ┌─ simple_open_auction.fe:60:13
+ ┌─ simple_open_auction.fe:62:13
│
-60 │ self.pending_returns[ctx.msg_sender()] = 0
+62 │ self.pending_returns[ctx.msg_sender()] = 0
│ ^^^^^^^^^^^^^^^^^^^^ ^^^ Context: Memory
│ │
│ Map: Storage { nonce: Some(4) }
note:
- ┌─ simple_open_auction.fe:60:34
+ ┌─ simple_open_auction.fe:62:34
│
-60 │ self.pending_returns[ctx.msg_sender()] = 0
+62 │ self.pending_returns[ctx.msg_sender()] = 0
│ ^^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ simple_open_auction.fe:60:13
+ ┌─ simple_open_auction.fe:62:13
│
-60 │ self.pending_returns[ctx.msg_sender()] = 0
+62 │ self.pending_returns[ctx.msg_sender()] = 0
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^ u256: Value
│ │
│ u256: Storage { nonce: None }
-61 │ ctx.send_value(to: ctx.msg_sender(), wei: amount)
+63 │ ctx.send_value(to: ctx.msg_sender(), wei: amount)
│ ^^^ ^^^ Context: Memory
│ │
│ Context: Memory
note:
- ┌─ simple_open_auction.fe:61:32
+ ┌─ simple_open_auction.fe:63:32
│
-61 │ ctx.send_value(to: ctx.msg_sender(), wei: amount)
+63 │ ctx.send_value(to: ctx.msg_sender(), wei: amount)
│ ^^^^^^^^^^^^^^^^ ^^^^^^ u256: Value
│ │
│ address: Value
note:
- ┌─ simple_open_auction.fe:61:13
+ ┌─ simple_open_auction.fe:63:13
│
-61 │ ctx.send_value(to: ctx.msg_sender(), wei: amount)
+63 │ ctx.send_value(to: ctx.msg_sender(), wei: amount)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
-62 │ }
-63 │ return true
+64 │ }
+65 │ return true
│ ^^^^ bool: Value
note:
- ┌─ simple_open_auction.fe:66:5
+ ┌─ simple_open_auction.fe:68:5
│
-66 │ ╭ pub fn action_end(self, ctx: Context) {
-67 │ │ if ctx.block_timestamp() <= self.auction_end_time {
-68 │ │ revert AuctionNotYetEnded()
-69 │ │ }
+68 │ ╭ pub fn action_end(self, ctx: Context) {
+69 │ │ if ctx.block_timestamp() <= self.auction_end_time {
+70 │ │ revert AuctionNotYetEnded()
+71 │ │ }
· │
-76 │ │ ctx.send_value(to: self.beneficiary, wei: self.highest_bid)
-77 │ │ }
+78 │ │ ctx.send_value(to: self.beneficiary, wei: self.highest_bid)
+79 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }] -> ()
note:
- ┌─ simple_open_auction.fe:67:12
+ ┌─ simple_open_auction.fe:69:12
│
-67 │ if ctx.block_timestamp() <= self.auction_end_time {
+69 │ if ctx.block_timestamp() <= self.auction_end_time {
│ ^^^ Context: Memory
note:
- ┌─ simple_open_auction.fe:67:12
+ ┌─ simple_open_auction.fe:69:12
│
-67 │ if ctx.block_timestamp() <= self.auction_end_time {
+69 │ if ctx.block_timestamp() <= self.auction_end_time {
│ ^^^^^^^^^^^^^^^^^^^^^ ^^^^ SimpleOpenAuction: Value
│ │
│ u256: Value
note:
- ┌─ simple_open_auction.fe:67:37
+ ┌─ simple_open_auction.fe:69:37
│
-67 │ if ctx.block_timestamp() <= self.auction_end_time {
+69 │ if ctx.block_timestamp() <= self.auction_end_time {
│ ^^^^^^^^^^^^^^^^^^^^^ u256: Storage { nonce: Some(0) } => Value
note:
- ┌─ simple_open_auction.fe:67:12
+ ┌─ simple_open_auction.fe:69:12
│
-67 │ if ctx.block_timestamp() <= self.auction_end_time {
+69 │ if ctx.block_timestamp() <= self.auction_end_time {
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bool: Value
-68 │ revert AuctionNotYetEnded()
+70 │ revert AuctionNotYetEnded()
│ ^^^^^^^^^^^^^^^^^^^^ AuctionNotYetEnded: Memory
-69 │ }
-70 │ if self.ended {
+71 │ }
+72 │ if self.ended {
│ ^^^^ SimpleOpenAuction: Value
note:
- ┌─ simple_open_auction.fe:70:12
+ ┌─ simple_open_auction.fe:72:12
│
-70 │ if self.ended {
+72 │ if self.ended {
│ ^^^^^^^^^^ bool: Storage { nonce: Some(5) } => Value
-71 │ revert AuctionEndAlreadyCalled()
+73 │ revert AuctionEndAlreadyCalled()
│ ^^^^^^^^^^^^^^^^^^^^^^^^^ AuctionEndAlreadyCalled: Memory
-72 │ }
-73 │ self.ended = true
+74 │ }
+75 │ self.ended = true
│ ^^^^ SimpleOpenAuction: Value
note:
- ┌─ simple_open_auction.fe:73:9
+ ┌─ simple_open_auction.fe:75:9
│
-73 │ self.ended = true
+75 │ self.ended = true
│ ^^^^^^^^^^ ^^^^ bool: Value
│ │
│ bool: Storage { nonce: Some(5) }
-74 │ emit AuctionEnded(ctx, winner: self.highest_bidder, amount: self.highest_bid)
- │ ^^^ ^^^^ SimpleOpenAuction: Value
- │ │
- │ Context: Memory
+76 │ ctx.emit(AuctionEnded(winner: self.highest_bidder, amount: self.highest_bid))
+ │ ^^^ ^^^^ SimpleOpenAuction: Value
+ │ │
+ │ Context: Memory
+
+note:
+ ┌─ simple_open_auction.fe:76:39
+ │
+76 │ ctx.emit(AuctionEnded(winner: self.highest_bidder, amount: self.highest_bid))
+ │ ^^^^^^^^^^^^^^^^^^^ ^^^^ SimpleOpenAuction: Value
+ │ │
+ │ address: Storage { nonce: Some(2) } => Value
note:
- ┌─ simple_open_auction.fe:74:40
+ ┌─ simple_open_auction.fe:76:68
│
-74 │ emit AuctionEnded(ctx, winner: self.highest_bidder, amount: self.highest_bid)
- │ ^^^^^^^^^^^^^^^^^^^ ^^^^ SimpleOpenAuction: Value
- │ │
- │ address: Storage { nonce: Some(2) } => Value
+76 │ ctx.emit(AuctionEnded(winner: self.highest_bidder, amount: self.highest_bid))
+ │ ^^^^^^^^^^^^^^^^ u256: Storage { nonce: Some(3) } => Value
note:
- ┌─ simple_open_auction.fe:74:69
+ ┌─ simple_open_auction.fe:76:18
│
-74 │ emit AuctionEnded(ctx, winner: self.highest_bidder, amount: self.highest_bid)
- │ ^^^^^^^^^^^^^^^^ u256: Storage { nonce: Some(3) } => Value
-75 │
-76 │ ctx.send_value(to: self.beneficiary, wei: self.highest_bid)
+76 │ ctx.emit(AuctionEnded(winner: self.highest_bidder, amount: self.highest_bid))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AuctionEnded: Memory
+
+note:
+ ┌─ simple_open_auction.fe:76:9
+ │
+76 │ ctx.emit(AuctionEnded(winner: self.highest_bidder, amount: self.highest_bid))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
+77 │
+78 │ ctx.send_value(to: self.beneficiary, wei: self.highest_bid)
│ ^^^ ^^^^ SimpleOpenAuction: Value
│ │
│ Context: Memory
note:
- ┌─ simple_open_auction.fe:76:28
+ ┌─ simple_open_auction.fe:78:28
│
-76 │ ctx.send_value(to: self.beneficiary, wei: self.highest_bid)
+78 │ ctx.send_value(to: self.beneficiary, wei: self.highest_bid)
│ ^^^^^^^^^^^^^^^^ ^^^^ SimpleOpenAuction: Value
│ │
│ address: Storage { nonce: Some(1) } => Value
note:
- ┌─ simple_open_auction.fe:76:51
+ ┌─ simple_open_auction.fe:78:51
│
-76 │ ctx.send_value(to: self.beneficiary, wei: self.highest_bid)
+78 │ ctx.send_value(to: self.beneficiary, wei: self.highest_bid)
│ ^^^^^^^^^^^^^^^^ u256: Storage { nonce: Some(3) } => Value
note:
- ┌─ simple_open_auction.fe:76:9
+ ┌─ simple_open_auction.fe:78:9
│
-76 │ ctx.send_value(to: self.beneficiary, wei: self.highest_bid)
+78 │ ctx.send_value(to: self.beneficiary, wei: self.highest_bid)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
diff --git a/crates/analyzer/tests/snapshots/analysis__sized_vals_in_sto.snap b/crates/analyzer/tests/snapshots/analysis__sized_vals_in_sto.snap
index e6cf4fb36e..7744a0fd06 100644
--- a/crates/analyzer/tests/snapshots/analysis__sized_vals_in_sto.snap
+++ b/crates/analyzer/tests/snapshots/analysis__sized_vals_in_sto.snap
@@ -6,22 +6,22 @@ expression: "build_snapshot(&db, module)"
note:
┌─ sized_vals_in_sto.fe:2:5
│
-2 │ num: u256
- │ ^^^^^^^^^ u256
-3 │ nums: Array
- │ ^^^^^^^^^^^^^^^^^^^^^ Array
-4 │ str: String<26>
- │ ^^^^^^^^^^^^^^^ String<26>
+2 │ pub num: u256
+ │ ^^^^^^^^^^^^^ u256
+3 │ pub nums: Array
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Array
+4 │ pub str: String<26>
+ │ ^^^^^^^^^^^^^^^^^^^ String<26>
note:
- ┌─ sized_vals_in_sto.fe:7:9
- │
-7 │ num: u256
- │ ^^^^^^^^^ u256
-8 │ nums: Array
- │ ^^^^^^^^^^^^^^^^^^^^^ Array
-9 │ str: String<26>
- │ ^^^^^^^^^^^^^^^ String<26>
+ ┌─ sized_vals_in_sto.fe:8:5
+ │
+ 8 │ num: u256
+ │ ^^^^^^^^^ u256
+ 9 │ nums: Array
+ │ ^^^^^^^^^^^^^^^^^^^^^ Array
+10 │ str: String<26>
+ │ ^^^^^^^^^^^^^^^ String<26>
note:
┌─ sized_vals_in_sto.fe:12:5
@@ -165,50 +165,62 @@ note:
┌─ sized_vals_in_sto.fe:36:5
│
36 │ ╭ pub fn emit_event(self, ctx: Context) {
-37 │ │ emit MyEvent(ctx, num: self.num, nums: self.nums.to_mem(), str: self.str.to_mem())
+37 │ │ ctx.emit(MyEvent(num: self.num, nums: self.nums.to_mem(), str: self.str.to_mem()))
38 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }] -> ()
note:
- ┌─ sized_vals_in_sto.fe:37:22
+ ┌─ sized_vals_in_sto.fe:37:9
+ │
+37 │ ctx.emit(MyEvent(num: self.num, nums: self.nums.to_mem(), str: self.str.to_mem()))
+ │ ^^^ ^^^^ Foo: Value
+ │ │
+ │ Context: Memory
+
+note:
+ ┌─ sized_vals_in_sto.fe:37:31
+ │
+37 │ ctx.emit(MyEvent(num: self.num, nums: self.nums.to_mem(), str: self.str.to_mem()))
+ │ ^^^^^^^^ ^^^^ Foo: Value
+ │ │
+ │ u256: Storage { nonce: Some(0) } => Value
+
+note:
+ ┌─ sized_vals_in_sto.fe:37:47
│
-37 │ emit MyEvent(ctx, num: self.num, nums: self.nums.to_mem(), str: self.str.to_mem())
- │ ^^^ ^^^^ Foo: Value
- │ │
- │ Context: Memory
+37 │ ctx.emit(MyEvent(num: self.num, nums: self.nums.to_mem(), str: self.str.to_mem()))
+ │ ^^^^^^^^^ Array: Storage { nonce: Some(1) }
note:
- ┌─ sized_vals_in_sto.fe:37:32
+ ┌─ sized_vals_in_sto.fe:37:47
│
-37 │ emit MyEvent(ctx, num: self.num, nums: self.nums.to_mem(), str: self.str.to_mem())
- │ ^^^^^^^^ ^^^^ Foo: Value
- │ │
- │ u256: Storage { nonce: Some(0) } => Value
+37 │ ctx.emit(MyEvent(num: self.num, nums: self.nums.to_mem(), str: self.str.to_mem()))
+ │ ^^^^^^^^^^^^^^^^^^ ^^^^ Foo: Value
+ │ │
+ │ Array: Storage { nonce: Some(1) } => Memory
note:
- ┌─ sized_vals_in_sto.fe:37:48
+ ┌─ sized_vals_in_sto.fe:37:72
│
-37 │ emit MyEvent(ctx, num: self.num, nums: self.nums.to_mem(), str: self.str.to_mem())
- │ ^^^^^^^^^ Array: Storage { nonce: Some(1) }
+37 │ ctx.emit(MyEvent(num: self.num, nums: self.nums.to_mem(), str: self.str.to_mem()))
+ │ ^^^^^^^^ String<26>: Storage { nonce: Some(2) }
note:
- ┌─ sized_vals_in_sto.fe:37:48
+ ┌─ sized_vals_in_sto.fe:37:72
│
-37 │ emit MyEvent(ctx, num: self.num, nums: self.nums.to_mem(), str: self.str.to_mem())
- │ ^^^^^^^^^^^^^^^^^^ ^^^^ Foo: Value
- │ │
- │ Array: Storage { nonce: Some(1) } => Memory
+37 │ ctx.emit(MyEvent(num: self.num, nums: self.nums.to_mem(), str: self.str.to_mem()))
+ │ ^^^^^^^^^^^^^^^^^ String<26>: Storage { nonce: Some(2) } => Memory
note:
- ┌─ sized_vals_in_sto.fe:37:73
+ ┌─ sized_vals_in_sto.fe:37:18
│
-37 │ emit MyEvent(ctx, num: self.num, nums: self.nums.to_mem(), str: self.str.to_mem())
- │ ^^^^^^^^ String<26>: Storage { nonce: Some(2) }
+37 │ ctx.emit(MyEvent(num: self.num, nums: self.nums.to_mem(), str: self.str.to_mem()))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ MyEvent: Memory
note:
- ┌─ sized_vals_in_sto.fe:37:73
+ ┌─ sized_vals_in_sto.fe:37:9
│
-37 │ emit MyEvent(ctx, num: self.num, nums: self.nums.to_mem(), str: self.str.to_mem())
- │ ^^^^^^^^^^^^^^^^^ String<26>: Storage { nonce: Some(2) } => Memory
+37 │ ctx.emit(MyEvent(num: self.num, nums: self.nums.to_mem(), str: self.str.to_mem()))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
diff --git a/crates/analyzer/tests/snapshots/analysis__strings.snap b/crates/analyzer/tests/snapshots/analysis__strings.snap
index b6958bc307..988bea67b5 100644
--- a/crates/analyzer/tests/snapshots/analysis__strings.snap
+++ b/crates/analyzer/tests/snapshots/analysis__strings.snap
@@ -4,106 +4,106 @@ expression: "build_snapshot(&db, module)"
---
note:
- ┌─ strings.fe:3:9
+ ┌─ strings.fe:2:5
│
-3 │ s2: String<26>
- │ ^^^^^^^^^^^^^^ String<26>
-4 │ u: u256
- │ ^^^^^^^ u256
-5 │ s1: String<42>
- │ ^^^^^^^^^^^^^^ String<42>
-6 │ s3: String<100>
- │ ^^^^^^^^^^^^^^^ String<100>
-7 │ a: address
- │ ^^^^^^^^^^ address
-8 │ s4: String<18>
- │ ^^^^^^^^^^^^^^ String<18>
-9 │ s5: String<100>
- │ ^^^^^^^^^^^^^^^ String<100>
+2 │ pub s2: String<26>
+ │ ^^^^^^^^^^^^^^^^^^ String<26>
+3 │ pub u: u256
+ │ ^^^^^^^^^^^ u256
+4 │ pub s1: String<42>
+ │ ^^^^^^^^^^^^^^^^^^ String<42>
+5 │ pub s3: String<100>
+ │ ^^^^^^^^^^^^^^^^^^^ String<100>
+6 │ pub a: address
+ │ ^^^^^^^^^^^^^^ address
+7 │ pub s4: String<18>
+ │ ^^^^^^^^^^^^^^^^^^ String<18>
+8 │ pub s5: String<100>
+ │ ^^^^^^^^^^^^^^^^^^^ String<100>
note:
- ┌─ strings.fe:16:5
+ ┌─ strings.fe:17:5
│
-16 │ ╭ pub fn bar(s1: String<100>, s2: String<100>) -> String<100> {
-17 │ │ return s2
-18 │ │ }
+17 │ ╭ pub fn bar(s1: String<100>, s2: String<100>) -> String<100> {
+18 │ │ return s2
+19 │ │ }
│ ╰─────^ self: None, params: [{ label: None, name: s1, typ: String<100> }, { label: None, name: s2, typ: String<100> }] -> String<100>
note:
- ┌─ strings.fe:17:16
+ ┌─ strings.fe:18:16
│
-17 │ return s2
+18 │ return s2
│ ^^ String<100>: Memory
note:
- ┌─ strings.fe:20:5
+ ┌─ strings.fe:21:5
│
-20 │ ╭ pub fn return_static_string() -> String<43> {
-21 │ │ return "The quick brown fox jumps over the lazy dog"
-22 │ │ }
+21 │ ╭ pub fn return_static_string() -> String<43> {
+22 │ │ return "The quick brown fox jumps over the lazy dog"
+23 │ │ }
│ ╰─────^ self: None, params: [] -> String<43>
note:
- ┌─ strings.fe:21:16
+ ┌─ strings.fe:22:16
│
-21 │ return "The quick brown fox jumps over the lazy dog"
+22 │ return "The quick brown fox jumps over the lazy dog"
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ String<43>: Memory
note:
- ┌─ strings.fe:24:5
+ ┌─ strings.fe:25:5
│
-24 │ ╭ pub fn return_casted_static_string() -> String<100> {
-25 │ │ return String<100>("foo")
-26 │ │ }
+25 │ ╭ pub fn return_casted_static_string() -> String<100> {
+26 │ │ return String<100>("foo")
+27 │ │ }
│ ╰─────^ self: None, params: [] -> String<100>
note:
- ┌─ strings.fe:25:28
+ ┌─ strings.fe:26:28
│
-25 │ return String<100>("foo")
+26 │ return String<100>("foo")
│ ^^^^^ String<3>: Memory
note:
- ┌─ strings.fe:25:16
+ ┌─ strings.fe:26:16
│
-25 │ return String<100>("foo")
+26 │ return String<100>("foo")
│ ^^^^^^^^^^^^^^^^^^ String<100>: Memory
note:
- ┌─ strings.fe:28:5
+ ┌─ strings.fe:29:5
│
-28 │ ╭ pub fn shorter_string_assign() {
-29 │ │ let s: String<18> = "fe"
-30 │ │ }
+29 │ ╭ pub fn shorter_string_assign() {
+30 │ │ let s: String<18> = "fe"
+31 │ │ }
│ ╰─────^ self: None, params: [] -> ()
note:
- ┌─ strings.fe:29:13
+ ┌─ strings.fe:30:13
│
-29 │ let s: String<18> = "fe"
+30 │ let s: String<18> = "fe"
│ ^ String<18>
note:
- ┌─ strings.fe:29:29
+ ┌─ strings.fe:30:29
│
-29 │ let s: String<18> = "fe"
+30 │ let s: String<18> = "fe"
│ ^^^^ String<18>: Memory
note:
- ┌─ strings.fe:32:5
+ ┌─ strings.fe:33:5
│
-32 │ ╭ pub fn return_special_chars() -> String<18> {
-33 │ │ return "\n\"'\r\t
-34 │ │ foo\\"
-35 │ │ }
+33 │ ╭ pub fn return_special_chars() -> String<18> {
+34 │ │ return "\n\"'\r\t
+35 │ │ foo\\"
+36 │ │ }
│ ╰─────^ self: None, params: [] -> String<18>
note:
- ┌─ strings.fe:33:16
+ ┌─ strings.fe:34:16
│
-33 │ return "\n\"'\r\t
+34 │ return "\n\"'\r\t
│ ╭────────────────^
-34 │ │ foo\\"
+35 │ │ foo\\"
│ ╰──────────────^ String<18>: Memory
diff --git a/crates/analyzer/tests/snapshots/analysis__tuple_stress.snap b/crates/analyzer/tests/snapshots/analysis__tuple_stress.snap
index 235856c4fc..17b62a25df 100644
--- a/crates/analyzer/tests/snapshots/analysis__tuple_stress.snap
+++ b/crates/analyzer/tests/snapshots/analysis__tuple_stress.snap
@@ -6,14 +6,14 @@ expression: "build_snapshot(&db, module)"
note:
┌─ tuple_stress.fe:2:5
│
-2 │ my_sto_tuple: (u256, i32)
- │ ^^^^^^^^^^^^^^^^^^^^^^^^^ (u256, i32)
+2 │ pub my_tuple: (u256, bool, address)
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (u256, bool, address)
note:
- ┌─ tuple_stress.fe:5:9
+ ┌─ tuple_stress.fe:6:5
│
-5 │ my_tuple: (u256, bool, address)
- │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (u256, bool, address)
+6 │ my_sto_tuple: (u256, i32)
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^ (u256, i32)
note:
┌─ tuple_stress.fe:8:5
@@ -122,17 +122,29 @@ note:
┌─ tuple_stress.fe:28:5
│
28 │ ╭ pub fn emit_my_event(ctx: Context, my_tuple: (u256, bool, address)) {
-29 │ │ emit MyEvent(ctx, my_tuple)
+29 │ │ ctx.emit(MyEvent(my_tuple))
30 │ │ }
│ ╰─────^ self: None, params: [{ label: None, name: ctx, typ: Context }, { label: None, name: my_tuple, typ: (u256, bool, address) }] -> ()
note:
- ┌─ tuple_stress.fe:29:22
+ ┌─ tuple_stress.fe:29:9
+ │
+29 │ ctx.emit(MyEvent(my_tuple))
+ │ ^^^ ^^^^^^^^ (u256, bool, address): Memory
+ │ │
+ │ Context: Memory
+
+note:
+ ┌─ tuple_stress.fe:29:18
+ │
+29 │ ctx.emit(MyEvent(my_tuple))
+ │ ^^^^^^^^^^^^^^^^^ MyEvent: Memory
+
+note:
+ ┌─ tuple_stress.fe:29:9
│
-29 │ emit MyEvent(ctx, my_tuple)
- │ ^^^ ^^^^^^^^ (u256, bool, address): Memory
- │ │
- │ Context: Memory
+29 │ ctx.emit(MyEvent(my_tuple))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
note:
┌─ tuple_stress.fe:32:5
diff --git a/crates/analyzer/tests/snapshots/analysis__uniswap.snap b/crates/analyzer/tests/snapshots/analysis__uniswap.snap
index a43bce79d5..2eaf4f66f4 100644
--- a/crates/analyzer/tests/snapshots/analysis__uniswap.snap
+++ b/crates/analyzer/tests/snapshots/analysis__uniswap.snap
@@ -32,695 +32,747 @@ note:
│ ^^^^^ bool: Value
note:
- ┌─ uniswap.fe:15:5
+ ┌─ uniswap.fe:13:5
│
-15 │ balances: Map
- │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Map
-16 │ allowances: Map>
- │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Map>
-17 │ total_supply: u256
- │ ^^^^^^^^^^^^^^^^^^ u256
-18 │
-19 │ nonces: Map
- │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Map
-20 │
-21 │ factory: address
- │ ^^^^^^^^^^^^^^^^ address
-22 │ token0: ERC20
- │ ^^^^^^^^^^^^^ ERC20
-23 │ token1: ERC20
- │ ^^^^^^^^^^^^^ ERC20
-24 │
-25 │ reserve0: u256
- │ ^^^^^^^^^^^^^^ u256
-26 │ reserve1: u256
- │ ^^^^^^^^^^^^^^ u256
-27 │ block_timestamp_last: u256
- │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ u256
-28 │
-29 │ price0_cumulative_last: u256
- │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256
-30 │ price1_cumulative_last: u256
- │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256
-31 │ k_last: u256
- │ ^^^^^^^^^^^^ u256
+13 │ pub owner: address
+ │ ^^^^^^^^^^^^^^^^^^ address
+14 │ #indexed
+15 │ pub spender: address
+ │ ^^^^^^^^^^^^^^^^^^^^ address
+16 │ pub value: u256
+ │ ^^^^^^^^^^^^^^^ u256
note:
- ┌─ uniswap.fe:34:9
+ ┌─ uniswap.fe:21:5
│
-34 │ idx owner: address
- │ ^^^^^^^^^^^^^^^^^^ address
-35 │ idx spender: address
- │ ^^^^^^^^^^^^^^^^^^^^ address
-36 │ value: u256
- │ ^^^^^^^^^^^ u256
+21 │ pub from: address
+ │ ^^^^^^^^^^^^^^^^^ address
+22 │ #indexed
+23 │ pub to: address
+ │ ^^^^^^^^^^^^^^^ address
+24 │ pub value: u256
+ │ ^^^^^^^^^^^^^^^ u256
note:
- ┌─ uniswap.fe:40:9
+ ┌─ uniswap.fe:29:5
│
-40 │ idx from: address
- │ ^^^^^^^^^^^^^^^^^ address
-41 │ idx to: address
- │ ^^^^^^^^^^^^^^^ address
-42 │ value: u256
- │ ^^^^^^^^^^^ u256
+29 │ pub sender: address
+ │ ^^^^^^^^^^^^^^^^^^^ address
+30 │ pub amount0: u256
+ │ ^^^^^^^^^^^^^^^^^ u256
+31 │ pub amount1: u256
+ │ ^^^^^^^^^^^^^^^^^ u256
note:
- ┌─ uniswap.fe:46:9
+ ┌─ uniswap.fe:36:5
│
-46 │ idx sender: address
- │ ^^^^^^^^^^^^^^^^^^^ address
-47 │ amount0: u256
- │ ^^^^^^^^^^^^^ u256
-48 │ amount1: u256
- │ ^^^^^^^^^^^^^ u256
-
-note:
- ┌─ uniswap.fe:52:9
+36 │ pub sender: address
+ │ ^^^^^^^^^^^^^^^^^^^ address
+37 │ pub amount0: u256
+ │ ^^^^^^^^^^^^^^^^^ u256
+38 │ pub amount1: u256
+ │ ^^^^^^^^^^^^^^^^^ u256
+39 │ #indexed
+40 │ pub to: address
+ │ ^^^^^^^^^^^^^^^ address
+
+note:
+ ┌─ uniswap.fe:45:5
│
-52 │ idx sender: address
- │ ^^^^^^^^^^^^^^^^^^^ address
-53 │ amount0: u256
- │ ^^^^^^^^^^^^^ u256
-54 │ amount1: u256
- │ ^^^^^^^^^^^^^ u256
-55 │ idx to: address
- │ ^^^^^^^^^^^^^^^ address
+45 │ pub sender: address
+ │ ^^^^^^^^^^^^^^^^^^^ address
+46 │ pub amount0_in: u256
+ │ ^^^^^^^^^^^^^^^^^^^^ u256
+47 │ pub amount1_in: u256
+ │ ^^^^^^^^^^^^^^^^^^^^ u256
+48 │ pub amount0_out: u256
+ │ ^^^^^^^^^^^^^^^^^^^^^ u256
+49 │ pub amount1_out: u256
+ │ ^^^^^^^^^^^^^^^^^^^^^ u256
+50 │ #indexed
+51 │ pub to: address
+ │ ^^^^^^^^^^^^^^^ address
+
+note:
+ ┌─ uniswap.fe:55:5
+ │
+55 │ pub reserve0: u256
+ │ ^^^^^^^^^^^^^^^^^^ u256
+56 │ pub reserve1: u256
+ │ ^^^^^^^^^^^^^^^^^^ u256
note:
- ┌─ uniswap.fe:59:9
- │
-59 │ idx sender: address
- │ ^^^^^^^^^^^^^^^^^^^ address
-60 │ amount0_in: u256
- │ ^^^^^^^^^^^^^^^^ u256
-61 │ amount1_in: u256
- │ ^^^^^^^^^^^^^^^^ u256
-62 │ amount0_out: u256
- │ ^^^^^^^^^^^^^^^^^ u256
-63 │ amount1_out: u256
- │ ^^^^^^^^^^^^^^^^^ u256
-64 │ idx to: address
- │ ^^^^^^^^^^^^^^^ address
-
-note:
- ┌─ uniswap.fe:68:9
+ ┌─ uniswap.fe:63:5
│
-68 │ reserve0: u256
- │ ^^^^^^^^^^^^^^ u256
-69 │ reserve1: u256
- │ ^^^^^^^^^^^^^^ u256
+63 │ balances: Map
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Map
+64 │ allowances: Map>
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Map>
+65 │ total_supply: u256
+ │ ^^^^^^^^^^^^^^^^^^ u256
+66 │
+67 │ nonces: Map
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Map
+68 │
+69 │ factory: address
+ │ ^^^^^^^^^^^^^^^^ address
+70 │ token0: ERC20
+ │ ^^^^^^^^^^^^^ ERC20
+71 │ token1: ERC20
+ │ ^^^^^^^^^^^^^ ERC20
+72 │
+73 │ reserve0: u256
+ │ ^^^^^^^^^^^^^^ u256
+74 │ reserve1: u256
+ │ ^^^^^^^^^^^^^^ u256
+75 │ block_timestamp_last: u256
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ u256
+76 │
+77 │ price0_cumulative_last: u256
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256
+78 │ price1_cumulative_last: u256
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256
+79 │ k_last: u256
+ │ ^^^^^^^^^^^^ u256
note:
- ┌─ uniswap.fe:76:5
+ ┌─ uniswap.fe:85:5
│
-76 │ ╭ pub fn factory(self) -> address {
-77 │ │ return self.factory
-78 │ │ }
+85 │ ╭ pub fn factory(self) -> address {
+86 │ │ return self.factory
+87 │ │ }
│ ╰─────^ self: Some(Mutable), params: [] -> address
note:
- ┌─ uniswap.fe:77:16
+ ┌─ uniswap.fe:86:16
│
-77 │ return self.factory
+86 │ return self.factory
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:77:16
+ ┌─ uniswap.fe:86:16
│
-77 │ return self.factory
+86 │ return self.factory
│ ^^^^^^^^^^^^ address: Storage { nonce: Some(4) } => Value
note:
- ┌─ uniswap.fe:80:5
+ ┌─ uniswap.fe:89:5
│
-80 │ ╭ pub fn token0(self) -> address {
-81 │ │ return address(self.token0)
-82 │ │ }
+89 │ ╭ pub fn token0(self) -> address {
+90 │ │ return address(self.token0)
+91 │ │ }
│ ╰─────^ self: Some(Mutable), params: [] -> address
note:
- ┌─ uniswap.fe:81:24
+ ┌─ uniswap.fe:90:24
│
-81 │ return address(self.token0)
+90 │ return address(self.token0)
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:81:24
+ ┌─ uniswap.fe:90:24
│
-81 │ return address(self.token0)
+90 │ return address(self.token0)
│ ^^^^^^^^^^^ ERC20: Storage { nonce: Some(5) } => Value
note:
- ┌─ uniswap.fe:81:16
+ ┌─ uniswap.fe:90:16
│
-81 │ return address(self.token0)
+90 │ return address(self.token0)
│ ^^^^^^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ uniswap.fe:84:5
+ ┌─ uniswap.fe:93:5
│
-84 │ ╭ pub fn token1(self) -> address {
-85 │ │ return address(self.token1)
-86 │ │ }
+93 │ ╭ pub fn token1(self) -> address {
+94 │ │ return address(self.token1)
+95 │ │ }
│ ╰─────^ self: Some(Mutable), params: [] -> address
note:
- ┌─ uniswap.fe:85:24
+ ┌─ uniswap.fe:94:24
│
-85 │ return address(self.token1)
+94 │ return address(self.token1)
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:85:24
+ ┌─ uniswap.fe:94:24
│
-85 │ return address(self.token1)
+94 │ return address(self.token1)
│ ^^^^^^^^^^^ ERC20: Storage { nonce: Some(6) } => Value
note:
- ┌─ uniswap.fe:85:16
+ ┌─ uniswap.fe:94:16
│
-85 │ return address(self.token1)
+94 │ return address(self.token1)
│ ^^^^^^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ uniswap.fe:88:5
- │
-88 │ ╭ fn _mint(self, ctx: Context, to: address, value: u256) {
-89 │ │ self.total_supply = self.total_supply + value
-90 │ │ self.balances[to] = self.balances[to] + value
-91 │ │ emit Transfer(ctx, from: address(0), to, value)
-92 │ │ }
- │ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: to, typ: address }, { label: None, name: value, typ: u256 }] -> ()
+ ┌─ uniswap.fe:97:5
+ │
+ 97 │ ╭ fn _mint(self, ctx: Context, to: address, value: u256) {
+ 98 │ │ self.total_supply = self.total_supply + value
+ 99 │ │ self.balances[to] = self.balances[to] + value
+100 │ │ ctx.emit(Transfer(from: address(0), to, value))
+101 │ │ }
+ │ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: to, typ: address }, { label: None, name: value, typ: u256 }] -> ()
note:
- ┌─ uniswap.fe:89:9
+ ┌─ uniswap.fe:98:9
│
-89 │ self.total_supply = self.total_supply + value
+98 │ self.total_supply = self.total_supply + value
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:89:9
+ ┌─ uniswap.fe:98:9
│
-89 │ self.total_supply = self.total_supply + value
+98 │ self.total_supply = self.total_supply + value
│ ^^^^^^^^^^^^^^^^^ ^^^^ UniswapV2Pair: Value
│ │
│ u256: Storage { nonce: Some(2) }
note:
- ┌─ uniswap.fe:89:29
+ ┌─ uniswap.fe:98:29
│
-89 │ self.total_supply = self.total_supply + value
+98 │ self.total_supply = self.total_supply + value
│ ^^^^^^^^^^^^^^^^^ ^^^^^ u256: Value
│ │
│ u256: Storage { nonce: Some(2) } => Value
note:
- ┌─ uniswap.fe:89:29
+ ┌─ uniswap.fe:98:29
│
-89 │ self.total_supply = self.total_supply + value
+98 │ self.total_supply = self.total_supply + value
│ ^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-90 │ self.balances[to] = self.balances[to] + value
+99 │ self.balances[to] = self.balances[to] + value
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:90:9
+ ┌─ uniswap.fe:99:9
│
-90 │ self.balances[to] = self.balances[to] + value
+99 │ self.balances[to] = self.balances[to] + value
│ ^^^^^^^^^^^^^ ^^ address: Value
│ │
│ Map: Storage { nonce: Some(0) }
note:
- ┌─ uniswap.fe:90:9
+ ┌─ uniswap.fe:99:9
│
-90 │ self.balances[to] = self.balances[to] + value
+99 │ self.balances[to] = self.balances[to] + value
│ ^^^^^^^^^^^^^^^^^ ^^^^ UniswapV2Pair: Value
│ │
│ u256: Storage { nonce: None }
note:
- ┌─ uniswap.fe:90:29
+ ┌─ uniswap.fe:99:29
│
-90 │ self.balances[to] = self.balances[to] + value
+99 │ self.balances[to] = self.balances[to] + value
│ ^^^^^^^^^^^^^ ^^ address: Value
│ │
│ Map: Storage { nonce: Some(0) }
note:
- ┌─ uniswap.fe:90:29
+ ┌─ uniswap.fe:99:29
│
-90 │ self.balances[to] = self.balances[to] + value
+99 │ self.balances[to] = self.balances[to] + value
│ ^^^^^^^^^^^^^^^^^ ^^^^^ u256: Value
│ │
│ u256: Storage { nonce: None } => Value
note:
- ┌─ uniswap.fe:90:29
- │
-90 │ self.balances[to] = self.balances[to] + value
- │ ^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-91 │ emit Transfer(ctx, from: address(0), to, value)
- │ ^^^ ^ u256: Value
- │ │
- │ Context: Memory
+ ┌─ uniswap.fe:99:29
+ │
+ 99 │ self.balances[to] = self.balances[to] + value
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
+100 │ ctx.emit(Transfer(from: address(0), to, value))
+ │ ^^^ ^ u256: Value
+ │ │
+ │ Context: Memory
note:
- ┌─ uniswap.fe:91:34
- │
-91 │ emit Transfer(ctx, from: address(0), to, value)
- │ ^^^^^^^^^^ ^^ ^^^^^ u256: Value
- │ │ │
- │ │ address: Value
- │ address: Value
+ ┌─ uniswap.fe:100:33
+ │
+100 │ ctx.emit(Transfer(from: address(0), to, value))
+ │ ^^^^^^^^^^ ^^ ^^^^^ u256: Value
+ │ │ │
+ │ │ address: Value
+ │ address: Value
note:
- ┌─ uniswap.fe:94:5
- │
-94 │ ╭ fn _burn(self, ctx: Context, from: address, value: u256) {
-95 │ │ self.balances[from] = self.balances[from] - value
-96 │ │ self.total_supply = self.total_supply - value
-97 │ │ emit Transfer(ctx, from, to: address(0), value)
-98 │ │ }
- │ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: from, typ: address }, { label: None, name: value, typ: u256 }] -> ()
+ ┌─ uniswap.fe:100:18
+ │
+100 │ ctx.emit(Transfer(from: address(0), to, value))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Transfer: Memory
note:
- ┌─ uniswap.fe:95:9
- │
-95 │ self.balances[from] = self.balances[from] - value
- │ ^^^^ UniswapV2Pair: Value
+ ┌─ uniswap.fe:100:9
+ │
+100 │ ctx.emit(Transfer(from: address(0), to, value))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
note:
- ┌─ uniswap.fe:95:9
- │
-95 │ self.balances[from] = self.balances[from] - value
- │ ^^^^^^^^^^^^^ ^^^^ address: Value
- │ │
- │ Map: Storage { nonce: Some(0) }
+ ┌─ uniswap.fe:103:5
+ │
+103 │ ╭ fn _burn(self, ctx: Context, from: address, value: u256) {
+104 │ │ self.balances[from] = self.balances[from] - value
+105 │ │ self.total_supply = self.total_supply - value
+106 │ │ ctx.emit(Transfer(from, to: address(0), value))
+107 │ │ }
+ │ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: from, typ: address }, { label: None, name: value, typ: u256 }] -> ()
note:
- ┌─ uniswap.fe:95:9
- │
-95 │ self.balances[from] = self.balances[from] - value
- │ ^^^^^^^^^^^^^^^^^^^ ^^^^ UniswapV2Pair: Value
- │ │
- │ u256: Storage { nonce: None }
+ ┌─ uniswap.fe:104:9
+ │
+104 │ self.balances[from] = self.balances[from] - value
+ │ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:95:31
- │
-95 │ self.balances[from] = self.balances[from] - value
- │ ^^^^^^^^^^^^^ ^^^^ address: Value
- │ │
- │ Map: Storage { nonce: Some(0) }
+ ┌─ uniswap.fe:104:9
+ │
+104 │ self.balances[from] = self.balances[from] - value
+ │ ^^^^^^^^^^^^^ ^^^^ address: Value
+ │ │
+ │ Map: Storage { nonce: Some(0) }
note:
- ┌─ uniswap.fe:95:31
- │
-95 │ self.balances[from] = self.balances[from] - value
- │ ^^^^^^^^^^^^^^^^^^^ ^^^^^ u256: Value
- │ │
- │ u256: Storage { nonce: None } => Value
+ ┌─ uniswap.fe:104:9
+ │
+104 │ self.balances[from] = self.balances[from] - value
+ │ ^^^^^^^^^^^^^^^^^^^ ^^^^ UniswapV2Pair: Value
+ │ │
+ │ u256: Storage { nonce: None }
note:
- ┌─ uniswap.fe:95:31
- │
-95 │ self.balances[from] = self.balances[from] - value
- │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-96 │ self.total_supply = self.total_supply - value
- │ ^^^^ UniswapV2Pair: Value
+ ┌─ uniswap.fe:104:31
+ │
+104 │ self.balances[from] = self.balances[from] - value
+ │ ^^^^^^^^^^^^^ ^^^^ address: Value
+ │ │
+ │ Map: Storage { nonce: Some(0) }
note:
- ┌─ uniswap.fe:96:9
- │
-96 │ self.total_supply = self.total_supply - value
- │ ^^^^^^^^^^^^^^^^^ ^^^^ UniswapV2Pair: Value
- │ │
- │ u256: Storage { nonce: Some(2) }
+ ┌─ uniswap.fe:104:31
+ │
+104 │ self.balances[from] = self.balances[from] - value
+ │ ^^^^^^^^^^^^^^^^^^^ ^^^^^ u256: Value
+ │ │
+ │ u256: Storage { nonce: None } => Value
note:
- ┌─ uniswap.fe:96:29
- │
-96 │ self.total_supply = self.total_supply - value
- │ ^^^^^^^^^^^^^^^^^ ^^^^^ u256: Value
- │ │
- │ u256: Storage { nonce: Some(2) } => Value
+ ┌─ uniswap.fe:104:31
+ │
+104 │ self.balances[from] = self.balances[from] - value
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
+105 │ self.total_supply = self.total_supply - value
+ │ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:96:29
- │
-96 │ self.total_supply = self.total_supply - value
- │ ^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-97 │ emit Transfer(ctx, from, to: address(0), value)
- │ ^^^ ^^^^ ^ u256: Value
- │ │ │
- │ │ address: Value
- │ Context: Memory
+ ┌─ uniswap.fe:105:9
+ │
+105 │ self.total_supply = self.total_supply - value
+ │ ^^^^^^^^^^^^^^^^^ ^^^^ UniswapV2Pair: Value
+ │ │
+ │ u256: Storage { nonce: Some(2) }
note:
- ┌─ uniswap.fe:97:38
- │
-97 │ emit Transfer(ctx, from, to: address(0), value)
- │ ^^^^^^^^^^ ^^^^^ u256: Value
- │ │
- │ address: Value
+ ┌─ uniswap.fe:105:29
+ │
+105 │ self.total_supply = self.total_supply - value
+ │ ^^^^^^^^^^^^^^^^^ ^^^^^ u256: Value
+ │ │
+ │ u256: Storage { nonce: Some(2) } => Value
+
+note:
+ ┌─ uniswap.fe:105:29
+ │
+105 │ self.total_supply = self.total_supply - value
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
+106 │ ctx.emit(Transfer(from, to: address(0), value))
+ │ ^^^ ^^^^ ^ u256: Value
+ │ │ │
+ │ │ address: Value
+ │ Context: Memory
+
+note:
+ ┌─ uniswap.fe:106:37
+ │
+106 │ ctx.emit(Transfer(from, to: address(0), value))
+ │ ^^^^^^^^^^ ^^^^^ u256: Value
+ │ │
+ │ address: Value
+
+note:
+ ┌─ uniswap.fe:106:18
+ │
+106 │ ctx.emit(Transfer(from, to: address(0), value))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Transfer: Memory
note:
- ┌─ uniswap.fe:100:5
+ ┌─ uniswap.fe:106:9
+ │
+106 │ ctx.emit(Transfer(from, to: address(0), value))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
+
+note:
+ ┌─ uniswap.fe:109:5
│
-100 │ ╭ fn _approve(self, ctx: Context, owner: address, spender: address, value: u256) {
-101 │ │ self.allowances[owner][spender] = value
-102 │ │ emit Approval(ctx, owner, spender, value)
-103 │ │ }
+109 │ ╭ fn _approve(self, ctx: Context, owner: address, spender: address, value: u256) {
+110 │ │ self.allowances[owner][spender] = value
+111 │ │ ctx.emit(Approval(owner, spender, value))
+112 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: owner, typ: address }, { label: None, name: spender, typ: address }, { label: None, name: value, typ: u256 }] -> ()
note:
- ┌─ uniswap.fe:101:9
+ ┌─ uniswap.fe:110:9
│
-101 │ self.allowances[owner][spender] = value
+110 │ self.allowances[owner][spender] = value
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:101:9
+ ┌─ uniswap.fe:110:9
│
-101 │ self.allowances[owner][spender] = value
+110 │ self.allowances[owner][spender] = value
│ ^^^^^^^^^^^^^^^ ^^^^^ address: Value
│ │
│ Map>: Storage { nonce: Some(1) }
note:
- ┌─ uniswap.fe:101:9
+ ┌─ uniswap.fe:110:9
│
-101 │ self.allowances[owner][spender] = value
+110 │ self.allowances[owner][spender] = value
│ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^ address: Value
│ │
│ Map: Storage { nonce: None }
note:
- ┌─ uniswap.fe:101:9
+ ┌─ uniswap.fe:110:9
│
-101 │ self.allowances[owner][spender] = value
+110 │ self.allowances[owner][spender] = value
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ u256: Value
│ │
│ u256: Storage { nonce: None }
-102 │ emit Approval(ctx, owner, spender, value)
- │ ^^^ ^^^^^ ^^^^^^^ ^^^^^ u256: Value
- │ │ │ │
- │ │ │ address: Value
- │ │ address: Value
- │ Context: Memory
+111 │ ctx.emit(Approval(owner, spender, value))
+ │ ^^^ ^^^^^ ^^^^^^^ ^^^^^ u256: Value
+ │ │ │ │
+ │ │ │ address: Value
+ │ │ address: Value
+ │ Context: Memory
note:
- ┌─ uniswap.fe:105:5
+ ┌─ uniswap.fe:111:18
+ │
+111 │ ctx.emit(Approval(owner, spender, value))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Approval: Memory
+
+note:
+ ┌─ uniswap.fe:111:9
+ │
+111 │ ctx.emit(Approval(owner, spender, value))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
+
+note:
+ ┌─ uniswap.fe:114:5
│
-105 │ ╭ fn _transfer(self, ctx: Context, from: address, to: address, value: u256) {
-106 │ │ self.balances[from] = self.balances[from] - value
-107 │ │ self.balances[to] = self.balances[to] + value
-108 │ │ emit Transfer(ctx, from, to, value)
-109 │ │ }
+114 │ ╭ fn _transfer(self, ctx: Context, from: address, to: address, value: u256) {
+115 │ │ self.balances[from] = self.balances[from] - value
+116 │ │ self.balances[to] = self.balances[to] + value
+117 │ │ ctx.emit(Transfer(from, to, value))
+118 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: from, typ: address }, { label: None, name: to, typ: address }, { label: None, name: value, typ: u256 }] -> ()
note:
- ┌─ uniswap.fe:106:9
+ ┌─ uniswap.fe:115:9
│
-106 │ self.balances[from] = self.balances[from] - value
+115 │ self.balances[from] = self.balances[from] - value
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:106:9
+ ┌─ uniswap.fe:115:9
│
-106 │ self.balances[from] = self.balances[from] - value
+115 │ self.balances[from] = self.balances[from] - value
│ ^^^^^^^^^^^^^ ^^^^ address: Value
│ │
│ Map: Storage { nonce: Some(0) }
note:
- ┌─ uniswap.fe:106:9
+ ┌─ uniswap.fe:115:9
│
-106 │ self.balances[from] = self.balances[from] - value
+115 │ self.balances[from] = self.balances[from] - value
│ ^^^^^^^^^^^^^^^^^^^ ^^^^ UniswapV2Pair: Value
│ │
│ u256: Storage { nonce: None }
note:
- ┌─ uniswap.fe:106:31
+ ┌─ uniswap.fe:115:31
│
-106 │ self.balances[from] = self.balances[from] - value
+115 │ self.balances[from] = self.balances[from] - value
│ ^^^^^^^^^^^^^ ^^^^ address: Value
│ │
│ Map: Storage { nonce: Some(0) }
note:
- ┌─ uniswap.fe:106:31
+ ┌─ uniswap.fe:115:31
│
-106 │ self.balances[from] = self.balances[from] - value
+115 │ self.balances[from] = self.balances[from] - value
│ ^^^^^^^^^^^^^^^^^^^ ^^^^^ u256: Value
│ │
│ u256: Storage { nonce: None } => Value
note:
- ┌─ uniswap.fe:106:31
+ ┌─ uniswap.fe:115:31
│
-106 │ self.balances[from] = self.balances[from] - value
+115 │ self.balances[from] = self.balances[from] - value
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-107 │ self.balances[to] = self.balances[to] + value
+116 │ self.balances[to] = self.balances[to] + value
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:107:9
+ ┌─ uniswap.fe:116:9
│
-107 │ self.balances[to] = self.balances[to] + value
+116 │ self.balances[to] = self.balances[to] + value
│ ^^^^^^^^^^^^^ ^^ address: Value
│ │
│ Map: Storage { nonce: Some(0) }
note:
- ┌─ uniswap.fe:107:9
+ ┌─ uniswap.fe:116:9
│
-107 │ self.balances[to] = self.balances[to] + value
+116 │ self.balances[to] = self.balances[to] + value
│ ^^^^^^^^^^^^^^^^^ ^^^^ UniswapV2Pair: Value
│ │
│ u256: Storage { nonce: None }
note:
- ┌─ uniswap.fe:107:29
+ ┌─ uniswap.fe:116:29
│
-107 │ self.balances[to] = self.balances[to] + value
+116 │ self.balances[to] = self.balances[to] + value
│ ^^^^^^^^^^^^^ ^^ address: Value
│ │
│ Map: Storage { nonce: Some(0) }
note:
- ┌─ uniswap.fe:107:29
+ ┌─ uniswap.fe:116:29
│
-107 │ self.balances[to] = self.balances[to] + value
+116 │ self.balances[to] = self.balances[to] + value
│ ^^^^^^^^^^^^^^^^^ ^^^^^ u256: Value
│ │
│ u256: Storage { nonce: None } => Value
note:
- ┌─ uniswap.fe:107:29
+ ┌─ uniswap.fe:116:29
│
-107 │ self.balances[to] = self.balances[to] + value
+116 │ self.balances[to] = self.balances[to] + value
│ ^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-108 │ emit Transfer(ctx, from, to, value)
- │ ^^^ ^^^^ ^^ ^^^^^ u256: Value
- │ │ │ │
- │ │ │ address: Value
- │ │ address: Value
- │ Context: Memory
+117 │ ctx.emit(Transfer(from, to, value))
+ │ ^^^ ^^^^ ^^ ^^^^^ u256: Value
+ │ │ │ │
+ │ │ │ address: Value
+ │ │ address: Value
+ │ Context: Memory
note:
- ┌─ uniswap.fe:111:5
+ ┌─ uniswap.fe:117:18
+ │
+117 │ ctx.emit(Transfer(from, to, value))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^ Transfer: Memory
+
+note:
+ ┌─ uniswap.fe:117:9
+ │
+117 │ ctx.emit(Transfer(from, to, value))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
+
+note:
+ ┌─ uniswap.fe:120:5
│
-111 │ ╭ pub fn approve(self, ctx: Context, spender: address, value: u256) -> bool {
-112 │ │ self._approve(ctx, owner: ctx.msg_sender(), spender, value)
-113 │ │ return true
-114 │ │ }
+120 │ ╭ pub fn approve(self, ctx: Context, spender: address, value: u256) -> bool {
+121 │ │ self._approve(ctx, owner: ctx.msg_sender(), spender, value)
+122 │ │ return true
+123 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: spender, typ: address }, { label: None, name: value, typ: u256 }] -> bool
note:
- ┌─ uniswap.fe:112:9
+ ┌─ uniswap.fe:121:9
│
-112 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value)
+121 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value)
│ ^^^^ ^^^ ^^^ Context: Memory
│ │ │
│ │ Context: Memory
│ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:112:35
+ ┌─ uniswap.fe:121:35
│
-112 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value)
+121 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value)
│ ^^^^^^^^^^^^^^^^ ^^^^^^^ ^^^^^ u256: Value
│ │ │
│ │ address: Value
│ address: Value
note:
- ┌─ uniswap.fe:112:9
+ ┌─ uniswap.fe:121:9
│
-112 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value)
+121 │ self._approve(ctx, owner: ctx.msg_sender(), spender, value)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
-113 │ return true
+122 │ return true
│ ^^^^ bool: Value
note:
- ┌─ uniswap.fe:116:5
+ ┌─ uniswap.fe:125:5
│
-116 │ ╭ pub fn transfer(self, ctx: Context, to: address, value: u256) -> bool {
-117 │ │ self._transfer(ctx, from: ctx.msg_sender(), to, value)
-118 │ │ return true
-119 │ │ }
+125 │ ╭ pub fn transfer(self, ctx: Context, to: address, value: u256) -> bool {
+126 │ │ self._transfer(ctx, from: ctx.msg_sender(), to, value)
+127 │ │ return true
+128 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: to, typ: address }, { label: None, name: value, typ: u256 }] -> bool
note:
- ┌─ uniswap.fe:117:9
+ ┌─ uniswap.fe:126:9
│
-117 │ self._transfer(ctx, from: ctx.msg_sender(), to, value)
+126 │ self._transfer(ctx, from: ctx.msg_sender(), to, value)
│ ^^^^ ^^^ ^^^ Context: Memory
│ │ │
│ │ Context: Memory
│ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:117:35
+ ┌─ uniswap.fe:126:35
│
-117 │ self._transfer(ctx, from: ctx.msg_sender(), to, value)
+126 │ self._transfer(ctx, from: ctx.msg_sender(), to, value)
│ ^^^^^^^^^^^^^^^^ ^^ ^^^^^ u256: Value
│ │ │
│ │ address: Value
│ address: Value
note:
- ┌─ uniswap.fe:117:9
+ ┌─ uniswap.fe:126:9
│
-117 │ self._transfer(ctx, from: ctx.msg_sender(), to, value)
+126 │ self._transfer(ctx, from: ctx.msg_sender(), to, value)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
-118 │ return true
+127 │ return true
│ ^^^^ bool: Value
note:
- ┌─ uniswap.fe:121:5
+ ┌─ uniswap.fe:130:5
│
-121 │ ╭ pub fn transferFrom(self, ctx: Context, from: address, to: address, value: u256) -> bool {
-122 │ │ assert self.allowances[from][ctx.msg_sender()] >= value
-123 │ │ self.allowances[from][ctx.msg_sender()] = self.allowances[from][ctx.msg_sender()] - value
-124 │ │ self._transfer(ctx, from, to, value)
-125 │ │ return true
-126 │ │ }
+130 │ ╭ pub fn transferFrom(self, ctx: Context, from: address, to: address, value: u256) -> bool {
+131 │ │ assert self.allowances[from][ctx.msg_sender()] >= value
+132 │ │ self.allowances[from][ctx.msg_sender()] = self.allowances[from][ctx.msg_sender()] - value
+133 │ │ self._transfer(ctx, from, to, value)
+134 │ │ return true
+135 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: from, typ: address }, { label: None, name: to, typ: address }, { label: None, name: value, typ: u256 }] -> bool
note:
- ┌─ uniswap.fe:122:16
+ ┌─ uniswap.fe:131:16
│
-122 │ assert self.allowances[from][ctx.msg_sender()] >= value
+131 │ assert self.allowances[from][ctx.msg_sender()] >= value
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:122:16
+ ┌─ uniswap.fe:131:16
│
-122 │ assert self.allowances[from][ctx.msg_sender()] >= value
+131 │ assert self.allowances[from][ctx.msg_sender()] >= value
│ ^^^^^^^^^^^^^^^ ^^^^ address: Value
│ │
│ Map>: Storage { nonce: Some(1) }
note:
- ┌─ uniswap.fe:122:16
+ ┌─ uniswap.fe:131:16
│
-122 │ assert self.allowances[from][ctx.msg_sender()] >= value
+131 │ assert self.allowances[from][ctx.msg_sender()] >= value
│ ^^^^^^^^^^^^^^^^^^^^^ ^^^ Context: Memory
│ │
│ Map: Storage { nonce: None }
note:
- ┌─ uniswap.fe:122:38
+ ┌─ uniswap.fe:131:38
│
-122 │ assert self.allowances[from][ctx.msg_sender()] >= value
+131 │ assert self.allowances[from][ctx.msg_sender()] >= value
│ ^^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ uniswap.fe:122:16
+ ┌─ uniswap.fe:131:16
│
-122 │ assert self.allowances[from][ctx.msg_sender()] >= value
+131 │ assert self.allowances[from][ctx.msg_sender()] >= value
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ u256: Value
│ │
│ u256: Storage { nonce: None } => Value
note:
- ┌─ uniswap.fe:122:16
+ ┌─ uniswap.fe:131:16
│
-122 │ assert self.allowances[from][ctx.msg_sender()] >= value
+131 │ assert self.allowances[from][ctx.msg_sender()] >= value
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bool: Value
-123 │ self.allowances[from][ctx.msg_sender()] = self.allowances[from][ctx.msg_sender()] - value
+132 │ self.allowances[from][ctx.msg_sender()] = self.allowances[from][ctx.msg_sender()] - value
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:123:9
+ ┌─ uniswap.fe:132:9
│
-123 │ self.allowances[from][ctx.msg_sender()] = self.allowances[from][ctx.msg_sender()] - value
+132 │ self.allowances[from][ctx.msg_sender()] = self.allowances[from][ctx.msg_sender()] - value
│ ^^^^^^^^^^^^^^^ ^^^^ address: Value
│ │
│ Map>: Storage { nonce: Some(1) }
note:
- ┌─ uniswap.fe:123:9
+ ┌─ uniswap.fe:132:9
│
-123 │ self.allowances[from][ctx.msg_sender()] = self.allowances[from][ctx.msg_sender()] - value
+132 │ self.allowances[from][ctx.msg_sender()] = self.allowances[from][ctx.msg_sender()] - value
│ ^^^^^^^^^^^^^^^^^^^^^ ^^^ Context: Memory
│ │
│ Map: Storage { nonce: None }
note:
- ┌─ uniswap.fe:123:31
+ ┌─ uniswap.fe:132:31
│
-123 │ self.allowances[from][ctx.msg_sender()] = self.allowances[from][ctx.msg_sender()] - value
+132 │ self.allowances[from][ctx.msg_sender()] = self.allowances[from][ctx.msg_sender()] - value
│ ^^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ uniswap.fe:123:9
+ ┌─ uniswap.fe:132:9
│
-123 │ self.allowances[from][ctx.msg_sender()] = self.allowances[from][ctx.msg_sender()] - value
+132 │ self.allowances[from][ctx.msg_sender()] = self.allowances[from][ctx.msg_sender()] - value
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ UniswapV2Pair: Value
│ │
│ u256: Storage { nonce: None }
note:
- ┌─ uniswap.fe:123:51
+ ┌─ uniswap.fe:132:51
│
-123 │ self.allowances[from][ctx.msg_sender()] = self.allowances[from][ctx.msg_sender()] - value
+132 │ self.allowances[from][ctx.msg_sender()] = self.allowances[from][ctx.msg_sender()] - value
│ ^^^^^^^^^^^^^^^ ^^^^ address: Value
│ │
│ Map>: Storage { nonce: Some(1) }
note:
- ┌─ uniswap.fe:123:51
+ ┌─ uniswap.fe:132:51
│
-123 │ self.allowances[from][ctx.msg_sender()] = self.allowances[from][ctx.msg_sender()] - value
+132 │ self.allowances[from][ctx.msg_sender()] = self.allowances[from][ctx.msg_sender()] - value
│ ^^^^^^^^^^^^^^^^^^^^^ ^^^ Context: Memory
│ │
│ Map: Storage { nonce: None }
note:
- ┌─ uniswap.fe:123:73
+ ┌─ uniswap.fe:132:73
│
-123 │ self.allowances[from][ctx.msg_sender()] = self.allowances[from][ctx.msg_sender()] - value
+132 │ self.allowances[from][ctx.msg_sender()] = self.allowances[from][ctx.msg_sender()] - value
│ ^^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ uniswap.fe:123:51
+ ┌─ uniswap.fe:132:51
│
-123 │ self.allowances[from][ctx.msg_sender()] = self.allowances[from][ctx.msg_sender()] - value
+132 │ self.allowances[from][ctx.msg_sender()] = self.allowances[from][ctx.msg_sender()] - value
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ u256: Value
│ │
│ u256: Storage { nonce: None } => Value
note:
- ┌─ uniswap.fe:123:51
+ ┌─ uniswap.fe:132:51
│
-123 │ self.allowances[from][ctx.msg_sender()] = self.allowances[from][ctx.msg_sender()] - value
+132 │ self.allowances[from][ctx.msg_sender()] = self.allowances[from][ctx.msg_sender()] - value
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-124 │ self._transfer(ctx, from, to, value)
+133 │ self._transfer(ctx, from, to, value)
│ ^^^^ ^^^ ^^^^ ^^ ^^^^^ u256: Value
│ │ │ │ │
│ │ │ │ address: Value
@@ -729,561 +781,573 @@ note:
│ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:124:9
+ ┌─ uniswap.fe:133:9
│
-124 │ self._transfer(ctx, from, to, value)
+133 │ self._transfer(ctx, from, to, value)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
-125 │ return true
+134 │ return true
│ ^^^^ bool: Value
note:
- ┌─ uniswap.fe:128:5
+ ┌─ uniswap.fe:137:5
│
-128 │ ╭ pub fn balanceOf(self, _ account: address) -> u256 {
-129 │ │ return self.balances[account]
-130 │ │ }
+137 │ ╭ pub fn balanceOf(self, _ account: address) -> u256 {
+138 │ │ return self.balances[account]
+139 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: Some("_"), name: account, typ: address }] -> u256
note:
- ┌─ uniswap.fe:129:16
+ ┌─ uniswap.fe:138:16
│
-129 │ return self.balances[account]
+138 │ return self.balances[account]
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:129:16
+ ┌─ uniswap.fe:138:16
│
-129 │ return self.balances[account]
+138 │ return self.balances[account]
│ ^^^^^^^^^^^^^ ^^^^^^^ address: Value
│ │
│ Map: Storage { nonce: Some(0) }
note:
- ┌─ uniswap.fe:129:16
+ ┌─ uniswap.fe:138:16
│
-129 │ return self.balances[account]
+138 │ return self.balances[account]
│ ^^^^^^^^^^^^^^^^^^^^^^ u256: Storage { nonce: None } => Value
note:
- ┌─ uniswap.fe:132:5
+ ┌─ uniswap.fe:141:5
│
-132 │ ╭ pub fn get_reserves(self) -> (u256, u256, u256) {
-133 │ │ return (self.reserve0, self.reserve1, self.block_timestamp_last)
-134 │ │ }
+141 │ ╭ pub fn get_reserves(self) -> (u256, u256, u256) {
+142 │ │ return (self.reserve0, self.reserve1, self.block_timestamp_last)
+143 │ │ }
│ ╰─────^ self: Some(Mutable), params: [] -> (u256, u256, u256)
note:
- ┌─ uniswap.fe:133:17
+ ┌─ uniswap.fe:142:17
│
-133 │ return (self.reserve0, self.reserve1, self.block_timestamp_last)
+142 │ return (self.reserve0, self.reserve1, self.block_timestamp_last)
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:133:17
+ ┌─ uniswap.fe:142:17
│
-133 │ return (self.reserve0, self.reserve1, self.block_timestamp_last)
+142 │ return (self.reserve0, self.reserve1, self.block_timestamp_last)
│ ^^^^^^^^^^^^^ ^^^^ UniswapV2Pair: Value
│ │
│ u256: Storage { nonce: Some(7) } => Value
note:
- ┌─ uniswap.fe:133:32
+ ┌─ uniswap.fe:142:32
│
-133 │ return (self.reserve0, self.reserve1, self.block_timestamp_last)
+142 │ return (self.reserve0, self.reserve1, self.block_timestamp_last)
│ ^^^^^^^^^^^^^ ^^^^ UniswapV2Pair: Value
│ │
│ u256: Storage { nonce: Some(8) } => Value
note:
- ┌─ uniswap.fe:133:47
+ ┌─ uniswap.fe:142:47
│
-133 │ return (self.reserve0, self.reserve1, self.block_timestamp_last)
+142 │ return (self.reserve0, self.reserve1, self.block_timestamp_last)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Storage { nonce: Some(9) } => Value
note:
- ┌─ uniswap.fe:133:16
+ ┌─ uniswap.fe:142:16
│
-133 │ return (self.reserve0, self.reserve1, self.block_timestamp_last)
+142 │ return (self.reserve0, self.reserve1, self.block_timestamp_last)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (u256, u256, u256): Memory
note:
- ┌─ uniswap.fe:137:5
+ ┌─ uniswap.fe:146:5
│
-137 │ ╭ pub fn initialize(self, ctx: Context, token0: ERC20, token1: ERC20) {
-138 │ │ assert ctx.msg_sender() == self.factory, "UniswapV2: FORBIDDEN"
-139 │ │ self.token0 = token0
-140 │ │ self.token1 = token1
-141 │ │ }
+146 │ ╭ pub fn initialize(self, ctx: Context, token0: ERC20, token1: ERC20) {
+147 │ │ assert ctx.msg_sender() == self.factory, "UniswapV2: FORBIDDEN"
+148 │ │ self.token0 = token0
+149 │ │ self.token1 = token1
+150 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: token0, typ: ERC20 }, { label: None, name: token1, typ: ERC20 }] -> ()
note:
- ┌─ uniswap.fe:138:16
+ ┌─ uniswap.fe:147:16
│
-138 │ assert ctx.msg_sender() == self.factory, "UniswapV2: FORBIDDEN"
+147 │ assert ctx.msg_sender() == self.factory, "UniswapV2: FORBIDDEN"
│ ^^^ Context: Memory
note:
- ┌─ uniswap.fe:138:16
+ ┌─ uniswap.fe:147:16
│
-138 │ assert ctx.msg_sender() == self.factory, "UniswapV2: FORBIDDEN"
+147 │ assert ctx.msg_sender() == self.factory, "UniswapV2: FORBIDDEN"
│ ^^^^^^^^^^^^^^^^ ^^^^ UniswapV2Pair: Value
│ │
│ address: Value
note:
- ┌─ uniswap.fe:138:36
+ ┌─ uniswap.fe:147:36
│
-138 │ assert ctx.msg_sender() == self.factory, "UniswapV2: FORBIDDEN"
+147 │ assert ctx.msg_sender() == self.factory, "UniswapV2: FORBIDDEN"
│ ^^^^^^^^^^^^ address: Storage { nonce: Some(4) } => Value
note:
- ┌─ uniswap.fe:138:16
+ ┌─ uniswap.fe:147:16
│
-138 │ assert ctx.msg_sender() == self.factory, "UniswapV2: FORBIDDEN"
+147 │ assert ctx.msg_sender() == self.factory, "UniswapV2: FORBIDDEN"
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ String<20>: Memory
│ │
│ bool: Value
-139 │ self.token0 = token0
+148 │ self.token0 = token0
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:139:9
+ ┌─ uniswap.fe:148:9
│
-139 │ self.token0 = token0
+148 │ self.token0 = token0
│ ^^^^^^^^^^^ ^^^^^^ ERC20: Value
│ │
│ ERC20: Storage { nonce: Some(5) }
-140 │ self.token1 = token1
+149 │ self.token1 = token1
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:140:9
+ ┌─ uniswap.fe:149:9
│
-140 │ self.token1 = token1
+149 │ self.token1 = token1
│ ^^^^^^^^^^^ ^^^^^^ ERC20: Value
│ │
│ ERC20: Storage { nonce: Some(6) }
note:
- ┌─ uniswap.fe:144:5
+ ┌─ uniswap.fe:153:5
│
-144 │ ╭ fn _update(self, ctx: Context, balance0: u256, balance1: u256, reserve0: u256, reserve1: u256) {
-145 │ │ // changed from u32s
-146 │ │ // TODO: reproduce desired overflow (https://github.com/ethereum/fe/issues/286)
-147 │ │ let block_timestamp: u256 = ctx.block_timestamp() % 2 ** 32
+153 │ ╭ fn _update(self, ctx: Context, balance0: u256, balance1: u256, reserve0: u256, reserve1: u256) {
+154 │ │ // changed from u32s
+155 │ │ // TODO: reproduce desired overflow (https://github.com/ethereum/fe/issues/286)
+156 │ │ let block_timestamp: u256 = ctx.block_timestamp() % 2 ** 32
· │
-156 │ │ emit Sync(ctx, reserve0: self.reserve0, reserve1: self.reserve1)
-157 │ │ }
+165 │ │ ctx.emit(Sync(reserve0: self.reserve0, reserve1: self.reserve1))
+166 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: balance0, typ: u256 }, { label: None, name: balance1, typ: u256 }, { label: None, name: reserve0, typ: u256 }, { label: None, name: reserve1, typ: u256 }] -> ()
note:
- ┌─ uniswap.fe:147:13
+ ┌─ uniswap.fe:156:13
│
-147 │ let block_timestamp: u256 = ctx.block_timestamp() % 2 ** 32
+156 │ let block_timestamp: u256 = ctx.block_timestamp() % 2 ** 32
│ ^^^^^^^^^^^^^^^ u256
-148 │ let time_elapsed: u256 = block_timestamp - self.block_timestamp_last
+157 │ let time_elapsed: u256 = block_timestamp - self.block_timestamp_last
│ ^^^^^^^^^^^^ u256
note:
- ┌─ uniswap.fe:147:37
+ ┌─ uniswap.fe:156:37
│
-147 │ let block_timestamp: u256 = ctx.block_timestamp() % 2 ** 32
+156 │ let block_timestamp: u256 = ctx.block_timestamp() % 2 ** 32
│ ^^^ Context: Memory
note:
- ┌─ uniswap.fe:147:37
+ ┌─ uniswap.fe:156:37
│
-147 │ let block_timestamp: u256 = ctx.block_timestamp() % 2 ** 32
+156 │ let block_timestamp: u256 = ctx.block_timestamp() % 2 ** 32
│ ^^^^^^^^^^^^^^^^^^^^^ ^ ^^ u256: Value
│ │ │
│ │ u256: Value
│ u256: Value
note:
- ┌─ uniswap.fe:147:61
+ ┌─ uniswap.fe:156:61
│
-147 │ let block_timestamp: u256 = ctx.block_timestamp() % 2 ** 32
+156 │ let block_timestamp: u256 = ctx.block_timestamp() % 2 ** 32
│ ^^^^^^^ u256: Value
note:
- ┌─ uniswap.fe:147:37
+ ┌─ uniswap.fe:156:37
│
-147 │ let block_timestamp: u256 = ctx.block_timestamp() % 2 ** 32
+156 │ let block_timestamp: u256 = ctx.block_timestamp() % 2 ** 32
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-148 │ let time_elapsed: u256 = block_timestamp - self.block_timestamp_last
+157 │ let time_elapsed: u256 = block_timestamp - self.block_timestamp_last
│ ^^^^^^^^^^^^^^^ ^^^^ UniswapV2Pair: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:148:52
+ ┌─ uniswap.fe:157:52
│
-148 │ let time_elapsed: u256 = block_timestamp - self.block_timestamp_last
+157 │ let time_elapsed: u256 = block_timestamp - self.block_timestamp_last
│ ^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Storage { nonce: Some(9) } => Value
note:
- ┌─ uniswap.fe:148:34
+ ┌─ uniswap.fe:157:34
│
-148 │ let time_elapsed: u256 = block_timestamp - self.block_timestamp_last
+157 │ let time_elapsed: u256 = block_timestamp - self.block_timestamp_last
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-149 │ if time_elapsed > 0 and reserve0 != 0 and reserve1 != 0 {
+158 │ if time_elapsed > 0 and reserve0 != 0 and reserve1 != 0 {
│ ^^^^^^^^^^^^ ^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:149:12
+ ┌─ uniswap.fe:158:12
│
-149 │ if time_elapsed > 0 and reserve0 != 0 and reserve1 != 0 {
+158 │ if time_elapsed > 0 and reserve0 != 0 and reserve1 != 0 {
│ ^^^^^^^^^^^^^^^^ ^^^^^^^^ ^ u256: Value
│ │ │
│ │ u256: Value
│ bool: Value
note:
- ┌─ uniswap.fe:149:33
+ ┌─ uniswap.fe:158:33
│
-149 │ if time_elapsed > 0 and reserve0 != 0 and reserve1 != 0 {
+158 │ if time_elapsed > 0 and reserve0 != 0 and reserve1 != 0 {
│ ^^^^^^^^^^^^^ bool: Value
note:
- ┌─ uniswap.fe:149:12
+ ┌─ uniswap.fe:158:12
│
-149 │ if time_elapsed > 0 and reserve0 != 0 and reserve1 != 0 {
+158 │ if time_elapsed > 0 and reserve0 != 0 and reserve1 != 0 {
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^ u256: Value
│ │ │
│ │ u256: Value
│ bool: Value
note:
- ┌─ uniswap.fe:149:51
+ ┌─ uniswap.fe:158:51
│
-149 │ if time_elapsed > 0 and reserve0 != 0 and reserve1 != 0 {
+158 │ if time_elapsed > 0 and reserve0 != 0 and reserve1 != 0 {
│ ^^^^^^^^^^^^^ bool: Value
note:
- ┌─ uniswap.fe:149:12
+ ┌─ uniswap.fe:158:12
│
-149 │ if time_elapsed > 0 and reserve0 != 0 and reserve1 != 0 {
+158 │ if time_elapsed > 0 and reserve0 != 0 and reserve1 != 0 {
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bool: Value
-150 │ self.price0_cumulative_last = self.price0_cumulative_last + reserve1 / reserve0 * time_elapsed
+159 │ self.price0_cumulative_last = self.price0_cumulative_last + reserve1 / reserve0 * time_elapsed
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:150:13
+ ┌─ uniswap.fe:159:13
│
-150 │ self.price0_cumulative_last = self.price0_cumulative_last + reserve1 / reserve0 * time_elapsed
+159 │ self.price0_cumulative_last = self.price0_cumulative_last + reserve1 / reserve0 * time_elapsed
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ UniswapV2Pair: Value
│ │
│ u256: Storage { nonce: Some(10) }
note:
- ┌─ uniswap.fe:150:43
+ ┌─ uniswap.fe:159:43
│
-150 │ self.price0_cumulative_last = self.price0_cumulative_last + reserve1 / reserve0 * time_elapsed
+159 │ self.price0_cumulative_last = self.price0_cumulative_last + reserve1 / reserve0 * time_elapsed
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^^^^^^^^ u256: Value
│ │ │
│ │ u256: Value
│ u256: Storage { nonce: Some(10) } => Value
note:
- ┌─ uniswap.fe:150:73
+ ┌─ uniswap.fe:159:73
│
-150 │ self.price0_cumulative_last = self.price0_cumulative_last + reserve1 / reserve0 * time_elapsed
+159 │ self.price0_cumulative_last = self.price0_cumulative_last + reserve1 / reserve0 * time_elapsed
│ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:150:73
+ ┌─ uniswap.fe:159:73
│
-150 │ self.price0_cumulative_last = self.price0_cumulative_last + reserve1 / reserve0 * time_elapsed
+159 │ self.price0_cumulative_last = self.price0_cumulative_last + reserve1 / reserve0 * time_elapsed
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
note:
- ┌─ uniswap.fe:150:43
+ ┌─ uniswap.fe:159:43
│
-150 │ self.price0_cumulative_last = self.price0_cumulative_last + reserve1 / reserve0 * time_elapsed
+159 │ self.price0_cumulative_last = self.price0_cumulative_last + reserve1 / reserve0 * time_elapsed
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-151 │ self.price1_cumulative_last = self.price1_cumulative_last + reserve0 / reserve1 * time_elapsed
+160 │ self.price1_cumulative_last = self.price1_cumulative_last + reserve0 / reserve1 * time_elapsed
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:151:13
+ ┌─ uniswap.fe:160:13
│
-151 │ self.price1_cumulative_last = self.price1_cumulative_last + reserve0 / reserve1 * time_elapsed
+160 │ self.price1_cumulative_last = self.price1_cumulative_last + reserve0 / reserve1 * time_elapsed
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ UniswapV2Pair: Value
│ │
│ u256: Storage { nonce: Some(11) }
note:
- ┌─ uniswap.fe:151:43
+ ┌─ uniswap.fe:160:43
│
-151 │ self.price1_cumulative_last = self.price1_cumulative_last + reserve0 / reserve1 * time_elapsed
+160 │ self.price1_cumulative_last = self.price1_cumulative_last + reserve0 / reserve1 * time_elapsed
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^^^^^^^^ u256: Value
│ │ │
│ │ u256: Value
│ u256: Storage { nonce: Some(11) } => Value
note:
- ┌─ uniswap.fe:151:73
+ ┌─ uniswap.fe:160:73
│
-151 │ self.price1_cumulative_last = self.price1_cumulative_last + reserve0 / reserve1 * time_elapsed
+160 │ self.price1_cumulative_last = self.price1_cumulative_last + reserve0 / reserve1 * time_elapsed
│ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:151:73
+ ┌─ uniswap.fe:160:73
│
-151 │ self.price1_cumulative_last = self.price1_cumulative_last + reserve0 / reserve1 * time_elapsed
+160 │ self.price1_cumulative_last = self.price1_cumulative_last + reserve0 / reserve1 * time_elapsed
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
note:
- ┌─ uniswap.fe:151:43
+ ┌─ uniswap.fe:160:43
│
-151 │ self.price1_cumulative_last = self.price1_cumulative_last + reserve0 / reserve1 * time_elapsed
+160 │ self.price1_cumulative_last = self.price1_cumulative_last + reserve0 / reserve1 * time_elapsed
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-152 │ }
-153 │ self.reserve0 = balance0
+161 │ }
+162 │ self.reserve0 = balance0
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:153:9
+ ┌─ uniswap.fe:162:9
│
-153 │ self.reserve0 = balance0
+162 │ self.reserve0 = balance0
│ ^^^^^^^^^^^^^ ^^^^^^^^ u256: Value
│ │
│ u256: Storage { nonce: Some(7) }
-154 │ self.reserve1 = balance1
+163 │ self.reserve1 = balance1
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:154:9
+ ┌─ uniswap.fe:163:9
│
-154 │ self.reserve1 = balance1
+163 │ self.reserve1 = balance1
│ ^^^^^^^^^^^^^ ^^^^^^^^ u256: Value
│ │
│ u256: Storage { nonce: Some(8) }
-155 │ self.block_timestamp_last = block_timestamp
+164 │ self.block_timestamp_last = block_timestamp
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:155:9
+ ┌─ uniswap.fe:164:9
│
-155 │ self.block_timestamp_last = block_timestamp
+164 │ self.block_timestamp_last = block_timestamp
│ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ u256: Value
│ │
│ u256: Storage { nonce: Some(9) }
-156 │ emit Sync(ctx, reserve0: self.reserve0, reserve1: self.reserve1)
- │ ^^^ ^^^^ UniswapV2Pair: Value
- │ │
- │ Context: Memory
+165 │ ctx.emit(Sync(reserve0: self.reserve0, reserve1: self.reserve1))
+ │ ^^^ ^^^^ UniswapV2Pair: Value
+ │ │
+ │ Context: Memory
+
+note:
+ ┌─ uniswap.fe:165:33
+ │
+165 │ ctx.emit(Sync(reserve0: self.reserve0, reserve1: self.reserve1))
+ │ ^^^^^^^^^^^^^ ^^^^ UniswapV2Pair: Value
+ │ │
+ │ u256: Storage { nonce: Some(7) } => Value
+
+note:
+ ┌─ uniswap.fe:165:58
+ │
+165 │ ctx.emit(Sync(reserve0: self.reserve0, reserve1: self.reserve1))
+ │ ^^^^^^^^^^^^^ u256: Storage { nonce: Some(8) } => Value
note:
- ┌─ uniswap.fe:156:34
+ ┌─ uniswap.fe:165:18
│
-156 │ emit Sync(ctx, reserve0: self.reserve0, reserve1: self.reserve1)
- │ ^^^^^^^^^^^^^ ^^^^ UniswapV2Pair: Value
- │ │
- │ u256: Storage { nonce: Some(7) } => Value
+165 │ ctx.emit(Sync(reserve0: self.reserve0, reserve1: self.reserve1))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Sync: Memory
note:
- ┌─ uniswap.fe:156:59
+ ┌─ uniswap.fe:165:9
│
-156 │ emit Sync(ctx, reserve0: self.reserve0, reserve1: self.reserve1)
- │ ^^^^^^^^^^^^^ u256: Storage { nonce: Some(8) } => Value
+165 │ ctx.emit(Sync(reserve0: self.reserve0, reserve1: self.reserve1))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
note:
- ┌─ uniswap.fe:159:5
+ ┌─ uniswap.fe:168:5
│
-159 │ ╭ fn _mint_fee(self, ctx: Context, reserve0: u256, reserve1: u256) -> bool {
-160 │ │ let fee_to: address = UniswapV2Factory(self.factory).fee_to()
-161 │ │ let fee_on: bool = fee_to != address(0)
-162 │ │ let k_last: u256 = self.k_last
+168 │ ╭ fn _mint_fee(self, ctx: Context, reserve0: u256, reserve1: u256) -> bool {
+169 │ │ let fee_to: address = UniswapV2Factory(self.factory).fee_to()
+170 │ │ let fee_on: bool = fee_to != address(0)
+171 │ │ let k_last: u256 = self.k_last
· │
-179 │ │ return fee_on
-180 │ │ }
+188 │ │ return fee_on
+189 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: reserve0, typ: u256 }, { label: None, name: reserve1, typ: u256 }] -> bool
note:
- ┌─ uniswap.fe:160:13
+ ┌─ uniswap.fe:169:13
│
-160 │ let fee_to: address = UniswapV2Factory(self.factory).fee_to()
+169 │ let fee_to: address = UniswapV2Factory(self.factory).fee_to()
│ ^^^^^^ address
-161 │ let fee_on: bool = fee_to != address(0)
+170 │ let fee_on: bool = fee_to != address(0)
│ ^^^^^^ bool
-162 │ let k_last: u256 = self.k_last
+171 │ let k_last: u256 = self.k_last
│ ^^^^^^ u256
·
-165 │ let root_k: u256 = sqrt(reserve0 * reserve1)
+174 │ let root_k: u256 = sqrt(reserve0 * reserve1)
│ ^^^^^^ u256
-166 │ let root_k_last: u256 = sqrt(k_last)
+175 │ let root_k_last: u256 = sqrt(k_last)
│ ^^^^^^^^^^^ u256
-167 │ if root_k > root_k_last {
-168 │ let numerator: u256 = self.total_supply * root_k - root_k_last
+176 │ if root_k > root_k_last {
+177 │ let numerator: u256 = self.total_supply * root_k - root_k_last
│ ^^^^^^^^^ u256
-169 │ let denominator: u256 = root_k * 5 + root_k_last
+178 │ let denominator: u256 = root_k * 5 + root_k_last
│ ^^^^^^^^^^^ u256
-170 │ let liquidity: u256 = numerator / denominator
+179 │ let liquidity: u256 = numerator / denominator
│ ^^^^^^^^^ u256
note:
- ┌─ uniswap.fe:160:48
+ ┌─ uniswap.fe:169:48
│
-160 │ let fee_to: address = UniswapV2Factory(self.factory).fee_to()
+169 │ let fee_to: address = UniswapV2Factory(self.factory).fee_to()
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:160:48
+ ┌─ uniswap.fe:169:48
│
-160 │ let fee_to: address = UniswapV2Factory(self.factory).fee_to()
+169 │ let fee_to: address = UniswapV2Factory(self.factory).fee_to()
│ ^^^^^^^^^^^^ address: Storage { nonce: Some(4) } => Value
note:
- ┌─ uniswap.fe:160:31
+ ┌─ uniswap.fe:169:31
│
-160 │ let fee_to: address = UniswapV2Factory(self.factory).fee_to()
+169 │ let fee_to: address = UniswapV2Factory(self.factory).fee_to()
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UniswapV2Factory: Value
note:
- ┌─ uniswap.fe:160:31
+ ┌─ uniswap.fe:169:31
│
-160 │ let fee_to: address = UniswapV2Factory(self.factory).fee_to()
+169 │ let fee_to: address = UniswapV2Factory(self.factory).fee_to()
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ address: Value
-161 │ let fee_on: bool = fee_to != address(0)
+170 │ let fee_on: bool = fee_to != address(0)
│ ^^^^^^ ^ u256: Value
│ │
│ address: Value
note:
- ┌─ uniswap.fe:161:38
+ ┌─ uniswap.fe:170:38
│
-161 │ let fee_on: bool = fee_to != address(0)
+170 │ let fee_on: bool = fee_to != address(0)
│ ^^^^^^^^^^ address: Value
note:
- ┌─ uniswap.fe:161:28
+ ┌─ uniswap.fe:170:28
│
-161 │ let fee_on: bool = fee_to != address(0)
+170 │ let fee_on: bool = fee_to != address(0)
│ ^^^^^^^^^^^^^^^^^^^^ bool: Value
-162 │ let k_last: u256 = self.k_last
+171 │ let k_last: u256 = self.k_last
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:162:28
+ ┌─ uniswap.fe:171:28
│
-162 │ let k_last: u256 = self.k_last
+171 │ let k_last: u256 = self.k_last
│ ^^^^^^^^^^^ u256: Storage { nonce: Some(12) } => Value
-163 │ if fee_on {
+172 │ if fee_on {
│ ^^^^^^ bool: Value
-164 │ if k_last != 0 {
+173 │ if k_last != 0 {
│ ^^^^^^ ^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:164:16
+ ┌─ uniswap.fe:173:16
│
-164 │ if k_last != 0 {
+173 │ if k_last != 0 {
│ ^^^^^^^^^^^ bool: Value
-165 │ let root_k: u256 = sqrt(reserve0 * reserve1)
+174 │ let root_k: u256 = sqrt(reserve0 * reserve1)
│ ^^^^^^^^ ^^^^^^^^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:165:41
+ ┌─ uniswap.fe:174:41
│
-165 │ let root_k: u256 = sqrt(reserve0 * reserve1)
+174 │ let root_k: u256 = sqrt(reserve0 * reserve1)
│ ^^^^^^^^^^^^^^^^^^^ u256: Value
note:
- ┌─ uniswap.fe:165:36
+ ┌─ uniswap.fe:174:36
│
-165 │ let root_k: u256 = sqrt(reserve0 * reserve1)
+174 │ let root_k: u256 = sqrt(reserve0 * reserve1)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-166 │ let root_k_last: u256 = sqrt(k_last)
+175 │ let root_k_last: u256 = sqrt(k_last)
│ ^^^^^^ u256: Value
note:
- ┌─ uniswap.fe:166:41
+ ┌─ uniswap.fe:175:41
│
-166 │ let root_k_last: u256 = sqrt(k_last)
+175 │ let root_k_last: u256 = sqrt(k_last)
│ ^^^^^^^^^^^^ u256: Value
-167 │ if root_k > root_k_last {
+176 │ if root_k > root_k_last {
│ ^^^^^^ ^^^^^^^^^^^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:167:20
+ ┌─ uniswap.fe:176:20
│
-167 │ if root_k > root_k_last {
+176 │ if root_k > root_k_last {
│ ^^^^^^^^^^^^^^^^^^^^ bool: Value
-168 │ let numerator: u256 = self.total_supply * root_k - root_k_last
+177 │ let numerator: u256 = self.total_supply * root_k - root_k_last
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:168:43
+ ┌─ uniswap.fe:177:43
│
-168 │ let numerator: u256 = self.total_supply * root_k - root_k_last
+177 │ let numerator: u256 = self.total_supply * root_k - root_k_last
│ ^^^^^^^^^^^^^^^^^ ^^^^^^ u256: Value
│ │
│ u256: Storage { nonce: Some(2) } => Value
note:
- ┌─ uniswap.fe:168:43
+ ┌─ uniswap.fe:177:43
│
-168 │ let numerator: u256 = self.total_supply * root_k - root_k_last
+177 │ let numerator: u256 = self.total_supply * root_k - root_k_last
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:168:43
+ ┌─ uniswap.fe:177:43
│
-168 │ let numerator: u256 = self.total_supply * root_k - root_k_last
+177 │ let numerator: u256 = self.total_supply * root_k - root_k_last
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-169 │ let denominator: u256 = root_k * 5 + root_k_last
+178 │ let denominator: u256 = root_k * 5 + root_k_last
│ ^^^^^^ ^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:169:45
+ ┌─ uniswap.fe:178:45
│
-169 │ let denominator: u256 = root_k * 5 + root_k_last
+178 │ let denominator: u256 = root_k * 5 + root_k_last
│ ^^^^^^^^^^ ^^^^^^^^^^^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:169:45
+ ┌─ uniswap.fe:178:45
│
-169 │ let denominator: u256 = root_k * 5 + root_k_last
+178 │ let denominator: u256 = root_k * 5 + root_k_last
│ ^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-170 │ let liquidity: u256 = numerator / denominator
+179 │ let liquidity: u256 = numerator / denominator
│ ^^^^^^^^^ ^^^^^^^^^^^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:170:43
+ ┌─ uniswap.fe:179:43
│
-170 │ let liquidity: u256 = numerator / denominator
+179 │ let liquidity: u256 = numerator / denominator
│ ^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-171 │ if liquidity > 0 {
+180 │ if liquidity > 0 {
│ ^^^^^^^^^ ^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:171:24
+ ┌─ uniswap.fe:180:24
│
-171 │ if liquidity > 0 {
+180 │ if liquidity > 0 {
│ ^^^^^^^^^^^^^ bool: Value
-172 │ self._mint(ctx, to: fee_to, value: liquidity)
+181 │ self._mint(ctx, to: fee_to, value: liquidity)
│ ^^^^ ^^^ ^^^^^^ ^^^^^^^^^ u256: Value
│ │ │ │
│ │ │ address: Value
@@ -1291,169 +1355,169 @@ note:
│ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:172:25
+ ┌─ uniswap.fe:181:25
│
-172 │ self._mint(ctx, to: fee_to, value: liquidity)
+181 │ self._mint(ctx, to: fee_to, value: liquidity)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
·
-176 │ } else if k_last != 0 {
+185 │ } else if k_last != 0 {
│ ^^^^^^ ^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:176:19
+ ┌─ uniswap.fe:185:19
│
-176 │ } else if k_last != 0 {
+185 │ } else if k_last != 0 {
│ ^^^^^^^^^^^ bool: Value
-177 │ self.k_last = 0
+186 │ self.k_last = 0
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:177:13
+ ┌─ uniswap.fe:186:13
│
-177 │ self.k_last = 0
+186 │ self.k_last = 0
│ ^^^^^^^^^^^ ^ u256: Value
│ │
│ u256: Storage { nonce: Some(12) }
-178 │ }
-179 │ return fee_on
+187 │ }
+188 │ return fee_on
│ ^^^^^^ bool: Value
note:
- ┌─ uniswap.fe:183:5
+ ┌─ uniswap.fe:192:5
│
-183 │ ╭ pub fn mint(self, ctx: Context, to: address) -> u256 {
-184 │ │ let MINIMUM_LIQUIDITY: u256 = 1000
-185 │ │ let reserve0: u256 = self.reserve0
-186 │ │ let reserve1: u256 = self.reserve1
+192 │ ╭ pub fn mint(self, ctx: Context, to: address) -> u256 {
+193 │ │ let MINIMUM_LIQUIDITY: u256 = 1000
+194 │ │ let reserve0: u256 = self.reserve0
+195 │ │ let reserve1: u256 = self.reserve1
· │
-207 │ │ return liquidity
-208 │ │ }
+216 │ │ return liquidity
+217 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: to, typ: address }] -> u256
note:
- ┌─ uniswap.fe:184:13
+ ┌─ uniswap.fe:193:13
│
-184 │ let MINIMUM_LIQUIDITY: u256 = 1000
+193 │ let MINIMUM_LIQUIDITY: u256 = 1000
│ ^^^^^^^^^^^^^^^^^ u256
-185 │ let reserve0: u256 = self.reserve0
+194 │ let reserve0: u256 = self.reserve0
│ ^^^^^^^^ u256
-186 │ let reserve1: u256 = self.reserve1
+195 │ let reserve1: u256 = self.reserve1
│ ^^^^^^^^ u256
-187 │ let balance0: u256 = self.token0.balanceOf(ctx.self_address())
+196 │ let balance0: u256 = self.token0.balanceOf(ctx.self_address())
│ ^^^^^^^^ u256
-188 │ let balance1: u256 = self.token1.balanceOf(ctx.self_address())
+197 │ let balance1: u256 = self.token1.balanceOf(ctx.self_address())
│ ^^^^^^^^ u256
-189 │ let amount0: u256 = balance0 - self.reserve0
+198 │ let amount0: u256 = balance0 - self.reserve0
│ ^^^^^^^ u256
-190 │ let amount1: u256 = balance1 - self.reserve1
+199 │ let amount1: u256 = balance1 - self.reserve1
│ ^^^^^^^ u256
-191 │ let fee_on: bool = self._mint_fee(ctx, reserve0, reserve1)
+200 │ let fee_on: bool = self._mint_fee(ctx, reserve0, reserve1)
│ ^^^^^^ bool
-192 │ let total_supply: u256 = self.total_supply // gas savings, must be defined here since totalSupply can update in _mintFee
+201 │ let total_supply: u256 = self.total_supply // gas savings, must be defined here since totalSupply can update in _mintFee
│ ^^^^^^^^^^^^ u256
-193 │ let liquidity: u256 = 0
+202 │ let liquidity: u256 = 0
│ ^^^^^^^^^ u256
note:
- ┌─ uniswap.fe:184:39
+ ┌─ uniswap.fe:193:39
│
-184 │ let MINIMUM_LIQUIDITY: u256 = 1000
+193 │ let MINIMUM_LIQUIDITY: u256 = 1000
│ ^^^^ u256: Value
-185 │ let reserve0: u256 = self.reserve0
+194 │ let reserve0: u256 = self.reserve0
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:185:30
+ ┌─ uniswap.fe:194:30
│
-185 │ let reserve0: u256 = self.reserve0
+194 │ let reserve0: u256 = self.reserve0
│ ^^^^^^^^^^^^^ u256: Storage { nonce: Some(7) } => Value
-186 │ let reserve1: u256 = self.reserve1
+195 │ let reserve1: u256 = self.reserve1
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:186:30
+ ┌─ uniswap.fe:195:30
│
-186 │ let reserve1: u256 = self.reserve1
+195 │ let reserve1: u256 = self.reserve1
│ ^^^^^^^^^^^^^ u256: Storage { nonce: Some(8) } => Value
-187 │ let balance0: u256 = self.token0.balanceOf(ctx.self_address())
+196 │ let balance0: u256 = self.token0.balanceOf(ctx.self_address())
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:187:30
+ ┌─ uniswap.fe:196:30
│
-187 │ let balance0: u256 = self.token0.balanceOf(ctx.self_address())
+196 │ let balance0: u256 = self.token0.balanceOf(ctx.self_address())
│ ^^^^^^^^^^^ ^^^ Context: Memory
│ │
│ ERC20: Storage { nonce: Some(5) } => Value
note:
- ┌─ uniswap.fe:187:52
+ ┌─ uniswap.fe:196:52
│
-187 │ let balance0: u256 = self.token0.balanceOf(ctx.self_address())
+196 │ let balance0: u256 = self.token0.balanceOf(ctx.self_address())
│ ^^^^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ uniswap.fe:187:30
+ ┌─ uniswap.fe:196:30
│
-187 │ let balance0: u256 = self.token0.balanceOf(ctx.self_address())
+196 │ let balance0: u256 = self.token0.balanceOf(ctx.self_address())
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-188 │ let balance1: u256 = self.token1.balanceOf(ctx.self_address())
+197 │ let balance1: u256 = self.token1.balanceOf(ctx.self_address())
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:188:30
+ ┌─ uniswap.fe:197:30
│
-188 │ let balance1: u256 = self.token1.balanceOf(ctx.self_address())
+197 │ let balance1: u256 = self.token1.balanceOf(ctx.self_address())
│ ^^^^^^^^^^^ ^^^ Context: Memory
│ │
│ ERC20: Storage { nonce: Some(6) } => Value
note:
- ┌─ uniswap.fe:188:52
+ ┌─ uniswap.fe:197:52
│
-188 │ let balance1: u256 = self.token1.balanceOf(ctx.self_address())
+197 │ let balance1: u256 = self.token1.balanceOf(ctx.self_address())
│ ^^^^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ uniswap.fe:188:30
+ ┌─ uniswap.fe:197:30
│
-188 │ let balance1: u256 = self.token1.balanceOf(ctx.self_address())
+197 │ let balance1: u256 = self.token1.balanceOf(ctx.self_address())
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-189 │ let amount0: u256 = balance0 - self.reserve0
+198 │ let amount0: u256 = balance0 - self.reserve0
│ ^^^^^^^^ ^^^^ UniswapV2Pair: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:189:40
+ ┌─ uniswap.fe:198:40
│
-189 │ let amount0: u256 = balance0 - self.reserve0
+198 │ let amount0: u256 = balance0 - self.reserve0
│ ^^^^^^^^^^^^^ u256: Storage { nonce: Some(7) } => Value
note:
- ┌─ uniswap.fe:189:29
+ ┌─ uniswap.fe:198:29
│
-189 │ let amount0: u256 = balance0 - self.reserve0
+198 │ let amount0: u256 = balance0 - self.reserve0
│ ^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-190 │ let amount1: u256 = balance1 - self.reserve1
+199 │ let amount1: u256 = balance1 - self.reserve1
│ ^^^^^^^^ ^^^^ UniswapV2Pair: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:190:40
+ ┌─ uniswap.fe:199:40
│
-190 │ let amount1: u256 = balance1 - self.reserve1
+199 │ let amount1: u256 = balance1 - self.reserve1
│ ^^^^^^^^^^^^^ u256: Storage { nonce: Some(8) } => Value
note:
- ┌─ uniswap.fe:190:29
+ ┌─ uniswap.fe:199:29
│
-190 │ let amount1: u256 = balance1 - self.reserve1
+199 │ let amount1: u256 = balance1 - self.reserve1
│ ^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-191 │ let fee_on: bool = self._mint_fee(ctx, reserve0, reserve1)
+200 │ let fee_on: bool = self._mint_fee(ctx, reserve0, reserve1)
│ ^^^^ ^^^ ^^^^^^^^ ^^^^^^^^ u256: Value
│ │ │ │
│ │ │ u256: Value
@@ -1461,131 +1525,131 @@ note:
│ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:191:28
+ ┌─ uniswap.fe:200:28
│
-191 │ let fee_on: bool = self._mint_fee(ctx, reserve0, reserve1)
+200 │ let fee_on: bool = self._mint_fee(ctx, reserve0, reserve1)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bool: Value
-192 │ let total_supply: u256 = self.total_supply // gas savings, must be defined here since totalSupply can update in _mintFee
+201 │ let total_supply: u256 = self.total_supply // gas savings, must be defined here since totalSupply can update in _mintFee
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:192:34
+ ┌─ uniswap.fe:201:34
│
-192 │ let total_supply: u256 = self.total_supply // gas savings, must be defined here since totalSupply can update in _mintFee
+201 │ let total_supply: u256 = self.total_supply // gas savings, must be defined here since totalSupply can update in _mintFee
│ ^^^^^^^^^^^^^^^^^ u256: Storage { nonce: Some(2) } => Value
-193 │ let liquidity: u256 = 0
+202 │ let liquidity: u256 = 0
│ ^ u256: Value
-194 │ if total_supply == 0 {
+203 │ if total_supply == 0 {
│ ^^^^^^^^^^^^ ^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:194:12
+ ┌─ uniswap.fe:203:12
│
-194 │ if total_supply == 0 {
+203 │ if total_supply == 0 {
│ ^^^^^^^^^^^^^^^^^ bool: Value
-195 │ liquidity = sqrt(amount0 * amount1) - MINIMUM_LIQUIDITY
+204 │ liquidity = sqrt(amount0 * amount1) - MINIMUM_LIQUIDITY
│ ^^^^^^^^^ ^^^^^^^ ^^^^^^^ u256: Value
│ │ │
│ │ u256: Value
│ u256: Value
note:
- ┌─ uniswap.fe:195:30
+ ┌─ uniswap.fe:204:30
│
-195 │ liquidity = sqrt(amount0 * amount1) - MINIMUM_LIQUIDITY
+204 │ liquidity = sqrt(amount0 * amount1) - MINIMUM_LIQUIDITY
│ ^^^^^^^^^^^^^^^^^ u256: Value
note:
- ┌─ uniswap.fe:195:25
+ ┌─ uniswap.fe:204:25
│
-195 │ liquidity = sqrt(amount0 * amount1) - MINIMUM_LIQUIDITY
+204 │ liquidity = sqrt(amount0 * amount1) - MINIMUM_LIQUIDITY
│ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:195:25
+ ┌─ uniswap.fe:204:25
│
-195 │ liquidity = sqrt(amount0 * amount1) - MINIMUM_LIQUIDITY
+204 │ liquidity = sqrt(amount0 * amount1) - MINIMUM_LIQUIDITY
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-196 │ self._mint(ctx, to: address(0), value: MINIMUM_LIQUIDITY) // permanently lock the first MINIMUM_LIQUIDITY tokens
+205 │ self._mint(ctx, to: address(0), value: MINIMUM_LIQUIDITY) // permanently lock the first MINIMUM_LIQUIDITY tokens
│ ^^^^ ^^^ ^ u256: Value
│ │ │
│ │ Context: Memory
│ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:196:33
+ ┌─ uniswap.fe:205:33
│
-196 │ self._mint(ctx, to: address(0), value: MINIMUM_LIQUIDITY) // permanently lock the first MINIMUM_LIQUIDITY tokens
+205 │ self._mint(ctx, to: address(0), value: MINIMUM_LIQUIDITY) // permanently lock the first MINIMUM_LIQUIDITY tokens
│ ^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ u256: Value
│ │
│ address: Value
note:
- ┌─ uniswap.fe:196:13
+ ┌─ uniswap.fe:205:13
│
-196 │ self._mint(ctx, to: address(0), value: MINIMUM_LIQUIDITY) // permanently lock the first MINIMUM_LIQUIDITY tokens
+205 │ self._mint(ctx, to: address(0), value: MINIMUM_LIQUIDITY) // permanently lock the first MINIMUM_LIQUIDITY tokens
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
-197 │ } else {
-198 │ liquidity = min(amount0 * total_supply / reserve0, amount1 * total_supply / reserve1)
+206 │ } else {
+207 │ liquidity = min(amount0 * total_supply / reserve0, amount1 * total_supply / reserve1)
│ ^^^^^^^^^ ^^^^^^^ ^^^^^^^^^^^^ u256: Value
│ │ │
│ │ u256: Value
│ u256: Value
note:
- ┌─ uniswap.fe:198:29
+ ┌─ uniswap.fe:207:29
│
-198 │ liquidity = min(amount0 * total_supply / reserve0, amount1 * total_supply / reserve1)
+207 │ liquidity = min(amount0 * total_supply / reserve0, amount1 * total_supply / reserve1)
│ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:198:29
+ ┌─ uniswap.fe:207:29
│
-198 │ liquidity = min(amount0 * total_supply / reserve0, amount1 * total_supply / reserve1)
+207 │ liquidity = min(amount0 * total_supply / reserve0, amount1 * total_supply / reserve1)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^ ^^^^^^^^^^^^ u256: Value
│ │ │
│ │ u256: Value
│ u256: Value
note:
- ┌─ uniswap.fe:198:64
+ ┌─ uniswap.fe:207:64
│
-198 │ liquidity = min(amount0 * total_supply / reserve0, amount1 * total_supply / reserve1)
+207 │ liquidity = min(amount0 * total_supply / reserve0, amount1 * total_supply / reserve1)
│ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:198:64
+ ┌─ uniswap.fe:207:64
│
-198 │ liquidity = min(amount0 * total_supply / reserve0, amount1 * total_supply / reserve1)
+207 │ liquidity = min(amount0 * total_supply / reserve0, amount1 * total_supply / reserve1)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
note:
- ┌─ uniswap.fe:198:25
+ ┌─ uniswap.fe:207:25
│
-198 │ liquidity = min(amount0 * total_supply / reserve0, amount1 * total_supply / reserve1)
+207 │ liquidity = min(amount0 * total_supply / reserve0, amount1 * total_supply / reserve1)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-199 │ }
-200 │ assert liquidity > 0, "UniswapV2: INSUFFICIENT_LIQUIDITY_MINTED"
+208 │ }
+209 │ assert liquidity > 0, "UniswapV2: INSUFFICIENT_LIQUIDITY_MINTED"
│ ^^^^^^^^^ ^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:200:16
+ ┌─ uniswap.fe:209:16
│
-200 │ assert liquidity > 0, "UniswapV2: INSUFFICIENT_LIQUIDITY_MINTED"
+209 │ assert liquidity > 0, "UniswapV2: INSUFFICIENT_LIQUIDITY_MINTED"
│ ^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ String<40>: Memory
│ │
│ bool: Value
-201 │ self._mint(ctx, to, value: liquidity)
+210 │ self._mint(ctx, to, value: liquidity)
│ ^^^^ ^^^ ^^ ^^^^^^^^^ u256: Value
│ │ │ │
│ │ │ address: Value
@@ -1593,11 +1657,11 @@ note:
│ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:201:9
+ ┌─ uniswap.fe:210:9
│
-201 │ self._mint(ctx, to, value: liquidity)
+210 │ self._mint(ctx, to, value: liquidity)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
-202 │ self._update(ctx, balance0, balance1, reserve0, reserve1)
+211 │ self._update(ctx, balance0, balance1, reserve0, reserve1)
│ ^^^^ ^^^ ^^^^^^^^ ^^^^^^^^ ^^^^^^^^ ^^^^^^^^ u256: Value
│ │ │ │ │ │
│ │ │ │ │ u256: Value
@@ -1607,176 +1671,188 @@ note:
│ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:202:9
+ ┌─ uniswap.fe:211:9
│
-202 │ self._update(ctx, balance0, balance1, reserve0, reserve1)
+211 │ self._update(ctx, balance0, balance1, reserve0, reserve1)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
-203 │ if fee_on {
+212 │ if fee_on {
│ ^^^^^^ bool: Value
-204 │ self.k_last = reserve0 * reserve1 // reserve0 and reserve1 are up-to-date
+213 │ self.k_last = reserve0 * reserve1 // reserve0 and reserve1 are up-to-date
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:204:13
+ ┌─ uniswap.fe:213:13
│
-204 │ self.k_last = reserve0 * reserve1 // reserve0 and reserve1 are up-to-date
+213 │ self.k_last = reserve0 * reserve1 // reserve0 and reserve1 are up-to-date
│ ^^^^^^^^^^^ ^^^^^^^^ ^^^^^^^^ u256: Value
│ │ │
│ │ u256: Value
│ u256: Storage { nonce: Some(12) }
note:
- ┌─ uniswap.fe:204:27
+ ┌─ uniswap.fe:213:27
│
-204 │ self.k_last = reserve0 * reserve1 // reserve0 and reserve1 are up-to-date
+213 │ self.k_last = reserve0 * reserve1 // reserve0 and reserve1 are up-to-date
│ ^^^^^^^^^^^^^^^^^^^ u256: Value
-205 │ }
-206 │ emit Mint(ctx, sender: ctx.msg_sender(), amount0, amount1)
- │ ^^^ ^^^ Context: Memory
- │ │
- │ Context: Memory
+214 │ }
+215 │ ctx.emit(Mint(sender: ctx.msg_sender(), amount0, amount1))
+ │ ^^^ ^^^ Context: Memory
+ │ │
+ │ Context: Memory
note:
- ┌─ uniswap.fe:206:32
+ ┌─ uniswap.fe:215:31
│
-206 │ emit Mint(ctx, sender: ctx.msg_sender(), amount0, amount1)
- │ ^^^^^^^^^^^^^^^^ ^^^^^^^ ^^^^^^^ u256: Value
- │ │ │
- │ │ u256: Value
- │ address: Value
-207 │ return liquidity
+215 │ ctx.emit(Mint(sender: ctx.msg_sender(), amount0, amount1))
+ │ ^^^^^^^^^^^^^^^^ ^^^^^^^ ^^^^^^^ u256: Value
+ │ │ │
+ │ │ u256: Value
+ │ address: Value
+
+note:
+ ┌─ uniswap.fe:215:18
+ │
+215 │ ctx.emit(Mint(sender: ctx.msg_sender(), amount0, amount1))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Mint: Memory
+
+note:
+ ┌─ uniswap.fe:215:9
+ │
+215 │ ctx.emit(Mint(sender: ctx.msg_sender(), amount0, amount1))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
+216 │ return liquidity
│ ^^^^^^^^^ u256: Value
note:
- ┌─ uniswap.fe:211:5
+ ┌─ uniswap.fe:220:5
│
-211 │ ╭ pub fn burn(self, ctx: Context, to: address) -> (u256, u256) {
-212 │ │ let reserve0: u256 = self.reserve0
-213 │ │ let reserve1: u256 = self.reserve1
-214 │ │ let token0: ERC20 = self.token0
+220 │ ╭ pub fn burn(self, ctx: Context, to: address) -> (u256, u256) {
+221 │ │ let reserve0: u256 = self.reserve0
+222 │ │ let reserve1: u256 = self.reserve1
+223 │ │ let token0: ERC20 = self.token0
· │
-235 │ │ return (amount0, amount1)
-236 │ │ }
+244 │ │ return (amount0, amount1)
+245 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: to, typ: address }] -> (u256, u256)
note:
- ┌─ uniswap.fe:212:13
+ ┌─ uniswap.fe:221:13
│
-212 │ let reserve0: u256 = self.reserve0
+221 │ let reserve0: u256 = self.reserve0
│ ^^^^^^^^ u256
-213 │ let reserve1: u256 = self.reserve1
+222 │ let reserve1: u256 = self.reserve1
│ ^^^^^^^^ u256
-214 │ let token0: ERC20 = self.token0
+223 │ let token0: ERC20 = self.token0
│ ^^^^^^ ERC20
-215 │ let token1: ERC20 = self.token1
+224 │ let token1: ERC20 = self.token1
│ ^^^^^^ ERC20
-216 │ let balance0: u256 = token0.balanceOf(ctx.self_address())
+225 │ let balance0: u256 = token0.balanceOf(ctx.self_address())
│ ^^^^^^^^ u256
-217 │ let balance1: u256 = token1.balanceOf(ctx.self_address())
+226 │ let balance1: u256 = token1.balanceOf(ctx.self_address())
│ ^^^^^^^^ u256
-218 │ let liquidity: u256 = self.balances[ctx.self_address()]
+227 │ let liquidity: u256 = self.balances[ctx.self_address()]
│ ^^^^^^^^^ u256
-219 │
-220 │ let fee_on: bool = self._mint_fee(ctx, reserve0, reserve1)
+228 │
+229 │ let fee_on: bool = self._mint_fee(ctx, reserve0, reserve1)
│ ^^^^^^ bool
-221 │ let total_supply: u256 = self.total_supply // gas savings, must be defined here since total_supply can update in _mintFee
+230 │ let total_supply: u256 = self.total_supply // gas savings, must be defined here since total_supply can update in _mintFee
│ ^^^^^^^^^^^^ u256
-222 │ let amount0: u256 = (liquidity * balance0) / total_supply // using balances ensures pro-rata distribution
+231 │ let amount0: u256 = (liquidity * balance0) / total_supply // using balances ensures pro-rata distribution
│ ^^^^^^^ u256
-223 │ let amount1: u256 = (liquidity * balance1) / total_supply // using balances ensures pro-rata distribution
+232 │ let amount1: u256 = (liquidity * balance1) / total_supply // using balances ensures pro-rata distribution
│ ^^^^^^^ u256
note:
- ┌─ uniswap.fe:212:30
+ ┌─ uniswap.fe:221:30
│
-212 │ let reserve0: u256 = self.reserve0
+221 │ let reserve0: u256 = self.reserve0
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:212:30
+ ┌─ uniswap.fe:221:30
│
-212 │ let reserve0: u256 = self.reserve0
+221 │ let reserve0: u256 = self.reserve0
│ ^^^^^^^^^^^^^ u256: Storage { nonce: Some(7) } => Value
-213 │ let reserve1: u256 = self.reserve1
+222 │ let reserve1: u256 = self.reserve1
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:213:30
+ ┌─ uniswap.fe:222:30
│
-213 │ let reserve1: u256 = self.reserve1
+222 │ let reserve1: u256 = self.reserve1
│ ^^^^^^^^^^^^^ u256: Storage { nonce: Some(8) } => Value
-214 │ let token0: ERC20 = self.token0
+223 │ let token0: ERC20 = self.token0
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:214:29
+ ┌─ uniswap.fe:223:29
│
-214 │ let token0: ERC20 = self.token0
+223 │ let token0: ERC20 = self.token0
│ ^^^^^^^^^^^ ERC20: Storage { nonce: Some(5) } => Value
-215 │ let token1: ERC20 = self.token1
+224 │ let token1: ERC20 = self.token1
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:215:29
+ ┌─ uniswap.fe:224:29
│
-215 │ let token1: ERC20 = self.token1
+224 │ let token1: ERC20 = self.token1
│ ^^^^^^^^^^^ ERC20: Storage { nonce: Some(6) } => Value
-216 │ let balance0: u256 = token0.balanceOf(ctx.self_address())
+225 │ let balance0: u256 = token0.balanceOf(ctx.self_address())
│ ^^^^^^ ^^^ Context: Memory
│ │
│ ERC20: Value
note:
- ┌─ uniswap.fe:216:47
+ ┌─ uniswap.fe:225:47
│
-216 │ let balance0: u256 = token0.balanceOf(ctx.self_address())
+225 │ let balance0: u256 = token0.balanceOf(ctx.self_address())
│ ^^^^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ uniswap.fe:216:30
+ ┌─ uniswap.fe:225:30
│
-216 │ let balance0: u256 = token0.balanceOf(ctx.self_address())
+225 │ let balance0: u256 = token0.balanceOf(ctx.self_address())
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-217 │ let balance1: u256 = token1.balanceOf(ctx.self_address())
+226 │ let balance1: u256 = token1.balanceOf(ctx.self_address())
│ ^^^^^^ ^^^ Context: Memory
│ │
│ ERC20: Value
note:
- ┌─ uniswap.fe:217:47
+ ┌─ uniswap.fe:226:47
│
-217 │ let balance1: u256 = token1.balanceOf(ctx.self_address())
+226 │ let balance1: u256 = token1.balanceOf(ctx.self_address())
│ ^^^^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ uniswap.fe:217:30
+ ┌─ uniswap.fe:226:30
│
-217 │ let balance1: u256 = token1.balanceOf(ctx.self_address())
+226 │ let balance1: u256 = token1.balanceOf(ctx.self_address())
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-218 │ let liquidity: u256 = self.balances[ctx.self_address()]
+227 │ let liquidity: u256 = self.balances[ctx.self_address()]
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:218:31
+ ┌─ uniswap.fe:227:31
│
-218 │ let liquidity: u256 = self.balances[ctx.self_address()]
+227 │ let liquidity: u256 = self.balances[ctx.self_address()]
│ ^^^^^^^^^^^^^ ^^^ Context: Memory
│ │
│ Map: Storage { nonce: Some(0) }
note:
- ┌─ uniswap.fe:218:45
+ ┌─ uniswap.fe:227:45
│
-218 │ let liquidity: u256 = self.balances[ctx.self_address()]
+227 │ let liquidity: u256 = self.balances[ctx.self_address()]
│ ^^^^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ uniswap.fe:218:31
+ ┌─ uniswap.fe:227:31
│
-218 │ let liquidity: u256 = self.balances[ctx.self_address()]
+227 │ let liquidity: u256 = self.balances[ctx.self_address()]
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Storage { nonce: None } => Value
-219 │
-220 │ let fee_on: bool = self._mint_fee(ctx, reserve0, reserve1)
+228 │
+229 │ let fee_on: bool = self._mint_fee(ctx, reserve0, reserve1)
│ ^^^^ ^^^ ^^^^^^^^ ^^^^^^^^ u256: Value
│ │ │ │
│ │ │ u256: Value
@@ -1784,157 +1860,157 @@ note:
│ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:220:28
+ ┌─ uniswap.fe:229:28
│
-220 │ let fee_on: bool = self._mint_fee(ctx, reserve0, reserve1)
+229 │ let fee_on: bool = self._mint_fee(ctx, reserve0, reserve1)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bool: Value
-221 │ let total_supply: u256 = self.total_supply // gas savings, must be defined here since total_supply can update in _mintFee
+230 │ let total_supply: u256 = self.total_supply // gas savings, must be defined here since total_supply can update in _mintFee
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:221:34
+ ┌─ uniswap.fe:230:34
│
-221 │ let total_supply: u256 = self.total_supply // gas savings, must be defined here since total_supply can update in _mintFee
+230 │ let total_supply: u256 = self.total_supply // gas savings, must be defined here since total_supply can update in _mintFee
│ ^^^^^^^^^^^^^^^^^ u256: Storage { nonce: Some(2) } => Value
-222 │ let amount0: u256 = (liquidity * balance0) / total_supply // using balances ensures pro-rata distribution
+231 │ let amount0: u256 = (liquidity * balance0) / total_supply // using balances ensures pro-rata distribution
│ ^^^^^^^^^ ^^^^^^^^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:222:29
+ ┌─ uniswap.fe:231:29
│
-222 │ let amount0: u256 = (liquidity * balance0) / total_supply // using balances ensures pro-rata distribution
+231 │ let amount0: u256 = (liquidity * balance0) / total_supply // using balances ensures pro-rata distribution
│ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:222:29
+ ┌─ uniswap.fe:231:29
│
-222 │ let amount0: u256 = (liquidity * balance0) / total_supply // using balances ensures pro-rata distribution
+231 │ let amount0: u256 = (liquidity * balance0) / total_supply // using balances ensures pro-rata distribution
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-223 │ let amount1: u256 = (liquidity * balance1) / total_supply // using balances ensures pro-rata distribution
+232 │ let amount1: u256 = (liquidity * balance1) / total_supply // using balances ensures pro-rata distribution
│ ^^^^^^^^^ ^^^^^^^^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:223:29
+ ┌─ uniswap.fe:232:29
│
-223 │ let amount1: u256 = (liquidity * balance1) / total_supply // using balances ensures pro-rata distribution
+232 │ let amount1: u256 = (liquidity * balance1) / total_supply // using balances ensures pro-rata distribution
│ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:223:29
+ ┌─ uniswap.fe:232:29
│
-223 │ let amount1: u256 = (liquidity * balance1) / total_supply // using balances ensures pro-rata distribution
+232 │ let amount1: u256 = (liquidity * balance1) / total_supply // using balances ensures pro-rata distribution
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-224 │ assert amount0 > 0 and amount1 > 0, "UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED"
+233 │ assert amount0 > 0 and amount1 > 0, "UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED"
│ ^^^^^^^ ^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:224:16
+ ┌─ uniswap.fe:233:16
│
-224 │ assert amount0 > 0 and amount1 > 0, "UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED"
+233 │ assert amount0 > 0 and amount1 > 0, "UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED"
│ ^^^^^^^^^^^ ^^^^^^^ ^ u256: Value
│ │ │
│ │ u256: Value
│ bool: Value
note:
- ┌─ uniswap.fe:224:32
+ ┌─ uniswap.fe:233:32
│
-224 │ assert amount0 > 0 and amount1 > 0, "UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED"
+233 │ assert amount0 > 0 and amount1 > 0, "UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED"
│ ^^^^^^^^^^^ bool: Value
note:
- ┌─ uniswap.fe:224:16
+ ┌─ uniswap.fe:233:16
│
-224 │ assert amount0 > 0 and amount1 > 0, "UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED"
+233 │ assert amount0 > 0 and amount1 > 0, "UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED"
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ String<40>: Memory
│ │
│ bool: Value
-225 │ self._burn(ctx, from: ctx.self_address(), value: liquidity)
+234 │ self._burn(ctx, from: ctx.self_address(), value: liquidity)
│ ^^^^ ^^^ ^^^ Context: Memory
│ │ │
│ │ Context: Memory
│ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:225:31
+ ┌─ uniswap.fe:234:31
│
-225 │ self._burn(ctx, from: ctx.self_address(), value: liquidity)
+234 │ self._burn(ctx, from: ctx.self_address(), value: liquidity)
│ ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^ u256: Value
│ │
│ address: Value
note:
- ┌─ uniswap.fe:225:9
+ ┌─ uniswap.fe:234:9
│
-225 │ self._burn(ctx, from: ctx.self_address(), value: liquidity)
+234 │ self._burn(ctx, from: ctx.self_address(), value: liquidity)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
-226 │ token0.transfer(to, amount0)
+235 │ token0.transfer(to, amount0)
│ ^^^^^^ ^^ ^^^^^^^ u256: Value
│ │ │
│ │ address: Value
│ ERC20: Value
note:
- ┌─ uniswap.fe:226:9
+ ┌─ uniswap.fe:235:9
│
-226 │ token0.transfer(to, amount0)
+235 │ token0.transfer(to, amount0)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bool: Value
-227 │ token1.transfer(to, amount1)
+236 │ token1.transfer(to, amount1)
│ ^^^^^^ ^^ ^^^^^^^ u256: Value
│ │ │
│ │ address: Value
│ ERC20: Value
note:
- ┌─ uniswap.fe:227:9
+ ┌─ uniswap.fe:236:9
│
-227 │ token1.transfer(to, amount1)
+236 │ token1.transfer(to, amount1)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bool: Value
-228 │ balance0 = token0.balanceOf(ctx.self_address())
+237 │ balance0 = token0.balanceOf(ctx.self_address())
│ ^^^^^^^^ ^^^^^^ ^^^ Context: Memory
│ │ │
│ │ ERC20: Value
│ u256: Value
note:
- ┌─ uniswap.fe:228:37
+ ┌─ uniswap.fe:237:37
│
-228 │ balance0 = token0.balanceOf(ctx.self_address())
+237 │ balance0 = token0.balanceOf(ctx.self_address())
│ ^^^^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ uniswap.fe:228:20
+ ┌─ uniswap.fe:237:20
│
-228 │ balance0 = token0.balanceOf(ctx.self_address())
+237 │ balance0 = token0.balanceOf(ctx.self_address())
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-229 │ balance1 = token1.balanceOf(ctx.self_address())
+238 │ balance1 = token1.balanceOf(ctx.self_address())
│ ^^^^^^^^ ^^^^^^ ^^^ Context: Memory
│ │ │
│ │ ERC20: Value
│ u256: Value
note:
- ┌─ uniswap.fe:229:37
+ ┌─ uniswap.fe:238:37
│
-229 │ balance1 = token1.balanceOf(ctx.self_address())
+238 │ balance1 = token1.balanceOf(ctx.self_address())
│ ^^^^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ uniswap.fe:229:20
+ ┌─ uniswap.fe:238:20
│
-229 │ balance1 = token1.balanceOf(ctx.self_address())
+238 │ balance1 = token1.balanceOf(ctx.self_address())
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-230 │ self._update(ctx, balance0, balance1, reserve0, reserve1)
+239 │ self._update(ctx, balance0, balance1, reserve0, reserve1)
│ ^^^^ ^^^ ^^^^^^^^ ^^^^^^^^ ^^^^^^^^ ^^^^^^^^ u256: Value
│ │ │ │ │ │
│ │ │ │ │ u256: Value
@@ -1944,514 +2020,526 @@ note:
│ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:230:9
+ ┌─ uniswap.fe:239:9
│
-230 │ self._update(ctx, balance0, balance1, reserve0, reserve1)
+239 │ self._update(ctx, balance0, balance1, reserve0, reserve1)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
-231 │ if fee_on {
+240 │ if fee_on {
│ ^^^^^^ bool: Value
-232 │ self.k_last = reserve0 * reserve1
+241 │ self.k_last = reserve0 * reserve1
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:232:13
+ ┌─ uniswap.fe:241:13
│
-232 │ self.k_last = reserve0 * reserve1
+241 │ self.k_last = reserve0 * reserve1
│ ^^^^^^^^^^^ ^^^^^^^^ ^^^^^^^^ u256: Value
│ │ │
│ │ u256: Value
│ u256: Storage { nonce: Some(12) }
note:
- ┌─ uniswap.fe:232:27
+ ┌─ uniswap.fe:241:27
│
-232 │ self.k_last = reserve0 * reserve1
+241 │ self.k_last = reserve0 * reserve1
│ ^^^^^^^^^^^^^^^^^^^ u256: Value
-233 │ }
-234 │ emit Burn(ctx, sender: ctx.msg_sender(), amount0, amount1, to)
- │ ^^^ ^^^ Context: Memory
- │ │
- │ Context: Memory
-
-note:
- ┌─ uniswap.fe:234:32
- │
-234 │ emit Burn(ctx, sender: ctx.msg_sender(), amount0, amount1, to)
- │ ^^^^^^^^^^^^^^^^ ^^^^^^^ ^^^^^^^ ^^ address: Value
- │ │ │ │
- │ │ │ u256: Value
- │ │ u256: Value
- │ address: Value
-235 │ return (amount0, amount1)
+242 │ }
+243 │ ctx.emit(Burn(sender: ctx.msg_sender(), amount0, amount1, to))
+ │ ^^^ ^^^ Context: Memory
+ │ │
+ │ Context: Memory
+
+note:
+ ┌─ uniswap.fe:243:31
+ │
+243 │ ctx.emit(Burn(sender: ctx.msg_sender(), amount0, amount1, to))
+ │ ^^^^^^^^^^^^^^^^ ^^^^^^^ ^^^^^^^ ^^ address: Value
+ │ │ │ │
+ │ │ │ u256: Value
+ │ │ u256: Value
+ │ address: Value
+
+note:
+ ┌─ uniswap.fe:243:18
+ │
+243 │ ctx.emit(Burn(sender: ctx.msg_sender(), amount0, amount1, to))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Burn: Memory
+
+note:
+ ┌─ uniswap.fe:243:9
+ │
+243 │ ctx.emit(Burn(sender: ctx.msg_sender(), amount0, amount1, to))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
+244 │ return (amount0, amount1)
│ ^^^^^^^ ^^^^^^^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:235:16
+ ┌─ uniswap.fe:244:16
│
-235 │ return (amount0, amount1)
+244 │ return (amount0, amount1)
│ ^^^^^^^^^^^^^^^^^^ (u256, u256): Memory
note:
- ┌─ uniswap.fe:241:5
+ ┌─ uniswap.fe:250:5
│
-241 │ ╭ pub fn swap(self, ctx: Context, amount0_out: u256, amount1_out: u256, to: address) {
-242 │ │ assert amount0_out > 0 or amount1_out > 0, "UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT"
-243 │ │ let reserve0: u256 = self.reserve0
-244 │ │ let reserve1: u256 = self.reserve1
+250 │ ╭ pub fn swap(self, ctx: Context, amount0_out: u256, amount1_out: u256, to: address) {
+251 │ │ assert amount0_out > 0 or amount1_out > 0, "UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT"
+252 │ │ let reserve0: u256 = self.reserve0
+253 │ │ let reserve1: u256 = self.reserve1
· │
-277 │ │ emit Swap(ctx, sender: ctx.msg_sender(), amount0_in, amount1_in, amount0_out, amount1_out, to)
-278 │ │ }
+286 │ │ ctx.emit(Swap(sender: ctx.msg_sender(), amount0_in, amount1_in, amount0_out, amount1_out, to))
+287 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: amount0_out, typ: u256 }, { label: None, name: amount1_out, typ: u256 }, { label: None, name: to, typ: address }] -> ()
note:
- ┌─ uniswap.fe:243:13
+ ┌─ uniswap.fe:252:13
│
-243 │ let reserve0: u256 = self.reserve0
+252 │ let reserve0: u256 = self.reserve0
│ ^^^^^^^^ u256
-244 │ let reserve1: u256 = self.reserve1
+253 │ let reserve1: u256 = self.reserve1
│ ^^^^^^^^ u256
·
-247 │ let token0: ERC20 = self.token0
+256 │ let token0: ERC20 = self.token0
│ ^^^^^^ ERC20
-248 │ let token1: ERC20 = self.token1
+257 │ let token1: ERC20 = self.token1
│ ^^^^^^ ERC20
·
-263 │ let balance0: u256 = token0.balanceOf(ctx.self_address())
+272 │ let balance0: u256 = token0.balanceOf(ctx.self_address())
│ ^^^^^^^^ u256
-264 │ let balance1: u256 = token1.balanceOf(ctx.self_address())
+273 │ let balance1: u256 = token1.balanceOf(ctx.self_address())
│ ^^^^^^^^ u256
-265 │
-266 │ let amount0_in: u256 = balance0 - (reserve0 - amount0_out) if balance0 > reserve0 - amount0_out else 0
+274 │
+275 │ let amount0_in: u256 = balance0 - (reserve0 - amount0_out) if balance0 > reserve0 - amount0_out else 0
│ ^^^^^^^^^^ u256
-267 │ let amount1_in: u256 = balance1 - (reserve1 - amount1_out) if balance1 > reserve1 - amount1_out else 0
+276 │ let amount1_in: u256 = balance1 - (reserve1 - amount1_out) if balance1 > reserve1 - amount1_out else 0
│ ^^^^^^^^^^ u256
·
-271 │ let balance0_adjusted: u256 = balance0 * 1000 - amount0_in * 3
+280 │ let balance0_adjusted: u256 = balance0 * 1000 - amount0_in * 3
│ ^^^^^^^^^^^^^^^^^ u256
-272 │ let balance1_adjusted: u256 = balance1 * 1000 - amount1_in * 3
+281 │ let balance1_adjusted: u256 = balance1 * 1000 - amount1_in * 3
│ ^^^^^^^^^^^^^^^^^ u256
note:
- ┌─ uniswap.fe:242:16
+ ┌─ uniswap.fe:251:16
│
-242 │ assert amount0_out > 0 or amount1_out > 0, "UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT"
+251 │ assert amount0_out > 0 or amount1_out > 0, "UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT"
│ ^^^^^^^^^^^ ^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:242:16
+ ┌─ uniswap.fe:251:16
│
-242 │ assert amount0_out > 0 or amount1_out > 0, "UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT"
+251 │ assert amount0_out > 0 or amount1_out > 0, "UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT"
│ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^ ^ u256: Value
│ │ │
│ │ u256: Value
│ bool: Value
note:
- ┌─ uniswap.fe:242:35
+ ┌─ uniswap.fe:251:35
│
-242 │ assert amount0_out > 0 or amount1_out > 0, "UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT"
+251 │ assert amount0_out > 0 or amount1_out > 0, "UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT"
│ ^^^^^^^^^^^^^^^ bool: Value
note:
- ┌─ uniswap.fe:242:16
+ ┌─ uniswap.fe:251:16
│
-242 │ assert amount0_out > 0 or amount1_out > 0, "UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT"
+251 │ assert amount0_out > 0 or amount1_out > 0, "UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT"
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ String<37>: Memory
│ │
│ bool: Value
-243 │ let reserve0: u256 = self.reserve0
+252 │ let reserve0: u256 = self.reserve0
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:243:30
+ ┌─ uniswap.fe:252:30
│
-243 │ let reserve0: u256 = self.reserve0
+252 │ let reserve0: u256 = self.reserve0
│ ^^^^^^^^^^^^^ u256: Storage { nonce: Some(7) } => Value
-244 │ let reserve1: u256 = self.reserve1
+253 │ let reserve1: u256 = self.reserve1
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:244:30
+ ┌─ uniswap.fe:253:30
│
-244 │ let reserve1: u256 = self.reserve1
+253 │ let reserve1: u256 = self.reserve1
│ ^^^^^^^^^^^^^ u256: Storage { nonce: Some(8) } => Value
-245 │ assert amount0_out < reserve0 and amount1_out < reserve1, "UniswapV2: INSUFFICIENT_LIQUIDITY"
+254 │ assert amount0_out < reserve0 and amount1_out < reserve1, "UniswapV2: INSUFFICIENT_LIQUIDITY"
│ ^^^^^^^^^^^ ^^^^^^^^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:245:16
+ ┌─ uniswap.fe:254:16
│
-245 │ assert amount0_out < reserve0 and amount1_out < reserve1, "UniswapV2: INSUFFICIENT_LIQUIDITY"
+254 │ assert amount0_out < reserve0 and amount1_out < reserve1, "UniswapV2: INSUFFICIENT_LIQUIDITY"
│ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^ u256: Value
│ │ │
│ │ u256: Value
│ bool: Value
note:
- ┌─ uniswap.fe:245:43
+ ┌─ uniswap.fe:254:43
│
-245 │ assert amount0_out < reserve0 and amount1_out < reserve1, "UniswapV2: INSUFFICIENT_LIQUIDITY"
+254 │ assert amount0_out < reserve0 and amount1_out < reserve1, "UniswapV2: INSUFFICIENT_LIQUIDITY"
│ ^^^^^^^^^^^^^^^^^^^^^^ bool: Value
note:
- ┌─ uniswap.fe:245:16
+ ┌─ uniswap.fe:254:16
│
-245 │ assert amount0_out < reserve0 and amount1_out < reserve1, "UniswapV2: INSUFFICIENT_LIQUIDITY"
+254 │ assert amount0_out < reserve0 and amount1_out < reserve1, "UniswapV2: INSUFFICIENT_LIQUIDITY"
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ String<33>: Memory
│ │
│ bool: Value
-246 │
-247 │ let token0: ERC20 = self.token0
+255 │
+256 │ let token0: ERC20 = self.token0
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:247:29
+ ┌─ uniswap.fe:256:29
│
-247 │ let token0: ERC20 = self.token0
+256 │ let token0: ERC20 = self.token0
│ ^^^^^^^^^^^ ERC20: Storage { nonce: Some(5) } => Value
-248 │ let token1: ERC20 = self.token1
+257 │ let token1: ERC20 = self.token1
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:248:29
+ ┌─ uniswap.fe:257:29
│
-248 │ let token1: ERC20 = self.token1
+257 │ let token1: ERC20 = self.token1
│ ^^^^^^^^^^^ ERC20: Storage { nonce: Some(6) } => Value
·
-251 │ assert to != address(token0) and to != address(token1), "UniswapV2: INVALID_TO"
+260 │ assert to != address(token0) and to != address(token1), "UniswapV2: INVALID_TO"
│ ^^ ^^^^^^ ERC20: Value
│ │
│ address: Value
note:
- ┌─ uniswap.fe:251:22
+ ┌─ uniswap.fe:260:22
│
-251 │ assert to != address(token0) and to != address(token1), "UniswapV2: INVALID_TO"
+260 │ assert to != address(token0) and to != address(token1), "UniswapV2: INVALID_TO"
│ ^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ uniswap.fe:251:16
+ ┌─ uniswap.fe:260:16
│
-251 │ assert to != address(token0) and to != address(token1), "UniswapV2: INVALID_TO"
+260 │ assert to != address(token0) and to != address(token1), "UniswapV2: INVALID_TO"
│ ^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^ ERC20: Value
│ │ │
│ │ address: Value
│ bool: Value
note:
- ┌─ uniswap.fe:251:48
+ ┌─ uniswap.fe:260:48
│
-251 │ assert to != address(token0) and to != address(token1), "UniswapV2: INVALID_TO"
+260 │ assert to != address(token0) and to != address(token1), "UniswapV2: INVALID_TO"
│ ^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ uniswap.fe:251:42
+ ┌─ uniswap.fe:260:42
│
-251 │ assert to != address(token0) and to != address(token1), "UniswapV2: INVALID_TO"
+260 │ assert to != address(token0) and to != address(token1), "UniswapV2: INVALID_TO"
│ ^^^^^^^^^^^^^^^^^^^^^ bool: Value
note:
- ┌─ uniswap.fe:251:16
+ ┌─ uniswap.fe:260:16
│
-251 │ assert to != address(token0) and to != address(token1), "UniswapV2: INVALID_TO"
+260 │ assert to != address(token0) and to != address(token1), "UniswapV2: INVALID_TO"
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ String<21>: Memory
│ │
│ bool: Value
-252 │
-253 │ if amount0_out > 0 {
+261 │
+262 │ if amount0_out > 0 {
│ ^^^^^^^^^^^ ^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:253:12
+ ┌─ uniswap.fe:262:12
│
-253 │ if amount0_out > 0 {
+262 │ if amount0_out > 0 {
│ ^^^^^^^^^^^^^^^ bool: Value
-254 │ token0.transfer(to, amount0_out) // optimistically transfer tokens
+263 │ token0.transfer(to, amount0_out) // optimistically transfer tokens
│ ^^^^^^ ^^ ^^^^^^^^^^^ u256: Value
│ │ │
│ │ address: Value
│ ERC20: Value
note:
- ┌─ uniswap.fe:254:13
+ ┌─ uniswap.fe:263:13
│
-254 │ token0.transfer(to, amount0_out) // optimistically transfer tokens
+263 │ token0.transfer(to, amount0_out) // optimistically transfer tokens
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bool: Value
-255 │ }
-256 │ if amount1_out > 0 {
+264 │ }
+265 │ if amount1_out > 0 {
│ ^^^^^^^^^^^ ^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:256:12
+ ┌─ uniswap.fe:265:12
│
-256 │ if amount1_out > 0 {
+265 │ if amount1_out > 0 {
│ ^^^^^^^^^^^^^^^ bool: Value
-257 │ token1.transfer(to, amount1_out) // optimistically transfer tokens
+266 │ token1.transfer(to, amount1_out) // optimistically transfer tokens
│ ^^^^^^ ^^ ^^^^^^^^^^^ u256: Value
│ │ │
│ │ address: Value
│ ERC20: Value
note:
- ┌─ uniswap.fe:257:13
+ ┌─ uniswap.fe:266:13
│
-257 │ token1.transfer(to, amount1_out) // optimistically transfer tokens
+266 │ token1.transfer(to, amount1_out) // optimistically transfer tokens
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bool: Value
·
-263 │ let balance0: u256 = token0.balanceOf(ctx.self_address())
+272 │ let balance0: u256 = token0.balanceOf(ctx.self_address())
│ ^^^^^^ ^^^ Context: Memory
│ │
│ ERC20: Value
note:
- ┌─ uniswap.fe:263:47
+ ┌─ uniswap.fe:272:47
│
-263 │ let balance0: u256 = token0.balanceOf(ctx.self_address())
+272 │ let balance0: u256 = token0.balanceOf(ctx.self_address())
│ ^^^^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ uniswap.fe:263:30
+ ┌─ uniswap.fe:272:30
│
-263 │ let balance0: u256 = token0.balanceOf(ctx.self_address())
+272 │ let balance0: u256 = token0.balanceOf(ctx.self_address())
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-264 │ let balance1: u256 = token1.balanceOf(ctx.self_address())
+273 │ let balance1: u256 = token1.balanceOf(ctx.self_address())
│ ^^^^^^ ^^^ Context: Memory
│ │
│ ERC20: Value
note:
- ┌─ uniswap.fe:264:47
+ ┌─ uniswap.fe:273:47
│
-264 │ let balance1: u256 = token1.balanceOf(ctx.self_address())
+273 │ let balance1: u256 = token1.balanceOf(ctx.self_address())
│ ^^^^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ uniswap.fe:264:30
+ ┌─ uniswap.fe:273:30
│
-264 │ let balance1: u256 = token1.balanceOf(ctx.self_address())
+273 │ let balance1: u256 = token1.balanceOf(ctx.self_address())
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-265 │
-266 │ let amount0_in: u256 = balance0 - (reserve0 - amount0_out) if balance0 > reserve0 - amount0_out else 0
+274 │
+275 │ let amount0_in: u256 = balance0 - (reserve0 - amount0_out) if balance0 > reserve0 - amount0_out else 0
│ ^^^^^^^^ ^^^^^^^^ ^^^^^^^^^^^ u256: Value
│ │ │
│ │ u256: Value
│ u256: Value
note:
- ┌─ uniswap.fe:266:82
+ ┌─ uniswap.fe:275:82
│
-266 │ let amount0_in: u256 = balance0 - (reserve0 - amount0_out) if balance0 > reserve0 - amount0_out else 0
+275 │ let amount0_in: u256 = balance0 - (reserve0 - amount0_out) if balance0 > reserve0 - amount0_out else 0
│ ^^^^^^^^^^^^^^^^^^^^^^ u256: Value
note:
- ┌─ uniswap.fe:266:32
+ ┌─ uniswap.fe:275:32
│
-266 │ let amount0_in: u256 = balance0 - (reserve0 - amount0_out) if balance0 > reserve0 - amount0_out else 0
+275 │ let amount0_in: u256 = balance0 - (reserve0 - amount0_out) if balance0 > reserve0 - amount0_out else 0
│ ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bool: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:266:44
+ ┌─ uniswap.fe:275:44
│
-266 │ let amount0_in: u256 = balance0 - (reserve0 - amount0_out) if balance0 > reserve0 - amount0_out else 0
+275 │ let amount0_in: u256 = balance0 - (reserve0 - amount0_out) if balance0 > reserve0 - amount0_out else 0
│ ^^^^^^^^ ^^^^^^^^^^^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:266:43
+ ┌─ uniswap.fe:275:43
│
-266 │ let amount0_in: u256 = balance0 - (reserve0 - amount0_out) if balance0 > reserve0 - amount0_out else 0
+275 │ let amount0_in: u256 = balance0 - (reserve0 - amount0_out) if balance0 > reserve0 - amount0_out else 0
│ ^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
note:
- ┌─ uniswap.fe:266:32
+ ┌─ uniswap.fe:275:32
│
-266 │ let amount0_in: u256 = balance0 - (reserve0 - amount0_out) if balance0 > reserve0 - amount0_out else 0
+275 │ let amount0_in: u256 = balance0 - (reserve0 - amount0_out) if balance0 > reserve0 - amount0_out else 0
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:266:32
+ ┌─ uniswap.fe:275:32
│
-266 │ let amount0_in: u256 = balance0 - (reserve0 - amount0_out) if balance0 > reserve0 - amount0_out else 0
+275 │ let amount0_in: u256 = balance0 - (reserve0 - amount0_out) if balance0 > reserve0 - amount0_out else 0
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-267 │ let amount1_in: u256 = balance1 - (reserve1 - amount1_out) if balance1 > reserve1 - amount1_out else 0
+276 │ let amount1_in: u256 = balance1 - (reserve1 - amount1_out) if balance1 > reserve1 - amount1_out else 0
│ ^^^^^^^^ ^^^^^^^^ ^^^^^^^^^^^ u256: Value
│ │ │
│ │ u256: Value
│ u256: Value
note:
- ┌─ uniswap.fe:267:82
+ ┌─ uniswap.fe:276:82
│
-267 │ let amount1_in: u256 = balance1 - (reserve1 - amount1_out) if balance1 > reserve1 - amount1_out else 0
+276 │ let amount1_in: u256 = balance1 - (reserve1 - amount1_out) if balance1 > reserve1 - amount1_out else 0
│ ^^^^^^^^^^^^^^^^^^^^^^ u256: Value
note:
- ┌─ uniswap.fe:267:32
+ ┌─ uniswap.fe:276:32
│
-267 │ let amount1_in: u256 = balance1 - (reserve1 - amount1_out) if balance1 > reserve1 - amount1_out else 0
+276 │ let amount1_in: u256 = balance1 - (reserve1 - amount1_out) if balance1 > reserve1 - amount1_out else 0
│ ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bool: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:267:44
+ ┌─ uniswap.fe:276:44
│
-267 │ let amount1_in: u256 = balance1 - (reserve1 - amount1_out) if balance1 > reserve1 - amount1_out else 0
+276 │ let amount1_in: u256 = balance1 - (reserve1 - amount1_out) if balance1 > reserve1 - amount1_out else 0
│ ^^^^^^^^ ^^^^^^^^^^^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:267:43
+ ┌─ uniswap.fe:276:43
│
-267 │ let amount1_in: u256 = balance1 - (reserve1 - amount1_out) if balance1 > reserve1 - amount1_out else 0
+276 │ let amount1_in: u256 = balance1 - (reserve1 - amount1_out) if balance1 > reserve1 - amount1_out else 0
│ ^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
note:
- ┌─ uniswap.fe:267:32
+ ┌─ uniswap.fe:276:32
│
-267 │ let amount1_in: u256 = balance1 - (reserve1 - amount1_out) if balance1 > reserve1 - amount1_out else 0
+276 │ let amount1_in: u256 = balance1 - (reserve1 - amount1_out) if balance1 > reserve1 - amount1_out else 0
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:267:32
+ ┌─ uniswap.fe:276:32
│
-267 │ let amount1_in: u256 = balance1 - (reserve1 - amount1_out) if balance1 > reserve1 - amount1_out else 0
+276 │ let amount1_in: u256 = balance1 - (reserve1 - amount1_out) if balance1 > reserve1 - amount1_out else 0
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-268 │
-269 │ assert amount0_in > 0 or amount1_in > 0, "UniswapV2: INSUFFICIENT_INPUT_AMOUNT"
+277 │
+278 │ assert amount0_in > 0 or amount1_in > 0, "UniswapV2: INSUFFICIENT_INPUT_AMOUNT"
│ ^^^^^^^^^^ ^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:269:16
+ ┌─ uniswap.fe:278:16
│
-269 │ assert amount0_in > 0 or amount1_in > 0, "UniswapV2: INSUFFICIENT_INPUT_AMOUNT"
+278 │ assert amount0_in > 0 or amount1_in > 0, "UniswapV2: INSUFFICIENT_INPUT_AMOUNT"
│ ^^^^^^^^^^^^^^ ^^^^^^^^^^ ^ u256: Value
│ │ │
│ │ u256: Value
│ bool: Value
note:
- ┌─ uniswap.fe:269:34
+ ┌─ uniswap.fe:278:34
│
-269 │ assert amount0_in > 0 or amount1_in > 0, "UniswapV2: INSUFFICIENT_INPUT_AMOUNT"
+278 │ assert amount0_in > 0 or amount1_in > 0, "UniswapV2: INSUFFICIENT_INPUT_AMOUNT"
│ ^^^^^^^^^^^^^^ bool: Value
note:
- ┌─ uniswap.fe:269:16
+ ┌─ uniswap.fe:278:16
│
-269 │ assert amount0_in > 0 or amount1_in > 0, "UniswapV2: INSUFFICIENT_INPUT_AMOUNT"
+278 │ assert amount0_in > 0 or amount1_in > 0, "UniswapV2: INSUFFICIENT_INPUT_AMOUNT"
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ String<36>: Memory
│ │
│ bool: Value
-270 │
-271 │ let balance0_adjusted: u256 = balance0 * 1000 - amount0_in * 3
+279 │
+280 │ let balance0_adjusted: u256 = balance0 * 1000 - amount0_in * 3
│ ^^^^^^^^ ^^^^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:271:39
+ ┌─ uniswap.fe:280:39
│
-271 │ let balance0_adjusted: u256 = balance0 * 1000 - amount0_in * 3
+280 │ let balance0_adjusted: u256 = balance0 * 1000 - amount0_in * 3
│ ^^^^^^^^^^^^^^^ ^^^^^^^^^^ ^ u256: Value
│ │ │
│ │ u256: Value
│ u256: Value
note:
- ┌─ uniswap.fe:271:57
+ ┌─ uniswap.fe:280:57
│
-271 │ let balance0_adjusted: u256 = balance0 * 1000 - amount0_in * 3
+280 │ let balance0_adjusted: u256 = balance0 * 1000 - amount0_in * 3
│ ^^^^^^^^^^^^^^ u256: Value
note:
- ┌─ uniswap.fe:271:39
+ ┌─ uniswap.fe:280:39
│
-271 │ let balance0_adjusted: u256 = balance0 * 1000 - amount0_in * 3
+280 │ let balance0_adjusted: u256 = balance0 * 1000 - amount0_in * 3
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-272 │ let balance1_adjusted: u256 = balance1 * 1000 - amount1_in * 3
+281 │ let balance1_adjusted: u256 = balance1 * 1000 - amount1_in * 3
│ ^^^^^^^^ ^^^^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:272:39
+ ┌─ uniswap.fe:281:39
│
-272 │ let balance1_adjusted: u256 = balance1 * 1000 - amount1_in * 3
+281 │ let balance1_adjusted: u256 = balance1 * 1000 - amount1_in * 3
│ ^^^^^^^^^^^^^^^ ^^^^^^^^^^ ^ u256: Value
│ │ │
│ │ u256: Value
│ u256: Value
note:
- ┌─ uniswap.fe:272:57
+ ┌─ uniswap.fe:281:57
│
-272 │ let balance1_adjusted: u256 = balance1 * 1000 - amount1_in * 3
+281 │ let balance1_adjusted: u256 = balance1 * 1000 - amount1_in * 3
│ ^^^^^^^^^^^^^^ u256: Value
note:
- ┌─ uniswap.fe:272:39
+ ┌─ uniswap.fe:281:39
│
-272 │ let balance1_adjusted: u256 = balance1 * 1000 - amount1_in * 3
+281 │ let balance1_adjusted: u256 = balance1 * 1000 - amount1_in * 3
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-273 │
-274 │ assert balance0_adjusted * balance1_adjusted >= reserve0 * reserve1 * 1000000, "UniswapV2: K"
+282 │
+283 │ assert balance0_adjusted * balance1_adjusted >= reserve0 * reserve1 * 1000000, "UniswapV2: K"
│ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:274:16
+ ┌─ uniswap.fe:283:16
│
-274 │ assert balance0_adjusted * balance1_adjusted >= reserve0 * reserve1 * 1000000, "UniswapV2: K"
+283 │ assert balance0_adjusted * balance1_adjusted >= reserve0 * reserve1 * 1000000, "UniswapV2: K"
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^^^^^^^^ u256: Value
│ │ │
│ │ u256: Value
│ u256: Value
note:
- ┌─ uniswap.fe:274:57
+ ┌─ uniswap.fe:283:57
│
-274 │ assert balance0_adjusted * balance1_adjusted >= reserve0 * reserve1 * 1000000, "UniswapV2: K"
+283 │ assert balance0_adjusted * balance1_adjusted >= reserve0 * reserve1 * 1000000, "UniswapV2: K"
│ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^ u256: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:274:57
+ ┌─ uniswap.fe:283:57
│
-274 │ assert balance0_adjusted * balance1_adjusted >= reserve0 * reserve1 * 1000000, "UniswapV2: K"
+283 │ assert balance0_adjusted * balance1_adjusted >= reserve0 * reserve1 * 1000000, "UniswapV2: K"
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
note:
- ┌─ uniswap.fe:274:16
+ ┌─ uniswap.fe:283:16
│
-274 │ assert balance0_adjusted * balance1_adjusted >= reserve0 * reserve1 * 1000000, "UniswapV2: K"
+283 │ assert balance0_adjusted * balance1_adjusted >= reserve0 * reserve1 * 1000000, "UniswapV2: K"
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ String<12>: Memory
│ │
│ bool: Value
-275 │
-276 │ self._update(ctx, balance0, balance1, reserve0, reserve1)
+284 │
+285 │ self._update(ctx, balance0, balance1, reserve0, reserve1)
│ ^^^^ ^^^ ^^^^^^^^ ^^^^^^^^ ^^^^^^^^ ^^^^^^^^ u256: Value
│ │ │ │ │ │
│ │ │ │ │ u256: Value
@@ -2461,66 +2549,78 @@ note:
│ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:276:9
+ ┌─ uniswap.fe:285:9
│
-276 │ self._update(ctx, balance0, balance1, reserve0, reserve1)
+285 │ self._update(ctx, balance0, balance1, reserve0, reserve1)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
-277 │ emit Swap(ctx, sender: ctx.msg_sender(), amount0_in, amount1_in, amount0_out, amount1_out, to)
- │ ^^^ ^^^ Context: Memory
- │ │
- │ Context: Memory
+286 │ ctx.emit(Swap(sender: ctx.msg_sender(), amount0_in, amount1_in, amount0_out, amount1_out, to))
+ │ ^^^ ^^^ Context: Memory
+ │ │
+ │ Context: Memory
+
+note:
+ ┌─ uniswap.fe:286:31
+ │
+286 │ ctx.emit(Swap(sender: ctx.msg_sender(), amount0_in, amount1_in, amount0_out, amount1_out, to))
+ │ ^^^^^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^ address: Value
+ │ │ │ │ │ │
+ │ │ │ │ │ u256: Value
+ │ │ │ │ u256: Value
+ │ │ │ u256: Value
+ │ │ u256: Value
+ │ address: Value
note:
- ┌─ uniswap.fe:277:32
+ ┌─ uniswap.fe:286:18
│
-277 │ emit Swap(ctx, sender: ctx.msg_sender(), amount0_in, amount1_in, amount0_out, amount1_out, to)
- │ ^^^^^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^ address: Value
- │ │ │ │ │ │
- │ │ │ │ │ u256: Value
- │ │ │ │ u256: Value
- │ │ │ u256: Value
- │ │ u256: Value
- │ address: Value
+286 │ ctx.emit(Swap(sender: ctx.msg_sender(), amount0_in, amount1_in, amount0_out, amount1_out, to))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Swap: Memory
note:
- ┌─ uniswap.fe:281:5
+ ┌─ uniswap.fe:286:9
+ │
+286 │ ctx.emit(Swap(sender: ctx.msg_sender(), amount0_in, amount1_in, amount0_out, amount1_out, to))
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (): Value
+
+note:
+ ┌─ uniswap.fe:290:5
│
-281 │ ╭ pub fn skim(self, ctx: Context, to: address) {
-282 │ │ let token0: ERC20 = self.token0 // gas savings
-283 │ │ let token1: ERC20 = self.token1 // gas savings
-284 │ │ token0.transfer(to, token0.balanceOf(ctx.self_address()) - self.reserve0)
-285 │ │ token1.transfer(to, token1.balanceOf(ctx.self_address()) - self.reserve1)
-286 │ │ }
+290 │ ╭ pub fn skim(self, ctx: Context, to: address) {
+291 │ │ let token0: ERC20 = self.token0 // gas savings
+292 │ │ let token1: ERC20 = self.token1 // gas savings
+293 │ │ token0.transfer(to, token0.balanceOf(ctx.self_address()) - self.reserve0)
+294 │ │ token1.transfer(to, token1.balanceOf(ctx.self_address()) - self.reserve1)
+295 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }, { label: None, name: to, typ: address }] -> ()
note:
- ┌─ uniswap.fe:282:13
+ ┌─ uniswap.fe:291:13
│
-282 │ let token0: ERC20 = self.token0 // gas savings
+291 │ let token0: ERC20 = self.token0 // gas savings
│ ^^^^^^ ERC20
-283 │ let token1: ERC20 = self.token1 // gas savings
+292 │ let token1: ERC20 = self.token1 // gas savings
│ ^^^^^^ ERC20
note:
- ┌─ uniswap.fe:282:29
+ ┌─ uniswap.fe:291:29
│
-282 │ let token0: ERC20 = self.token0 // gas savings
+291 │ let token0: ERC20 = self.token0 // gas savings
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:282:29
+ ┌─ uniswap.fe:291:29
│
-282 │ let token0: ERC20 = self.token0 // gas savings
+291 │ let token0: ERC20 = self.token0 // gas savings
│ ^^^^^^^^^^^ ERC20: Storage { nonce: Some(5) } => Value
-283 │ let token1: ERC20 = self.token1 // gas savings
+292 │ let token1: ERC20 = self.token1 // gas savings
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:283:29
+ ┌─ uniswap.fe:292:29
│
-283 │ let token1: ERC20 = self.token1 // gas savings
+292 │ let token1: ERC20 = self.token1 // gas savings
│ ^^^^^^^^^^^ ERC20: Storage { nonce: Some(6) } => Value
-284 │ token0.transfer(to, token0.balanceOf(ctx.self_address()) - self.reserve0)
+293 │ token0.transfer(to, token0.balanceOf(ctx.self_address()) - self.reserve0)
│ ^^^^^^ ^^ ^^^^^^ ^^^ Context: Memory
│ │ │ │
│ │ │ ERC20: Value
@@ -2528,37 +2628,37 @@ note:
│ ERC20: Value
note:
- ┌─ uniswap.fe:284:46
+ ┌─ uniswap.fe:293:46
│
-284 │ token0.transfer(to, token0.balanceOf(ctx.self_address()) - self.reserve0)
+293 │ token0.transfer(to, token0.balanceOf(ctx.self_address()) - self.reserve0)
│ ^^^^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ uniswap.fe:284:29
+ ┌─ uniswap.fe:293:29
│
-284 │ token0.transfer(to, token0.balanceOf(ctx.self_address()) - self.reserve0)
+293 │ token0.transfer(to, token0.balanceOf(ctx.self_address()) - self.reserve0)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ UniswapV2Pair: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:284:68
+ ┌─ uniswap.fe:293:68
│
-284 │ token0.transfer(to, token0.balanceOf(ctx.self_address()) - self.reserve0)
+293 │ token0.transfer(to, token0.balanceOf(ctx.self_address()) - self.reserve0)
│ ^^^^^^^^^^^^^ u256: Storage { nonce: Some(7) } => Value
note:
- ┌─ uniswap.fe:284:29
+ ┌─ uniswap.fe:293:29
│
-284 │ token0.transfer(to, token0.balanceOf(ctx.self_address()) - self.reserve0)
+293 │ token0.transfer(to, token0.balanceOf(ctx.self_address()) - self.reserve0)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
note:
- ┌─ uniswap.fe:284:9
+ ┌─ uniswap.fe:293:9
│
-284 │ token0.transfer(to, token0.balanceOf(ctx.self_address()) - self.reserve0)
+293 │ token0.transfer(to, token0.balanceOf(ctx.self_address()) - self.reserve0)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bool: Value
-285 │ token1.transfer(to, token1.balanceOf(ctx.self_address()) - self.reserve1)
+294 │ token1.transfer(to, token1.balanceOf(ctx.self_address()) - self.reserve1)
│ ^^^^^^ ^^ ^^^^^^ ^^^ Context: Memory
│ │ │ │
│ │ │ ERC20: Value
@@ -2566,805 +2666,818 @@ note:
│ ERC20: Value
note:
- ┌─ uniswap.fe:285:46
+ ┌─ uniswap.fe:294:46
│
-285 │ token1.transfer(to, token1.balanceOf(ctx.self_address()) - self.reserve1)
+294 │ token1.transfer(to, token1.balanceOf(ctx.self_address()) - self.reserve1)
│ ^^^^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ uniswap.fe:285:29
+ ┌─ uniswap.fe:294:29
│
-285 │ token1.transfer(to, token1.balanceOf(ctx.self_address()) - self.reserve1)
+294 │ token1.transfer(to, token1.balanceOf(ctx.self_address()) - self.reserve1)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ UniswapV2Pair: Value
│ │
│ u256: Value
note:
- ┌─ uniswap.fe:285:68
+ ┌─ uniswap.fe:294:68
│
-285 │ token1.transfer(to, token1.balanceOf(ctx.self_address()) - self.reserve1)
+294 │ token1.transfer(to, token1.balanceOf(ctx.self_address()) - self.reserve1)
│ ^^^^^^^^^^^^^ u256: Storage { nonce: Some(8) } => Value
note:
- ┌─ uniswap.fe:285:29
+ ┌─ uniswap.fe:294:29
│
-285 │ token1.transfer(to, token1.balanceOf(ctx.self_address()) - self.reserve1)
+294 │ token1.transfer(to, token1.balanceOf(ctx.self_address()) - self.reserve1)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
note:
- ┌─ uniswap.fe:285:9
+ ┌─ uniswap.fe:294:9
│
-285 │ token1.transfer(to, token1.balanceOf(ctx.self_address()) - self.reserve1)
+294 │ token1.transfer(to, token1.balanceOf(ctx.self_address()) - self.reserve1)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bool: Value
note:
- ┌─ uniswap.fe:289:5
+ ┌─ uniswap.fe:298:5
│
-289 │ ╭ pub fn sync(self, ctx: Context) {
-290 │ │ let token0: ERC20 = self.token0
-291 │ │ let token1: ERC20 = self.token1
-292 │ │ self._update(ctx,
+298 │ ╭ pub fn sync(self, ctx: Context) {
+299 │ │ let token0: ERC20 = self.token0
+300 │ │ let token1: ERC20 = self.token1
+301 │ │ self._update(ctx,
· │
-296 │ │ reserve1: self.reserve1)
-297 │ │ }
+305 │ │ reserve1: self.reserve1)
+306 │ │ }
│ ╰─────^ self: Some(Mutable), params: [{ label: None, name: ctx, typ: Context }] -> ()
note:
- ┌─ uniswap.fe:290:13
+ ┌─ uniswap.fe:299:13
│
-290 │ let token0: ERC20 = self.token0
+299 │ let token0: ERC20 = self.token0
│ ^^^^^^ ERC20
-291 │ let token1: ERC20 = self.token1
+300 │ let token1: ERC20 = self.token1
│ ^^^^^^ ERC20
note:
- ┌─ uniswap.fe:290:29
+ ┌─ uniswap.fe:299:29
│
-290 │ let token0: ERC20 = self.token0
+299 │ let token0: ERC20 = self.token0
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:290:29
+ ┌─ uniswap.fe:299:29
│
-290 │ let token0: ERC20 = self.token0
+299 │ let token0: ERC20 = self.token0
│ ^^^^^^^^^^^ ERC20: Storage { nonce: Some(5) } => Value
-291 │ let token1: ERC20 = self.token1
+300 │ let token1: ERC20 = self.token1
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:291:29
+ ┌─ uniswap.fe:300:29
│
-291 │ let token1: ERC20 = self.token1
+300 │ let token1: ERC20 = self.token1
│ ^^^^^^^^^^^ ERC20: Storage { nonce: Some(6) } => Value
-292 │ self._update(ctx,
+301 │ self._update(ctx,
│ ^^^^ ^^^ Context: Memory
│ │
│ UniswapV2Pair: Value
-293 │ balance0: token0.balanceOf(ctx.self_address()),
+302 │ balance0: token0.balanceOf(ctx.self_address()),
│ ^^^^^^ ^^^ Context: Memory
│ │
│ ERC20: Value
note:
- ┌─ uniswap.fe:293:49
+ ┌─ uniswap.fe:302:49
│
-293 │ balance0: token0.balanceOf(ctx.self_address()),
+302 │ balance0: token0.balanceOf(ctx.self_address()),
│ ^^^^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ uniswap.fe:293:32
+ ┌─ uniswap.fe:302:32
│
-293 │ balance0: token0.balanceOf(ctx.self_address()),
+302 │ balance0: token0.balanceOf(ctx.self_address()),
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-294 │ balance1: token1.balanceOf(ctx.self_address()),
+303 │ balance1: token1.balanceOf(ctx.self_address()),
│ ^^^^^^ ^^^ Context: Memory
│ │
│ ERC20: Value
note:
- ┌─ uniswap.fe:294:49
+ ┌─ uniswap.fe:303:49
│
-294 │ balance1: token1.balanceOf(ctx.self_address()),
+303 │ balance1: token1.balanceOf(ctx.self_address()),
│ ^^^^^^^^^^^^^^^^^^ address: Value
note:
- ┌─ uniswap.fe:294:32
+ ┌─ uniswap.fe:303:32
│
-294 │ balance1: token1.balanceOf(ctx.self_address()),
+303 │ balance1: token1.balanceOf(ctx.self_address()),
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u256: Value
-295 │ reserve0: self.reserve0,
+304 │ reserve0: self.reserve0,
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:295:32
+ ┌─ uniswap.fe:304:32
│
-295 │ reserve0: self.reserve0,
+304 │ reserve0: self.reserve0,
│ ^^^^^^^^^^^^^ u256: Storage { nonce: Some(7) } => Value
-296 │ reserve1: self.reserve1)
+305 │ reserve1: self.reserve1)
│ ^^^^ UniswapV2Pair: Value
note:
- ┌─ uniswap.fe:296:32
+ ┌─ uniswap.fe:305:32
│
-296 │ reserve1: self.reserve1)
+305 │ reserve1: self.reserve1)
│ ^^^^^^^^^^^^^ u256: Storage { nonce: Some(8) } => Value
note:
- ┌─ uniswap.fe:292:9
+ ┌─ uniswap.fe:301:9
│
-292 │ ╭ self._update(ctx,
-293 │ │ balance0: token0.balanceOf(ctx.self_address()),
-294 │ │ balance1: token1.balanceOf(ctx.self_address()),
-295 │ │ reserve0: self.reserve0,
-296 │ │ reserve1: self.reserve1)
+301 │ ╭ self._update(ctx,
+302 │ │ balance0: token0.balanceOf(ctx.self_address()),
+303 │ │ balance1: token1.balanceOf(ctx.self_address()),
+304 │ │ reserve0: self.reserve0,
+305 │ │ reserve1: self.reserve1)
│ ╰─────────────────────────────────────────────^ (): Value
note:
- ┌─ uniswap.fe:301:5
+ ┌─ uniswap.fe:311:5
│
-301 │ fee_to: address
+311 │ pub token0: address
+ │ ^^^^^^^^^^^^^^^^^^^ address
+312 │ #indexed
+313 │ pub token1: address
+ │ ^^^^^^^^^^^^^^^^^^^ address
+314 │ pub pair: address
+ │ ^^^^^^^^^^^^^^^^^ address
+315 │ pub index: u256
+ │ ^^^^^^^^^^^^^^^ u256
+
+note:
+ ┌─ uniswap.fe:319:5
+ │
+319 │ fee_to: address
│ ^^^^^^^^^^^^^^^ address
-302 │ fee_to_setter: address
+320 │ fee_to_setter: address
│ ^^^^^^^^^^^^^^^^^^^^^^ address
-303 │
-304 │ pairs: Map>
+321 │
+322 │ pairs: Map>
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Map>
-305 │
-306 │ all_pairs: Array
+323 │
+324 │ all_pairs: Array