6 Sep 2023 |
| etomazzo#0 changed their display name from E-ToMaZZo to etomazzo#0. | 11:43:14 |
11 Sep 2023 |
| porkeypine#0 changed their display name from Porkey to porkeypine#0. | 22:30:43 |
13 Sep 2023 |
| b_s_z#0 changed their display name from B_S_Z#4449 to b_s_z#0. | 16:37:10 |
18 Sep 2023 |
| phynncastro#0 changed their display name from PhynnCastro#1223 to phynncastro#0. | 13:13:39 |
21 Sep 2023 |
| viraldecay#0 changed their display name from ViralDecay#7746 to viraldecay#0. | 01:05:27 |
| viraldecay#0 changed their profile picture. | 01:05:29 |
| h1o5#0 changed their display name from clustan#0 to h1o5#0. | 08:45:19 |
| h1o5#0 changed their profile picture. | 08:45:22 |
25 Sep 2023 |
| marengoeight#0 changed their display name from MARENGO EIGHT to marengoeight#0. | 05:38:05 |
27 Sep 2023 |
| .nostalgia_#0 changed their profile picture. | 16:40:04 |
28 Sep 2023 |
| sayerp#0 changed their display name from Sayerp to sayerp#0. | 00:29:54 |
| bitpiratex#0 changed their display name from sirakka#0 to bitpiratex#0. | 18:19:26 |
| bitpiratex#0 changed their profile picture. | 18:19:27 |
| mika_34_#0 changed their profile picture. | 19:54:22 |
3 Oct 2023 |
jQrgen ▽ | Is anyone testing NexScript? | 21:15:57 |
4 Oct 2023 |
Shomari | pragma nexscript >= 0.2.0;
contract TradingPost(
bytes32 tokenid,
bytes20 seller,
int rate,
bytes20 provider,
int fee,
) {
/**
* Cancel (Trade) Posting
*
* Sends all remaining assets back to the contract's owner (ie. the Seller).
*
* NOTE: For compliance purposes, both the Seller and the Provider have the
* ability to cancel a trade posting.
*
* ASSETS CAN ONLY BE SENT TO THE SELLER.
*
* @param executor
* @param signature
*/
function cancelPosting(pubkey executor, sig signature) {
/* Verify executor has provided a valid signature. */
require(checkSig(signature, executor));
/* Hash the executor's public key hash. */
bytes20 pubKeyHash = hash160(executor);
/* Verify the executor is an authorized contract participant. */
require(pubKeyHash == seller || pubKeyHash == provider);
/* Validate the 1st output is the Seller's `scriptPubKey`. */
int lockingBytecodeLen = tx.outputs[0].lockingBytecode.length;
bytes20 sellerBytecode = bytes20(tx.outputs[0].lockingBytecode.split(lockingBytecodeLen - 20)[1]);
require(seller == sellerBytecode);
/* Validate the 1st output is the Seller's asset. */
require(tx.outputs[0].tokenGroupId == tokenid);
/* Set (min/max) constants. */
int MIN_OUTPUTS = 1;
int MAX_OUTPUTS = 2;
/* Validate the 2nd (change) output IS NOT the Seller's asset. */
require(
(tx.outputs.length == MIN_OUTPUTS) ||
(tx.outputs.length == MAX_OUTPUTS && tx.outputs[1].tokenGroupId == 0x0)
);
}
/**
* Trade (Token) Asset
*
* Sends the buyer the requested amount of an asset for a rate set
* by the contract's owner (ie. the Seller).
*/
function tradeAsset() {
/* Parse and verify Seller's bytecode receives the $NEXA payout. */
int lockingBytecodeLen = tx.outputs[0].lockingBytecode.length;
bytes20 payoutBytecode = bytes20(tx.outputs[0].lockingBytecode.split(lockingBytecodeLen - 20)[1]);
require(payoutBytecode == seller);
/* Set amount of $NEXA Seller paid to posting. */
int sellerPayout = tx.outputs[0].value;
/* Calculate and verify Buyer's asset payout amount. */
int buyerPayout = sellerPayout / rate;
require(tx.outputs[1].tokenAmount >= buyerPayout);
/* Verify 2nd output is the Buyer's asset. */
require(tx.outputs[1].tokenGroupId == tokenid);
/* Calculate Provider commission amount (received). */
int commission = (sellerPayout * fee) / 100;
/* Validate and handle commission payout. */
if (commission > 0) {
/* Create Provider bytecode. */
bytes23 providerBytecode = new LockingBytecodeP2PKT(provider);
require(tx.outputs[2].lockingBytecode == providerBytecode);
/* Verify Provider payout amount. */
require(tx.outputs[2].value >= commission);
}
}
}
👆️ working on a semi-DEX contract now (does a one-way asset trade)
| 02:49:24 |
| jqrg joined the room. | 03:30:52 |
| jqrgen_#0 changed their display name from ▽ jQrgen ▽#5000 to jqrgen_#0. | 19:01:58 |
11 Oct 2023 |
| Wise Degentraschizo Sensei 🧙 changed their display name from decentralizd#0 to Wise Degentraschizo Sensei 🧙. | 05:34:22 |
| phynncastro#0 changed their profile picture. | 21:15:51 |
13 Oct 2023 |
| Dolaned - nexa.pool137.io changed their display name from dolaned#0 to Dolaned - nexa.pool137.io. | 11:59:30 |
15 Oct 2023 |
| PistolCrypt | wattpool.net changed their display name from pistolcrypt#0 to PistolCrypt | wattpool.net. | 19:40:06 |
| Griffith - nexa.pool137.io changed their display name from gimme_da_seed#0 to Griffith - nexa.pool137.io. | 20:54:57 |
17 Oct 2023 |
| b_s_z#0 changed their profile picture. | 15:51:18 |
18 Oct 2023 |
| cna#0374 changed their display name from cna to cna#0374. | 10:20:13 |
19 Oct 2023 |
| crypto0750#0 changed their display name from crypto to crypto0750#0. | 02:10:39 |
21 Oct 2023 |
| fusion-cro | 20:35:16 |
| jojogugi changed their display name from jojogugi#0 to jojogugi. | 20:36:09 |
| paulwebdev changed their display name from paulwebdev#0 to paulwebdev. | 20:51:22 |
6 Dec 2023 |
| Synth set a profile picture. | 21:35:05 |