lakshya-20 / supply-chain

Decentralised food supply chain to trace products from end to end and provide a smart and reliable way of providing information to the customers.
food-supply-chain.vercel.app
GNU Affero General Public License v3.0
66 stars 25 forks source link

not able to get admin privileges to verify farmer #22

Closed Annem-Vijitha closed 1 year ago

Annem-Vijitha commented 1 year ago

I am logging into the application that is running on localhost with the same wallet address that i used for deploying the contracts, still I am not logged in as admin

lakshya-20 commented 1 year ago

hello

Thanks for your patience

I understood your problem, the solution is to delete the Contracts ABI once and then try compiling the contract again. Login using the first ganache's account, this should work.

Thanks

On Tue, Apr 18, 2023 at 1:41 AM Annem-Vijitha @.***> wrote:

I am logging into the application that is running on localhost with the same wallet address that i used for deploying the contracts, still I am not logged in as admin

— Reply to this email directly, view it on GitHub https://github.com/lakshya-20/supply-chain/issues/22, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJK5SVJOCD6KCUMKDCPUSFLXBWPWXANCNFSM6AAAAAAXBVMK3Y . You are receiving this because you are subscribed to this thread.Message ID: @.***>

--

Lakshya Bansal Software Engineer | MERN Stack | Web3

[image: phone-icon] @.*** [image: phone-icon] New Delhi, India [image: phone-icon] Portfolio https://lakshyabansal.vercel.app/ [image: twitter icon] https://twitter.com/lakshya__bansal lakshyabansal <https://twitter.com/lakshyabansal> [image: linkedin icon] https://www.linkedin.com/in/lakshyabansal/ lakshyabansal https://www.linkedin.com/in/lakshyabansal/

saniya-daga commented 1 year ago

hello,

Thanks for the reply. We tried doing this, but it is still not able to recognize the admin . Is there any other way?

adithyapaib commented 1 year ago

Try updating 1_initial_migration.js to

` const Main = artifacts.require("Main"); const Farmer = artifacts.require('Farmer'); const Manufacturer = artifacts.require('Manufacturer'); const Product = artifacts.require('Product'); const Stakeholder = artifacts.require('Stakeholder'); const Admin = artifacts.require('Admin');

module.exports = async function (deployer, network, accounts) {

deployer.deploy(Admin, accounts[0]);

await deployer.deploy(Farmer); const farmer = await Farmer.deployed();

await deployer.deploy(Manufacturer); const manufacturer = await Manufacturer.deployed();

await deployer.deploy(Stakeholder); const stakeholder = await Stakeholder.deployed();

await deployer.deploy(Product); const product = await Product.deployed();

await deployer.deploy(Main, farmer.address, manufacturer.address, stakeholder.address); }; `

QingCold commented 1 year ago

same error.. it doesn't work