1. 20 Sep, 2021 1 commit
    • Robin Freyler's avatar
      Make #[ink(selector = ..)] take a u32 parameter instead of a string (#928) · c9a97bbe
      Robin Freyler authored
      * make #[ink(selector = ..)] take an integer instead of a string
      
      Also warn about deprecation if a user still uses the old string parameter.
      
      * update tests for new selector int parameter
      
      * update contract examples for new selector int parameter
      
      * remove unused regex dependency from ink_lang_ir
      
      Also remove unnecessary regex dependency from ink_lang_codegen
      
      * update README for new selector int parameter
      
      Also update namespace parameter description.
      
      * update preliminary release notes
      
      * update spellcheck dict
      c9a97bbe
  2. 11 Aug, 2021 1 commit
  3. 05 Aug, 2021 1 commit
    • Michael Müller's avatar
      Run clippy with `--all-targets` (#884) · 4b909706
      Michael Müller authored
      * Add clippy flag `--all-targets`
      
      * Fix `redundant_closure`
      
      * Fix `redundant_clone`
      
      * Fix `clone_on_copy`
      
      * Fix `needless_borrow`
      
      * Fix `bool_assert_comparison`
      
      * Fix `len_zero`
      
      * Fix `stable_sort_primitive`
      
      * Forward feature
      
      * Allow `type_complexity`
      
      * Fix `unnecessary_mut_passed`
      
      * Fix `manual_map`
      
      * Fix `match_like_matches_macro`
      
      * Remove duplicate test
      
      * Fix `new_without_default`
      
      * Fix `match_ref_pats`
      
      * Allow clippy rules for  tests
      
      * Fix `unit_arg`
      
      * Apply `cargo fmt`
      
      * Add explanatory comments
      
      * Remove `--all-targets` for Wasm tests
      
      * Fix `or_fun_call`
      
      * Fix `bool_comparison`
      
      * Fix `needless_collect`
      
      * Revert "Forward feature"
      
      This reverts commit 472c50ed.
      
      * Fix `bool_assert_comparison`
      
      * Deactivate test because of feature issue with dev-dependencies
      
      * Add flag
      
      * Fix `unique_topics` tests
      
      * Allow `clippy:bool_assert_comparison`
      
      * Revert "Fix `bool_assert_comparison`"
      
      This reverts commit bceb2dc2.
      
      * Revert "Fix `bool_comparison`"
      
      This reverts commit 02960f98.
      
      * Fix flags positioning
      
      * Add comment for clarification
      
      * Fix comparison
      
      * Do not check all targets for target = wasm32
      
      * Adapt `check-workspace.sh` with clippy flag
      
      * Add clarification comment
      
      * Ignore test
      
      * Revert `CLIPPY_FLAGS` hack
      
      * Link ink! issue
      
      * Fix `assert`'s
      
      * Fix `assert`'s
      4b909706
  4. 13 Jul, 2021 1 commit
  5. 08 Jul, 2021 1 commit
    • Hernando Castano's avatar
      ERC-1155 Example (#800) · afc48714
      Hernando Castano authored
      
      
      * Add basic contract skeleton
      
      * Add dummy ERC-1155 trait implementations
      
      * Implement `balance_of` method
      
      * First attempt at `balance_of_batch` implementation
      
      I'm not sure if the output format is correct, need to read the docs
      more closely
      
      * Implement simple token transfer
      
      * Flatten balances BTreeMap
      
      * Clean up account usage in tests
      
      * Implement approval mechanism
      
      * Fix bug when sending tokens to an account with zero balance
      
      * Check approvals before sending tokens
      
      * Suppress warnings
      
      * Appease Clippy
      
      * Add crude support for token transfers to smart contracts
      
      * Simplify check for smart contract-ness
      
      * Handle receiving tokens as a smart contract
      
      * Implement `safe_transfer_from` method
      
      * Only do approval and recipient checks during in batch transfers
      
      * I was wrong about the compiler's cleverness...
      
      * Add documentation about interface
      
      * Make better use of some imports
      
      * Disallow owners from approving themselves for token tranfers
      
      * Allow creating and minting tokens
      
      * Derive default for storage struct
      
      * Add note on on-chain panic
      
      * Remove `with_balances` constructor
      
      It wasn't ERC-1155 compliant (no transfer events emitted) and it
      also leaked the internal structure of how balances were tracked.
      
      * RustFmt with Nightly
      
      Not sure I like some of the decisions though...
      
      * Tag on_received messages with selectors
      
      * Add missing event
      
      * Index topics in events
      
      * Remove note on BTreeSet usage
      
      Can't figure out how to get tests to compile with it.
      
      * Stop panicking on cross-contract call error
      
      However, this is only because I have no feedback on why this call
      is actually failing. This behaviour should be added back.
      
      * Nightly RustFmt
      
      * Fix RustDoc links
      
      * Remove inline questions
      
      * Remove unused `data` argument from `create/mint`
      
      * Rename magic value contants
      
      * Remove data argument from `mint/create` tests
      
      * Use entry API when decreasing account balance
      
      * Extract approvals pairs into struct
      
      This is better in terms of type safety and ease of use
      
      * Improve some of the panic messages
      
      * Cache calls to `self.env().caller()`
      
      * Allow `TransferSingle` events to contain Optional addresses
      
      This slightly deviates from the spec which says we should use the `0x00`
      address during certain operations, but this is more idiomatic Rust.
      
      * Add logging around calls to `onERC1155Received`
      
      * Improve debug message when receiving cross-contract results
      
      * Move warning lints to specific lines of code
      
      * Format code
      
      * Remove backticks from URLs
      Co-authored-by: Michael Müller's avatarMichael Müller <michi@parity.io>
      
      * Fix comment wording/typo
      
      * Add expected panic messages to tests
      
      * Move imports related to x-contract calls closer to use site
      
      * Change selector bytes to hex for the humans
      
      * Remove incorrect comment about off-chain environment testing
      
      * Add documentation for `TokenId`
      
      This will make sure that it doesn't show up as `u128` in
      the generated docs.
      
      * Nightly RustFmt
      
      * Uppercase selector bytes
      
      * Don't repeat `erc_1155` in `Erc1155TokenReceiver` methods
      
      * Nightly RustFmt
      
      * Appease the spellchecker
      
      * Use Environment typedef
      
      * Allow tests to run in stable and experimental off-chain envs
      
      * Add explanation as to why we don't accept tokens
      
      * Return `Result` when minting tokens
      
      * Allow (most) errors to be handled gracefully by caller
      
      * Nightly RustFmt
      
      * Add shorthand zero-address to allowed spelling list
      
      * Run tests with `--features ink-experimental-engine` in CI
      
      * Perform batch balance checks before trying to transfer tokens
      
      * Move smart contract transfer checks to their own helper function
      
      * Appease Clippy
      
      * Make `ensure` macro definition more explicit
      Co-authored-by: default avatarRobin Freyler <robin.freyler@gmail.com>
      
      * Iterate over values instead of references
      Co-authored-by: default avatarRobin Freyler <robin.freyler@gmail.com>
      
      * Iterate over references again
      
      * Return a value from `on_batch_received`
      
      * Don't collect into intermediate Vec
      
      * Wrap 0x00 in code blocks
      
      This way the spellchecker will ignore it and we
      can avoid adding it to our dictionary.
      Co-authored-by: Michael Müller's avatarMichael Müller <michi@parity.io>
      Co-authored-by: default avatarRobin Freyler <robin.freyler@gmail.com>
      afc48714