diff --git a/README.md b/README.md index 80b29a9..ba3813f 100644 --- a/README.md +++ b/README.md @@ -91,18 +91,59 @@ Then: ```shell export DEPLOY_PRIVATE_KEY= export JSON_RPC_POLYGON= -forge create --rpc-url $JSON_RPC_POLYGON --private-key $DEPLOY_PRIVATE_KEY contracts/TermsOfService.sol:TermsOfService +export POLYGONSCAN_API_KEY= +forge create \ + --rpc-url $JSON_RPC_POLYGON \ + --private-key $DEPLOY_PRIVATE_KEY \ + --etherscan-api-key $POLYGONSCAN_API_KEY \ + --verify \ + src/TermsOfService.sol:TermsOfService +``` + +#### PolygonScan verification failures with Forge + +Save the address. Because Polygonscan is a hard mistress and tends to crash, verify manually: + +```shell +export CONTRACT_ADDRESS=0xDCD7C644a6AA72eb2f86781175b18ADc30Aa4f4d. +scripts/verify-deployment.sh ``` ### Initialising -The following placeholder terms of service message is used. +[The INITIAL_ACCEPTANCE_MESSAGE placeholder terms of service message](./terms_of_service/acceptance_message.py) is used. + +Get the hash of the message: + +```shell +ipython ``` +```python +from terms_of_service.acceptance_message import INITIAL_ACCEPTANCE_MESSAGE, get_signing_hash +print(get_signing_hash(INITIAL_ACCEPTANCE_MESSAGE).hex()) +``` + +```shell +export ACCEPTANCE_MESSAGE_HASH=808318f1c18ddfb861cd9755fe5005e3028f816039dc42a1b52e4f5031b645a4 +export TERMS_OF_SERVICE_VERSION=1 +``` + +Then set the initial version: + +```shell +cast send \ + --private-key $DEPLOY_PRIVATE_KEY \ + --rpc-url $JSON_RPC_POLYGON \ + "updateTermsOfService(uint16 version, bytes32 acceptanceMessageHash)" \ + $TERMS_OF_SERVICE_VERSION \ + $ACCEPTANCE_MESSAGE_HASH ``` +## Deployment +A test deployment can be found on Polygon [](). ## More information diff --git a/abi/TermsOfService.json b/abi/TermsOfService.json new file mode 100644 index 0000000..d68f0c5 --- /dev/null +++ b/abi/TermsOfService.json @@ -0,0 +1 @@ +{"abi":[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"signer","type":"address"},{"indexed":false,"internalType":"uint16","name":"version","type":"uint16"},{"indexed":false,"internalType":"bytes32","name":"hash","type":"bytes32"},{"indexed":false,"internalType":"bytes","name":"metadata","type":"bytes"}],"name":"Signed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"version","type":"uint16"},{"indexed":false,"internalType":"bytes32","name":"acceptanceMessageHash","type":"bytes32"}],"name":"UpdateTermsOfService","type":"event"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"acceptanceMessageHash","type":"bytes32"}],"name":"acceptances","outputs":[{"internalType":"bool","name":"accepted","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canProceed","outputs":[{"internalType":"bool","name":"accepted","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"version","type":"uint16"}],"name":"getTextHash","outputs":[{"internalType":"bytes32","name":"hash","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"acceptanceMessageHash","type":"bytes32"}],"name":"hasAcceptedHash","outputs":[{"internalType":"bool","name":"accepted","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint16","name":"version","type":"uint16"}],"name":"hasAcceptedVersion","outputs":[{"internalType":"bool","name":"accepted","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestAcceptanceMessageHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestTermsOfServiceVersion","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"signer","type":"address"},{"internalType":"bytes32","name":"hash","type":"bytes32"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"metadata","type":"bytes"}],"name":"signTermsOfServiceBehalf","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"hash","type":"bytes32"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"metadata","type":"bytes"}],"name":"signTermsOfServiceOwn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"version","type":"uint16"},{"internalType":"bytes32","name":"acceptanceMessageHash","type":"bytes32"}],"name":"updateTermsOfService","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"version","type":"uint16"}],"name":"versions","outputs":[{"internalType":"bytes32","name":"acceptanceMessageHash","type":"bytes32"}],"stateMutability":"view","type":"function"}],"ast":{"ast_type":"SourceUnit","children":[{"ast_type":"PragmaDirective","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":23,"start":37}},{"ast_type":"ImportDirective","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":42,"start":62}},{"ast_type":"ImportDirective","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":63,"start":202}},{"ast_type":"ContractDefinition","children":[{"ast_type":"InheritanceSpecifier","children":[{"ast_type":"IdentifierPath","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"Ownable","src":{"contract_id":8,"jump_code":"","length":7,"start":417}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":7,"start":417}},{"ast_type":"StructuredDocumentation","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":122,"start":267}},{"ast_type":"UsingForDirective","children":[{"ast_type":"IdentifierPath","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"SignatureChecker","src":{"contract_id":8,"jump_code":"","length":16,"start":438}},{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"address","src":{"contract_id":8,"jump_code":"","length":7,"start":459}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":35,"start":432}},{"ast_type":"VariableDeclaration","children":[{"ast_type":"Mapping","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"address","src":{"contract_id":8,"jump_code":"","length":7,"start":742}},{"ast_type":"Mapping","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"bytes32","src":{"contract_id":8,"jump_code":"","length":7,"start":769}},{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"bool","src":{"contract_id":8,"jump_code":"","length":4,"start":802}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":55,"start":761}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":83,"start":734}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"acceptances","src":{"contract_id":8,"jump_code":"","length":102,"start":734}},{"ast_type":"VariableDeclaration","children":[{"ast_type":"Mapping","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"uint16","src":{"contract_id":8,"jump_code":"","length":6,"start":900}},{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"bytes32","src":{"contract_id":8,"jump_code":"","length":7,"start":918}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":56,"start":892}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"versions","src":{"contract_id":8,"jump_code":"","length":72,"start":892}},{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"bytes32","src":{"contract_id":8,"jump_code":"","length":7,"start":971}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"latestAcceptanceMessageHash","src":{"contract_id":8,"jump_code":"","length":42,"start":971}},{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"uint16","src":{"contract_id":8,"jump_code":"","length":6,"start":1138}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"latestTermsOfServiceVersion","src":{"contract_id":8,"jump_code":"","length":41,"start":1138}},{"ast_type":"EventDefinition","children":[{"ast_type":"ParameterList","children":[{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"uint16","src":{"contract_id":8,"jump_code":"","length":6,"start":1255}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"version","src":{"contract_id":8,"jump_code":"","length":14,"start":1255}},{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"bytes32","src":{"contract_id":8,"jump_code":"","length":7,"start":1271}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"acceptanceMessageHash","src":{"contract_id":8,"jump_code":"","length":29,"start":1271}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":47,"start":1254}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"UpdateTermsOfService","src":{"contract_id":8,"jump_code":"","length":74,"start":1228}},{"ast_type":"EventDefinition","children":[{"ast_type":"ParameterList","children":[{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"address","src":{"contract_id":8,"jump_code":"","length":7,"start":1321}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"signer","src":{"contract_id":8,"jump_code":"","length":14,"start":1321}},{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"uint16","src":{"contract_id":8,"jump_code":"","length":6,"start":1337}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"version","src":{"contract_id":8,"jump_code":"","length":14,"start":1337}},{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"bytes32","src":{"contract_id":8,"jump_code":"","length":7,"start":1353}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"hash","src":{"contract_id":8,"jump_code":"","length":12,"start":1353}},{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"bytes","src":{"contract_id":8,"jump_code":"","length":5,"start":1367}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"metadata","src":{"contract_id":8,"jump_code":"","length":14,"start":1367}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":62,"start":1320}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"Signed","src":{"contract_id":8,"jump_code":"","length":75,"start":1308}},{"ast_type":"FunctionDefinition","children":[{"ast_type":"Block","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":7,"start":1413}},{"ast_type":"ModifierInvocation","children":[{"ast_type":"IdentifierPath","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"Ownable","src":{"contract_id":8,"jump_code":"","length":7,"start":1403}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":9,"start":1403}},{"ast_type":"ParameterList","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":2,"start":1400}},{"ast_type":"ParameterList","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","start":1413}}],"classification":1,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"","src":{"contract_id":8,"jump_code":"","length":31,"start":1389}},{"ast_type":"FunctionDefinition","children":[{"ast_type":"Block","children":[{"ast_type":"Return","children":[{"ast_type":"IndexAccess","children":[{"ast_type":"IndexAccess","children":[{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"acceptances","src":{"contract_id":8,"jump_code":"","length":11,"start":1552}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"account","src":{"contract_id":8,"jump_code":"","length":7,"start":1564}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":20,"start":1552}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"acceptanceMessageHash","src":{"contract_id":8,"jump_code":"","length":21,"start":1573}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":43,"start":1552}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":50,"start":1545}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":67,"start":1535}},{"ast_type":"ParameterList","children":[{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"address","src":{"contract_id":8,"jump_code":"","length":7,"start":1451}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"account","src":{"contract_id":8,"jump_code":"","length":15,"start":1451}},{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"bytes32","src":{"contract_id":8,"jump_code":"","length":7,"start":1468}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"acceptanceMessageHash","src":{"contract_id":8,"jump_code":"","length":29,"start":1468}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":48,"start":1450}},{"ast_type":"ParameterList","children":[{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"bool","src":{"contract_id":8,"jump_code":"","length":4,"start":1520}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"accepted","src":{"contract_id":8,"jump_code":"","length":13,"start":1520}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":15,"start":1519}}],"classification":1,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"hasAcceptedHash","src":{"contract_id":8,"jump_code":"","length":176,"start":1426}},{"ast_type":"FunctionDefinition","children":[{"ast_type":"Block","children":[{"ast_type":"Return","children":[{"ast_type":"IndexAccess","children":[{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"versions","src":{"contract_id":8,"jump_code":"","length":8,"start":1697}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"version","src":{"contract_id":8,"jump_code":"","length":7,"start":1706}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":17,"start":1697}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":24,"start":1690}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":41,"start":1680}},{"ast_type":"ParameterList","children":[{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"uint16","src":{"contract_id":8,"jump_code":"","length":6,"start":1629}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"version","src":{"contract_id":8,"jump_code":"","length":14,"start":1629}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":16,"start":1628}},{"ast_type":"ParameterList","children":[{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"bytes32","src":{"contract_id":8,"jump_code":"","length":7,"start":1666}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"hash","src":{"contract_id":8,"jump_code":"","length":12,"start":1666}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":14,"start":1665}}],"classification":1,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"getTextHash","src":{"contract_id":8,"jump_code":"","length":113,"start":1608}},{"ast_type":"FunctionDefinition","children":[{"ast_type":"Block","children":[{"ast_type":"VariableDeclarationStatement","children":[{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"bytes32","src":{"contract_id":8,"jump_code":"","length":7,"start":1834}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"hash","src":{"contract_id":8,"jump_code":"","length":12,"start":1834}},{"ast_type":"IndexAccess","children":[{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"versions","src":{"contract_id":8,"jump_code":"","length":8,"start":1849}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"version","src":{"contract_id":8,"jump_code":"","length":7,"start":1858}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":17,"start":1849}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":32,"start":1834}},{"ast_type":"ExpressionStatement","children":[{"ast_type":"FunctionCall","children":[{"ast_type":"BinaryOperation","children":[{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"hash","src":{"contract_id":8,"jump_code":"","length":4,"start":1884}},{"ast_type":"FunctionCall","children":[{"ast_type":"Literal","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":1,"start":1900}},{"ast_type":"ElementaryTypeNameExpression","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"bytes32","src":{"contract_id":8,"jump_code":"","length":7,"start":1892}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":7,"start":1892}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":10,"start":1892}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":18,"start":1884}},{"ast_type":"Literal","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":17,"start":1904}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"require","src":{"contract_id":8,"jump_code":"","length":7,"start":1876}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":46,"start":1876}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":46,"start":1876}},{"ast_type":"Return","children":[{"ast_type":"FunctionCall","children":[{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"account","src":{"contract_id":8,"jump_code":"","length":7,"start":1955}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"hash","src":{"contract_id":8,"jump_code":"","length":4,"start":1964}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"hasAcceptedHash","src":{"contract_id":8,"jump_code":"","length":15,"start":1939}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":30,"start":1939}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":37,"start":1932}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":152,"start":1824}},{"ast_type":"ParameterList","children":[{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"address","src":{"contract_id":8,"jump_code":"","length":7,"start":1755}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"account","src":{"contract_id":8,"jump_code":"","length":15,"start":1755}},{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"uint16","src":{"contract_id":8,"jump_code":"","length":6,"start":1772}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"version","src":{"contract_id":8,"jump_code":"","length":14,"start":1772}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":33,"start":1754}},{"ast_type":"ParameterList","children":[{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"bool","src":{"contract_id":8,"jump_code":"","length":4,"start":1809}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"accepted","src":{"contract_id":8,"jump_code":"","length":13,"start":1809}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":15,"start":1808}}],"classification":1,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"hasAcceptedVersion","src":{"contract_id":8,"jump_code":"","length":249,"start":1727}},{"ast_type":"FunctionDefinition","children":[{"ast_type":"Block","children":[{"ast_type":"ExpressionStatement","children":[{"ast_type":"FunctionCall","children":[{"ast_type":"BinaryOperation","children":[{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"version","src":{"contract_id":8,"jump_code":"","length":7,"start":2094}},{"ast_type":"BinaryOperation","children":[{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"latestTermsOfServiceVersion","src":{"contract_id":8,"jump_code":"","length":27,"start":2105}},{"ast_type":"Literal","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":1,"start":2135}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":31,"start":2105}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":42,"start":2094}},{"ast_type":"Literal","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":40,"start":2138}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"require","src":{"contract_id":8,"jump_code":"","length":7,"start":2086}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":93,"start":2086}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":93,"start":2086}},{"ast_type":"ExpressionStatement","children":[{"ast_type":"FunctionCall","children":[{"ast_type":"BinaryOperation","children":[{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"acceptanceMessageHash","src":{"contract_id":8,"jump_code":"","length":21,"start":2197}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"latestAcceptanceMessageHash","src":{"contract_id":8,"jump_code":"","length":27,"start":2222}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":52,"start":2197}},{"ast_type":"Literal","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":41,"start":2251}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"require","src":{"contract_id":8,"jump_code":"","length":7,"start":2189}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":104,"start":2189}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":104,"start":2189}},{"ast_type":"ExpressionStatement","children":[{"ast_type":"Assignment","children":[{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"latestAcceptanceMessageHash","src":{"contract_id":8,"jump_code":"","length":27,"start":2303}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"acceptanceMessageHash","src":{"contract_id":8,"jump_code":"","length":21,"start":2333}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":51,"start":2303}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":51,"start":2303}},{"ast_type":"ExpressionStatement","children":[{"ast_type":"Assignment","children":[{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"latestTermsOfServiceVersion","src":{"contract_id":8,"jump_code":"","length":27,"start":2364}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"version","src":{"contract_id":8,"jump_code":"","length":7,"start":2394}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":37,"start":2364}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":37,"start":2364}},{"ast_type":"ExpressionStatement","children":[{"ast_type":"Assignment","children":[{"ast_type":"IndexAccess","children":[{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"versions","src":{"contract_id":8,"jump_code":"","length":8,"start":2411}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"version","src":{"contract_id":8,"jump_code":"","length":7,"start":2420}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":17,"start":2411}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"acceptanceMessageHash","src":{"contract_id":8,"jump_code":"","length":21,"start":2431}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":41,"start":2411}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":41,"start":2411}},{"ast_type":"EmitStatement","children":[{"ast_type":"FunctionCall","children":[{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"version","src":{"contract_id":8,"jump_code":"","length":7,"start":2488}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"acceptanceMessageHash","src":{"contract_id":8,"jump_code":"","length":21,"start":2497}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"UpdateTermsOfService","src":{"contract_id":8,"jump_code":"","length":20,"start":2467}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":52,"start":2467}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":57,"start":2462}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":450,"start":2076}},{"ast_type":"ModifierInvocation","children":[{"ast_type":"IdentifierPath","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"onlyOwner","src":{"contract_id":8,"jump_code":"","length":9,"start":2066}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":9,"start":2066}},{"ast_type":"ParameterList","children":[{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"uint16","src":{"contract_id":8,"jump_code":"","length":6,"start":2012}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"version","src":{"contract_id":8,"jump_code":"","length":14,"start":2012}},{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"bytes32","src":{"contract_id":8,"jump_code":"","length":7,"start":2028}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"acceptanceMessageHash","src":{"contract_id":8,"jump_code":"","length":29,"start":2028}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":47,"start":2011}},{"ast_type":"ParameterList","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","start":2076}}],"classification":1,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"updateTermsOfService","src":{"contract_id":8,"jump_code":"","length":544,"start":1982}},{"ast_type":"FunctionDefinition","children":[{"ast_type":"Block","children":[{"ast_type":"ExpressionStatement","children":[{"ast_type":"FunctionCall","children":[{"ast_type":"BinaryOperation","children":[{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"latestAcceptanceMessageHash","src":{"contract_id":8,"jump_code":"","length":27,"start":2740}},{"ast_type":"FunctionCall","children":[{"ast_type":"Literal","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":1,"start":2779}},{"ast_type":"ElementaryTypeNameExpression","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"bytes32","src":{"contract_id":8,"jump_code":"","length":7,"start":2771}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":7,"start":2771}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":10,"start":2771}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":41,"start":2740}},{"ast_type":"Literal","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":34,"start":2783}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"require","src":{"contract_id":8,"jump_code":"","length":7,"start":2732}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":86,"start":2732}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":86,"start":2732}},{"ast_type":"Return","children":[{"ast_type":"FunctionCall","children":[{"ast_type":"MemberAccess","children":[{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"msg","src":{"contract_id":8,"jump_code":"","length":3,"start":2851}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":10,"start":2851}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"latestAcceptanceMessageHash","src":{"contract_id":8,"jump_code":"","length":27,"start":2863}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"hasAcceptedHash","src":{"contract_id":8,"jump_code":"","length":15,"start":2835}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":56,"start":2835}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":63,"start":2828}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":176,"start":2722}},{"ast_type":"StructuredDocumentation","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":127,"start":2532}},{"ast_type":"ParameterList","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":2,"start":2683}},{"ast_type":"ParameterList","children":[{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"bool","src":{"contract_id":8,"jump_code":"","length":4,"start":2707}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"accepted","src":{"contract_id":8,"jump_code":"","length":13,"start":2707}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":15,"start":2706}}],"classification":1,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"canProceed","src":{"contract_id":8,"jump_code":"","length":234,"start":2664}},{"ast_type":"FunctionDefinition","children":[{"ast_type":"Block","children":[{"ast_type":"ExpressionStatement","children":[{"ast_type":"FunctionCall","children":[{"ast_type":"BinaryOperation","children":[{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"hash","src":{"contract_id":8,"jump_code":"","length":4,"start":3719}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"latestAcceptanceMessageHash","src":{"contract_id":8,"jump_code":"","length":27,"start":3727}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":35,"start":3719}},{"ast_type":"Literal","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":57,"start":3756}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"require","src":{"contract_id":8,"jump_code":"","length":7,"start":3711}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":103,"start":3711}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":103,"start":3711}},{"ast_type":"ExpressionStatement","children":[{"ast_type":"FunctionCall","children":[{"ast_type":"FunctionCall","children":[{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"hash","src":{"contract_id":8,"jump_code":"","length":4,"start":3859}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"signature","src":{"contract_id":8,"jump_code":"","length":9,"start":3865}},{"ast_type":"MemberAccess","children":[{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"signer","src":{"contract_id":8,"jump_code":"","length":6,"start":3832}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":26,"start":3832}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":43,"start":3832}},{"ast_type":"Literal","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":24,"start":3877}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"require","src":{"contract_id":8,"jump_code":"","length":7,"start":3824}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":78,"start":3824}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":78,"start":3824}},{"ast_type":"ExpressionStatement","children":[{"ast_type":"FunctionCall","children":[{"ast_type":"BinaryOperation","children":[{"ast_type":"IndexAccess","children":[{"ast_type":"IndexAccess","children":[{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"acceptances","src":{"contract_id":8,"jump_code":"","length":11,"start":3920}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"signer","src":{"contract_id":8,"jump_code":"","length":6,"start":3932}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":19,"start":3920}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"latestAcceptanceMessageHash","src":{"contract_id":8,"jump_code":"","length":27,"start":3940}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":48,"start":3920}},{"ast_type":"Literal","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":5,"start":3972}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":57,"start":3920}},{"ast_type":"Literal","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":16,"start":3979}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"require","src":{"contract_id":8,"jump_code":"","length":7,"start":3912}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":84,"start":3912}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":84,"start":3912}},{"ast_type":"ExpressionStatement","children":[{"ast_type":"Assignment","children":[{"ast_type":"IndexAccess","children":[{"ast_type":"IndexAccess","children":[{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"acceptances","src":{"contract_id":8,"jump_code":"","length":11,"start":4006}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"signer","src":{"contract_id":8,"jump_code":"","length":6,"start":4018}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":19,"start":4006}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"latestAcceptanceMessageHash","src":{"contract_id":8,"jump_code":"","length":27,"start":4026}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":48,"start":4006}},{"ast_type":"Literal","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":4,"start":4057}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":55,"start":4006}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":55,"start":4006}},{"ast_type":"EmitStatement","children":[{"ast_type":"FunctionCall","children":[{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"signer","src":{"contract_id":8,"jump_code":"","length":6,"start":4083}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"latestTermsOfServiceVersion","src":{"contract_id":8,"jump_code":"","length":27,"start":4091}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"latestAcceptanceMessageHash","src":{"contract_id":8,"jump_code":"","length":27,"start":4120}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"metadata","src":{"contract_id":8,"jump_code":"","length":8,"start":4149}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"Signed","src":{"contract_id":8,"jump_code":"","length":6,"start":4076}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":82,"start":4076}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":87,"start":4071}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":464,"start":3701}},{"ast_type":"StructuredDocumentation","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":674,"start":2904}},{"ast_type":"ParameterList","children":[{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"address","src":{"contract_id":8,"jump_code":"","length":7,"start":3617}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"signer","src":{"contract_id":8,"jump_code":"","length":14,"start":3617}},{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"bytes32","src":{"contract_id":8,"jump_code":"","length":7,"start":3633}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"hash","src":{"contract_id":8,"jump_code":"","length":12,"start":3633}},{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"bytes","src":{"contract_id":8,"jump_code":"","length":5,"start":3647}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"signature","src":{"contract_id":8,"jump_code":"","length":22,"start":3647}},{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"bytes","src":{"contract_id":8,"jump_code":"","length":5,"start":3671}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"metadata","src":{"contract_id":8,"jump_code":"","length":21,"start":3671}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":77,"start":3616}},{"ast_type":"ParameterList","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","start":3701}}],"classification":1,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"signTermsOfServiceBehalf","src":{"contract_id":8,"jump_code":"","length":582,"start":3583}},{"ast_type":"FunctionDefinition","children":[{"ast_type":"Block","children":[{"ast_type":"ExpressionStatement","children":[{"ast_type":"FunctionCall","children":[{"ast_type":"MemberAccess","children":[{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"msg","src":{"contract_id":8,"jump_code":"","length":3,"start":4305}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":10,"start":4305}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"hash","src":{"contract_id":8,"jump_code":"","length":4,"start":4317}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"signature","src":{"contract_id":8,"jump_code":"","length":9,"start":4323}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"metadata","src":{"contract_id":8,"jump_code":"","length":8,"start":4334}},{"ast_type":"Identifier","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"signTermsOfServiceBehalf","src":{"contract_id":8,"jump_code":"","length":24,"start":4280}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":63,"start":4280}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":63,"start":4280}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":80,"start":4270}},{"ast_type":"ParameterList","children":[{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"bytes32","src":{"contract_id":8,"jump_code":"","length":7,"start":4202}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"hash","src":{"contract_id":8,"jump_code":"","length":12,"start":4202}},{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"bytes","src":{"contract_id":8,"jump_code":"","length":5,"start":4216}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"signature","src":{"contract_id":8,"jump_code":"","length":22,"start":4216}},{"ast_type":"VariableDeclaration","children":[{"ast_type":"ElementaryTypeName","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"bytes","src":{"contract_id":8,"jump_code":"","length":5,"start":4240}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"metadata","src":{"contract_id":8,"jump_code":"","length":21,"start":4240}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":61,"start":4201}},{"ast_type":"ParameterList","children":[],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","start":4270}}],"classification":1,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"signTermsOfServiceOwn","src":{"contract_id":8,"jump_code":"","length":179,"start":4171}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"name":"TermsOfService","src":{"contract_id":8,"jump_code":"","length":3963,"start":390}}],"classification":0,"col_offset":-1,"end_col_offset":-1,"end_lineno":-1,"lineno":-1,"src":{"contract_id":8,"jump_code":"","length":4317,"start":37}},"contractName":"TermsOfService","deploymentBytecode":{"bytecode":"0x608060405234801561000f575f80fd5b506100193361001e565b61006d565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610d508061007a5f395ff3fe608060405234801561000f575f80fd5b50600436106100e5575f3560e01c8063931f45f811610088578063be0fc8a611610063578063be0fc8a6146101e7578063c4846df0146101fa578063f2fde38b1461021d578063f8f584b814610230575f80fd5b8063931f45f8146101905780639a5f773e146101bd578063b8ad591b146101c6575f80fd5b80635fc7e1b6116100c35780635fc7e1b61461012457806361b3516314610156578063715018a61461016e5780638da5cb5b14610176575f80fd5b80633f3dea15146100e95780635c162cdf146100fe5780635f145fb714610111575b5f80fd5b6100fc6100f7366004610a58565b610243565b005b6100fc61010c366004610ad6565b610254565b6100fc61011f366004610b14565b61039f565b610143610132366004610b8d565b60026020525f908152604090205481565b6040519081526020015b60405180910390f35b61015e610553565b604051901515815260200161014d565b6100fc6105b5565b5f546040516001600160a01b03909116815260200161014d565b61015e61019e366004610bad565b600160209081525f928352604080842090915290825290205460ff1681565b61014360035481565b6004546101d49061ffff1681565b60405161ffff909116815260200161014d565b61015e6101f5366004610bc7565b6105c8565b610143610208366004610b8d565b61ffff165f9081526002602052604090205490565b6100fc61022b366004610bf8565b61062c565b61015e61023e366004610bad565b6106a5565b61024f3384848461039f565b505050565b61025c6106cf565b60045461026e9061ffff166001610c11565b61ffff168261ffff16146102d85760405162461bcd60e51b815260206004820152602660248201527f56657273696f6e73206d757374206265207570646174656420696e6372656d656044820152656e74616c6c7960d01b60648201526084015b60405180910390fd5b60035481036103395760405162461bcd60e51b815260206004820152602760248201527f53657474696e67207468652073616d65207465726d73206f66207365727669636044820152666520747769636560c81b60648201526084016102cf565b60038190556004805461ffff191661ffff84169081179091555f81815260026020908152604091829020849055815192835282018390527f85b7d26208605d06e97fbd501843a4150a6efa1d95745c8401f38d56156f82e2910160405180910390a15050565b60035483146104165760405162461bcd60e51b815260206004820152603760248201527f43616e6e6f74207369676e206f6c646572206f7220756e6b6e6f776e2076657260448201527f73696f6e73207465726d73206f6620736572766963657300000000000000000060648201526084016102cf565b61042a6001600160a01b0385168484610728565b61046f5760405162461bcd60e51b815260206004820152601660248201527514da59db985d1d5c99481a5cc81b9bdd081d985b1a5960521b60448201526064016102cf565b6001600160a01b0384165f908152600160209081526040808320600354845290915290205460ff16156104d55760405162461bcd60e51b815260206004820152600e60248201526d105b1c9958591e481cda59db995960921b60448201526064016102cf565b6001600160a01b0384165f908152600160208181526040808420600380548652925292839020805460ff1916909217909155600454905491517f32c70fa5bb7bfd2dd4d863783422e6009fbcd3127a0e36bb0627e67ae136f9a79261054592889261ffff90911691908690610c8c565b60405180910390a150505050565b6003545f906105a45760405162461bcd60e51b815260206004820181905260248201527f5465726d73206f662073657276696365206e6f7420696e697469616c6973656460448201526064016102cf565b6105b0336003546106a5565b905090565b6105bd6106cf565b6105c65f610786565b565b61ffff81165f908152600260205260408120548061061a5760405162461bcd60e51b815260206004820152600f60248201526e27379039bab1b4103b32b939b4b7b760891b60448201526064016102cf565b61062484826106a5565b949350505050565b6106346106cf565b6001600160a01b0381166106995760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102cf565b6106a281610786565b50565b6001600160a01b03919091165f908152600160209081526040808320938352929052205460ff1690565b5f546001600160a01b031633146105c65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102cf565b5f805f61073585856107d5565b90925090505f81600481111561074d5761074d610cbc565b14801561076b5750856001600160a01b0316826001600160a01b0316145b8061077c575061077c868686610817565b9695505050505050565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f808251604103610809576020830151604084015160608501515f1a6107fd878285856108fe565b94509450505050610810565b505f905060025b9250929050565b5f805f856001600160a01b0316631626ba7e60e01b868660405160240161083f929190610cd0565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905161087d9190610ce8565b5f60405180830381855afa9150503d805f81146108b5576040519150601f19603f3d011682016040523d82523d5f602084013e6108ba565b606091505b50915091508180156108ce57506020815110155b801561077c57508051630b135d3f60e11b906108f39083016020908101908401610d03565b149695505050505050565b5f807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561093357505f905060036109b2565b604080515f8082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610984573d5f803e3d5ffd5b5050604051601f1901519150506001600160a01b0381166109ac575f600192509250506109b2565b91505f90505b94509492505050565b634e487b7160e01b5f52604160045260245ffd5b5f82601f8301126109de575f80fd5b813567ffffffffffffffff808211156109f9576109f96109bb565b604051601f8301601f19908116603f01168101908282118183101715610a2157610a216109bb565b81604052838152866020858801011115610a39575f80fd5b836020870160208301375f602085830101528094505050505092915050565b5f805f60608486031215610a6a575f80fd5b83359250602084013567ffffffffffffffff80821115610a88575f80fd5b610a94878388016109cf565b93506040860135915080821115610aa9575f80fd5b50610ab6868287016109cf565b9150509250925092565b803561ffff81168114610ad1575f80fd5b919050565b5f8060408385031215610ae7575f80fd5b610af083610ac0565b946020939093013593505050565b80356001600160a01b0381168114610ad1575f80fd5b5f805f8060808587031215610b27575f80fd5b610b3085610afe565b935060208501359250604085013567ffffffffffffffff80821115610b53575f80fd5b610b5f888389016109cf565b93506060870135915080821115610b74575f80fd5b50610b81878288016109cf565b91505092959194509250565b5f60208284031215610b9d575f80fd5b610ba682610ac0565b9392505050565b5f8060408385031215610bbe575f80fd5b610af083610afe565b5f8060408385031215610bd8575f80fd5b610be183610afe565b9150610bef60208401610ac0565b90509250929050565b5f60208284031215610c08575f80fd5b610ba682610afe565b61ffff818116838216019080821115610c3857634e487b7160e01b5f52601160045260245ffd5b5092915050565b5f5b83811015610c59578181015183820152602001610c41565b50505f910152565b5f8151808452610c78816020860160208601610c3f565b601f01601f19169290920160200192915050565b60018060a01b038516815261ffff84166020820152826040820152608060608201525f61077c6080830184610c61565b634e487b7160e01b5f52602160045260245ffd5b828152604060208201525f6106246040830184610c61565b5f8251610cf9818460208701610c3f565b9190910192915050565b5f60208284031215610d13575f80fd5b505191905056fea2646970667358221220a29632c211a6ced40a4579e4cb33ffe0642c9da82b1f9c3dae5e8fb2c9f7dadf64736f6c63430008170033"},"devdoc":{"kind":"dev","methods":{"owner()":{"details":"Returns the address of the current owner."},"renounceOwnership()":{"details":"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner."},"transferOwnership(address)":{"details":"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner."}},"version":1},"methodIdentifiers":{"acceptances(address,bytes32)":"0x931f45f8","canProceed()":"0x61b35163","getTextHash(uint16)":"0xc4846df0","hasAcceptedHash(address,bytes32)":"0xf8f584b8","hasAcceptedVersion(address,uint16)":"0xbe0fc8a6","latestAcceptanceMessageHash()":"0x9a5f773e","latestTermsOfServiceVersion()":"0xb8ad591b","owner()":"0x8da5cb5b","renounceOwnership()":"0x715018a6","signTermsOfServiceBehalf(address,bytes32,bytes,bytes)":"0x5f145fb7","signTermsOfServiceOwn(bytes32,bytes,bytes)":"0x3f3dea15","transferOwnership(address)":"0xf2fde38b","updateTermsOfService(uint16,bytes32)":"0x5c162cdf","versions(uint16)":"0x5fc7e1b6"},"runtimeBytecode":{"bytecode":"0x608060405234801561000f575f80fd5b50600436106100e5575f3560e01c8063931f45f811610088578063be0fc8a611610063578063be0fc8a6146101e7578063c4846df0146101fa578063f2fde38b1461021d578063f8f584b814610230575f80fd5b8063931f45f8146101905780639a5f773e146101bd578063b8ad591b146101c6575f80fd5b80635fc7e1b6116100c35780635fc7e1b61461012457806361b3516314610156578063715018a61461016e5780638da5cb5b14610176575f80fd5b80633f3dea15146100e95780635c162cdf146100fe5780635f145fb714610111575b5f80fd5b6100fc6100f7366004610a58565b610243565b005b6100fc61010c366004610ad6565b610254565b6100fc61011f366004610b14565b61039f565b610143610132366004610b8d565b60026020525f908152604090205481565b6040519081526020015b60405180910390f35b61015e610553565b604051901515815260200161014d565b6100fc6105b5565b5f546040516001600160a01b03909116815260200161014d565b61015e61019e366004610bad565b600160209081525f928352604080842090915290825290205460ff1681565b61014360035481565b6004546101d49061ffff1681565b60405161ffff909116815260200161014d565b61015e6101f5366004610bc7565b6105c8565b610143610208366004610b8d565b61ffff165f9081526002602052604090205490565b6100fc61022b366004610bf8565b61062c565b61015e61023e366004610bad565b6106a5565b61024f3384848461039f565b505050565b61025c6106cf565b60045461026e9061ffff166001610c11565b61ffff168261ffff16146102d85760405162461bcd60e51b815260206004820152602660248201527f56657273696f6e73206d757374206265207570646174656420696e6372656d656044820152656e74616c6c7960d01b60648201526084015b60405180910390fd5b60035481036103395760405162461bcd60e51b815260206004820152602760248201527f53657474696e67207468652073616d65207465726d73206f66207365727669636044820152666520747769636560c81b60648201526084016102cf565b60038190556004805461ffff191661ffff84169081179091555f81815260026020908152604091829020849055815192835282018390527f85b7d26208605d06e97fbd501843a4150a6efa1d95745c8401f38d56156f82e2910160405180910390a15050565b60035483146104165760405162461bcd60e51b815260206004820152603760248201527f43616e6e6f74207369676e206f6c646572206f7220756e6b6e6f776e2076657260448201527f73696f6e73207465726d73206f6620736572766963657300000000000000000060648201526084016102cf565b61042a6001600160a01b0385168484610728565b61046f5760405162461bcd60e51b815260206004820152601660248201527514da59db985d1d5c99481a5cc81b9bdd081d985b1a5960521b60448201526064016102cf565b6001600160a01b0384165f908152600160209081526040808320600354845290915290205460ff16156104d55760405162461bcd60e51b815260206004820152600e60248201526d105b1c9958591e481cda59db995960921b60448201526064016102cf565b6001600160a01b0384165f908152600160208181526040808420600380548652925292839020805460ff1916909217909155600454905491517f32c70fa5bb7bfd2dd4d863783422e6009fbcd3127a0e36bb0627e67ae136f9a79261054592889261ffff90911691908690610c8c565b60405180910390a150505050565b6003545f906105a45760405162461bcd60e51b815260206004820181905260248201527f5465726d73206f662073657276696365206e6f7420696e697469616c6973656460448201526064016102cf565b6105b0336003546106a5565b905090565b6105bd6106cf565b6105c65f610786565b565b61ffff81165f908152600260205260408120548061061a5760405162461bcd60e51b815260206004820152600f60248201526e27379039bab1b4103b32b939b4b7b760891b60448201526064016102cf565b61062484826106a5565b949350505050565b6106346106cf565b6001600160a01b0381166106995760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102cf565b6106a281610786565b50565b6001600160a01b03919091165f908152600160209081526040808320938352929052205460ff1690565b5f546001600160a01b031633146105c65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102cf565b5f805f61073585856107d5565b90925090505f81600481111561074d5761074d610cbc565b14801561076b5750856001600160a01b0316826001600160a01b0316145b8061077c575061077c868686610817565b9695505050505050565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f808251604103610809576020830151604084015160608501515f1a6107fd878285856108fe565b94509450505050610810565b505f905060025b9250929050565b5f805f856001600160a01b0316631626ba7e60e01b868660405160240161083f929190610cd0565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905161087d9190610ce8565b5f60405180830381855afa9150503d805f81146108b5576040519150601f19603f3d011682016040523d82523d5f602084013e6108ba565b606091505b50915091508180156108ce57506020815110155b801561077c57508051630b135d3f60e11b906108f39083016020908101908401610d03565b149695505050505050565b5f807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561093357505f905060036109b2565b604080515f8082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610984573d5f803e3d5ffd5b5050604051601f1901519150506001600160a01b0381166109ac575f600192509250506109b2565b91505f90505b94509492505050565b634e487b7160e01b5f52604160045260245ffd5b5f82601f8301126109de575f80fd5b813567ffffffffffffffff808211156109f9576109f96109bb565b604051601f8301601f19908116603f01168101908282118183101715610a2157610a216109bb565b81604052838152866020858801011115610a39575f80fd5b836020870160208301375f602085830101528094505050505092915050565b5f805f60608486031215610a6a575f80fd5b83359250602084013567ffffffffffffffff80821115610a88575f80fd5b610a94878388016109cf565b93506040860135915080821115610aa9575f80fd5b50610ab6868287016109cf565b9150509250925092565b803561ffff81168114610ad1575f80fd5b919050565b5f8060408385031215610ae7575f80fd5b610af083610ac0565b946020939093013593505050565b80356001600160a01b0381168114610ad1575f80fd5b5f805f8060808587031215610b27575f80fd5b610b3085610afe565b935060208501359250604085013567ffffffffffffffff80821115610b53575f80fd5b610b5f888389016109cf565b93506060870135915080821115610b74575f80fd5b50610b81878288016109cf565b91505092959194509250565b5f60208284031215610b9d575f80fd5b610ba682610ac0565b9392505050565b5f8060408385031215610bbe575f80fd5b610af083610afe565b5f8060408385031215610bd8575f80fd5b610be183610afe565b9150610bef60208401610ac0565b90509250929050565b5f60208284031215610c08575f80fd5b610ba682610afe565b61ffff818116838216019080821115610c3857634e487b7160e01b5f52601160045260245ffd5b5092915050565b5f5b83811015610c59578181015183820152602001610c41565b50505f910152565b5f8151808452610c78816020860160208601610c3f565b601f01601f19169290920160200192915050565b60018060a01b038516815261ffff84166020820152826040820152608060608201525f61077c6080830184610c61565b634e487b7160e01b5f52602160045260245ffd5b828152604060208201525f6106246040830184610c61565b5f8251610cf9818460208701610c3f565b9190910192915050565b5f60208284031215610d13575f80fd5b505191905056fea2646970667358221220a29632c211a6ced40a4579e4cb33ffe0642c9da82b1f9c3dae5e8fb2c9f7dadf64736f6c63430008170033"},"sourceId":"TermsOfService.sol","sourcemap":"390:3963:8:-:0;;;1389:31;;;;;;;;;-1:-1:-1;936:32:0;734:10:2;936:18:0;:32::i;:::-;390:3963:8;;2426:187:0;2499:16;2518:6;;-1:-1:-1;;;;;2534:17:0;;;-1:-1:-1;;;;;;2534:17:0;;;;;;2566:40;;2518:6;;;;;;;2566:40;;2499:16;2566:40;2489:124;2426:187;:::o;390:3963:8:-;;;;;;;","userdoc":{"kind":"user","methods":{"canProceed()":{"notice":"Can the current user proceed to the next step, or they they need to sign the latest terms of service."},"signTermsOfServiceBehalf(address,bytes32,bytes,bytes)":{"notice":"Sign terms of service - Externally Owned Account sign - EIP-1271 sign - EIP-191 formatted message The user can sign multiple times. See - ECDSA tryRecover https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/ECDSA.sol - Gnosis Safe signing example: https://github.com/safe-global/safe-eth-py/blob/master/gnosis/safe/tests/test_safe_signature.py#L195 - OpenZeppelin SignatureChecker implementation: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/SignatureChecker.sol"}},"notice":"Terms of service acceptance tracker Manage signatures of users of different versions of terms of service.","version":1}} \ No newline at end of file diff --git a/remappings.txt b/remappings.txt new file mode 100644 index 0000000..43c0428 --- /dev/null +++ b/remappings.txt @@ -0,0 +1 @@ +@openzeppelin/=lib/openzeppelin-contracts/contracts \ No newline at end of file diff --git a/scripts/verify-deployment.sh b/scripts/verify-deployment.sh new file mode 100755 index 0000000..9d9b026 --- /dev/null +++ b/scripts/verify-deployment.sh @@ -0,0 +1,15 @@ + #!/bin/bash + +set -e +set -x +set -u + +forge verify-contract \ + --etherscan-api-key $POLYGONSCAN_API_KEY \ + --flatten \ + --force \ + --chain polygon \ + --constructor-args $(cast abi-encode "constructor()") \ + $CONTRACT_ADDRESS \ + src/VaultUSDCPaymentForwarder.sol:VaultUSDCPaymentForwarder + diff --git a/terms_of_service/acceptance_message.py b/terms_of_service/acceptance_message.py index 888da19..999da41 100644 --- a/terms_of_service/acceptance_message.py +++ b/terms_of_service/acceptance_message.py @@ -8,7 +8,7 @@ from eth_account.messages import encode_defunct, _hash_eip191_message -DEFAULT_ACCEPTANCE_MESSAGE = """ +DEFAULT_ACCEPTANCE_MESSAGE_TEMPLATE = """ I read and agree on terms of service (version {version}) to use smart contract software deployed on a blockchain. @@ -16,24 +16,36 @@ The unique identifier hash for this terms of service text was {hash}. """.strip() +INITIAL_ACCEPTANCE_MESSAGE = """ +I read and agree on terms of service (version 1) to use +smart contract software deployed on a blockchain. + +The terms of service text was published 10.1.2024 at https://example.com. +The unique identifier hash for this terms of service text was 0x0000000000000000000000000000000000000000. +""".strip() + def generate_acceptance_message( version: int, date: datetime.datetime, link: str, hash: bytes, - template=DEFAULT_ACCEPTANCE_MESSAGE): + template=DEFAULT_ACCEPTANCE_MESSAGE_TEMPLATE): assert type(version) == int assert type(link) == str assert type(hash) == bytes assert len(hash) == 32, "Must be 256-bit sha of terms of service file" assert isinstance(date, datetime.datetime) human_date = date.strftime("%Y-%m-%d") - return DEFAULT_ACCEPTANCE_MESSAGE.format(version=version, link=link, hash=hash.hex(), human_date=human_date) + return template.format(version=version, link=link, hash=hash.hex(), human_date=human_date) def get_signing_hash(message: str) -> bytes: assert type(message) == str signable_message = encode_defunct(text=message) hash = _hash_eip191_message(signable_message) - return hash \ No newline at end of file + return hash + + +def get_initial_hash() -> bytes: + """""" \ No newline at end of file