Under Us law (Regulation 50 USC 1702): “the importation into the United States of any goods or services of Iranian origin or owned or controlled by the Government of Iran, other than information and informational materials within the meaning of section 203(b)(3) of the International Emergency Economic Powers Act ( 50 U.S.C. 1702(b)(3)), is prohibited.”
In light of 560.206, it may be illegal for Us companies to recruit Iranian nationals under US law; Therefore, an Iranian person is not subject to US law but the US company would be.
However, in your case, since you have Canadian citizenship and hold a bank account in Canada, there won’t be any problem regarding the payment process.
More importantly, the fact that you are not defined as an employee to the Us company you’re about to work, but a self-employed (according to your independent contractor agreement), makes it easier for the company to work with you, and transfer your payment into your Canadian bank account.