Solidity - ERC20 Legal Verbiage

Where in the code and what is the proper way to add legal verbiage to my ERC20 Smart Contract?

I’ve seen a few samples where it gets saved on a variable and then that variable value is referenced in the body of a function using memory.


contract MyToken is ERC20, Ownable {   
    string public processNumber = "0041518-41.1982.8.26.0053";
    string public legalBinding = "a lot, a lot of verbiage would go here";

    constructor() ERC20("MyToken", "MTK") {
        _mint(msg.sender, 9000000 * 10 ** decimals());

    function mint(address to, uint256 amount) public onlyOwner {
        _mint(to, amount);
  function setProcessNumber (string memory v) public onlyOwner() {
    processNumber = v;

  function setLegalBinding (string memory v) public onlyOwner() {
    legalBinding = v;


What are those two last functions doing anyway does it ever get executed or just saved in memory?

Is that the correct practice?

Is there a better approach to this?

Where in the code do developers typically add that type of info?

If I’m to save a massive string of text containing all the legal verbiage on a variable, can I save those on a template literal using back-ticks to leverage multiple lines breaks inside the string and so forth?

The standard in general is to add legal verbiage to a README or LICENSE file on github.

The standard for smart contracts that will be deployed is to add legal verbiage to the top of your Smart Contract in the form of comments and a license identifier.

You should see many examples with the
// SPDX-License-Identifier: MIT at the top.
Here is a list of licenses.

I think I may be misunderstanding your question.
Why would you want this to be on the contract somewhere?
You could update it, but why not have it in a README or LICENSE file on github? Direct readers to the github’s readme or license file in your smart contract. That way you can update the README or LICENSE file on github instead of spending the gas on chain.

Usually the standard practice for any coding, not just smart contracts, is to have a reference at the top of your code file to the license or to the README/LICENSE.

Everyone has their own flavor of how they like to do things, but ultimately the goal is to make sure viewers of the code know there is a specific license behind it.

If you absolutely must have this in your Smart Contract, then I think the way you are doing it is “fine”? The two functions at the bottom allow you to change the Legal Statement and the Process number when you need to.

@Tsushima_Yoshiko Thank you for the insights - I understand the Readme pattern, but that file won’t get published to the Block chain once you verify the contract. Correct (?)

Is the License File also an .md file, and is it also something to be seeing on Github only?

If so, looks like I’m left with adding a comment section on top of my smart-contract containing the legal verbiage.