Skip to content

Commit

Permalink
feat(solis): verify ownership in the sequencer (#304)
Browse files Browse the repository at this point in the history
## Description
In the Solis sequencer, we've implemented a preliminary check of asset
ownership and balance before pooling. This crucial step ensures that
only assets genuinely owned by the user and with a sufficient balance
are eligible for processing by the sequencer, thereby enhancing the
security and integrity of transactions within Solis.
<!--
Please do not leave this blank.
Describe the changes in this PR. What does it [add/remove/fix/replace]?

For crafting a good description, consider using ChatGPT to help
articulate your changes.
-->

## What type of PR is this? (check all applicable)

- [x] 🍕 Feature (`feat:`)
- [ ] 🐛 Bug Fix (`fix:`)
- [ ] 📝 Documentation Update (`docs:`)
- [ ] 🎨 Style (`style:`)
- [ ] 🧑‍💻 Code Refactor (`refactor:`)
- [ ] 🔥 Performance Improvements (`perf:`)
- [ ] ✅ Test (`test:`)
- [ ] 🤖 Build (`build:`)
- [ ] 🔁 CI (`ci:`)
- [ ] 📦 Chore (`chore:`)
- [ ] ⏩ Revert (`revert:`)
- [ ] 🚀 Breaking Changes (`BREAKING CHANGE:`)

## Related Tickets & Documents

<!--
Please use this format to link related issues: Fixes #<issue_number>
More info:
https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->

## Added tests?

- [x] 👍 yes
- [ ] 🙅 no, because they aren't needed
- [ ] 🙋 no, because I need help

## Added to documentation?

- [ ] 📜 README.md
- [ ] 📓 Documentation
- [ ] 🙅 no documentation needed

## [optional] Are there any post-deployment tasks we need to perform?

<!-- Describe any additional tasks, if any, and provide steps. -->

## [optional] What gif best describes this PR or how it makes you feel?

<!-- Share a fun gif related to your PR! -->

### PR Title and Description Guidelines:

- Ensure your PR title follows semantic versioning standards. This helps
automate releases and changelogs.
- Use types like `feat:`, `fix:`, `chore:`, `BREAKING CHANGE:` etc. in
your PR title.
- Your PR title will be used as a commit message when merging. Make sure
it adheres to [Conventional Commits
standards](https://www.conventionalcommits.org/).

## Closing Issues

<!--
Use keywords to close related issues. This ensures that the associated
issues will automatically close when the PR is merged.

- `Fixes #123` will close issue 123 when the PR is merged.
- `Closes #123` will also close issue 123 when the PR is merged.
- `Resolves #123` will also close issue 123 when the PR is merged.

You can also use multiple keywords in one comment:
- `Fixes #123, Resolves #456`

More info:
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
-->
  • Loading branch information
ybensacq authored Mar 4, 2024
1 parent 6021bfb commit aad63d4
Show file tree
Hide file tree
Showing 21 changed files with 487 additions and 173 deletions.
5 changes: 5 additions & 0 deletions .changeset/khaki-shirts-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ark-project/core": minor
---

new function to whitelist the broker before listing
74 changes: 53 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 63 additions & 0 deletions artifacts/contract.abi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[
{
"type": "impl",
"name": "ITestImpl",
"interface_name": "package_name::ITest"
},
{
"type": "struct",
"name": "core::array::Span::<core::felt252>",
"members": [
{
"name": "snapshot",
"type": "@core::array::Array::<core::felt252>"
}
]
},
{
"type": "struct",
"name": "package_name::TxCall",
"members": [
{
"name": "to",
"type": "core::starknet::contract_address::ContractAddress"
},
{
"name": "selector",
"type": "core::felt252"
},
{
"name": "calldata",
"type": "core::array::Span::<core::felt252>"
}
]
},
{
"type": "interface",
"name": "package_name::ITest",
"items": [
{
"type": "function",
"name": "ev",
"inputs": [],
"outputs": [
{
"type": "package_name::TxCall"
}
],
"state_mutability": "view"
}
]
},
{
"type": "constructor",
"name": "constructor",
"inputs": []
},
{
"type": "event",
"name": "package_name::c1::Event",
"kind": "enum",
"variants": []
}
]
4 changes: 4 additions & 0 deletions artifacts/orderbook.abi.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,10 @@
{
"name": "admin",
"type": "core::starknet::contract_address::ContractAddress"
},
{
"name": "chain_id",
"type": "core::felt252"
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion contracts.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"goerli":{"nftContract":"0x22411b480425fe6e627fdf4d1b6ac7f8567314ada5617a0a6d8ef3e74b69436","messaging":"0x2c3d3e0c37d29364a13ba8cff046e7bc5624655a72526961876a1c8bb3f63c8","executor":"0x73148536f8ea9546e92761d11515548cc433df46883d5ee98871a6f63a0bbbc","orderbook":"0x66f1e6acf9bdbd23837b2eea271430298b355c506978edb132737e7fcb6b310"},"sepolia":{},"mainnet":{},"dev":{"messaging":"0x1fed294721e45a912cd64ec6aba8b9e902b6f54fd516547ca740805607d47cd","executor":"0x4a69823e775f40d8837c62cf9e239c3da4ab65888dd6d8f19e6f9b11771e460","nftContract":"0x664b395332553a06c12f6164f11544b92b1ec308fa6c360f01f9cde1cc32ac2","eth":"0x4007c4afac7b79c2119c1d417e3106294cb28d92bdfba26474e8e250b1e91c9","orderbook":"0x1b59160f5593a11ea887b063d541a42f758d82e0b7295763e3104e09057ab5"}}
{"goerli":{"nftContract":"0x22411b480425fe6e627fdf4d1b6ac7f8567314ada5617a0a6d8ef3e74b69436","messaging":"0x2c3d3e0c37d29364a13ba8cff046e7bc5624655a72526961876a1c8bb3f63c8","executor":"0x73148536f8ea9546e92761d11515548cc433df46883d5ee98871a6f63a0bbbc","orderbook":"0x66f1e6acf9bdbd23837b2eea271430298b355c506978edb132737e7fcb6b310"},"sepolia":{},"mainnet":{},"dev":{"messaging":"0x53a0b0ca4b9d248dff574299c98340b67197f7ffc79df9afef66d01e83022c6","executor":"0x32cee2469074dabb6ee8dcce24df08d79e9ffd5f978163fbdd0704bce269bab","nftContract":"0x305bf776b8976a9709dde4cf307aebed4060e201ab3fca7154ca6db386f13c","eth":"0x144a0c8ae6e665dc3652e164ba2881eda87ad9cb5dcc93d30ca6d61b818014c","orderbook":"0x33b337f2c708c08e49f5e0161658ed093101dd629c3147ad9eea921e6a6afe3"}}
4 changes: 4 additions & 0 deletions crates/diri/artifacts/orderbook.abi.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,10 @@
{
"name": "admin",
"type": "core::starknet::contract_address::ContractAddress"
},
{
"name": "chain_id",
"type": "core::felt252"
}
]
},
Expand Down
3 changes: 2 additions & 1 deletion crates/solis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ katana-rpc = { git = "https://github.com/ArkProjectNFTs/dojo", tag = "v0.2.0-sol
katana-rpc-api = { git = "https://github.com/ArkProjectNFTs/dojo", tag = "v0.2.0-solis" }
katana-primitives = { git = "https://github.com/ArkProjectNFTs/dojo", tag = "v0.2.0-solis" }

cainome = { git = "https://github.com/cartridge-gg/cainome", tag = "v0.1.5", features = [
cainome = { git = "https://github.com/cartridge-gg/cainome", tag = "v0.2.4-fix-ord", features = [
"abigen-rs",
] }

6 changes: 3 additions & 3 deletions crates/solis/messaging.local.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"chain": "starknet",
"rpc_url": "http://127.0.0.1:5050",
"contract_address": "0x1fed294721e45a912cd64ec6aba8b9e902b6f54fd516547ca740805607d47cd",
"sender_address": "0x2d71e9c974539bb3ffb4b115e66a23d0f62a641ea66c4016e903454c8753bbc",
"private_key": "0x33003003001800009900180300d206308b0070db00121318d17b5e6262150b",
"contract_address": "0x53a0b0ca4b9d248dff574299c98340b67197f7ffc79df9afef66d01e83022c6",
"sender_address": "0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03",
"private_key": "0x1800000000300000180000000000030000000000003006001800006600",
"interval": 2,
"from_block": 0
}
1 change: 0 additions & 1 deletion crates/solis/src/contracts/starknet_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use starknet::{
use url::Url;

abigen!(StarknetUtils, "./artifacts/starknet_utils.json");

pub fn new_starknet_utils_reader(
contract_address: FieldElement,
provider_url: &str,
Expand Down
Loading

0 comments on commit aad63d4

Please sign in to comment.