Bot Controller Smart Contract

in #steem-engine4 years ago

{"id":"ssc-mainnet1","json":{"contractName":"contract","contractAction":"deploy","contractPayload":{"name":"botcontroller","params":"","code":"Y29uc3QgVVRJTElUWV9UT0tFTl9TWU1CT0w9IkVORyIsQkFTRV9TWU1CT0w9IlNURUVNUCIsQkFTRV9TWU1CT0xfUFJFQ0lTSU9OPTgsQ0hBSU5fVFlQRT0iU1RFRU0iO2FjdGlvbnMuY3JlYXRlU1NDPWFzeW5jKCk9PntpZighMT09PWF3YWl0IGFwaS5kYi50YWJsZUV4aXN0cygidXNlcnMiKSl7YXdhaXQgYXBpLmRiLmNyZWF0ZVRhYmxlKCJ1c2VycyIsWyJhY2NvdW50IiwibGFzdFRpY2tCbG9jayJdKSxhd2FpdCBhcGkuZGIuY3JlYXRlVGFibGUoIm1hcmtldHMiLFsiYWNjb3VudCIsInN5bWJvbCJdKSxhd2FpdCBhcGkuZGIuY3JlYXRlVGFibGUoInBhcmFtcyIpO2NvbnN0IHBhcmFtcz17YmFzaWNGZWU6IjEwMCIsYmFzaWNTZXR0aW5nc0ZlZToiMSIscHJlbWl1bUZlZToiMTAwIixwcmVtaXVtQmFzZVN0YWtlOiIxMDAwIixzdGFrZVBlck1hcmtldDoiMjAwIixiYXNpY0R1cmF0aW9uQmxvY2tzOjQwMzIwMCxiYXNpY0Nvb2xkb3duQmxvY2tzOjQwMzIwMCxiYXNpY01pblRpY2tJbnRlcnZhbEJsb2NrczoyMDAscHJlbWl1bU1pblRpY2tJbnRlcnZhbEJsb2NrczoxMDAsYmFzaWNNYXhUaWNrc1BlckJsb2NrOjIwLHByZW1pdW1NYXhUaWNrc1BlckJsb2NrOjMwfTthd2FpdCBhcGkuZGIuaW5zZXJ0KCJwYXJhbXMiLHBhcmFtcyl9fSxhY3Rpb25zLnVwZGF0ZVBhcmFtcz1hc3luYyBwYXlsb2FkPT57aWYoYXBpLnNlbmRlciE9PWFwaS5vd25lcilyZXR1cm47Y29uc3R7YmFzaWNGZWU6YmF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