-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove explicitly imported function from implicit imports. (#75)
* Remove explicitly imported function from implicit imports. * Fix test folder name. * Remove more false positives on implicit-import
- Loading branch information
Showing
9 changed files
with
93 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[must-check-caller-address] in utils.cairo:10:10 | ||
[must-check-caller-address] in utils.cairo:23:10 | ||
[unused-imports] in proxy.cairo:3:19 | ||
[unused-imports] in proxy.cairo:3:38 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[implicit-import] [This](0) function will be imported by [here](1), even though it was not explicitly imported. in utils.cairo:19:1 and proxy.cairo:3:19 | ||
[must-check-caller-address] in utils.cairo:10:10 | ||
[must-check-caller-address] in utils.cairo:23:10 | ||
[unused-imports] in proxy.cairo:3:19 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
%lang starknet | ||
|
||
from utils import auth_read_storage, auth_write_storage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
%lang starknet | ||
|
||
from starkware.starknet.common.syscalls import storage_read, storage_write, get_caller_address | ||
|
||
# Helpers for auth users to interact with contract's storage | ||
@view | ||
func auth_read_storage{ | ||
syscall_ptr : felt*, | ||
}(auth_account : felt, address : felt) -> (value : felt): | ||
let (caller) = get_caller_address() | ||
|
||
assert caller = auth_account | ||
|
||
let (value) = storage_read(address=address) | ||
|
||
return (value=value) | ||
end | ||
|
||
@external | ||
func auth_write_storage{ | ||
syscall_ptr : felt*, | ||
}(auth_account : felt, address : felt, value : felt): | ||
let (caller) = get_caller_address() | ||
|
||
assert caller = auth_account | ||
|
||
storage_write(address=address, value=value) | ||
return() | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
%lang starknet | ||
|
||
from utils import auth_read_storage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
%lang starknet | ||
|
||
from starkware.starknet.common.syscalls import storage_read, storage_write, get_caller_address | ||
|
||
# Helpers for auth users to interact with contract's storage | ||
@view | ||
func auth_read_storage{ | ||
syscall_ptr : felt*, | ||
}(auth_account : felt, address : felt) -> (value : felt): | ||
let (caller) = get_caller_address() | ||
|
||
assert caller = auth_account | ||
|
||
let (value) = storage_read(address=address) | ||
|
||
return (value=value) | ||
end | ||
|
||
@external | ||
func auth_write_storage{ | ||
syscall_ptr : felt*, | ||
}(auth_account : felt, address : felt, value : felt): | ||
let (caller) = get_caller_address() | ||
|
||
assert caller = auth_account | ||
|
||
storage_write(address=address, value=value) | ||
return() | ||
end |