Skip to content

Instantly share code, notes, and snippets.

View wighawag's full-sized avatar

Ronan Sandford wighawag

View GitHub Profile
@wighawag
wighawag / machine.js
Last active June 20, 2020 13:37
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'wallet',
type: "parallel",
context: {
address: undefined,
},
states: {
builtin: {
initial: 'unknown',
@wighawag
wighawag / machine.js
Created June 20, 2020 17:01
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'planet',
initial: 'unknown',
states: {
unknown: {
on: {
PROBE: 'probing',
},
},
probing: {
@wighawag
wighawag / machine.js
Last active June 21, 2020 09:30
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@wighawag
wighawag / machine.js
Created June 22, 2020 11:28
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@wighawag
wighawag / machine.js
Last active June 22, 2020 15:49
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'wallet',
type: "parallel",
context: {
address: undefined,
},
states: {
builtin: {
initial: 'unknown',
@wighawag
wighawag / machine.js
Last active June 22, 2020 22:07
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'wallet',
type: "parallel",
context: {
address: undefined,
vendor: undefined,
},
states: {
builtin: {
@wighawag
wighawag / machine.js
Last active June 22, 2020 22:20
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'planet',
initial: 'unknown',
on :{
PROBE: {
target: '.probing',
in: 'unknown',
},
RETRY: {
target: '.probing',
@wighawag
wighawag / machine.js
Last active June 22, 2020 22:32
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'planet',
initial: 'idle',
context: {
error: undefined
},
on: {
PROBE: {
target: '.probing',
in: 'idle',
{
"language": "Solidity",
"sources": {
"src/contracts_common/src/BaseWithStorage/Admin.sol": {
"content": "pragma solidity ^0.6.0;\n\n\ncontract Admin {\n address internal _admin;\n\n /// @dev emitted when the contract administrator is changed.\n /// @param oldAdmin address of the previous administrator.\n /// @param newAdmin address of the new administrator.\n event AdminChanged(address oldAdmin, address newAdmin);\n\n /// @dev gives the current administrator of this contract.\n /// @return the current administrator of this contract.\n function getAdmin() external view returns (address) {\n return _admin;\n }\n\n /// @dev change the administrator to be `newAdmin`.\n /// @param newAdmin address of the new administrator.\n function changeAdmin(address newAdmin) external {\n require(msg.sender == _admin, \"only admin can change admin\");\n emit AdminChanged(_admin, newAdmin);\n _admin = newAdmin;\n }\n\n modifier onlyAdmin() {\n
{
"language": "Solidity",
"sources": {
"src/AContract.sol": {
"content": "pragma solidity 0.6.5;\r\n\r\nimport \"./ALibrary.sol\";\r\n\r\ncontract AContract {\r\n using ALibrary for uint256;\r\n\r\n function times4(uint256 t) external pure returns (uint256) {\r\n return t.twice().twice();\r\n }\r\n}\r\n"
},
"src/ALibrary.sol": {
"content": "pragma solidity 0.6.5;\r\n\r\nlibrary ALibrary {\r\n function twice(uint256 t) external pure returns (uint256) {\r\n return t * 2;\r\n }\r\n}\r\n"
},
"src/diamon_test/ActionFacet.sol": {