SmartTokenLabs / TokenScript

TokenScript schema, specs and paper
http://tokenscript.org
MIT License
242 stars 71 forks source link

factor in decimal as the property of the contract #401

Open SmartLayer opened 4 years ago

SmartLayer commented 4 years ago

The contract has to have the decimal property applied to many but not all attributes, instead of them being specified as as="e16"

Example scenario where as wouldn't solve the problem:

<ts:attribute name="pairedTokenAllowance">
    <ts:type>
        <ts:syntax>1.3.6.1.4.1.1466.115.121.1.27</ts:syntax>
    </ts:type>
    <ts:origins>
        <ethereum:call function="allowance" contract="pair">
            <ts:data>
                <ts:address ref="ownerAddress"></ts:address>
                <ts:address ref="CoFiXRouter"></ts:address>
            </ts:data>
        </ethereum:call>
    </ts:origins>
</ts:attribute>

It's also important to be able to specify decimal in TS instead of through reference to the contract decimals public method since many contracts don't implement it, such as CoFiXPair.sol