You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: bind initialize to the deploying account so a front-runner cannot capture admin - #24
CI on my fork ran green: rustfmt, clippy -D warnings, cargo test -p yield_vault,
the wasm build, and the TypeScript typecheck, lint, format check and tests
(<link to the green run on Cmitchelle7/yield-general>).
Not covered by CI: a live Testnet deploy. deploy-yield-vault.ts and deploy-yield-vault.sh now pass the salt to initialize, but I have not run
them against Testnet, and the shell path relies on stellar contract deploy --salt and passing a hex BytesN<32> argument.
What it does: it implements option 2 from the issue, binding initialize to the
deploying account. The existing admin.require_auth() only stops a caller from
installing an admin it doesn't control, so a front-runner could still name itself admin
and sign its own call. initialize now takes the deployer and the creation salt,
re-derives the contract address from them, and rejects the call with BadDeployer unless
it matches the vault's own address. The deployer must sign. AlreadyInit behaviour is
unchanged, and there's no SDK bump or constructor.
Verification: CI is green on my fork, covering rustfmt, clippy -D warnings, cargo test -p yield_vault, the wasm build, and the TypeScript typecheck, lint, format
check and tests: <link to the green run on Cmitchelle7/yield-general>.
The workflows on this PR are waiting for maintainer approval because I'm a first-time
contributor. Could you approve them so the checks run here too?
Not covered by CI: a live Testnet deploy. Both deploy scripts now pass the salt
through to initialize, but I haven't run them against Testnet. The shell path relies on stellar contract deploy --salt and passing a hex BytesN<32> argument.
Note: this changes the initialize ABI (callers now pass deployer and salt). The
Testnet vault in docs/deployment/testnet.md was deployed earlier and is already
initialized, so it's unaffected, and the doc says so.
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Verification
CI on my fork ran green: rustfmt, clippy
-D warnings,cargo test -p yield_vault,the wasm build, and the TypeScript typecheck, lint, format check and tests
(<link to the green run on Cmitchelle7/yield-general>).
Not covered by CI: a live Testnet deploy.
deploy-yield-vault.tsanddeploy-yield-vault.shnow pass the salt toinitialize, but I have not runthem against Testnet, and the shell path relies on
stellar contract deploy --saltand passing a hexBytesN<32>argument.