Skip to content

feat: let users to disable auth by PREDECESSOR_ID #69

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

Draft
wants to merge 32 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
7acf381
feat: account locks
fusede Apr 15, 2025
dfa2009
wip
fusede Apr 15, 2025
dedfa13
fix: check for lock in cached accounts
fusede Apr 15, 2025
67e4dab
feat: impl BorshSerializeAs/BorshDeserializeAs for std types
fusede Apr 15, 2025
5a19142
wip
fusede Apr 16, 2025
e21735c
feat: allow deposits/transfers to locked accounts
fusede Apr 18, 2025
557713e
fix: TODOs
fusede Apr 21, 2025
e56bd33
chore: polish code
fusede Apr 22, 2025
2f6f8b1
Merge branch 'main' into feat/aml
fusede Apr 22, 2025
09ad632
chore: make clippy happy
fusede Apr 22, 2025
9472461
chore: make clippy happy
fusede Apr 22, 2025
f2357a7
feat: PanicOnClone tests
fusede Apr 22, 2025
a9bb8ac
Merge branch 'main' into feat/aml
fusede Apr 22, 2025
06f085e
refactor: better deserialization of AccountEntry
fusede Apr 22, 2025
e07ebe8
chore: make clippy happy
fusede Apr 23, 2025
064989b
chore
fusede Apr 23, 2025
2c0d37d
feat: test lazy legacy Account upgrade
fusede Apr 23, 2025
fc08d48
docs
fusede Apr 23, 2025
f2f3347
feat: let users to disable auth by PREDECESSOR_ID
fusede Apr 23, 2025
b17ea24
feat: test upgrade flags
fusede Apr 24, 2025
e3e4d57
fix: remove unknown flags
fusede Apr 24, 2025
fda00c0
Merge branch 'main' into feat/aml
fusede Apr 24, 2025
a3de10f
Merge branch 'feat/aml' into feat/disable-auth-by-predecessor-id
fusede Apr 24, 2025
83ad807
fix: view method mt_tokens_for_owner() should not respect lock
fusede Apr 24, 2025
26e2331
Merge branch 'feat/aml' into feat/disable-auth-by-predecessor-id
fusede Apr 24, 2025
a63f6d4
Merge branch 'main' into feat/aml
fusede Apr 24, 2025
ccd07a8
tests: should_panic test for PanicOnClone
fusede Apr 24, 2025
7f9aca3
fix: version numbers
fusede Apr 24, 2025
4068707
fix: use magic prefix to differentiate between legacy and versioned A…
fusede Apr 28, 2025
c39ef65
Merge branch 'feat/aml' into feat/disable-auth-by-predecessor-id
fusede Apr 28, 2025
87c00d9
Merge branch 'main' into feat/aml
fusede Apr 28, 2025
7246f8b
Merge branch 'feat/aml' into feat/disable-auth-by-predecessor-id
fusede Apr 28, 2025
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
52 changes: 34 additions & 18 deletions Cargo.lock

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

10 changes: 7 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ members = [
"crypto",
"defuse",
"erc191",
"io-utils",
"map-utils",
"near-utils",
"nep245",
Expand Down Expand Up @@ -40,6 +41,7 @@ defuse-core.path = "core"
defuse-crypto.path = "crypto"
defuse.path = "defuse"
defuse-erc191.path = "erc191"
defuse-io-utils.path = "io-utils"
defuse-map-utils.path = "map-utils"
defuse-near-utils.path = "near-utils"
defuse-nep245.path = "nep245"
Expand All @@ -52,10 +54,11 @@ defuse-poa-token.path = "poa-token"
defuse-serde-utils.path = "serde-utils"
defuse-wnear.path = "wnear"

randomness.path = "randomness"
test-utils.path = "test-utils"
defuse-randomness.path = "randomness"
defuse-test-utils.path = "test-utils"

anyhow = "1"
bitflags = "2.9.0"
bnum = { version = "0.13", features = ["borsh"] }
chrono = { version = "0.4", default-features = false }
derive_more = "2.0"
Expand Down Expand Up @@ -83,9 +86,10 @@ tokio = { version = "1.38", default-features = false }
[workspace.lints.clippy]
all = { level = "deny", priority = -1 }
pedantic = { level = "deny", priority = -1 }
module_name_repetitions = "allow"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
module_name_repetitions = "allow"
must_use_candidate = "allow"


[profile.release]
Expand Down
22 changes: 12 additions & 10 deletions Makefile.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[config]
init_task = "add-cache-dir-tags"
default_to_workspace = false
skip_core_tasks = true

[env]
TARGET_DIR = "${PWD}/res"
TARGET_DIR = "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/res"
POA_TOKEN_WASM = "${TARGET_DIR}/defuse_poa_token.wasm"
POA_TOKEN_WITH_NO_REGISTRATION_DIR = "${TARGET_DIR}/poa-token-no-registration"
POA_TOKEN_WASM_NO_REGISTRATION_WASM = "${POA_TOKEN_WITH_NO_REGISTRATION_DIR}/defuse_poa_token.wasm"
Expand All @@ -12,15 +13,18 @@ POA_TOKEN_WASM_NO_REGISTRATION_WASM = "${POA_TOKEN_WITH_NO_REGISTRATION_DIR}/def
alias = "build"

[tasks.clippy]
dependencies = ["add-cache-dir-tag"]
command = "cargo"
args = ["clippy", "--workspace", "--all-targets", "--no-deps"]

[tasks.build]
dependencies = ["add-cache-dir-tag", "build-defuse", "build-poa-factory", "contract-stats", "build-poa-token-no-registration"]
dependencies = [
"build-defuse",
"build-poa-factory",
"contract-stats",
"build-poa-token-no-registration",
]

[tasks.build-defuse]
dependencies = ["add-cache-dir-tag"]
command = "cargo"
args = [
"near",
Expand All @@ -37,7 +41,7 @@ args = [
]

[tasks.build-poa-factory]
dependencies = ["add-cache-dir-tag", "build-poa-token"]
dependencies = ["build-poa-token"]
command = "cargo"
args = [
"near",
Expand All @@ -54,7 +58,6 @@ args = [
]

[tasks.build-poa-token]
dependencies = ["add-cache-dir-tag"]
command = "cargo"
args = [
"near",
Expand All @@ -71,7 +74,6 @@ args = [
]

[tasks.build-poa-token-no-registration]
dependencies = ["add-cache-dir-tag"]
command = "cargo"
args = [
"near",
Expand Down Expand Up @@ -116,9 +118,9 @@ category = "Tools"
script = "cd ${TARGET_DIR} && du -ah *.wasm"

# We add CACHEDIR.TAG as it helps in making system level applications, e.g., backup systems, understand that this directory is just for disposable things.
[tasks.add-cache-dir-tag]
[tasks.add-cache-dir-tags]
condition = { platforms = ["linux", "mac"] }
script = [
"mkdir -p target res",
"echo 'Signature: 8a477f597d28d172789f06886806bc55' | tee target/CACHEDIR.TAG res/CACHEDIR.TAG > /dev/null"
"mkdir -p ${CARGO_MAKE_CRATE_TARGET_DIRECTORY} ${TARGET_DIR}",
"echo 'Signature: 8a477f597d28d172789f06886806bc55' | tee ${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/CACHEDIR.TAG ${TARGET_DIR}/CACHEDIR.TAG > /dev/null",
]
3 changes: 3 additions & 0 deletions admin-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@ edition.workspace = true
version.workspace = true
repository.workspace = true

[lints]
workspace = true

[dependencies]
near-sdk.workspace = true
3 changes: 3 additions & 0 deletions bitmap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ edition.workspace = true
version.workspace = true
repository.workspace = true

[lints]
workspace = true

[dependencies]
defuse-map-utils.workspace = true

Expand Down
6 changes: 6 additions & 0 deletions borsh-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ edition.workspace = true
version.workspace = true
repository.workspace = true

[lints]
workspace = true

[dependencies]
defuse-io-utils.workspace = true

near-sdk.workspace = true
impl-tools.workspace = true
Loading
Loading