Skip to content

Latest commit

 

History

History
89 lines (60 loc) · 8.9 KB

MandatoryDeBotFunctions.md

File metadata and controls

89 lines (60 loc) · 8.9 KB

Description

Document describes the functions that every Debot should have.

Functions

getDebotInfo - return information about debot

returns:

dabi: bytes - string with DeBot ABI

name: bytes - utf-8 string with name of debot, e.g. "DePool"

version: bytes - SemVer version of debot, e.g. "0.0.1"

publisher: bytes - utf-8 string with info about who has deployed debot to blokchain, e.g. "TON Labs"

caption: bytes - (10-20 ch.) utf-8 string with short description, e.g. "Work with DePools"

author: bytes - utf-8 string with name of author of DeBot, e.g. "Ivan Ivanov".

support: address - Free TON address of author for questions and donations

hello: bytes - utf-8 string with first messsage with DeBot description, e.g. "Hello, I'm a FreeTON Debot Kapellmeister. I know everything about DePools. Let's start." 

language: bytes - (ISO-639) utf-8 string with debot interface language, e.g. "en"

icon: bytes - utf8-string with encoded PNG image (144x144 px). The string format is "data:image/png;base64,<image>", where `image` - image bytes encoded in base64. See example below.

legalNotes: LegalNote[] - optional, list of legal notes. Every note is a pair of name and link.

LegalNote {
    name: bytes - utf-8 string with the name of legal note.
    link: bytes - utf-8 string with the url of legal note.
}

sourceCode: bytes - optional, utf-8 string with the url to DeBot's source code.

getRequiredInterfaces - returns array of interfaces used by debot. Debot Browser should check if it supports all interfaces from this array. If anyone is not supported debot should not be started.

returns:

interfaces: uint256[] - array of interface ids

Declaration in Solidity

    // Base contract for all debots
    abstract contract Debot {

        struct LegalNote {
            string name;
            string link;
        }

        function getRequiredInterfaces() virtual returns (uint256[] interfaces); 

        function getDebotInfo() virtual returns (
            string dabi, string name, string version, string publisher, string caption, string author, address support, 
            string hello, string language, string icon, LegalNote[] legalNotes, string sourceCode);
    }
    
    contract DebotA is Debot {
        
        function getRequiredInterfaces() override returns (uint256[] interfaces) {
            return [ID_TERMINAL, ID_MENU, ...];
        }

        function getDebotInfo() override returns (string dabi, string name, string version, string publisher, string caption, string author, address support, string hello, string language, string icon, LegalNote[] legalNotes, string sourceCode) {
            dabi = m_debotAbi.get();
            name = "Depool Debot";
            version = "0.1.0";
            publisher = "TON Labs";
            caption = "Works with DePools";
            author = "Ivan Ivanov";
            support = address.makeAddrStd(0, 0x841288ed3b55d9cdafa806807f02a0ae0c169aa5edfe88a789a6482429756a94);
            hello = "Hello, I'm a FreeTON Debot Kapellmeister. I know everything about DePools. Let's start.";
            language = "en";
            icon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA/8SURBVHgB7Z1vbBPnGcCf9xzqJLYTt4Q0tNC636qB1LRIHdAPNUwb0A9r2Eah7SqgK+u+rMCqTutUDaj6YVW1Au3Urf9GsnZaoZtIug9QTSvmQwudtBFUqDoJVHfphNMQMCwQh8V+9z4XH9jnO/vOvju/7937k6LE9tnxn5+f53mf9707ApIy4vGeROg60ksJ3EoAbqOUdBJCE+ymRHGThIWHSbP7Zin+UJIGKHxBgAzn6XQ6OzY2DD6CQIBRZZkFSVBIL3sj7mUfdgIIjYP7pNjP8XyeDsJ0bjjLAEEJlEAojBIm9wNVhenzSBYrpKBA+/MhOJzNZNIgEL4XKN7Vk1QU5V6F0D6WUnqBfwaBwsD4V2cGQQB8KVCcoVzXvpnVLhvAWs3CI2kWlbbzHpV8JVC8e25fiMBm9mcS/EOa1Wb9BaUwwKNIwgt0NdoAbOGopnGDNEvBu8+NntkFHCGsQAESR0+atQW2jI+ODgEHCCdQgMUph6W1vFLY0ey0JoxAUhxD0nlCNzKJUtAkQiAAs+f0bFBmzfojIdi7gVaQaMQVIBvaIh0weem/h6EJcB2B4j2sU0zJHvDXqMotUsVolAYP4VagG7pv2ibTlW0wpS3zUiLuBMKo00LJfkG6xjySVgrTq8c8mrRVgCNuuHHu5lBBOSblaYhEQWk5xL6ISfAALiIQjrBC4TasdfpA4hxsKmc8kxkAF2m6QPE5N/eGlMJ+EHfOimuKNVEKXKKp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zJuH50cxR8ABuUpgRMq3ZZld+anJHPet66oVrgTRm9/RsYF+t9TK1GTOTsuijTjYIrSKEQBoYkWgBNrDUth4kGp5HnVKEEkgD+0eseEsGOyrRFJuc3nG2xtEz3EZIgUoJnkx8iKMhvECl+FsmvsTR8JVApcQZoevakuyN76OE3CviSA7PFEAIHWA/g7yJo+FbgfTE59zcGwrle1l79n7WK+F2T9qZ00sUBhUFBqZzueFmFcdWCYxAelShSCHB3oEk+9juoFTpbd6etXggS3Kc50hjRmAF0sOEwl+qVBQodsBvZTVHAtRIRRLgCDQ9E2HoMGtFDCuEHhchylRDCmQBVpzjr0RLMe1R7XfBJA0S1tgjVN0fmr3B6WlchZnLZUUWRSJxhf8DDsVZG6yx9UAAAAAASUVORK5CYII=";
            legalNotes = [ LegalNote("Terms and conditions", "https://github.com/tonlabs/debots/TermsAndConditions.md") ];
            sourceCode = "https://github.com/tonlabs/debots/main/helloworld";
        }
    }

Declaration in C++

TODO: Add declaration