Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions assembly/massa/get_call_coins/call_coins.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { generateEvent, Context} from "@massalabs/massa-as-sdk";

export function test(param: StaticArray<u8>): void {
generateEvent("Caller_Address : " + Context.caller().toByteString() + " || tokens sent to the SC during the call : " + Context.transferedCoins().toString());
}
21 changes: 21 additions & 0 deletions assembly/massa/get_call_coins/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/** ****************************
* Bytecode to send to the massa network that push the `helloworld`
* smartcontract.
*
* N.B. The entry file of your Massa Smart Contract program should be named
* `src/main.ts`, the command `yarn bundle` will produce an `build/main.wasm`
* which is ready to be send on Massa network node!
**/

import {createSC, generateEvent, getOpData, getOpKeys} from "@massalabs/massa-as-sdk";

export function main(_args: string): void {
// Create every SC available in the ExecuteSC operation datastore
const keys = getOpKeys();
keys.forEach(function (key) {
const bytecode = getOpData(key);
const address = createSC(bytecode);
generateEvent(address.toByteString());
});

}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
"build_:set_bytecode_fail_1": "asc assembly/massa/set_bytecode_fail/smart-contract.ts --transform json-as/transform --target release --exportRuntime --runtime stub --outFile build/massa/smart-contract.wasm",
"build_:set_bytecode_fail_2": "asc assembly/massa/set_bytecode_fail/main.ts --transform json-as/transform --target release --exportRuntime --runtime stub --outFile build/massa/set_bytecode_fail.wasm",
"build:set_bytecode_fail": "run-s build_:set_bytecode_fail_*",
"build_:get_call_coins_1": "asc assembly/massa/get_call_coins/call_coins.ts --target release --exportRuntime --runtime stub --outFile build/massa/get_call_coins_test.wasm",
"build_:get_call_coins_2": "asc assembly/massa/get_call_coins/main.ts --target release --exportRuntime --runtime stub --outFile build/massa/get_call_coins_main.wasm",
"build:get_call_coins": "run-s build_:get_call_coins_*",
"build_:nested_call_1": "asc assembly/massa/nested_call/test.ts --transform json-as/transform --target release --exportRuntime --runtime stub --outFile build/massa/test.wasm",
"build_:nested_call_2": "asc assembly/massa/nested_call/main.ts --transform json-as/transform --target release --exportRuntime --runtime stub --outFile build/massa/nested_call.wasm",
"build:nested_call": "run-s build_:nested_call_*",
Expand Down