Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fmg-core

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fmg-core

Force-move games core

  • 0.5.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
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 {
    uint bar;
    uint 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

Package last updated on 26 Feb 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc