Questions tagged [archetype]
The archetype tag has no usage guidance.
14
questions
4
votes
3
answers
183
views
What's wrong with my calculation of fees and burn here?
I am trying to calculate the cost of a transaction, post-hoc, from the response to calling the entrypoint. This is for the purposes of a testing tool I am building that I need accurate costs for.
As ...
2
votes
1
answer
59
views
archetype: how to remove the bytes that are prepended by the pack() routine
I am trying to concatenate two strings and then convert to bytes using pack(). However this prepends some bytes to the front of the result.
var str1 : string = "TEST INDEX #";
var str2 = ...
2
votes
1
answer
75
views
How can I convert duration to int or nat in archetype?
Or: How can I multiply duration and tez? (I need tez as my output)
I would usually write something about what I have tried - but I don't really know where to start with this one. I have looked through ...
1
vote
1
answer
26
views
Do partitions reduce gas usage?
I have a ledger asset which is a big map.
Each entry has a partition leading to another other asset, which in the worst case will have 20 entries in it associated with one entry in the ledger asset (I'...
0
votes
1
answer
53
views
How can I check if an address is a contract vs account (or how can I convert an address to a string) in archetype?
I am attempting to write a simple function to check if an address is an account (e.g tz1, tz2 etc) or contract address (KT).
I want to write something like this:
function isAddressContract(ad: address)...
0
votes
1
answer
44
views
How to call an entrypoint from the current contract?
There is a straightforward example of how to do this in the docs, however it does not seem to work for me. With the following code which I basically copied straight from the docs ...
entry ...
0
votes
2
answers
30
views
How can I assign values for a map-type in an archetype test script?
I have the following typescript in my test script:
const tmdBytes = Bytes.hex_encode("ipfs://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
const tmdMap : Array<[ ...
0
votes
1
answer
34
views
How do you originate an archetype contract from within a dapp?
I’m trying to figure out how to originate a new contract from within a dapp. I seem to have found what I am looking for here: https://tezostaquito.io/docs/originate
Here is the example code I am ...
0
votes
2
answers
34
views
NatValidationError when deploying an archetype contract with taquito
I am attempting to deploy a very simple archetype contract with Taquito in a react Dapp. However, I am receiving a validation error. My guess is that I have the syntax wrong for the storage parameter, ...
0
votes
1
answer
23
views
Events and emit archetype issue: TypeError: Cannot read properties of undefined (reading '0')
I'm having some trouble getting events and emit to work as I expect in my archetype contract. I must be messing something up with the syntax. I have no problem if I am emitting a single value in the ...
0
votes
1
answer
18
views
Trying to create a FA2 token with Archetype
I’m trying to create a FA2 token, for this I use https://github.com/completium/archetype-fa2/blob/main/contracts/fa2_fungible.arl as an example. When I change line 71 to put my ipfs link in bytes (...
0
votes
2
answers
72
views
CORS error with completium-cli sandbox
I'm trying to access a contract on the completium-cli sandbox within my dapp running on a local vite server. Ideally I would set up my dev environment so I can test deploy to the sandbox within the ...
0
votes
1
answer
43
views
How to call a getter entrypoint in contract using completium-cli
How to call a getter entrypoint in contract using completium-cli? For example if it is declared like this:
variable bar : nat = 0
variable msg : string = ""
getter getBar(s : string) : nat {...
0
votes
1
answer
8
views
How can I apply a minus operation to Tez type in the archetype testing library?
I am writing some simple contract tests, and I want to check that account balances are updating appropriately.
There is currently no minus method on the Tez type. I attempted to add my own to the ...