Skip to content

Instantly share code, notes, and snippets.

View thor314's full-sized avatar

Thor 🪁 thor314

View GitHub Profile
Compiling near-sdk-core v2.0.0 (https://github.com/near/near-sdk-rs.git?tag=2.4.0#477056f1)
error[E0432]: unresolved import `syn::export`
--> /home/thor/.cargo/registry/src/github.com-1ecc6299db9ec823/borsh-schema-derive-internal-0.7.1/src/helpers.rs:2:10
|
2 | use syn::export::TokenStream2;
| ^^^^^^ could not find `export` in `syn`
error[E0432]: unresolved import `syn::export`
--> /home/thor/.cargo/registry/src/github.com-1ecc6299db9ec823/borsh-schema-derive-internal-0.7.1/src/enum_schema.rs:3:10
|

Questions regarding evgeny’s contract review

Factory

// TODO: may want to charge mintbase here, so you can refund it below

What’s this mean? I did a refactor, reminder to self to walk thru it on the call.

This works on a method not declared payable?

Promise::new(store_creator_id).transfer(env::attached_deposit() - self.store_cost);

Why does this trait exist twice?

https://github.com/Mintbase/mb-contracts/pull/29/commits/5282cc042ccf40e7d8012ec90cdc5918d9840c25#diff-904ee840186925bca41dc3f8d92b89e0752144be75c7bb4b9859496a27a7db10R166

Review:

public key

updated w public key. I think this means that the deployer of the factory can call near deploy <wasm_blob> <address of any store created by the factory>

pub fn new() -> Self {
  assert!(!env::state_exists());
  let storage_price_per_byte = 10_000_000_000_000_000_000; // 10^19
  Self {
    ...
//! Usage:
//!
//! Use `nft_move` to Burn tokens on this Contract and re-mint it on
//! another Contract.
use crate::{internal::loggers, *};
use near_sdk::{ext_contract, json_types::U64, near_bindgen};
use std::convert::TryInto;
#[ext_contract(ext_move)]
@thor314
thor314 / config.scm
Last active November 30, 2021 22:47
;; This is an operating system configuration template
;; for a "desktop" setup with GNOME and Xfce where the
;; root partition is encrypted with LUKS.
(use-modules (gnu) (gnu system nss))
(use-service-modules desktop xorg)
(use-package-modules certs gnome)
(operating-system
(host-name "tk0") ;; 0
@thor314
thor314 / guix.sh
Last active November 30, 2021 23:19
echo 'network={
ssid="Internet Robot"
key_mgmt=WPA-PSK
psk="im_sorry"
}' > wifi.conf
rfkill unblock all
ifconfig -a # wlan0
wpa_supplicant -c wifi.conf -i wlan0 -B # outputs some failures, but turns out unimportant
dhclient -v wlan0
ping gnu.com # get bytes, yay
# Bash initialization for interactive non-login shells and
# for remote shells (info "(bash) Bash Startup Files").
# Export 'SHELL' to child processes. Programs such as 'screen'
# honor it and otherwise use /bin/sh.
export SHELL
if [[ $- != *i* ]]
then
# We are being invoked from a non-interactive shell. If this
× display-manager.service - X11 Server
Loaded: loaded (/etc/systemd/system/display-manager.service; linked; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2021-12-22 12:35:50 WET; 1min 14s ago
Process: 1188 ExecStartPre=/nix/store/wd1p0dmsixyps2nswszmwsfl8l5ym3h1-unit-script-display-manager-pre-start/bin/display-manager-pre-start (code=exited, status=0/SUCCESS)
Process: 1190 ExecStart=/nix/store/hphsx5383075c6l7s4kvnkp9hmjww4gz-unit-script-display-manager-start/bin/display-manager-start (code=exited, status=1/FAILURE)
Main PID: 1190 (code=exited, status=1/FAILURE)
IP: 0B in, 0B out
CPU: 41ms
Dec 22 12:35:50 tk0 systemd[1]: display-manager.service: Scheduled restart job, restart counter is at 3.
{ config, pkgs, ... }: {
imports = [ # Include the results of the hardware scan.
./hardware-configuration.nix
];
boot.loader.systemd-boot.enable =
true; # Use the systemd-boot EFI boot loader.
boot.loader.efi.canTouchEfiVariables = true;
time.timeZone = "Europe/Lisbon"; # Set your time zone.
# NETWORKING
networking.hostName = "tk0"; # Define your hostname.