-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bump ethers from 5.6.7 to 5.6.8 (#147) Bumps [ethers](https://github.com/ethers-io/ethers.js/tree/HEAD/packages/ethers) from 5.6.7 to 5.6.8. - [Release notes](https://github.com/ethers-io/ethers.js/releases) - [Changelog](https://github.com/ethers-io/ethers.js/blob/master/CHANGELOG.md) - [Commits](https://github.com/ethers-io/ethers.js/commits/v5.6.8/packages/ethers) --- updated-dependencies: - dependency-name: ethers dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump typescript from 4.6.4 to 4.7.2 (#146) Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.6.4 to 4.7.2. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](microsoft/TypeScript@v4.6.4...v4.7.2) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add starknet auth (#138) * Update to 0.8.1 and devnet 0.2.1; Format * Add execute lib; Switch to authenticate method * Add felt_to_uint256; Add starknet_tx auth * Use felt instead of u256 * Add test for starknet tx auth * Add starknet_tx_auth and starknet_account_auth; blocked by compilation on starknet_account_auth * Remove starknet_account test; Rename starknet_account to starknet_sig * Add comment about hash * Update to 0.8.2 * Add voting_strategy_params_all to setup functions * Bump npm from 8.10.0 to 8.11.0 (#149) Bumps [npm](https://github.com/npm/cli) from 8.10.0 to 8.11.0. - [Release notes](https://github.com/npm/cli/releases) - [Changelog](https://github.com/npm/cli/blob/latest/CHANGELOG.md) - [Commits](npm/cli@v8.10.0...v8.11.0) --- updated-dependencies: - dependency-name: npm dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * renaming tests * renamed cairo contracts * fixed starknet tx auth test * formatting * updated starknet hardhat * fixed account import Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pscott <30843220+pscott@users.noreply.github.com>
- Loading branch information
1 parent
06de52c
commit d856f47
Showing
28 changed files
with
688 additions
and
467 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,36 @@ | ||
%lang starknet | ||
|
||
from contracts.starknet.lib.execute import execute | ||
from contracts.starknet.lib.felt_to_uint256 import felt_to_uint256 | ||
from starkware.starknet.common.syscalls import get_caller_address | ||
from starkware.cairo.common.cairo_builtins import BitwiseBuiltin | ||
from starkware.cairo.common.math import assert_not_zero | ||
from starkware.cairo.common.uint256 import uint256_eq | ||
# from openzeppelin.account.IAccount import IAccount | ||
|
||
# TODO: change `hash` to actual data, not simply the hash | ||
@external | ||
func authenticate{syscall_ptr : felt*, range_check_ptr, bitwise_ptr : BitwiseBuiltin*}( | ||
hash : felt, | ||
sig_len : felt, | ||
sig : felt*, | ||
target : felt, | ||
function_selector : felt, | ||
calldata_len : felt, | ||
calldata : felt*, | ||
) -> (): | ||
# Voter address or proposer address should be located in calldata[0] | ||
let user_address = calldata[0] | ||
|
||
# Will throw if signature is invalid | ||
# with_attr error_message("Invalid signature"): | ||
# IAccount.is_valid_signature( | ||
# contract_address=user_address, hash=hash, signature_len=sig_len, signature=sig | ||
# ) | ||
# end | ||
# Call the contract | ||
execute(target, function_selector, calldata_len, calldata) | ||
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,22 @@ | ||
%lang starknet | ||
from contracts.starknet.lib.execute import execute | ||
from contracts.starknet.lib.felt_to_uint256 import felt_to_uint256 | ||
from starkware.starknet.common.syscalls import get_caller_address | ||
from starkware.cairo.common.cairo_builtins import BitwiseBuiltin | ||
from starkware.cairo.common.uint256 import uint256_eq | ||
|
||
@external | ||
func authenticate{syscall_ptr : felt*, range_check_ptr, bitwise_ptr : BitwiseBuiltin*}( | ||
target : felt, function_selector : felt, calldata_len : felt, calldata : felt* | ||
) -> (): | ||
let (caller_address) = get_caller_address() | ||
|
||
with_attr error_message("Incorrect caller"): | ||
assert caller_address = calldata[0] | ||
end | ||
# Call the contract | ||
execute(target, function_selector, calldata_len, calldata) | ||
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 |
---|---|---|
@@ -1,20 +1,15 @@ | ||
%lang starknet | ||
from starkware.starknet.common.syscalls import call_contract | ||
from contracts.starknet.lib.execute import execute | ||
|
||
# Forwards `data` to `target` without verifying anything. | ||
@external | ||
func execute{syscall_ptr : felt*, range_check_ptr}( | ||
func authenticate{syscall_ptr : felt*, range_check_ptr}( | ||
target : felt, function_selector : felt, calldata_len : felt, calldata : felt* | ||
) -> (): | ||
# TODO: Actually verify the signature | ||
|
||
# Call the contract | ||
call_contract( | ||
contract_address=target, | ||
function_selector=function_selector, | ||
calldata_size=calldata_len, | ||
calldata=calldata, | ||
) | ||
execute(target, function_selector, calldata_len, calldata) | ||
|
||
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
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,17 @@ | ||
%lang starknet | ||
from starkware.starknet.common.syscalls import call_contract | ||
|
||
# Forwards `data` to `target` without verifying anything. | ||
@external | ||
func execute{syscall_ptr : felt*, range_check_ptr}( | ||
target : felt, function_selector : felt, calldata_len : felt, calldata : felt* | ||
) -> (): | ||
call_contract( | ||
contract_address=target, | ||
function_selector=function_selector, | ||
calldata_size=calldata_len, | ||
calldata=calldata, | ||
) | ||
|
||
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
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
https://github.com/starkware-libs/cairo-lang/releases/download/v0.8.0/cairo-lang-0.8.0.zip | ||
https://github.com/starkware-libs/cairo-lang/releases/download/v0.8.2/cairo-lang-0.8.2.zip | ||
openzeppelin-cairo-contracts |
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
File renamed without changes.
File renamed without changes.
Oops, something went wrong.