-
Notifications
You must be signed in to change notification settings - Fork 256
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
README.md #66
base: main
Are you sure you want to change the base?
README.md #66
Changes from all commits
d5f0a0d
badcbfb
0ed97d4
2f2eaca
4fab977
88557eb
6d2a38b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# This workflow will trigger Datadog Synthetic tests within your Datadog organisation | ||
# For more information on running Synthetic tests within your GitHub workflows see: https://docs.datadoghq.com/synthetics/cicd_integrations/github_actions/ | ||
|
||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
# To get started: | ||
|
||
# 1. Add your Datadog API (DD_API_KEY) and Application Key (DD_APP_KEY) as secrets to your GitHub repository. For more information, see: https://docs.datadoghq.com/account_management/api-app-keys/. | ||
# 2. Start using the action within your workflow | ||
|
||
name: Run Datadog Synthetic tests | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Run Synthetic tests within your GitHub workflow. | ||
# For additional configuration options visit the action within the marketplace: https://github.com/marketplace/actions/datadog-synthetics-ci | ||
- name: Run Datadog Synthetic tests | ||
uses: DataDog/synthetics-ci-github-action@87b505388a22005bb8013481e3f73a367b9a53eb # v1.4.0 | ||
with: | ||
api_key: ${{secrets.DD_API_KEY}} | ||
app_key: ${{secrets.DD_APP_KEY}} | ||
test_search_query: 'tag:e2e-tests' #Modify this tag to suit your tagging strategy | ||
|
||
|
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,7 +70,7 @@ cell verify_c5_actions(cell c5, int is_external) inline { | |
;; only `action_send_msg` is allowed; `action_set_code`, `action_reserve_currency` or `action_change_library` are not. | ||
cs = cs.enforce_and_remove_action_send_msg_prefix(); | ||
|
||
throw_unless(error::invalid_c5, cs.slice_bits() == 8); ;; send_mode | ||
throw_unless(error::invalid_c5, cs.slice_bits() == 8); ;; send_mode uint8 | ||
throw_unless(error::invalid_c5, cs.slice_refs() == 2); ;; next-action-ref and MessageRelaxed ref | ||
|
||
;; enforce that send_mode has +2 bit (ignore errors) set for external message. | ||
|
@@ -100,7 +100,7 @@ cell verify_c5_actions(cell c5, int is_external) inline { | |
return (); | ||
} | ||
|
||
;; Loop extended actions until we reach standard actions | ||
;; Loop extended actions | ||
while (true) { | ||
int is_add_extension = cs~check_and_remove_add_extension_prefix(); | ||
int is_remove_extension = is_add_extension ? 0 : cs~check_and_remove_remove_extension_prefix(); | ||
|
@@ -109,7 +109,7 @@ cell verify_c5_actions(cell c5, int is_external) inline { | |
(int address_wc, int address_hash) = parse_std_addr(cs~load_msg_addr()); | ||
(int my_address_wc, _) = parse_std_addr(my_address()); | ||
|
||
throw_unless(error::extension_wrong_workchain, my_address_wc == address_wc); | ||
throw_unless(error::extension_wrong_workchain, my_address_wc == address_wc); ;; the extension must be in the same workchain as the wallet. | ||
|
||
slice data_slice = get_data().begin_parse(); | ||
slice data_slice_before_extensions = data_slice~load_bits(size::bool + size::seqno + size::wallet_id + size::public_key); | ||
|
@@ -131,7 +131,7 @@ cell verify_c5_actions(cell c5, int is_external) inline { | |
.store_dict(extensions) | ||
.end_cell()); | ||
|
||
} elseif (cs~check_and_remove_set_signature_allowed_prefix()) { | ||
} elseif (cs~check_and_remove_set_signature_allowed_prefix()) { ;; allow/disallow signature | ||
throw_unless(error::only_extension_can_change_signature_mode, is_extension); | ||
int allow_signature = cs~load_int(1); | ||
slice data_slice = get_data().begin_parse(); | ||
|
@@ -184,6 +184,7 @@ cell verify_c5_actions(cell c5, int is_external) inline { | |
return (); | ||
} | ||
} | ||
;; In case the wallet application has initially, by mistake, deployed a contract with the wrong bit (signature is forbidden and extensions are empty) - we allow such a contract to work. | ||
throw_if(error::signature_disabled, (~ is_signature_allowed) & is_extensions_not_empty); | ||
throw_unless(error::invalid_seqno, seqno == stored_seqno); | ||
throw_unless(error::invalid_wallet_id, wallet_id == stored_wallet_id); | ||
|
@@ -193,7 +194,6 @@ cell verify_c5_actions(cell c5, int is_external) inline { | |
accept_message(); | ||
} | ||
|
||
;; Store and commit the seqno increment to prevent replays even if the subsequent requests fail. | ||
stored_seqno = stored_seqno + 1; | ||
set_data(begin_cell() | ||
.store_int(true, size::bool) ;; is_signature_allowed | ||
|
@@ -202,6 +202,7 @@ cell verify_c5_actions(cell c5, int is_external) inline { | |
.end_cell()); | ||
|
||
if (is_external) { | ||
;; For external messages we commit seqno changes, so that even if an exception occurs further on, the reply-protection will still work. | ||
commit(); | ||
} | ||
|
||
|
@@ -217,14 +218,14 @@ cell verify_c5_actions(cell c5, int is_external) inline { | |
|
||
() recv_internal(cell in_msg_full, slice in_msg_body) impure inline { | ||
if (in_msg_body.slice_bits() < size::message_operation_prefix) { | ||
return (); | ||
return (); ;; just receive Toncoins | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OKK There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good |
||
} | ||
int op = in_msg_body.preload_uint(size::message_operation_prefix); | ||
if ((op != prefix::extension_action) & (op != prefix::signed_internal)) { | ||
return (); | ||
return (); ;; just receive Toncoins | ||
} | ||
|
||
;; bounded messages has 0xffffff prefix and skipped by op check | ||
;; bounced messages has 0xffffffff prefix and skipped by op check | ||
|
||
if (op == prefix::extension_action) { | ||
in_msg_body~skip_bits(size::message_operation_prefix); | ||
|
@@ -257,7 +258,9 @@ cell verify_c5_actions(cell c5, int is_external) inline { | |
|
||
} | ||
|
||
;; Additional check to make sure that there are enough bits for reading before signature check | ||
;; Before signature checking we handle errors silently (return), after signature checking we throw exceptions. | ||
|
||
;; Check to make sure that there are enough bits for reading before signature check | ||
if (in_msg_body.slice_bits() < size::message_operation_prefix + size::wallet_id + size::valid_until + size::seqno + size::signature) { | ||
return (); | ||
} | ||
|
@@ -290,7 +293,7 @@ int get_public_key() method_id { | |
.preload_uint(size::public_key); | ||
} | ||
|
||
;; Returns raw dictionary (or null if empty) where keys are address hashes. Workchains of extensions are same with wallet smart contract workchain | ||
;; Returns raw dictionary (or null if empty) where keys are address hashes. Workchains of extensions are same with wallet smart contract workchain. | ||
cell get_extensions() method_id { | ||
return get_data().begin_parse() | ||
.skip_bits(size::bool + size::seqno + size::wallet_id + size::public_key) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { Dictionary, toNano } from 'ton-core'; | ||
import { WalletId, WalletV5 } from '../wrappers/wallet-v5'; | ||
import { compile, NetworkProvider } from '@ton-community/blueprint'; | ||
import { compile, NetworkProvider } from '@ton/blueprint'; | ||
import { LibraryDeployer } from '../wrappers/library-deployer'; | ||
import { getSecureRandomBytes, keyPairFromSeed } from 'ton-crypto'; | ||
|
||
|
@@ -15,11 +15,11 @@ export async function run(provider: NetworkProvider) { | |
const walletV5 = provider.open( | ||
WalletV5.createFromConfig( | ||
{ | ||
signature_auth_disabled: false, | ||
signatureAllowed: true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. scripts/deployWalletV5.ts There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PROVIDE There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Myeadzain marked this conversation as resolved.
Show resolved
Hide resolved
|
||
seqno: 0, | ||
walletId: new WalletId({ networkGlobalId: -3 }).serialized, // testnet | ||
publicKey: keypair.publicKey, | ||
extensions: Dictionary.empty() | ||
extensions: Dictionary.empty() as any | ||
}, | ||
LibraryDeployer.exportLibCode(await compile('wallet_v5')) | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.