Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds the security contract #139

Merged
merged 112 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
0fcc512
Add template contract for initial skeleton of nav.
Taztingo Feb 5, 2024
9efee7b
Initial update of converting template to nav contract. Still need to …
Taztingo Feb 6, 2024
7a0734d
Add event for set tag.
Taztingo Feb 6, 2024
024af8b
Simplify storage::tag for now, and add comments.
Taztingo Feb 7, 2024
dea84b5
Add some basic logic for set_tag.
Taztingo Feb 7, 2024
ea36ce8
Provide a way to remove an asset's tag.
Taztingo Feb 7, 2024
1714a58
Add remove_asset_tag func.
Taztingo Feb 7, 2024
eb0ef20
Update execute funcs to not take funds.
Taztingo Feb 7, 2024
ad4e107
Add error for invalid asset. Add validation to check if asset exists …
Taztingo Feb 7, 2024
ae3e2dc
Remove reply entrypoint since it's not needed.
Taztingo Feb 7, 2024
d4e8f15
include change that was missed in previous commit.
Taztingo Feb 7, 2024
b3cbaf8
Add query_address. Remove validation since it's done by set.
Taztingo Feb 7, 2024
82b205c
Fix unused imports and args.
Taztingo Feb 7, 2024
119eeea
Rename project to nav-tag.
Taztingo Feb 7, 2024
ea88fdf
Replace deprecated functions to_binary and from_binary.
Taztingo Feb 7, 2024
244c218
Update optimizer.
Taztingo Feb 7, 2024
0390af8
Move old store known as tag.rs to asset.rs. Create new store known as…
Taztingo Feb 7, 2024
b3be920
Add query for getting all the accepted tag types.
Taztingo Feb 7, 2024
0a7eb7a
Add messages for adding and removing tag types. Still need to impleme…
Taztingo Feb 7, 2024
d470800
Add UpdateTagTypes event. Create actions for add and remove tag types…
Taztingo Feb 8, 2024
8cf09f1
Start remove logic, but need a way to quickly check if an asset uses …
Taztingo Feb 8, 2024
0d89adf
Add temporary unfilled functions to the asset storage until I figure …
Taztingo Feb 8, 2024
1603626
Add logic to set_tag to verify that the tag being used is valid.
Taztingo Feb 8, 2024
ebfb8dd
Add TODO so I don't forget to include logic.
Taztingo Feb 8, 2024
bda6bc0
Add additional map for quick tag lookup and asset by tag retrieval.
Taztingo Feb 8, 2024
99a6c24
Include logic for adding and removing entries from TAG_TO_ASSET lookup.
Taztingo Feb 8, 2024
05cad06
Add tag types to init so we have a choice to populate them initially.
Taztingo Feb 8, 2024
c17ba2a
Fix function documentation and testing for instantiate.
Taztingo Feb 8, 2024
4bc3d24
Add tests for tag storage.
Taztingo Feb 9, 2024
9f00b16
Add tests for asset storage.
Taztingo Feb 9, 2024
101f557
Remove empty test.
Taztingo Feb 9, 2024
41b75ff
Add logic to query_tag.
Taztingo Feb 9, 2024
d7e3a88
Fix mock init having funds, and add tests for query_address.
Taztingo Feb 9, 2024
46414d2
Add tests for query_tag_types.
Taztingo Feb 9, 2024
1ccaa49
Add tests for query_tag. Fix some expect messages as well.
Taztingo Feb 9, 2024
4c6cee6
Start adding tests for execute validate. Mocks still need to be updated.
Taztingo Feb 9, 2024
d39e902
Refactor validate logic to be in the handler since it was more comple…
Taztingo Feb 12, 2024
33df05d
Improve tests.
Taztingo Feb 12, 2024
ae30c15
Adds tests for add_tag_types.
Taztingo Feb 12, 2024
a2e9b8f
Add remove_tag_types logic.
Taztingo Feb 12, 2024
069e190
Remove unused errors.
Taztingo Feb 12, 2024
27c0bcf
Update schema and examples.
Taztingo Feb 12, 2024
1dfad96
Lint code.
Taztingo Feb 12, 2024
566291d
Start adding pagination.
Taztingo Feb 12, 2024
deddf23
Update code to have pagination params for QueryTagTypes and QueryTag.
Taztingo Feb 13, 2024
be4ebb1
Add tests for with_tag pagination.
Taztingo Feb 13, 2024
34c3c36
Add tests for get_tag_types pagination.
Taztingo Feb 13, 2024
0b95c5d
Update schema.
Taztingo Feb 13, 2024
5fc43e0
Update dependencies.
Taztingo Feb 13, 2024
2fb771c
Remove unused dependency and move mod util up in lib.rs.
Taztingo Feb 13, 2024
2aff109
Merge branch 'main' into taztingo/138-nav-contract
Taztingo Feb 13, 2024
33661fe
Add nav to excluded contracts.
Taztingo Feb 13, 2024
78e04b6
Remove unused dependencies.
Taztingo Feb 13, 2024
31ccfc7
Use AssetTag instead of String type.
Taztingo Feb 13, 2024
f2596d8
Start converting AssetTag to Security. Update tag store
Taztingo Feb 15, 2024
6232722
Remove alias and rename tag.rs to security.rs
Taztingo Feb 15, 2024
33d84e4
Fix constants.
Taztingo Feb 15, 2024
68c19f4
Fix more constants and rename tag to security in security.rs
Taztingo Feb 15, 2024
d1cbae1
Update asset to use security intead of tag. Update all tests
Taztingo Feb 15, 2024
9768974
Add tests that include a security with a name.
Taztingo Feb 15, 2024
f6de5b8
Update message types to use Security.
Taztingo Feb 15, 2024
f1ea6f0
Update query address.
Taztingo Feb 15, 2024
6b23125
Update query logic for query_tag_types.
Taztingo Feb 15, 2024
c7db2b4
Fix query_tag.
Taztingo Feb 15, 2024
dcc9ca8
Fix query router, and rename files to use security rather than tag.
Taztingo Feb 15, 2024
d1de729
Update default init message handler.
Taztingo Feb 15, 2024
548762a
Update router for instantiate.
Taztingo Feb 15, 2024
bdcc77d
Remove tag name from execute messages.
Taztingo Feb 15, 2024
808c5f7
Update testing messages.
Taztingo Feb 15, 2024
d8acdee
Update events and actions.
Taztingo Feb 15, 2024
a9c7c1f
Rename to add_security_types and update handler.
Taztingo Feb 16, 2024
7b95add
Update errors not to use tag.
Taztingo Feb 16, 2024
4aad912
Rename remove_tag_types to remove_security_types, and update logic to…
Taztingo Feb 16, 2024
6b29301
Rename set_tag to set_security and update to use security logic.
Taztingo Feb 16, 2024
f22aafe
Fix router for execute.
Taztingo Feb 16, 2024
340d308
Fix borrow issues with key for asset.
Taztingo Feb 16, 2024
aefe1bd
Fix storage security borrows.
Taztingo Feb 16, 2024
c825432
Fix one test that was failing.
Taztingo Feb 16, 2024
b91a778
Fix keys in storage so we can properly use sub_prefix.
Taztingo Feb 16, 2024
32a910e
Add with_security_category to query by security_category.
Taztingo Feb 16, 2024
ba1f990
Add tests for query router.
Taztingo Feb 20, 2024
86adba7
Add tests for execute router.
Taztingo Feb 20, 2024
fa38109
Add check to ensure there is always a category type.
Taztingo Feb 20, 2024
d44aa8c
Add query_security_category. Still need tests.
Taztingo Feb 20, 2024
fedc735
Add tests for query_security_category.
Taztingo Feb 20, 2024
2228167
Move security logic out of msg.
Taztingo Feb 20, 2024
86f8c08
Add CategorizedSecurity to get rid of the pair concept for the end user.
Taztingo Feb 20, 2024
0521419
Use tryfold to get Result<Vec, ContractErr>
Taztingo Feb 20, 2024
56caeeb
Change map type of () to Empty.
Taztingo Feb 22, 2024
c44d47a
Update schema.
Taztingo Feb 22, 2024
18425a9
Fix linting and clean up get_types.
Taztingo Feb 22, 2024
5cafe53
Extract remove security from set security. Update validate to ensure …
Taztingo Feb 23, 2024
737974e
Fix dependency order.
Taztingo Feb 26, 2024
c808bde
Fix is_scope and is_marker.
Taztingo Feb 26, 2024
2e69e75
Update schema.
Taztingo Feb 26, 2024
1848cc3
Update makefile.
Taztingo Feb 27, 2024
2283cd1
Rename contract to security.
Taztingo Feb 27, 2024
aeb4137
Update documentation for intro, concepts, txs, migration.
Taztingo Feb 27, 2024
503f0e4
Update README to have query section.
Taztingo Feb 27, 2024
d92e7fd
Fix typo in error.
Taztingo Feb 28, 2024
3350b51
Fix typo in remove event.
Taztingo Feb 28, 2024
e3c0876
Update typos in comments.
Taztingo Feb 28, 2024
deb8427
Update remove security event to include the security. An error will a…
Taztingo Feb 28, 2024
0e933e3
Update Makefile with correct SELinux policy.
Taztingo Feb 28, 2024
28baffa
Add backticks to function comment to correctly close.
Taztingo Feb 28, 2024
155c146
Add more clarity to readme.
Taztingo Feb 28, 2024
1173927
Update README.
Taztingo Feb 29, 2024
fef68b2
Add route for set_security_multiple.
Taztingo Feb 29, 2024
8e789ba
Fix linting
Taztingo Feb 29, 2024
ea31290
Update schema.
Taztingo Feb 29, 2024
f0c4872
Add documentation for Set Security Multiple.
Taztingo Feb 29, 2024
cf74620
Update changelog.
Taztingo Feb 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Bump to Provenance 1.17.1 ([#135](https://github.com/provenance-io/provwasm/issues/135))
* Add ibc message types ([#136](https://github.com/provenance-io/provwasm/issues/136))
* Update contracts to use `cosmwasm/optimzer` ([#140](https://github.com/provenance-io/provwasm/issues/140))
* Create security contract to link assets with a security type ([#138](https://github.com/provenance-io/provwasm/issues/138))

## Releases

Expand Down
16 changes: 9 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@ members = [
"contracts/nft",
"contracts/scope",
"contracts/trigger",
"contracts/tutorial"
]
exclude = [
"contracts/template"
"contracts/tutorial",
]
exclude = ["contracts/template", "contracts/security"]

[workspace.package]
version = "2.2.0"
Expand All @@ -42,11 +40,15 @@ provwasm-std = { version = "2.2.0", path = "packages/provwasm-std" }

base64 = "=0.21.7"
chrono = { version = "=0.4.33", default-features = false }
prost = { version = "=0.11.9", default-features = false, features = ["prost-derive"] }
prost = { version = "=0.11.9", default-features = false, features = [
"prost-derive",
] }
prost-types = { version = "=0.11.9", default-features = false }
prost-build = "=0.11.9"
schemars = "=0.8.16"
serde = { version = "=1.0.196", default-features = false, features = ["derive"] }
serde = { version = "=1.0.196", default-features = false, features = [
"derive",
] }
serde_json = { version = "=1.0.113", features = ["std"] }
thiserror = { version = "=1.0.56" }

Expand All @@ -59,4 +61,4 @@ debug-assertions = false
codegen-units = 1
panic = 'abort'
incremental = false
overflow-checks = true
overflow-checks = true
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,7 @@ scope:
.PHONY: trigger
scope:
@make -C contracts/trigger

.PHONY: security
security:
@make -C contracts/security
4 changes: 4 additions & 0 deletions contracts/security/.cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[alias]
wasm = "build --release --target wasm32-unknown-unknown"
unit-test = "test --lib"
schema = "run --example schema"
15 changes: 15 additions & 0 deletions contracts/security/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Generated by cargo
/target/

# Backup files generated by rustfmt
**/*.rs.bak

# Build artifacts
artifacts

# IDE
/.vscode/
/.idea/
/.run/

*.iml
Loading
Loading