# METL Transaction Logging Requirements
## ADMIN INTERFACE
### Update ROLE Transactions
This is for each of Burners, Freezers, Minters, and Pausers.
Role update transactions contain a ROLE, ADDRESS, and either GRANT or REVOKE status.
```
CREATE TABLE roleTransactions (
transaction_id serial PRIMARY KEY,
role VARCHAR ( 8 ) NOT NULL, // which role is being updated
type VARCHAR ( 6 ) NOT NULL, // ADD or REMOVE
name VARCHAR (50), // the user's name
address VARCHAR ( 42 ) NOT NULL, // the user's wallet address
user VARCHAR (42) NOT NULL, // The transaction performer's address
created_on TIMESTAMP NOT NULL,
);
```
Example JSON Payloads
```
{
role: "MINTER",
type: "REMOVE",
address: "0xf1093dBAD29144880743FB98ea7b936F3aeADCf2",
user: "0xBc4A2b0B65e39bAE9bedad1798B824EAf0A60639"
}
{
role: "FREEZER",
type: "ADD",
name: "Mackenzie",
address: "0xBc4A2b0B65e39bAE9bedad1798B824EAf0A60639",
user: "0xf1093dBAD29144880743FB98ea7b936F3aeADCf2"
}
```
### Update Pool Transactions
Pool transactions either ADD or REMOVE an ADDRESS.
```
CREATE TABLE poolTransactions (
transaction_id serial PRIMARY KEY,
type VARCHAR ( 6 ) NOT NULL, // ADD or REMOVE
name VARCHAR (50), // the bank's name
address VARCHAR ( 42 ) NOT NULL, // the bank's multisig pool
user VARCHAR (42) NOT NULL, // The transaction performer's address
created_on TIMESTAMP NOT NULL,
);
```
Tech note: Adding and Removing BANK ADDRESSES are technically the same operation as GRANTING or REVOKING roles. They can be combined to the roleTransactions table, but I'm requesting a separation of concerns.
## BURNER INTERFACE
### BURN Transactions
Burn transactions contain a BURN_TARGET and an AMOUNT.
```
CREATE TABLE burnTransactions (
transaction_id serial PRIMARY KEY,
address VARCHAR ( 42 ) NOT NULL, // the BURN_TARGET (will be a bank)
amount INTEGER NOT NULL, // the AMOUNT
user VARCHAR (42) NOT NULL, // The transaction performer's address
created_on TIMESTAMP NOT NULL,
);
```
## MINTER INTERFACE
### MINT Transactions
Mint transactions contain a MINT_TARGET and an AMOUNT.
```
CREATE TABLE mintTransactions (
transaction_id serial PRIMARY KEY,
address VARCHAR ( 42 ) NOT NULL, // the MINT_TARGET (will be a bank)
amount INTEGER NOT NULL, // the AMOUNT
user VARCHAR (42) NOT NULL, // The transaction performer's address
created_on TIMESTAMP NOT NULL,
);
```
Note: Mint and Burn transactions are very similar. They can be combined with an additional TYPE field to save space if you so choose. Eg:
```
CREATE TABLE bankTransactions (
transaction_id serial PRIMARY KEY,
address VARCHAR ( 42 ) NOT NULL, // the MINT_TARGET or BURN_TARGET (will be a bank)
amount INTEGER NOT NULL, // the AMOUNT
type VARCHAR (4) NOT NULL, // MINT or BURN
user VARCHAR (42) NOT NULL, // The transaction performer's address
created_on TIMESTAMP NOT NULL,
)
```
## FREEZER INTERFACE
### FREEZE Transactions
Freeze transactions contain an ADDRESS and TYPE because users may be FROZEN or UNFROZEN.
```
CREATE TABLE freezeTransactions (
transaction_id serial PRIMARY KEY,
address VARCHAR ( 42 ) NOT NULL, // the ADDRESS (can be any user)
type VARCHAR ( 8 ) NOT NULL, // FROZEN or UNFROZEN
user VARCHAR (42) NOT NULL, // The transaction performer's address
created_on TIMESTAMP NOT NULL,
);
```
Note: FROZEN users are blocked from TRANSFERRING FUNDS. They are not blocked from having their ROLE updated.
## PAUSER INTERFACE
### PAUSE Transactions
Pause transactions only have a TYPE, PAUSE or UNPAUSE.
```
CREATE TABLE pauseTransactions (
transaction_id serial PRIMARY KEY,
type VARCHAR ( 7 ) NOT NULL, // PAUSE or UNPAUSE
user VARCHAR (42) NOT NULL, // The transaction performer's address
created_on TIMESTAMP NOT NULL,
);
```