Skip to content

Commit

Permalink
rename ERC20TemplateSapphire to ERC20Template4
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcos20 committed Aug 7, 2024
1 parent 31db861 commit 80e682a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ interface AccessListContract {
/**
* @title DatatokenTemplate to be used on Sapphire network
*
* @dev ERC20TemplateSapphire is an ERC20 compliant token template, which relies on privacy features offered by Sapphire
* @dev ERC20Template4 is an ERC20 compliant token template, which relies on privacy features offered by Sapphire
* Used by the factory contract as a bytecode reference to
* deploy new Datatokens.
* IMPORTANT CHANGES:
* - buyFromFreAndOrder function: one call to buy a DT from the minting capable FRE, startOrder and burn the DT
* - buyFromDispenserAndOrder function: one call to fetch a DT from the Dispenser, startOrder and burn the DT
*/
contract ERC20TemplateSapphire is
contract ERC20Template4 is
ERC20("test", "testSymbol"),
ERC20Roles,
ERC20Burnable,
Expand Down
2 changes: 1 addition & 1 deletion contracts/templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Ocean-contracts v1.x (Ocean V4 “Onda”) is built on top of templates, in orde
- has the following price schemas:
- fixed rate exchanges
### ERC20TemplateSapphire (asset files object stored in contract)
### ERC20Template4 (asset files object stored in contract)
- follows same functions and principles as ERC20TemplateEnterprise, with the following additions
- should be deployed only on Oasis Sapphire, and all transactions should be encrypted, otherwise security is compromised
- on initialize, files object(asset URLs) is stored in the contract
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"test:erc721": "npx hardhat test test/unit/datatokens/ERC721Template.test.js",
"test:erc20": "npx hardhat test test/unit/datatokens/ERC20Template.test.js",
"test:enterprise": "npx hardhat test test/unit/datatokens/ERC20TemplateEnterprise.test.js",
"test:sapphiretemplate": "npx hardhat test test/unit/datatokens/ERC20TemplateSapphire.test.js",
"test:template3": "npx hardhat test test/unit/datatokens/ERC20Template3.test.js",
"test:template4": "npx hardhat test test/unit/datatokens/ERC20Template4.test.js",
"test:factory": "npx hardhat test test/unit/factories/ERC721Factory.test.js",
"test:router": "npx hardhat test test/unit/pools/FactoryRouter.test.js",
"test:flow": "npx hardhat test test/flow/*.test.js ",
Expand Down
22 changes: 11 additions & 11 deletions scripts/deploy-contracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,17 +524,17 @@ async function main() {

if (sleepAmount > 0) await sleep(sleepAmount)
if (logging) console.info("Deploying ERC20 Sapphire Template");
const ERC20TemplateSapphire = await ethers.getContractFactory(
"ERC20TemplateSapphire",
const ERC20Template4 = await ethers.getContractFactory(
"ERC20Template4",
owner
);
let templateERC20TemplateSapphire
if (options) templateERC20TemplateSapphire = await ERC20TemplateSapphire.connect(owner).deploy(options);
else templateERC20TemplateSapphire = await ERC20TemplateSapphire.connect(owner).deploy();
await templateERC20TemplateSapphire.deployTransaction.wait();
let templateERC20Template4
if (options) templateERC20Template4 = await ERC20Template4.connect(owner).deploy(options);
else templateERC20Template4 = await ERC20Template4.connect(owner).deploy();
await templateERC20Template4.deployTransaction.wait();
if (show_verify) {
console.log("\tRun the following to verify on etherscan");
console.log("\tnpx hardhat verify --network " + networkName + " " + templateERC20TemplateSapphire.address)
console.log("\tnpx hardhat verify --network " + networkName + " " + templateERC20Template4.address)
}

addresses.ERC721Template = {};
Expand Down Expand Up @@ -647,17 +647,17 @@ async function main() {
templateERC20Template3.address;
}

if (logging) console.info("Adding ERC20TemplateSapphire to ERC721Factory");
if (options) templateadd = await factoryERC721.connect(owner).addTokenTemplate(templateERC20TemplateSapphire.address, options);
else templateadd = await factoryERC721.connect(owner).addTokenTemplate(templateERC20TemplateSapphire.address);
if (logging) console.info("Adding ERC20Template4 to ERC721Factory");
if (options) templateadd = await factoryERC721.connect(owner).addTokenTemplate(templateERC20Template4.address, options);
else templateadd = await factoryERC721.connect(owner).addTokenTemplate(templateERC20Template4.address);
await templateadd.wait();
if (sleepAmount > 0) await sleep(sleepAmount)
if (options) currentTokenCount = await factoryERC721.getCurrentTemplateCount(options);
else currentTokenCount = await factoryERC721.getCurrentTemplateCount(options);
if (options) tokenTemplate = await factoryERC721.getTokenTemplate(currentTokenCount, options);
else tokenTemplate = await factoryERC721.getTokenTemplate(currentTokenCount);
addresses.ERC20Template[currentTokenCount.toString()] =
templateERC20TemplateSapphire.address;
templateERC20Template4.address;

// SET REQUIRED ADDRESS
if (sleepAmount > 0) await sleep(sleepAmount)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async function signMessageShort(message, address) {


const provider = new ethers.providers.JsonRpcProvider();
describe("ERC20TemplateSapphire", () => {
describe("ERC20Template4", () => {
let name,
symbol,
owner,
Expand Down Expand Up @@ -137,7 +137,7 @@ describe("ERC20TemplateSapphire", () => {

beforeEach("init contracts for each test", async () => {
const ERC721Template = await ethers.getContractFactory("ERC721Template");
const ERC20Template = await ethers.getContractFactory("ERC20TemplateSapphire");
const ERC20Template = await ethers.getContractFactory("ERC20Template4");
const ERC721Factory = await ethers.getContractFactory("ERC721Factory");

const Router = await ethers.getContractFactory("FactoryRouter");
Expand Down Expand Up @@ -248,7 +248,7 @@ describe("ERC20TemplateSapphire", () => {
assert(event, "Cannot find TokenCreated event")
erc20Address = event.args[0];

erc20Token = await ethers.getContractAt("ERC20TemplateSapphire", erc20Address);
erc20Token = await ethers.getContractAt("ERC20Template4", erc20Address);
assert((await erc20Token.permissions(user3.address)).minter == true);
assert(await erc20Token.getAllowListContract()==addressZero)
assert(await erc20Token.getDenyListContract()==addressZero)
Expand All @@ -266,7 +266,7 @@ describe("ERC20TemplateSapphire", () => {
assert(event, "Cannot find TokenCreated event")
erc20AddressWithPublishFee = event.args[0];

erc20TokenWithPublishFee = await ethers.getContractAt("ERC20TemplateSapphire", erc20AddressWithPublishFee);
erc20TokenWithPublishFee = await ethers.getContractAt("ERC20Template4", erc20AddressWithPublishFee);
assert((await erc20TokenWithPublishFee.permissions(user3.address)).minter == true);


Expand All @@ -283,7 +283,7 @@ describe("ERC20TemplateSapphire", () => {
assert(event, "Cannot find TokenCreated event")
erc20AddressWithAccessList = event.args[0];

erc20TokenWithAccessList = await ethers.getContractAt("ERC20TemplateSapphire", erc20AddressWithAccessList);
erc20TokenWithAccessList = await ethers.getContractAt("ERC20Template4", erc20AddressWithAccessList);
assert((await erc20TokenWithAccessList.permissions(user3.address)).minter == true);
assert((await erc20TokenWithAccessList.getAllowListContract())==allowAccessList.address)
assert((await erc20TokenWithAccessList.getDenyListContract())==denyAccessList.address)
Expand Down Expand Up @@ -1155,7 +1155,7 @@ describe("ERC20TemplateSapphire", () => {
const event = getEventFromTx(trxReceiptEnterpriseERC20, 'TokenCreated')
assert(event, "Cannot find TokenCreated event")
const erc20Address = event.args[0];
EnterpriseToken = await ethers.getContractAt("ERC20TemplateSapphire", erc20Address);
EnterpriseToken = await ethers.getContractAt("ERC20Template4", erc20Address);
assert(await EnterpriseToken.totalSupply() == 0, "Invalid Total Supply")
let tx = await EnterpriseToken.connect(user3).createDispenser(
dispenser.address, web3.utils.toWei('1'), web3.utils.toWei('1'), true,addressZero)
Expand Down Expand Up @@ -1285,7 +1285,7 @@ describe("ERC20TemplateSapphire", () => {
let event = getEventFromTx(trxReceiptEnterpriseERC20, 'TokenCreated')
assert(event, "Cannot find TokenCreated event")
const erc20Address = event.args[0];
EnterpriseToken = await ethers.getContractAt("ERC20TemplateSapphire", erc20Address);
EnterpriseToken = await ethers.getContractAt("ERC20Template4", erc20Address);
assert(await EnterpriseToken.totalSupply() == 0, "Invalid Total Supply")

let tx = await EnterpriseToken.connect(user3).createFixedRate(
Expand Down Expand Up @@ -1435,7 +1435,7 @@ describe("ERC20TemplateSapphire", () => {
let event = getEventFromTx(trxReceiptEnterpriseERC20, 'TokenCreated')
assert(event, "Cannot find TokenCreated event")
const erc20Address = event.args[0];
EnterpriseToken = await ethers.getContractAt("ERC20TemplateSapphire", erc20Address);
EnterpriseToken = await ethers.getContractAt("ERC20Template4", erc20Address);
assert(await EnterpriseToken.totalSupply() == 0, "Invalid Total Supply")

let tx = await EnterpriseToken.connect(user3).createFixedRate(
Expand Down

0 comments on commit 80e682a

Please sign in to comment.