From 1cff73c0e565aa920a0db52de0c208352100ef2a Mon Sep 17 00:00:00 2001 From: Craig Everett Date: Thu, 21 Nov 2024 16:38:00 +0900 Subject: [PATCH 1/2] Update docs --- LICENSE | 1 + README.md | 17 ++--- docs/index.md | 5 +- docs/sophia_examples.md | 6 -- docs/sophia_features.md | 126 ++++-------------------------------- docs/sophia_stdlib.md | 139 ++-------------------------------------- docs/sophia_syntax.md | 5 +- 7 files changed, 32 insertions(+), 267 deletions(-) diff --git a/LICENSE b/LICENSE index b4cc822..43e19d2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,6 @@ ISC License +Copyright (c) 2024, QPQ AG Copyright (c) 2017, æternity developers Permission to use, copy, modify, and/or distribute this software for any diff --git a/README.md b/README.md index 65513e7..9dc9b88 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@ -# aesophia +# Sophia -This is the __sophia__ compiler for the æternity system which compiles contracts written in __sophia__ to [FATE](https://github.com/aeternity/protocol/blob/master/contracts/fate.md) instructions. +This is the __Sophia__ compiler for the Gajumaru system which compiles contracts written in __Sophia__ to [FATE](https://gitlab.com/ioecs/protocol/-/blob/master/contracts/fate.md) instructions. -The compiler is currently being used three places - - [The command line compiler](https://github.com/aeternity/aesophia_cli) - - [The HTTP compiler](https://github.com/aeternity/aesophia_http) - - In [æternity node](https://github.com/aeternity/aeternity) tests +The compiler is being used a few places + - [The command line compiler](https://gitlab.com/ioecs/sophia_cli) + - In [Gajumaru node](https://gitlab.com/ioecs/gajumaru) tests + - [Clutch](https://gitlab.com/ioecs/clutch), the desktop wallet + - Various backend systems that implement GRIDS ## Documentation @@ -16,13 +17,13 @@ The compiler is currently being used three places * [Contract examples](docs/sophia_examples.md) * [Contributing](CONTRIBUTING.md) -Additionally you can check out the [contracts section](https://github.com/aeternity/protocol/blob/master/contracts/contracts.md) of the æternity blockchain specification. +Additionally you can check out the [contracts section](https://gitlab.com/ioecs/protocol/-/tree/master/contracts) of the Gajumaru blockchain specification. ## Versioning Versioning should follow the [semantic versioning](https://semver.org/spec/v2.0.0) guidelines. Id est, given a version number MAJOR.MINOR.PATCH, increment the: -- MAJOR version when you make incompatible API changes +- MAJOR version when you make backward incompatible changes - MINOR version when you add functionality in a backwards compatible manner - PATCH version when you make backwards compatible bug fixes diff --git a/docs/index.md b/docs/index.md index b3f2129..e1b74fa 100644 --- a/docs/index.md +++ b/docs/index.md @@ -5,8 +5,7 @@ restricted mutable state. Sophia is customized for smart contracts, which can be published to a blockchain. Thus some features of conventional languages, such as floating point arithmetic, are not present in Sophia, and -some [æternity blockchain](https://aeternity.com) specific primitives, constructions and types have been added. +some [blockchain](https://gajumaru.io) specific primitives, constructions and types have been added. !!! Note - - For rapid prototyping of smart contracts check out [AEstudio](https://studio.aepps.com/)! - - For playing around and diving deeper into the language itself check out the [REPL](https://repl.aeternity.io/)! + - For playing around and diving deeper into the language itself check out the [REPL](https://gitlab.com/ioecs/aerepl)! diff --git a/docs/sophia_examples.md b/docs/sophia_examples.md index fab9285..63a2948 100644 --- a/docs/sophia_examples.md +++ b/docs/sophia_examples.md @@ -65,9 +65,3 @@ contract FundMe = amount = state.contributions[to]}) put(state{ contributions @ c = Map.delete(to, c) }) ``` - -## Repositories -This is a list with repositories that include smart contracts written in Sophia: - -- [aepp-sophia-examples](https://github.com/aeternity/aepp-sophia-examples) - - A repository that contains lots of different examples. The functionality of these examples is - to some extent - also covered by tests written in JavaScript. \ No newline at end of file diff --git a/docs/sophia_features.md b/docs/sophia_features.md index dfbfe59..dbfe064 100644 --- a/docs/sophia_features.md +++ b/docs/sophia_features.md @@ -40,8 +40,8 @@ contract VoteTwice = ``` Contract calls take two optional named arguments `gas : int` and `value : int` -that lets you set a gas limit and provide tokens to a contract call. If omitted -the defaults are no gas limit and no tokens. Suppose there is a fee for voting: +that lets you set a gas limit and provide coins to a contract call. If omitted +the defaults are no gas limit and no coins. Suppose there is a fee for voting: ```sophia entrypoint voteTwice(v : VotingType, fee : int, alt : string) = @@ -62,7 +62,7 @@ the type of the entrypoint does not match the stated contract type, the call fails. To recover the underlying `address` of a contract instance there is a field -`address : address`. For instance, to send tokens to the voting contract (given that it is payable) +`address : address`. For instance, to send coins to the voting contract (given that it is payable) without calling it you can write ```sophia @@ -99,7 +99,7 @@ running out of gas it is necessary to set a gas limit using the `gas` argument. However, note that errors that would normally consume all the gas in the transaction still only uses up the gas spent running the contract. -Any side effects (state change, token transfers, etc.) made by a failing +Any side effects (state change, coin transfers, etc.) made by a failing protected call is rolled back, just like they would be in the unprotected case. @@ -274,12 +274,6 @@ counterpart in `Args1`. - A map type `map(A1, A2)` is a subtype of `map(B1, B2)` if `A1` is a subtype of `B1`, and `A2` is a subtype of `B2`. -- An oracle type `oracle(A1, A2)` is a subtype of `oracle(B1, B2)` if `B1` is -a subtype of `A1`, and `A2` is a subtype of `B2`. - -- An oracle_query type `oracle_query(A1, A2)` is a subtype of `oracle_query(B1, B2)` -if `A1` is a subtype of `B1`, and `A2` is a subtype of `B2`. - - A user-defined datatype `t(Args1)` is a subtype of `t(Args2)` - When a user-defined type `t('a)` is covariant in `'a`, then `t(A)` is a @@ -340,10 +334,6 @@ Without the `stateful` annotation the compiler does not allow the call to * Use a stateful primitive function. These are - `put` - `Chain.spend` - - `Oracle.register` - - `Oracle.query` - - `Oracle.respond` - - `Oracle.extend` - `AENS.preclaim` - `AENS.claim` - `AENS.transfer` @@ -540,7 +530,7 @@ Sophia has the following types: | Type | Description | Example | |----------------------|---------------------------------------------------------------------------------------------|--------------------------------------------------------------| | int | A 2-complement integer | ```-1``` | -| address | æternity address, 32 bytes | ```Call.origin``` | +| address | on-chain address, 32 bytes | ```Call.origin``` | | bool | A Boolean | ```true``` | | bits | A bit field | ```Bits.none``` | | bytes(n) | A byte array with `n` bytes | ```#fedcba9876543210``` | @@ -556,8 +546,6 @@ Sophia has the following types: | hash | A 32-byte hash - equivalent to `bytes(32)` | | | signature | A signature - equivalent to `bytes(64)` | | | Chain.ttl | Time-to-live (fixed height or relative to current block) | ```FixedTTL(1050)``` ```RelativeTTL(50)``` | -| oracle('a, 'b) | And oracle answering questions of type 'a with answers of type 'b | ```Oracle.register(acct, qfee, ttl)``` | -| oracle_query('a, 'b) | A specific oracle query | ```Oracle.query(o, q, qfee, qttl, rttl)``` | | contract | A user defined, typed, contract address | ```function call_remote(r : RemoteContract) = r.fun()``` | ## Literals @@ -580,8 +568,6 @@ Sophia has the following types: | hash | `#000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f` | | signature | `sg_MhibzTP1wWzGCTjtPFr1TiPqRJrrJqw7auvEuF5i3FdoALWqXLBDY6xxRRNUSPHK3EQTnTzF12EyspkxrSMxVHKsZeSMj`, `#000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f` | | Chain.ttl | `FixedTTL(1050)`, `RelativeTTL(50)` | -| oracle('a, 'b) | `ok_2YNyxd6TRJPNrTcEDCe9ra59SVUdp9FR9qWC5msKZWYD9bP9z5` | -| oracle_query('a, 'b) | `oq_2oRvyowJuJnEkxy58Ckkw77XfWJrmRgmGaLzhdqb67SKEL1gPY` | | contract | `ct_Ez6MyeTMm17YnTnDdHTSrzMEBKmy7Uz2sXu347bTDPgVH2ifJ` | ## Hole expression @@ -891,77 +877,10 @@ wrapping a transaction.) The transaction and the transaction hash is available i `Auth.tx` and `Auth.tx_hash` respectively, they are *only* available during authentication if invoked by a normal contract call they return `None`. -## Oracle interface -You can attach an oracle to the current contract and you can interact with oracles -through the Oracle interface. - -For a full description of how Oracle works see -[Oracles](https://github.com/aeternity/protocol/blob/master/oracles/oracles.md#oracles). -For a functionality documentation refer to the [standard library](sophia_stdlib.md#oracle). - -### Example - -Example for an oracle answering questions of type `string` with answers of type `int`: -```sophia -contract Oracles = - - stateful entrypoint registerOracle(acct : address, - sign : signature, // Signed network id + oracle address + contract address - qfee : int, - ttl : Chain.ttl) : oracle(string, int) = - Oracle.register(acct, signature = sign, qfee, ttl) - - entrypoint queryFee(o : oracle(string, int)) : int = - Oracle.query_fee(o) - - payable stateful entrypoint createQuery(o : oracle_query(string, int), - q : string, - qfee : int, - qttl : Chain.ttl, - rttl : int) : oracle_query(string, int) = - require(qfee =< Call.value, "insufficient value for qfee") - Oracle.query(o, q, qfee, qttl, RelativeTTL(rttl)) - - stateful entrypoint extendOracle(o : oracle(string, int), - ttl : Chain.ttl) : unit = - Oracle.extend(o, ttl) - - stateful entrypoint signExtendOracle(o : oracle(string, int), - sign : signature, // Signed network id + oracle address + contract address - ttl : Chain.ttl) : unit = - Oracle.extend(o, signature = sign, ttl) - - stateful entrypoint respond(o : oracle(string, int), - q : oracle_query(string, int), - sign : signature, // Signed network id + oracle query id + contract address - r : int) = - Oracle.respond(o, q, signature = sign, r) - - entrypoint getQuestion(o : oracle(string, int), - q : oracle_query(string, int)) : string = - Oracle.get_question(o, q) - - entrypoint hasAnswer(o : oracle(string, int), - q : oracle_query(string, int)) = - switch(Oracle.get_answer(o, q)) - None => false - Some(_) => true - - entrypoint getAnswer(o : oracle(string, int), - q : oracle_query(string, int)) : option(int) = - Oracle.get_answer(o, q) -``` - -### Sanity checks - -When an Oracle literal is passed to a contract, no deep checks are performed. -For extra safety [Oracle.check](sophia_stdlib.md#check) and [Oracle.check_query](sophia_stdlib.md#check_query) -functions are provided. - ## AENS interface -Contracts can interact with the [æternity naming -system](https://github.com/aeternity/protocol/blob/master/AENS.md). For this +Contracts can interact with the [on-chain naming +system](https://gitlab.com/ioecs/protocol/-/blob/master/AENS.md). For this purpose the [AENS](sophia_stdlib.md#aens) and later the [AENSv2](sophia_stdlib.md#aensv2) library was exposed. @@ -1012,7 +931,7 @@ automatically removed so they will not appear in the pointers map. Sophia contracts log structured messages to an event log in the resulting blockchain transaction. The event log is quite similar to [Events in Solidity](https://solidity.readthedocs.io/en/v0.4.24/contracts.html#events). -Events are further discussed in the [protocol](https://github.com/aeternity/protocol/blob/master/contracts/events.md). +Events are further discussed in the [protocol](https://gitlab.com/ioecs/protocol/-/blob/master/contracts/events.md). To use events a contract must declare a datatype `event`, and events are then @@ -1032,15 +951,13 @@ field is indexed if it fits in a 32-byte word, i.e. - `int` - `bits` - `address` -- `oracle(_, _)` -- `oracle_query(_, _)` - contract types - `bytes(n)` for `n` ≤ 32, in particular `hash` The payload field must be either a string or a byte array of more than 32 bytes. The fields can appear in any order. -*NOTE:* Indexing is not part of the core æternity node. +*NOTE:* Indexing is not part of the core node. Events are emitted by using the `Chain.event` function. The following function will emit one Event of each kind in the example. @@ -1113,34 +1030,17 @@ however is in the gas consumption — while `abort` returns unused gas, a call t ## Delegation signature -Some chain operations (`Oracle.` and `AENSv2.`) have an +Some chain operations (`AENSv2.`) have an optional delegation signature. This is typically used when a user/accounts would like to allow a contract to act on it's behalf. -### From Ceres - -From the Ceres protocol version the delegation signatures have more structure, -including a unique tag, `network_id` and identifiers; there are five different -delegation signatures: +The signature structure includes a unique tag, `network_id` and identifiers; there +are three different delegation signatures: - AENS wildcard - the user signs: `owner account + contract` - `AENS_PRECLAIM` - the user signs: `owner account + contract` - `AENS_CLAIM, AENS_UPDATE, AENS_TRANSFER, AENS_REVOKE` - the user signs: `owner account + name hash + contract` - - `ORACLE_REGISTER, ORACLE_EXTEND` - the user signs: `owner account + contract` - - `ORACLE_RESPOND` - the user signs: `query id + contract` See [Serialized signature -data](https://github.com/aeternity/protocol/blob/master/contracts/fate.md#from-ceres-serialized-signature-data) +data](https://gitlab.com/ioecs/protocol/-/blob/master/contracts/fate.md#appendix-1-fate-serialization) for the exact structure used. - -### Before ceres - -The exact data to be signed varies for the different operations, but in all -cases you should prepend the signature data with the `network_id` (`ae_mainnet` -for the æternity mainnet, etc.). - -There are four different delegation signatures: - - `AENS_PRECLAIM` - the user signs: owner `network_id + account + contract` - - `AENS_CLAIM, AENS_UPDATE, AENS_TRANSFER, AENS_REVOKE` - the user signs: `network_id + owner account + name hash + contract` - - `ORACLE_REGISTER, ORACLE_EXTEND` - the user signs: `network_id + owner account + contract` - - `ORACLE_RESPOND` - the user signs: `network_id + query id + contract` diff --git a/docs/sophia_stdlib.md b/docs/sophia_stdlib.md index 8cbcf1f..7b32b31 100644 --- a/docs/sophia_stdlib.md +++ b/docs/sophia_stdlib.md @@ -25,7 +25,6 @@ The out-of-the-box namespaces are: - [Crypto](#crypto) - [Int](#int) - [Map](#map) -- [Oracle](#oracle) The following ones need to be included as regular files with `.aes` suffix, for example ``` @@ -71,15 +70,6 @@ Address.is_contract(a : address) : bool Is the address a contract - -#### is_oracle -``` -Address.is_oracle(a : address) : bool -``` - -Is the address a registered oracle - - #### is_payable ``` Address.is_payable(a : address) : bool @@ -114,20 +104,18 @@ datatype name = Name(address, Chain.ttl, map(string, AENS.pointee)) ##### pointee ``` -datatype pointee = AccountPt(address) | OraclePt(address) - | ContractPt(address) | ChannelPt(address) +datatype pointee = AccountPt(address) | ContractPt(address) | ChannelPt(address) ``` ### AENSv2 Note: introduced in v8.0 -The following functionality is available for interacting with the æternity +The following functionality is available for interacting with the naming system (AENS). If `owner` is equal to `Contract.address` the signature `signature` is ignored, and can be left out since it is a named argument. Otherwise we need a signature to prove that we are allowed to do AENS -operations on behalf of `owner`. The [signature is tied to a network -id](https://github.com/aeternity/protocol/blob/iris/consensus/consensus.md#transaction-signature), +operations on behalf of `owner`. The [signature is tied to a networkid](https://gitlab.com/ioecs/protocol/-/blob/master/consensus/README.md#transaction-signature), i.e. the signature material should be prefixed by the network id. #### Types @@ -141,8 +129,7 @@ datatype name = Name(address, Chain.ttl, map(string, AENSv2.pointee)) ##### pointee ``` -datatype pointee = AccountPt(address) | OraclePt(address) - | ContractPt(address) | ChannelPt(address) | DataPt(bytes()) +datatype pointee = AccountPt(address) | ContractPt(address) | ChannelPt(address) | DataPt(bytes()) ``` Note: on-chain there is a maximum length enforced for `DataPt`, it is 1024 bytes. @@ -287,7 +274,6 @@ namespace Chain = datatype ga_meta_tx = GAMetaTx(address, int) datatype paying_for_tx = PayingForTx(address, int) datatype base_tx = SpendTx(address, int, string) - | OracleRegisterTx | OracleQueryTx | OracleResponseTx | OracleExtendTx | NamePreclaimTx | NameClaimTx(hash) | NameUpdateTx(string) | NameRevokeTx(hash) | NameTransferTx(address, string) | ChannelCreateTx(address) | ChannelDepositTx(address, int) | ChannelWithdrawTx(address, int) | @@ -305,7 +291,7 @@ Auth.tx_hash : option(hash) Gets the transaction hash during authentication. Note: `Auth.tx_hash` computation differs between protocol versions (changed in Ceres!), see -[aeserialisation](https://github.com/aeternity/protocol/blob/master/serializations.md) +[serialisation](https://gitlab.com/ioecs/protocol/-/blob/master/serializations.md) specification for details. @@ -537,7 +523,6 @@ datatype paying_for_tx = PayingForTx(address, int) ##### base_tx ``` datatype base_tx = SpendTx(address, int, string) - | OracleRegisterTx | OracleQueryTx | OracleResponseTx | OracleExtendTx | NamePreclaimTx | NameClaimTx(hash) | NameUpdateTx(string) | NameRevokeTx(hash) | NameTransferTx(address, string) | ChannelCreateTx(address) | ChannelDepositTx(address, int) | ChannelWithdrawTx(address, int) | @@ -944,118 +929,6 @@ Returns a list containing pairs of keys and their respective elements. Turns a list of pairs of form `(key, value)` into a map -### Oracle - -#### register -``` -Oracle.register(, acct : address, qfee : int, ttl : Chain.ttl) : oracle('a, 'b) -``` - -Registers new oracle answering questions of type `'a` with answers of type `'b`. - -* The `acct` is the address of the oracle to register (can be the same as the contract). -* The [signature](./sophia_features.md#delegation-signature) should be a - serialized structure containing `network id`, `account address`, and - `contract address`. Using the private key of `account address` for signing. - Proving you have the private key of the oracle to be. If the address is the same - as the contract `sign` is ignored and can be left out entirely. -* The `qfee` is the minimum query fee to be paid by a user when asking a question of the oracle. -* The `ttl` is the Time To Live for the oracle in key blocks, either relative to the current - key block height (`RelativeTTL(delta)`) or a fixed key block height (`FixedTTL(height)`). -* The type `'a` is the type of the question to ask. -* The type `'b` is the type of the oracle answers. - -Examples: -``` - Oracle.register(addr0, 25, RelativeTTL(400)) - Oracle.register(addr1, 25, RelativeTTL(500), signature = sign1) -``` - - -#### get\_question -``` -Oracle.get_question(o : oracle('a, 'b), q : oracle_query('a, 'b)) : 'a -``` - -Checks what was the question of query `q` on oracle `o` - - -#### respond -``` -Oracle.respond(, o : oracle('a, 'b), q : oracle_query('a, 'b), 'b) : unit -``` - -Responds to the question `q` on `o`. Unless the contract address is the same -as the oracle address the `signature` (which is an optional, named argument) -needs to be provided. Proving that we have the private key of the oracle by -[signing](./sophia_features.md#delegation-signature) should be a serialized -structure containing `network id`, `oracle query id`, and `contract address`. - - -#### extend -``` -Oracle.extend(, o : oracle('a, 'b), ttl : Chain.ttl) : unit -``` - -Extends TTL of an oracle. -* `singature` is a named argument and thus optional. Must be the same as for `Oracle.register` -* `o` is the oracle being extended -* `ttl` must be `RelativeTTL`. The time to live of `o` will be extended by this value. - -#### query\_fee -``` -Oracle.query_fee(o : oracle('a, 'b)) : int -``` - -Returns the query fee of the oracle - - -#### query -``` -Oracle.query(o : oracle('a, 'b), q : 'a, qfee : int, qttl : Chain.ttl, rttl : Chain.ttl) : oracle_query('a, 'b) -``` - -Asks the oracle a question. -* The `qfee` is the query fee debited to the contract account (`Contract.address`). -* The `qttl` controls the last height at which the oracle can submit a response - and can be either fixed or relative. -* The `rttl` must be relative and controls how long an answer is kept on the chain. -The call fails if the oracle could expire before an answer. - - -#### get\_answer -``` -Oracle.get_answer(o : oracle('a, 'b), q : oracle_query('a, 'b)) : option('b) -``` - -Checks what is the optional query answer - - -#### expiry - -``` -Oracle.expiry(o : oracle('a, 'b)) : int -``` - -Ask the oracle when it expires. The result is the block height at which it will happen. - - -#### check -``` -Oracle.check(o : oracle('a, 'b)) : bool -``` - -Returns `true` iff the oracle `o` exists and has correct type - - -#### check_query -``` -Oracle.check_query(o : oracle('a, 'b), q : oracle_query('a, 'b)) : bool -``` - -It returns `true` iff the oracle query exist and has the expected type. - - ## Includable namespaces These need to be explicitly included (with `.aes` suffix) @@ -1664,7 +1537,7 @@ point where the error would exceed the `loss` value. For debugging. If it ever returns false in a code that doesn't call `frac` constructors or accept arbitrary `frac`s from the surface you should report it as a -[bug](https://github.com/aeternity/aesophia/issues/new) +[bug](https://gitlab.com/ioecs/gajumaru/-/issues/new) If you expect getting calls with malformed `frac`s in your contract, you should use this function to verify the input. diff --git a/docs/sophia_syntax.md b/docs/sophia_syntax.md index 6a9ae86..3557ad2 100644 --- a/docs/sophia_syntax.md +++ b/docs/sophia_syntax.md @@ -28,8 +28,6 @@ interface main using as for hiding - `Char` character literal enclosed in `'` with escape character `\` - `AccountAddress` base58-encoded 32 byte account pubkey with `ak_` prefix - `ContractAddress` base58-encoded 32 byte contract address with `ct_` prefix -- `OracleAddress` base58-encoded 32 byte oracle address with `ok_` prefix -- `OracleQueryId` base58-encoded 32 byte oracle query id with `oq_` prefix - `Signature` base58-encoded 64 byte cryptographic signature with `sg_` prefix Valid string escape codes are @@ -46,7 +44,7 @@ Valid string escape codes are | `\xHexDigits` | *HexDigits* | | -See the [identifier encoding scheme](https://github.com/aeternity/protocol/blob/master/node/api/api_encoding.md) for the +See the [identifier encoding scheme](https://gitlab.com/ioecs/protocol/-/blob/master/node/api/api_encoding.md) for the details on the base58 literals. ## Layout blocks @@ -239,7 +237,6 @@ Expr ::= '(' LamArgs ')' '=>' Block(Stmt) // Anonymous function (x) => x + | Id | Con | QId | QCon // Identifiers x, None, Map.member, AELib.Token | Int | Bytes | String | Char // Literals 123, 0xff, #00abc123, "foo", '%' | AccountAddress | ContractAddress // Chain identifiers - | OracleAddress | OracleQueryId // Chain identifiers | Signature // Signature | '???' // Hole expression 1 + ??? From 543a304a43e87714e873dacb04bbe072c339ad0a Mon Sep 17 00:00:00 2001 From: Craig Everett Date: Fri, 22 Nov 2024 14:31:15 +0900 Subject: [PATCH 2/2] New build script (old deps were wonky) --- .docssite/build | 16 ++++++++ .docssite/docs/favicon.png | Bin 1045 -> 1546 bytes .docssite/hook.py | 7 ---- .docssite/mkdocs.yml | 37 ++++++++--------- docs/sophia_stdlib.md | 81 +++++++++---------------------------- 5 files changed, 54 insertions(+), 87 deletions(-) create mode 100755 .docssite/build delete mode 100644 .docssite/hook.py diff --git a/.docssite/build b/.docssite/build new file mode 100755 index 0000000..cedcf96 --- /dev/null +++ b/.docssite/build @@ -0,0 +1,16 @@ +#! /usr/bin/bash + +if mkdocs=$(command -v mkdocs) + then + echo "mkdocs found at $mkdocs" + else + echo "Could not find a mkdocs installation!" + echo "mkdocs must be installed and available in \$PATH to proceed." + exit 95 +fi + +rm docs/*.md +cp ../docs/*.md docs/ +cp ../CHANGELOG.md docs/ + +mkdocs build diff --git a/.docssite/docs/favicon.png b/.docssite/docs/favicon.png index e81502d439e5fd8e4d9795a9ac2daada69c71053..2cf5940f30176cd10804e2f253880764ac6ac38e 100644 GIT binary patch delta 1529 zcmVO3l1ID-@6w*#dTB?C)vb&n- zhG>9_c3QSeqO5*cc6F^9iJgvhfCy+5-xg6&5N3MsbM`~qJAb#G0gB-HbnkijpZ{~t z^9pAnRZiQ?N@wG*&jv$&NYISmKX-*~ht`5P11P%PxVj?!_qx6xmB94dpPy7Z)-;H4 zpFnto*#mu!Y_73q+mg@DDS^pOd+8)S@t}yc0+;}xiVFNo1q-EG#K$^@%H!YXPORIr zZOM0MNg!@Toqy?dsIC!V@{m^H9l=`Olbrh>fasl@su6iiU}nJQOF16$x2o2sIu~?}ia=HEmY5~( zIz(>HgXkeensX9#lpc#7rG`KbAHClYat4UiZ{2Pj}Y6U6eqqrfrH^ z+KlL2L99Xbaa8`SZtl@k*W$wkWSibxkD6F-V)o4=ZPT3g2@^D1kH`Z+>A*NpAnCg9 zs=ls8`v5F}%Wi+VjF9dYVg6upPgOVe=Ry@d9rIQOlTVHB80%*-8U=~^|4w^o=yQK^ z&XJyu1%E5Ecvk_N6g47<2y^TbJ5%Xw{5gOPFtOCNfU$$+{#?bnE!8nUHLSGpon@|M zA426+QU|M^!tA{`*~{ zJ^}m4_<|V?5Q%qR7>!I$Bl3)*Ck%Rb>XBJ@z^rJi7EUQVM>Xo z(|_`Wr69JT1;s?v?8!9EC|rK312q^aiG)EZaxMg2vv~qvmQKuDR8Kj=;mit0H0sd7 z7T85hqXzX{dy!qz|C3Q?Rnd`K-ynel47B^qq_1V>C%`A8^%qo!_C6W53J&I5pv8Ln zBg&{I;W?9&tpdCByHk!@m5NAH`^XE($$uptx3Kh@Q@Mm}%lHJs<1Q__3Ox89$}SP9 z4V%fCs>c7`#cA#kRgK-ZM)f!Eipo;p%tfqy{@0w*Dv#H_DVyAE87@JG-x z5$lC$y!)+KL-$Pui5t3O(WWZ^Ii)&RxW$xJSiRjCxm6dIE0rlW@XOE(XdT3$XrzW5qT<``@Us&>n(?d#n){9 zMJPl&@H2q^ez&}@Ytg=ea#qLf*hNnHxFAQt00pxxW9W#Wd@NCv- zeAm_mpZhHcO0>4^O0j5F)tVqyC|#3Ch&!XUAS}k-Ze8UVmVsUs2JQ z)p#pU+vvcc+-trF=zTbRM#L($%n{JW88;( zw=UdKEYE4*1y#=GI|NzfVdEp~qbt*Z33#T~3NB1(S z-eE^4eR?lKqrfGBB=4YVL~`VYfbJVq*B(9g&0qFze;|80=reknRs3$l__A<#xr#g_ za9+@+s#y{1$t=fPGRb?s9xdh%dYoQev+1%imLvogt6+(0yC=FTovi!t^wH-~V$SAB ftai)wXM^#7^Hx)Y0(9g600000NkvXXu0mjfq%ZQ< literal 1045 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=hEVFnVW(M3hAM`dB6B=jtV<?;Zqle1Gx6p~WYGxKbf-tXS8q>!0ns}yePYv5bpoSKp8QB{;0T;&&% zT$P<{nWAKG$7NGt1vDTxwIorYA~z?m*s8)-32d$vkPQ;nS5g2gDap1~as*kZ5aAo3 z;GAESs$i;TrkiYNY@uLosb^?vX<=ldqhMrUXr^yqsc&eaYhY+)U}!BPbD zzk=sFD+UIpR!6#*-mlngTv_|`r=ZTEqB93H?i~DX(Yg4?+W9jMf0UZ` zFp}q>X-)IvA0oE3f)!l9H!7UJyQAy4fn2FY|Mr4yPM;zz8Zs;QHAzb}FWXYvxb+7k zSLU1+f1{s~dwM!6_<}#!^gZeIdwkVylK!#unSWH$9?k4A6y(0xS($P8N)W4*ab@wQ z{G;&fB&mJ92$>YRNddm~2Ga!7^Z^lO7EeXncA%%JmW#mMY<|?#&<*pNvdiD1B|M!3XbD4;^ z_OIif$|rKWRWEANk9jI#eHRz`_WoFXrcPXW@{1)(ZJp^wuNgV+9J2nwW&NR4URDIl`J$I2*{gl6Tu3vuN7gZ<;YnOJdX%GLx&W@Si(9l?VI^LEau$#QsxixJZ>GFe@AIX|O|0z}H_ncF5h4-7Lb6n) : unit +AENS.preclaim(owner : address, commitment_hash : hash, ) : unit ``` The [signature](./sophia_features.md#delegation-signature) should be a serialized structure containing `network id`, `owner address`, and `Contract.address`. -From Ceres (i.e. FATE VM version 3) the +The [signature](./sophia_features.md#delegation-signature) can also be generic (allowing _all_, existing and future, names to be delegated with one signature), i.e. containing `network id`, `owner address`, `Contract.address`. @@ -180,14 +157,14 @@ signature), i.e. containing `network id`, `owner address`, `Contract.address`. ##### claim ``` -AENSv2.claim(owner : address, name : string, salt : int, name_fee : int, ) : unit +AENS.claim(owner : address, name : string, salt : int, name_fee : int, ) : unit ``` The [signature](./sophia_features.md#delegation-signature) should be a serialized structure containing `network id`, `owner address`, and `Contract.address`. Using the private key of `owner address` for signing. -From Ceres (i.e. FATE VM version 3) the +The [signature](./sophia_features.md#delegation-signature) can also be generic (allowing _all_, existing and future, names to be delegated with one signature), i.e. containing `network id`, `owner address`, `name_hash`, and @@ -196,7 +173,7 @@ signature), i.e. containing `network id`, `owner address`, `name_hash`, and ##### transfer ``` -AENSv2.transfer(owner : address, new_owner : address, name : string, ) : unit +AENS.transfer(owner : address, new_owner : address, name : string, ) : unit ``` Transfers name to the new owner. @@ -205,7 +182,7 @@ The [signature](./sophia_features.md#delegation-signature) should be a serialized structure containing `network id`, `owner address`, and `Contract.address`. Using the private key of `owner address` for signing. -From Ceres (i.e. FATE VM version 3) the +The [signature](./sophia_features.md#delegation-signature) can also be generic (allowing _all_, existing and future, names to be delegated with one signature), i.e. containing `network id`, `owner address`, `name_hash`, and @@ -214,7 +191,7 @@ signature), i.e. containing `network id`, `owner address`, `name_hash`, and ##### revoke ``` -AENSv2.revoke(owner : address, name : string, ) : unit +AENS.revoke(owner : address, name : string, ) : unit ``` Revokes the name to extend the ownership time. @@ -223,7 +200,7 @@ The [signature](./sophia_features.md#delegation-signature) should be a serialized structure containing `network id`, `owner address`, and `Contract.address`. Using the private key of `owner address` for signing. -From Ceres (i.e. FATE VM version 3) the +The [signature](./sophia_features.md#delegation-signature) can also be generic (allowing _all_, existing and future, names to be delegated with one signature), i.e. containing `network id`, `owner address`, `name_hash`, and @@ -232,21 +209,21 @@ signature), i.e. containing `network id`, `owner address`, `name_hash`, and ##### update ``` -AENSv2.update(owner : address, name : string, expiry : option(Chain.ttl), client_ttl : option(int), - new_ptrs : option(map(string, AENSv2.pointee)), ) : unit +AENS.update(owner : address, name : string, expiry : option(Chain.ttl), client_ttl : option(int), + new_ptrs : option(map(string, AENS.pointee)), ) : unit ``` Updates the name. If the optional parameters are set to `None` that parameter will not be updated, for example if `None` is passed as `expiry` the expiry block of the name is not changed. -Note: Changed to consume `AENSv2.pointee` in v8.0 (Ceres protocol upgrade). +Note: Changed to consume `AENS.pointee` in v8.0 The [signature](./sophia_features.md#delegation-signature) should be a serialized structure containing `network id`, `owner address`, and `Contract.address`. Using the private key of `owner address` for signing. -From Ceres (i.e. FATE VM version 3) the +The [signature](./sophia_features.md#delegation-signature) can also be generic (allowing _all_, existing and future, names to be delegated with one signature), i.e. containing `network id`, `owner address`, `name_hash`, and @@ -289,10 +266,7 @@ namespace Chain = Auth.tx_hash : option(hash) ``` -Gets the transaction hash during authentication. Note: `Auth.tx_hash` -computation differs between protocol versions (changed in Ceres!), see -[serialisation](https://gitlab.com/ioecs/protocol/-/blob/master/serializations.md) -specification for details. +Gets the transaction hash during authentication. ### Bits @@ -934,23 +908,6 @@ Turns a list of pairs of form `(key, value)` into a map These need to be explicitly included (with `.aes` suffix) -### AENSCompat - -#### pointee\_to\_V2 -``` -AENSCompat.pointee_to_V2(p : AENS.pointee) : AENSv2.pointee -``` - -Translate old pointee format to new, this is always possible. - -#### pointee\_from\_V2 -``` -AENSCompat.pointee_from_V2(p2 : AENSv2.pointee) : option(AENS.pointee) -``` - -Translate new pointee format to old, `DataPt` can't be translated, so `None` is returned in this case. - - ### BLS12\_381 #### Types