Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add check that FiatTokenV1 is initialized #193

Merged
merged 1 commit into from
Aug 10, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 12 additions & 8 deletions validate/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function getAddressFromSlotData(slotData) {
}

function compare(actual, expected) {
if(expected == actual)
if(actual == expected)
{
return "(ok)";
} else {
Expand All @@ -79,7 +79,7 @@ function compare(actual, expected) {
}

function print(name, actual, expected) {
console.log(name + ": \t" + actual + "\t" + compare(expected, actual));
console.log(name + "\t" + actual + "\t" + compare(actual, expected));
}

async function Validate() {
Expand All @@ -92,13 +92,17 @@ async function Validate() {
// initialized needs to retrieved manually
var slot8Data = await asyncGetStorageAt(proxiedToken.address, 8);
var initialized = slot8Data.substring(24,26);
print("initialized", initialized, "01");
print("init proxy", initialized, "01");

var slot8Data = await asyncGetStorageAt(fiatTokenAddress, 8);
var initialized = slot8Data.substring(24,26);
print("init logic", initialized, "01");

var name = await proxiedToken.name.call();
print("name", name, NAME);
print("name ", name, NAME);

var symbol = await proxiedToken.symbol.call();
print("symbol", symbol, SYMBOL);
print("symbol ", symbol, SYMBOL);

var decimals = await proxiedToken.decimals.call();
print("decimals", decimals, DECIMALS);
Expand All @@ -110,7 +114,7 @@ async function Validate() {
print("totalSupply", totalSupply, TOTALSUPPLY);

var paused = await proxiedToken.paused.call();
print("paused", paused, PAUSED);
print("paused ", paused, PAUSED);

// implementation
var implementation = await asyncGetStorageAt(proxiedToken.address, implSlot);
Expand All @@ -120,13 +124,13 @@ async function Validate() {
print("upgrader", getAddressFromSlotData(admin), UPGRADER);

var owner = await proxiedToken.owner.call();
print("owner", owner, OWNER);
print("owner ", owner, OWNER);

var masterMinter = await proxiedToken.masterMinter.call();
print("masterMinter", masterMinter, MASTER_MINTER);

var pauser = await proxiedToken.pauser.call();
print("pauser", pauser, PAUSER);
print("pauser ", pauser, PAUSER);

var blacklister = await proxiedToken.blacklister.call();
print("blacklister", blacklister, BLACKLISTER);
Expand Down