/* The below does not represent a functional lock/unlock script.
 * It is intended to test KDE's Syntax Highlighting framework.
 */

// Pragma comment.
pragma cashscript ^0.9.2;

// Locking Script/Function.
contract TestContract(
	address addressExampple,
	int intExample,
	bool boolExample,
	string stringExample,
	pubkey pubkeyExample,
	sig sigExample,
	datasig datasigExample
) {
	// Unlocking Script/Function.
	function testUnlock(
		byte singleByte,
		bytes bytesUnspecifiedLength,
		bytes1 bytes1Length,
		bytes99 bytes99Length
	) {
		// General.
		require(singleByte == bytes1Length);

		// Arithmetic.
		int resultAbs = abs(intExample);
		int resultMin = min(intExample, 100);
		int resultMax = max(intExample, 100);
		int resultWithin = within(intExample, 0, 100);

		// Hashing.
		bool resultHash160 = hash160(bytesUnspecifiedLength);
		bool resultHash256 = hash256(bytesUnspecifiedLength);
		bool resultRipeMd160 = ripemd160(bytesUnspecifiedLength);
		bool resultSha1 = sha1(bytesUnspecifiedLength);
		bool resultSha256 = sha256(bytesUnspecifiedLength);

		// Signature checking.
		bool resultChecksig = checkSig(sigExample, pubkeyExample);
		bool resultCheckMultiSig = checkMultiSig([sigExample], [pubkeyExample]);
		bool resultCheckDataSig = checkDataSig(datasigExample, bytesUnspecifiedLength, pubkeyExample);

		// Locking Bytecode.
		bytes p2pkh = new LockingBytecodeP2PKH(bytesUnspecifiedLength);
		bytes p2sh20 = new LockingBytecodeP2SH20(bytesUnspecifiedLength);
		bytes p2sh32 = new LockingBytecodeP2SH32(bytesUnspecifiedLength);
		bytes nullData = new LockingBytecodeNullData(bytesUnspecifiedLength);

		// Keywods.
		bool exampleTrue = true;
		bool exampleFalse = false;

		// Control structures.
		if (exampleTrue) {
			require(singleByte == bytes1Length);
		} else if (exampleFalse) {
			require(singleByte == bytes1Length);
		} else {
			require(singleByte == bytes1Length);
		}

		// Units.
		int exampleSatoshis = 1 satoshis;
		int exampleSats = 1 sats;
		int exampleFinney = 1 finney;
		int exampleBits = 1 bits;
		int exampleBitcoin = 1 bitcoin;
		int exampleSeconds = 1 seconds;
		int exampleMinutes = 1 minutes;
		int exampleHours = 1 hours;
		int exampleDays = 1 days;
		int exampleWeeks = 1 weeks;

		// Misc.
		string exampleString = "This is an example string";
		bytes exampleHex = 0xaabbccddeeff;
	}
}
