Skip to content

Commit

Permalink
Change the parameter name, function name of the event
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelKim20 committed Oct 16, 2023
1 parent ade21bb commit a614632
Show file tree
Hide file tree
Showing 20 changed files with 643 additions and 679 deletions.
2 changes: 1 addition & 1 deletion packages/contracts-lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dms-osx-lib",
"version": "1.1.1",
"version": "1.1.3",
"description": "",
"main": "dist/bundle-cjs.js",
"module": "dist/bundle-esm.js",
Expand Down
200 changes: 110 additions & 90 deletions packages/contracts/contracts/Ledger.sol

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
validatorContractAddress
)) as ValidatorCollection;
const amount = Amount.make(100_000, 18);
const depositAmount = Amount.make(20_000, 18);
const depositedToken = Amount.make(20_000, 18);

for (const elem of validators) {
await tokenContract.connect(await ethers.getSigner(owner)).transfer(elem, amount.value);
Expand All @@ -41,11 +41,11 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
for (const elem of validators) {
const tx1 = await tokenContract
.connect(await ethers.getSigner(elem))
.approve(validatorContractAddress, depositAmount.value);
.approve(validatorContractAddress, depositedToken.value);
console.log(`Approve validator's amount (tx: ${tx1.hash})...`);
await tx1.wait();

const tx2 = await validatorContract.connect(await ethers.getSigner(elem)).deposit(depositAmount.value);
const tx2 = await validatorContract.connect(await ethers.getSigner(elem)).deposit(depositedToken.value);
console.log(`Deposit validator's amount (tx: ${tx2.hash})...`);
await tx2.wait();
}
Expand Down
16 changes: 9 additions & 7 deletions packages/contracts/deploy/bosagora_devnet/06_ledger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,21 +120,23 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
for (const user of users) {
const balance = await tokenContract.balanceOf(user.address);

const depositAmount = balance.div(2);
const depositedToken = balance.div(2);
const signer = new Wallet(user.privateKey).connect(ethers.provider);
const tx8 = await tokenContract.connect(signer).approve(ledgerContract.address, depositAmount);
const tx8 = await tokenContract.connect(signer).approve(ledgerContract.address, depositedToken);
console.log(`Approve user's amount (tx: ${tx8.hash})...`);
await tx8.wait();

const tx9 = await ledgerContract.connect(signer).deposit(depositAmount);
const tx9 = await ledgerContract.connect(signer).deposit(depositedToken);
console.log(`Deposit user's amount (tx: ${tx9.hash})...`);
await tx9.wait();

if (user.pointType === 1) {
const pointType = 1;
if (user.royaltyType === 1) {
const royaltyType = 1;
const nonce = await ledgerContract.nonceOf(user.address);
const signature = ContractUtils.signPointType(signer, pointType, nonce);
const tx10 = await ledgerContract.connect(validator1).setPointType(pointType, user.address, signature);
const signature = ContractUtils.signRoyaltyType(signer, royaltyType, nonce);
const tx10 = await ledgerContract
.connect(validator1)
.setRoyaltyType(royaltyType, user.address, signature);
console.log(`Deposit user's amount (tx: ${tx10.hash})...`);
await tx10.wait();
}
Expand Down
Loading

0 comments on commit a614632

Please sign in to comment.