Socket
Socket
Sign inDemoInstall

fmg-core

Package Overview
Dependencies
316
Maintainers
3
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    fmg-core

Force-move games core


Version published
Weekly downloads
27
increased by285.71%
Maintainers
3
Created
Weekly downloads
 

Readme

Source

Force-move Games: Core

This package contains the contracts and js libraries for the core of the force-move games framework.

The core provides the format of the states that are exchanged and the rules that govern the interpretation of these states.

Test contracts

Some contracts we use are libraries -- namely, State, Rules, and CountingState (in testing). Libraries are meant to be included in contracts, and not called externally. For reference, see some remarks by the Solidity team.

In spite of this, Solidity compiles library contracts that return structs, and produces a proper abi for external/pure functions. (It does not, however, produce a proper abi when an enum is used in a library.)

struct Foo {
    uint256 bar;
    uint256 baz;
}
// an invalid function in a library. Solidity produces the correct abi
function(Foo memory foo) public pure return s(uint, uint) {
    return (foo.bar, foo.baz);
}

contract SampleContract {
    enum Foo {Bar, Baz};
    // an invalid function in a library. Solidity produces the incorrect abi, which has
    // the type "SampleContract.Foo" as the type of the input `foo`.
    function(Foo foo) public pure returns (uint8) {
        return uint8(foo);
    }
}

However, external calls to these functions raise a runtime error. Therefore, to test a library SomeLibrary function foo, we define a test contract that imports Library.sol, and delegates foo to Library.

FAQs

Last updated on 27 Jun 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc