Bot Controller Smart Contract
{"id":"ssc-mainnet1","json":{"contractName":"contract","contractAction":"update","contractPayload":{"name":"botcontroller","params":"","code":"Y29uc3QgVVRJTElUWV9UT0tFTl9TWU1CT0w9IkVORyIsQkFTRV9TWU1CT0w9IlNURUVNUCIsQkFTRV9TWU1CT0xfUFJFQ0lTSU9OPTgsQ0hBSU5fVFlQRT0iU1RFRU0iO2FjdGlvbnMudXBkYXRlUGFyYW1zPWFzeW5jIHBheWxvYWQ9PntpZihhcGkuc2VuZGVyIT09YXBpLm93bmVyKXJldHVybjtjb25zdHtiYXNpY0ZlZTpiYXNpY0ZlZSxiYXNpY1NldHRpbmdzRmVlOmJhc2ljU2V0dGluZ3NGZWUscHJlbWl1bUZlZTpwcmVtaXVtRmVlLHByZW1pdW1CYXNlU3Rha2U6cHJlbWl1bUJhc2VTdGFrZSxzdGFrZVBlck1hcmtldDpzdGFrZVBlck1hcmtldCxiYXNpY0R1cmF0aW9uQmxvY2tzOmJhc2ljRHVyYXRpb25CbG9ja3MsYmFzaWNDb29sZG93bkJsb2NrczpiYXNpY0Nvb2xkb3duQmxvY2tzLGJhc2ljTWluVGlja0ludGVydmFsQmxvY2tzOmJhc2ljTWluVGlja0ludGVydmFsQmxvY2tzLHByZW1pdW1NaW5UaWNrSW50ZXJ2YWxCbG9ja3M6cHJlbWl1bU1pblRpY2tJbnRlcnZhbEJsb2NrcyxiYXNpY01heFRpY2tzUGVyQmxvY2s6YmFzaWNNYXhUaWNrc1BlckJsb2NrLHByZW1pdW1NYXhUaWNrc1BlckJsb2NrOnByZW1pdW1NYXhUaWNrc1BlckJsb2NrfT1wYXlsb2FkLHBhcmFtcz1hd2FpdCBhcGkuZGIuZmluZE9uZSgicGFyYW1zIix7fSk7YmFzaWNGZWUmJiJzdHJpbmciPT10eXBlb2YgYmFzaWNGZWUmJiFhcGkuQmlnTnVtYmVyKGJhc2ljRmVlKS5pc05hTigpJiZhcGkuQmlnTnVtYmVyKGJhc2ljRmVlKS5ndGUoM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